peachsim 0.1.2935 → 0.1.2937
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +6 -8
- package/cli/account-gate.ts +20 -3
- package/cli/app-bundle-resources.ts +66 -19
- package/cli/catalog/meta.ts +2 -106
- package/cli/command-agent.ts +7 -0
- package/cli/command-registry.ts +0 -1
- package/cli/commands/control.ts +13 -5
- package/cli/commands/daemon.ts +4 -2
- package/cli/commands/device.ts +78 -8
- package/cli/commands/do-chain.ts +11 -8
- package/cli/commands/inspect/core.ts +4 -9
- package/cli/commands/inspect/settling.ts +1 -0
- package/cli/commands/logout.ts +6 -1
- package/cli/commands/map.ts +2 -6
- package/cli/commands/package.ts +112 -57
- package/cli/commands/shell-url.ts +0 -1
- package/cli/download-auth.ts +2 -0
- package/cli/drivers/playwright-provisioning.ts +10 -38
- package/cli/github-workflow-identity.ts +8 -0
- package/cli/internal-child-contract.ts +1 -0
- package/cli/internal-child.ts +5 -0
- package/cli/main.ts +2 -10
- package/cli/outbound-endpoints.ts +26 -0
- package/detox/index.ts +227 -131
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +47 -3
- package/dist-lib/bridge-contract-input.mjs +6 -6
- package/dist-lib/bridge-contract.cjs +10 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +12779 -9515
- package/dist-lib/capture-contract.cjs +39 -17
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +8 -8
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +6 -6
- package/dist-lib/detox/index.cjs +200 -132
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-Q5TRRYSO.mjs → acorn-IIBLEO25.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-UDWBTBVG.mjs → chunk-4FTPQKPT.mjs} +10 -1
- package/dist-lib/esm-chunks/chunk-4WIDTRBB.mjs +10232 -0
- package/dist-lib/esm-chunks/{chunk-LCMFYMT7.mjs → chunk-5QZOQ3NZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BJ2OGUX7.mjs → chunk-CIY67HNL.mjs} +39 -17
- package/dist-lib/esm-chunks/{chunk-SKQTNQYE.mjs → chunk-CQFEMJ64.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-AXWVXRHX.mjs → chunk-CWVMCW23.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MTALOHQR.mjs → chunk-F6DZ4DS2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-I4R7IZRD.mjs → chunk-HJMF6O7L.mjs} +74 -46
- package/dist-lib/esm-chunks/chunk-I6T4PXJF.mjs +154 -0
- package/dist-lib/esm-chunks/{chunk-XWAUZKIA.mjs → chunk-IJU3JMWM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CXWUIOCH.mjs → chunk-KODEPXQC.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-WJE5QHSD.mjs → chunk-LD4K2VBL.mjs} +155 -36
- package/dist-lib/esm-chunks/{chunk-2TSM64HI.mjs → chunk-LTE7YMEG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3GGOXUJA.mjs → chunk-M3CSKAJE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7G5UETIG.mjs → chunk-NA6DJPB6.mjs} +43 -1
- package/dist-lib/esm-chunks/{chunk-MSUHMNAI.mjs → chunk-NNAX24FS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VDJA4LP4.mjs → chunk-PZPJJBAS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UEEEJVQA.mjs → chunk-QXSTHMWN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-S2RJB5I7.mjs → chunk-RBPVK5YI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VRAXNGYT.mjs → chunk-SCT5OFDV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-T3M73LGP.mjs → chunk-U3CJGYSP.mjs} +50 -6
- package/dist-lib/esm-chunks/{chunk-SLUGTGQQ.mjs → chunk-VXTOQ522.mjs} +12 -6
- package/dist-lib/esm-chunks/{chunk-EL44SZMV.mjs → chunk-WMSVGYTH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FEDEPSEV.mjs → chunk-WRWINRWK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BNO52N2S.mjs → chunk-YZF2USRD.mjs} +1905 -8760
- package/dist-lib/esm-chunks/{chunk-TQLKYMVP.mjs → chunk-ZNHR6C3L.mjs} +1 -1
- package/dist-lib/esm-chunks/{download-auth-registry-G75MIT55.mjs → download-auth-registry-AHS5MSIB.mjs} +4 -4
- package/dist-lib/esm-chunks/{metro-layout-parser-FXLUDTYT.mjs → metro-layout-parser-24ZYK5UP.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-524D4MA2.mjs → swift-package-prebuilt-L4YNXQRD.mjs} +15 -15
- package/dist-lib/esm-chunks/{swift-sdk-app-module-EX544YJY.mjs → swift-sdk-app-module-RM652JSW.mjs} +87 -71
- package/dist-lib/esm-chunks/{swift-sdk-image-LOTMWVM7.mjs → swift-sdk-image-5PQ44UJT.mjs} +15 -15
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-UO6B3M4U.mjs → swift-sdk-image-producer-GD3SM6YI.mjs} +5 -5
- package/dist-lib/esm-chunks/swift-sdk-later-data-62QYJ2KH.mjs +590 -0
- package/dist-lib/expo-swift-bundle.cjs +21037 -17896
- package/dist-lib/expo-swift-metadata.cjs +8 -2
- package/dist-lib/expo-swift-metadata.mjs +9 -8
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +22481 -18741
- package/dist-lib/host/fetch-proxy-handler.cjs +21079 -17980
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +68 -38
- package/dist-lib/kotlin-host.cjs +97 -21
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +23 -1
- package/dist-lib/metro-production-bundle.mjs +24 -4
- package/dist-lib/native-app-identity-project.cjs +3582 -571
- package/dist-lib/native-app-identity-project.mjs +1024 -398
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +132 -116
- package/dist-lib/public-origins-lib.json +215 -173
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +17 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +6 -7
- package/dist-lib/sdk.mjs +13 -14
- package/dist-lib/skills.cjs +23216 -19650
- package/dist-lib/swift-compile.cjs +4337 -2905
- package/dist-lib/swift-compile.mjs +15 -13
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +19 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +94 -32
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +8 -5
- package/dist-lib/worklet-executable.mjs +9 -6
- package/dist-types/packages/peach-engine/src/canvaskit-artifact-urls.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/capture/compositor-presentation-recording.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/generated/canvaskit-artifact-hashes.d.ts +26 -0
- package/dist-types/packages/peach-engine/src/engine/guest-scene-inspect.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/inspect-info.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/metalTypes.d.ts +32 -2
- package/dist-types/packages/peach-engine/src/engine/portalContract.d.ts +24 -0
- package/dist-types/packages/peach-engine/src/engine/remote-display-protocol.d.ts +12 -2
- package/dist-types/packages/peach-engine/src/guest/http-cookie-storage.d.ts +73 -0
- package/dist-types/packages/peach-engine/src/guest/native-evaluation-lease.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/guest/nitro-jsi-host.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +225 -9
- package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +4 -1
- package/dist-types/packages/peach-engine/src/ios/duo-vertical-bar-geometry.d.ts +0 -1
- package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-compositor.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-contract.d.ts +44 -10
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +4 -3
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -4
- package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -27
- package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +2 -6
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +11 -3
- package/dist-types/packages/peach-engine/src/settings/devices.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/settings/duo-fold.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/app-bundle-resources.d.ts +10 -0
- package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/hostStorageBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
- package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +9 -6
- package/dist-types/packages/peach-globals/src/nodeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/oneWidgetContract.d.ts +28 -0
- package/package.json +2 -2
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreHaptics.framework/Headers/CoreHaptics.h +251 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INImage.h +14 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntent.h +18 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentIdentifiers.h +30 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentResponse.h +12 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INInteraction.h +35 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectCollection.h +0 -7
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectSection.h +0 -7
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INOutgoingMessageType.h +7 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPerson.h +36 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPersonHandle.h +22 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent+UserNotifications.h +6 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent.h +33 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSpeakableString.h +24 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/Intents.h +11 -7
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +0 -8
- package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MetalTypes.h +8 -0
- package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/SLServiceTypes.h +9 -0
- package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/Social.h +1 -0
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h +5 -5
- package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
- package/sdk/ios/wasm/include/unistd.h +1 -0
- package/src/acorn-program.ts +3 -0
- package/src/audio-codec-archives.ts +141 -0
- package/src/bridge-contract-input.ts +61 -1
- package/src/bridge-contract.ts +45 -4
- package/src/bundle-channel.mjs +44 -30
- package/src/capture-contract.ts +57 -39
- package/src/conformance-comparison-contract.ts +2 -0
- package/src/expo-discovery-cache.ts +0 -2
- package/src/expo-macro-host.ts +8 -3
- package/src/expo-native-compiler-digest.ts +0 -1
- package/src/expo-native-prebuilt.ts +1 -1
- package/src/expo-native-workspace.ts +83 -45
- package/src/expo-pod-prebuilt.ts +1 -0
- package/src/expo-swift-host.ts +158 -77
- package/src/expo-swift-legacy-runtime-source.ts +12 -1
- package/src/expo-swift-view-source.ts +51 -20
- package/src/expo-workspace-exclusion.ts +7 -1
- package/src/expoSwiftContract.ts +10 -1
- package/src/ffmpeg-source-build.ts +123 -59
- package/src/genrule-archives.ts +7 -2
- package/src/genrule-library-builds.ts +101 -18
- package/src/host/bridge-host.ts +10 -1
- package/src/installed-native-libraries.ts +147 -23
- package/src/installed-package-versions.ts +30 -0
- package/src/ios-rn-bundle-request.ts +3 -1
- package/src/ios-rn-bundle.ts +38 -27
- package/src/ios-rn-compile.ts +23 -6
- package/src/ios-rn-startup.ts +2 -1
- package/src/java-module-abi.ts +4 -3
- package/src/kotlin-host.ts +4 -4
- package/src/kotlin-library-sources.ts +8 -5
- package/src/metro-production-bundle.ts +24 -0
- package/src/native-firebase-config.ts +2 -0
- package/src/native-framework-compiler.ts +5 -0
- package/src/native-package-slice-build.ts +3 -0
- package/src/native-package-slice.ts +15 -10
- package/src/native-preparation.ts +4 -1
- package/src/native-static-libraries.ts +107 -33
- package/src/nativeRuntimePackageIndex.ts +1 -4
- package/src/nitro-adapter.lock.json +286 -286
- package/src/nitro-app-providers.ts +20 -8
- package/src/nitro-compile.ts +131 -37
- package/src/nitro-dependencies.ts +42 -8
- package/src/nitro-source.ts +40 -36
- package/src/nitro-superset.lock.json +4 -4
- package/src/nitroAdapterContract.ts +32 -7
- package/src/nitroContract.ts +21 -37
- package/src/one-direct-host-source.ts +247 -140
- package/src/one-fabric.ts +129 -0
- package/src/one-native-controls-package.ts +95 -21
- package/src/one-native-controls-release.ts +147 -14
- package/src/one-native-source.ts +4 -1
- package/src/one-nitro-inputs.ts +1 -1
- package/src/one-nitro-source.ts +45 -1
- package/src/one-sdk/source.ts +10 -41
- package/src/one-widget-metadata.ts +2 -2
- package/src/one-widget-package.ts +1 -1
- package/src/oneSdkContract.ts +3 -0
- package/src/playwright-browser-paths.ts +30 -0
- package/src/pods-install.ts +6 -2
- package/src/pods-post-install.ts +2 -2
- package/src/pods-project.ts +10 -0
- package/src/podspec-ruby-stdlib.ts +73 -0
- package/src/podspec-ruby.ts +1 -1
- package/src/podspec-sources.ts +31 -13
- package/src/process-group.ts +135 -5
- package/src/published-swift-sdk.ts +25 -1
- package/src/react-native-bridge-modules.ts +35 -3
- package/src/react-native-core-build.ts +14 -2
- package/src/react-native-core.ts +12 -2
- package/src/rive-runtime-dependencies.ts +178 -40
- package/src/serverDiscoveryContract.ts +1 -1
- package/src/storageSnapshotContract.ts +1 -1
- package/src/swift-app-data-store.ts +35 -0
- package/src/swift-compile.ts +403 -121
- package/src/swift-compiler-digest.ts +4 -0
- package/src/swift-darwin-records.ts +6 -0
- package/src/swift-distribution-mirror.ts +10 -1
- package/src/swift-distribution.lock.json +19 -18
- package/src/swift-distribution.ts +17 -1
- package/src/swift-entry-module.ts +1 -0
- package/src/swift-guest-compile.ts +8 -1
- package/src/swift-host.ts +79 -23
- package/src/swift-installed-targets.ts +51 -20
- package/src/swift-objc-standin.ts +60 -8
- package/src/swift-packages.ts +104 -24
- package/src/swift-project-user.ts +2 -1
- package/src/swift-reproducible.ts +99 -1
- package/src/swift-root-lock.ts +52 -46
- package/src/swift-sdk-app-module.ts +65 -13
- package/src/swift-sdk-image-producer.ts +2 -1
- package/src/swift-sdk-image.ts +23 -8
- package/src/swift-sdk-later-data.ts +294 -44
- package/src/swift-sdk-surface.ts +233 -55
- package/src/swift-shared-sdk.ts +7 -0
- package/src/swift-standin-builtin-behavior.ts +18 -0
- package/src/swift-standin-emit.ts +242 -54
- package/src/swift-standins.ts +184 -38
- package/src/swift-startup-split.ts +19 -9
- package/src/swift-toolchain.ts +18 -0
- package/src/swift-wasm-prune.ts +179 -9
- package/src/swift-xcframework.ts +16 -0
- package/src/swiftContract.ts +4 -1
- package/src/swiftSdkLinkContract.ts +2 -0
- package/src/swiftTargetContract.ts +1 -0
- package/src/turbo-bundle.ts +6 -3
- package/src/turbo-codegen-intake.ts +106 -16
- package/src/turbo-compile.ts +89 -68
- package/src/turbo-fabric-app.ts +287 -23
- package/src/turbo-provider-host.ts +122 -31
- package/src/turbo-runtime.lock.json +26 -26
- package/src/turbo-source.ts +374 -157
- package/src/vite-plugin.ts +48 -112
- package/src/wasm-binary-sections.ts +40 -0
- package/src/wasm-code-immediates.ts +35 -5
- package/src/widget-extension-bundle.ts +15 -1
- package/src/worklet-executable.ts +2 -1
- package/src/worklet-kernel.ts +5 -3
- package/src/worklets-babel.ts +2 -1
- package/src/xcode-project.ts +151 -53
- package/src/xcode-scheme-actions.ts +104 -0
- package/cli/commands/canvas.ts +0 -1204
- package/dist-lib/esm-chunks/chunk-B5QD2KEV.mjs +0 -2787
- package/dist-lib/vendor/magic-string.cjs +0 -1693
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +0 -127
- package/src/appBundleResourcesContract.ts +0 -51
- package/src/canvas-groups.ts +0 -28
- package/src/canvas-map-layout.ts +0 -161
- package/src/oneWidgetContract.ts +0 -134
package/src/turbo-source.ts
CHANGED
|
@@ -12,11 +12,17 @@ import fs from 'node:fs'
|
|
|
12
12
|
import { createRequire } from 'node:module'
|
|
13
13
|
import path from 'node:path'
|
|
14
14
|
import { hasNativeCode, installedPackageDir } from '../cli/app-stubs'
|
|
15
|
+
import { readNativeProjectRenderer } from '../cli/commands/detect'
|
|
16
|
+
import { nodeRepoFileReader } from '../cli/commands/nodeRepoFileReader'
|
|
15
17
|
import { trunkSpecificationFile, trunkVersions } from './cocoapods-trunk'
|
|
16
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
prepareNativeAppRoot,
|
|
20
|
+
reactNativeRemovesLegacyArch,
|
|
21
|
+
} from './expo-native-workspace'
|
|
17
22
|
import { installedNativeSources } from './installed-native-libraries'
|
|
18
23
|
import { localPodspecPaths } from './pod-lockfile'
|
|
19
24
|
import { podSourceRoot } from './pod-sources'
|
|
25
|
+
import { findWorkspaceRoot } from './workspace-root'
|
|
20
26
|
|
|
21
27
|
// react-native 0.81 emits codegen specs directly under build/generated/ios;
|
|
22
28
|
// other releases nest them in a ReactCodegen subdirectory. use whichever
|
|
@@ -36,6 +42,7 @@ import {
|
|
|
36
42
|
nitroDependencyReader,
|
|
37
43
|
nitroDependencySources,
|
|
38
44
|
prepareNitroDependencies,
|
|
45
|
+
socketRocketSources,
|
|
39
46
|
} from './nitro-dependencies'
|
|
40
47
|
import { iosAutolinkedDependencies } from './nitro-source'
|
|
41
48
|
import {
|
|
@@ -52,7 +59,11 @@ import {
|
|
|
52
59
|
podspecSourceFiles as specSourceFiles,
|
|
53
60
|
} from './podspec-sources'
|
|
54
61
|
import { readPackageFile, relativeInside } from './swift-source-file'
|
|
55
|
-
import {
|
|
62
|
+
import {
|
|
63
|
+
SWIFT_NATIVE_INPUT_ROOT,
|
|
64
|
+
SWIFT_XCODE_BUILD_CONDITION,
|
|
65
|
+
type SwiftNativeHeaderMap,
|
|
66
|
+
} from './swiftContract'
|
|
56
67
|
import {
|
|
57
68
|
installedFabricSources,
|
|
58
69
|
type FabricPodSources,
|
|
@@ -72,6 +83,7 @@ import { installedXcodeWorkspace, readXcodeAppTarget } from './xcode-project'
|
|
|
72
83
|
import type { ReactNativeCoreMode } from './react-native-core'
|
|
73
84
|
import type { SwiftCompileInput } from './swift-compile'
|
|
74
85
|
import type { SwiftPackageTarget } from './swift-package'
|
|
86
|
+
import type { SwiftStandin } from './swift-standins'
|
|
75
87
|
|
|
76
88
|
type TurboPackage = { name: string; version: string; root: string }
|
|
77
89
|
|
|
@@ -94,6 +106,7 @@ export interface TurboInstalledSources {
|
|
|
94
106
|
export interface TurboInstalledPod extends TurboInstalledSources {
|
|
95
107
|
moduleName: string
|
|
96
108
|
publicHeaders: string[]
|
|
109
|
+
binaryFrameworks: { name: string; headers: string; standins: SwiftStandin[] }[]
|
|
97
110
|
headerSearchPaths: string[]
|
|
98
111
|
dependencySearchPaths: { root: string; directory: string }[]
|
|
99
112
|
reactHeaderMaps: SwiftNativeHeaderMap[]
|
|
@@ -109,6 +122,7 @@ export interface TurboInstalledPod extends TurboInstalledSources {
|
|
|
109
122
|
* which runs every `loads` symbol and then `peachTurboInitialize`. */
|
|
110
123
|
export interface TurboSourceCollection {
|
|
111
124
|
coreMode: ReactNativeCoreMode
|
|
125
|
+
removeLegacyArch: boolean
|
|
112
126
|
files: SwiftCompileInput['files']
|
|
113
127
|
libraries?: SwiftCompileInput['libraries']
|
|
114
128
|
binaryModules?: SwiftCompileInput['binaryModules']
|
|
@@ -140,6 +154,36 @@ export interface TurboSourceCollection {
|
|
|
140
154
|
|
|
141
155
|
export const TURBO_CORE_TARGET = 'TurboCore'
|
|
142
156
|
const TURBO_FMT_TARGET = 'TurboFmt'
|
|
157
|
+
// React-RCTAppDelegate's pods, which Peach's engine replaces as every app's
|
|
158
|
+
// React Native host, and the legacy architecture units a release still carries.
|
|
159
|
+
// they link as plain archives, loaded only when the app's own code reaches them
|
|
160
|
+
export const TURBO_APP_DELEGATE_TARGET = 'TurboAppDelegate'
|
|
161
|
+
const TURBO_LEGACY_ARCH_TARGET = 'TurboLegacyArch'
|
|
162
|
+
export const TURBO_REACHED_TARGETS: ReadonlySet<string> = new Set([
|
|
163
|
+
TURBO_APP_DELEGATE_TARGET,
|
|
164
|
+
TURBO_LEGACY_ARCH_TARGET,
|
|
165
|
+
])
|
|
166
|
+
|
|
167
|
+
const LEGACY_ARCH_GUARD = /^#\s*ifndef\s+RCT_REMOVE_LEGACY_ARCH\b/
|
|
168
|
+
|
|
169
|
+
/** a unit whose code lies wholly inside `#ifndef RCT_REMOVE_LEGACY_ARCH`, with
|
|
170
|
+
* no alternative it compiles to once the legacy architecture is removed */
|
|
171
|
+
function wholeLegacyArchUnit(source: string): boolean {
|
|
172
|
+
const lines = stripComments(source)
|
|
173
|
+
.split('\n')
|
|
174
|
+
.map((line) => line.trim())
|
|
175
|
+
.filter(Boolean)
|
|
176
|
+
const start = lines.findIndex((line) => !/^#\s*(?:import|include)\b/.test(line))
|
|
177
|
+
if (start < 0 || !LEGACY_ARCH_GUARD.test(lines[start]!)) return false
|
|
178
|
+
let depth = 0
|
|
179
|
+
for (let index = start; index < lines.length; index++) {
|
|
180
|
+
const line = lines[index]!
|
|
181
|
+
if (/^#\s*if/.test(line)) depth++
|
|
182
|
+
else if (depth === 1 && /^#\s*(?:else|elif)\b/.test(line)) return false
|
|
183
|
+
else if (/^#\s*endif\b/.test(line) && --depth === 0) return index === lines.length - 1
|
|
184
|
+
}
|
|
185
|
+
return false
|
|
186
|
+
}
|
|
143
187
|
export const TURBO_CORE_PUBLIC_HEADERS = 'entry'
|
|
144
188
|
|
|
145
189
|
const REGISTRATION = 'registerCxxModuleToGlobalModuleMap'
|
|
@@ -201,6 +245,7 @@ const REACT_NATIVE_INCLUDE_ROOTS = [
|
|
|
201
245
|
'ReactCommon/react/nativemodule/core/platform/ios',
|
|
202
246
|
'ReactCommon/runtimeexecutor',
|
|
203
247
|
'ReactCommon/runtimeexecutor/platform/ios',
|
|
248
|
+
'ReactCommon/react/runtime/platform/ios',
|
|
204
249
|
'ReactCommon/react/renderer/graphics/platform/ios',
|
|
205
250
|
'ReactCommon/react/renderer/textlayoutmanager/platform/ios',
|
|
206
251
|
'ReactCommon/react/renderer/components/scrollview/platform/cxx',
|
|
@@ -262,6 +307,7 @@ const REACT_NATIVE_OBJC_VERSIONED_UNITS = [
|
|
|
262
307
|
const REACT_NATIVE_HEADER_DIRS = [
|
|
263
308
|
{ from: 'React', to: 'React' },
|
|
264
309
|
{ from: 'Libraries/ActionSheetIOS', to: 'React' },
|
|
310
|
+
{ from: 'Libraries/AppDelegate', to: 'React' },
|
|
265
311
|
{ from: 'Libraries/Blob', to: 'React' },
|
|
266
312
|
{ from: 'Libraries/Image', to: 'React' },
|
|
267
313
|
{ from: 'Libraries/LinkingIOS', to: 'React' },
|
|
@@ -626,6 +672,7 @@ type Pod = {
|
|
|
626
672
|
file: string
|
|
627
673
|
directory: string
|
|
628
674
|
name: string
|
|
675
|
+
newArchitecture: boolean
|
|
629
676
|
installed?: TurboInstalledPod
|
|
630
677
|
}
|
|
631
678
|
|
|
@@ -633,6 +680,7 @@ function readPod(
|
|
|
633
680
|
provider: TurboProvider,
|
|
634
681
|
appRoot: string,
|
|
635
682
|
installed?: TurboInstalledPod,
|
|
683
|
+
newArchitecture = true,
|
|
636
684
|
): Pod {
|
|
637
685
|
const originalRoot = fs.realpathSync(provider.root)
|
|
638
686
|
// an installed pod's root is its podspec's own directory
|
|
@@ -649,12 +697,16 @@ function readPod(
|
|
|
649
697
|
// CocoaPods resolves every glob against the podspec's own directory
|
|
650
698
|
directory: path.relative(root, path.dirname(podspec)).split(path.sep).join('/'),
|
|
651
699
|
name: path.basename(podspec, '.podspec'),
|
|
700
|
+
newArchitecture,
|
|
652
701
|
...(installed ? { installed } : {}),
|
|
653
702
|
}
|
|
654
703
|
}
|
|
655
704
|
|
|
656
705
|
function podSegments(pod: Pod, requested: string[] = ['']): Spec[] {
|
|
657
|
-
return podspecMembers(
|
|
706
|
+
return podspecMembers(
|
|
707
|
+
loadPodspec(pod.file, pod.appRoot, pod.newArchitecture),
|
|
708
|
+
requested,
|
|
709
|
+
)
|
|
658
710
|
}
|
|
659
711
|
|
|
660
712
|
function podGlobFiles(pod: Pod, requested: string[] = ['']): string[] {
|
|
@@ -1189,22 +1241,26 @@ export function prepareTurboSourceDependencies(reactNativeRoot: string): Promise
|
|
|
1189
1241
|
return prepareNitroDependencies(packageInfo(reactNativeRoot).version, reactNativeRoot)
|
|
1190
1242
|
}
|
|
1191
1243
|
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1244
|
+
// the architecture the app's own iOS build uses: an explicit
|
|
1245
|
+
// RCT_NEW_ARCH_ENABLED, else what the prepared project declares (prebuild writes
|
|
1246
|
+
// an Expo config's newArchEnabled to ios/Podfile.properties.json)
|
|
1247
|
+
function appUsesPaper(projectRoot: string): boolean {
|
|
1248
|
+
const explicit = process.env.RCT_NEW_ARCH_ENABLED
|
|
1249
|
+
if (explicit !== undefined) return explicit === '0'
|
|
1250
|
+
const podfile = path.join(projectRoot, 'ios', 'Podfile')
|
|
1251
|
+
if (!fs.lstatSync(podfile, { throwIfNoEntry: false })?.isSymbolicLink())
|
|
1252
|
+
return readNativeProjectRenderer(projectRoot, 'ios') === 'paper'
|
|
1253
|
+
const target = fs.realpathSync(podfile)
|
|
1254
|
+
const workspace = fs.realpathSync(findWorkspaceRoot(projectRoot))
|
|
1255
|
+
if (relativeInside(workspace, target) === null)
|
|
1256
|
+
throw new Error('ios/Podfile: target is outside the native workspace')
|
|
1257
|
+
return (
|
|
1258
|
+
readNativeProjectRenderer(projectRoot, 'ios', {
|
|
1259
|
+
...nodeRepoFileReader,
|
|
1260
|
+
readMetadata: (file) =>
|
|
1261
|
+
nodeRepoFileReader.readMetadata(file === podfile ? target : file),
|
|
1262
|
+
}) === 'paper'
|
|
1263
|
+
)
|
|
1208
1264
|
}
|
|
1209
1265
|
|
|
1210
1266
|
/** collect each provider's podspec sources, its codegen output and React
|
|
@@ -1223,6 +1279,8 @@ export async function collectTurboSources(options: {
|
|
|
1223
1279
|
/** link React's native implementations into an existing Swift host. */
|
|
1224
1280
|
reactNativeProvider?: true
|
|
1225
1281
|
reactNativeCore?: true
|
|
1282
|
+
removeLegacyArch?: boolean
|
|
1283
|
+
standaloneProvider?: true
|
|
1226
1284
|
}): Promise<TurboSourceCollection> {
|
|
1227
1285
|
if (
|
|
1228
1286
|
options.providers.length === 0 &&
|
|
@@ -1234,19 +1292,17 @@ export async function collectTurboSources(options: {
|
|
|
1234
1292
|
if (reactNative.name !== 'react-native')
|
|
1235
1293
|
throw new Error(`${options.reactNativeRoot} is not react-native`)
|
|
1236
1294
|
const nativeManagers = reactNativeViewManagers(reactNative.root)
|
|
1237
|
-
const paperWorkspace =
|
|
1238
|
-
process.env.RCT_NEW_ARCH_ENABLED === '0' ||
|
|
1239
|
-
(options.installedPods !== undefined &&
|
|
1240
|
-
installedWorkspaceUsesPaper(options.projectRoot))
|
|
1295
|
+
const paperWorkspace = options.providers.length > 0 && appUsesPaper(options.projectRoot)
|
|
1241
1296
|
const rawProviders = options.providers
|
|
1242
1297
|
.map((provider) => {
|
|
1243
1298
|
const installed = options.installedPods?.get(provider.name)
|
|
1299
|
+
// an installed pod keeps the architecture CocoaPods built it with
|
|
1244
1300
|
const paper =
|
|
1245
1301
|
paperWorkspace &&
|
|
1246
|
-
installed
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1302
|
+
(installed === undefined ||
|
|
1303
|
+
!/(?:^| )-D ?RCT_NEW_ARCH_ENABLED(?:=[^ ]+)?(?: |$)/.test(
|
|
1304
|
+
installed.preprocessorFlags.cxx.join(' '),
|
|
1305
|
+
))
|
|
1250
1306
|
return {
|
|
1251
1307
|
...provider,
|
|
1252
1308
|
info: packageInfo(provider.root),
|
|
@@ -1256,7 +1312,7 @@ export async function collectTurboSources(options: {
|
|
|
1256
1312
|
})
|
|
1257
1313
|
.sort((a, b) => a.info.name.localeCompare(b.info.name))
|
|
1258
1314
|
const installedHeaderPods = (
|
|
1259
|
-
options.reactNativeProvider || options.reactNativeCore
|
|
1315
|
+
options.reactNativeProvider || options.reactNativeCore || options.standaloneProvider
|
|
1260
1316
|
? []
|
|
1261
1317
|
: await installedTurboHeaderPods(options.appRoot)
|
|
1262
1318
|
).map((provider) =>
|
|
@@ -1269,10 +1325,16 @@ export async function collectTurboSources(options: {
|
|
|
1269
1325
|
owned: Set<string>
|
|
1270
1326
|
thirdPartyComponentOwners: Set<string>
|
|
1271
1327
|
} | null = null
|
|
1328
|
+
const generateCodegen = () =>
|
|
1329
|
+
runInstalledTurboCodegen(
|
|
1330
|
+
options.appRoot,
|
|
1331
|
+
options.codegenDir,
|
|
1332
|
+
undefined,
|
|
1333
|
+
options.standaloneProvider,
|
|
1334
|
+
)
|
|
1272
1335
|
const loadCodegen = async () => {
|
|
1273
1336
|
if (codegenState) return codegenState
|
|
1274
|
-
codegen = (await
|
|
1275
|
-
.generatedRoot
|
|
1337
|
+
codegen = (await generateCodegen()).generatedRoot
|
|
1276
1338
|
const generated = codegenSpecRoot(codegen)
|
|
1277
1339
|
const owned = new Set<string>()
|
|
1278
1340
|
walkFiles(generated, '', owned)
|
|
@@ -1357,12 +1419,16 @@ export async function collectTurboSources(options: {
|
|
|
1357
1419
|
const targetPath = (name: string) => `Sources/${name}`
|
|
1358
1420
|
const providerTarget = (name: string) => `TurboPackage_${sha256(name).slice(0, 16)}`
|
|
1359
1421
|
const folly = readFollyConfig(reactNative.root)
|
|
1422
|
+
const removeLegacyArch =
|
|
1423
|
+
options.removeLegacyArch ??
|
|
1424
|
+
reactNativeRemovesLegacyArch(options.projectRoot, options.configuration)
|
|
1360
1425
|
const baseDefines = [
|
|
1361
1426
|
options.configuration === 'Debug' ? 'DEBUG=1' : 'NDEBUG',
|
|
1362
1427
|
'RCT_REMOTE_PROFILE=0',
|
|
1363
1428
|
...folly.defines,
|
|
1429
|
+
...(removeLegacyArch ? ['RCT_REMOVE_LEGACY_ARCH=1'] : []),
|
|
1364
1430
|
]
|
|
1365
|
-
const defines = [...baseDefines, 'RCT_NEW_ARCH_ENABLED=1'
|
|
1431
|
+
const defines = [...baseDefines, 'RCT_NEW_ARCH_ENABLED=1']
|
|
1366
1432
|
const target = (name: string, dependencies: string[], cxxDefines = defines) => ({
|
|
1367
1433
|
name,
|
|
1368
1434
|
path: targetPath(name),
|
|
@@ -1370,6 +1436,8 @@ export async function collectTurboSources(options: {
|
|
|
1370
1436
|
languageMode: 5,
|
|
1371
1437
|
mainActorIsolation: false,
|
|
1372
1438
|
resources: false,
|
|
1439
|
+
// cocoapods builds every collected pod, which never defines SWIFT_PACKAGE
|
|
1440
|
+
defines: [SWIFT_XCODE_BUILD_CONDITION],
|
|
1373
1441
|
dependencies: dependencies.map((dependency) => ({
|
|
1374
1442
|
kind: 'target' as const,
|
|
1375
1443
|
name: dependency,
|
|
@@ -1378,6 +1446,7 @@ export async function collectTurboSources(options: {
|
|
|
1378
1446
|
})
|
|
1379
1447
|
const result: TurboSourceCollection = {
|
|
1380
1448
|
coreMode: 'turbo-cxx',
|
|
1449
|
+
removeLegacyArch,
|
|
1381
1450
|
files: {},
|
|
1382
1451
|
targets: [target(TURBO_CORE_TARGET, [])],
|
|
1383
1452
|
loads: [],
|
|
@@ -1415,15 +1484,27 @@ export async function collectTurboSources(options: {
|
|
|
1415
1484
|
file,
|
|
1416
1485
|
`#pragma once\n#ifdef __OBJC__\n#import ${rel}\n#else\n#include ${rel}\n#endif\n`,
|
|
1417
1486
|
)
|
|
1487
|
+
// an included implementation (libwebp's sharpyuv includes src/dsp/cpu.c)
|
|
1488
|
+
// keeps its extension, so its forwarder must not compile on its own
|
|
1489
|
+
if (UNIT.test(file) || OBJC.test(file)) textualSources.add(file)
|
|
1418
1490
|
if (file.endsWith('/include/hermes/hermes.h')) {
|
|
1419
1491
|
hermesHeaderAliases.set(file, original)
|
|
1420
1492
|
}
|
|
1421
1493
|
}
|
|
1422
1494
|
}
|
|
1495
|
+
const standinTargets = new Map<string, SwiftStandin>()
|
|
1423
1496
|
// an original file under a target, by its root-relative path. returns the
|
|
1424
1497
|
// compile key; reading it again is free.
|
|
1425
1498
|
const compiledSources = new Set<string>()
|
|
1426
1499
|
const textualSources = new Set<string>()
|
|
1500
|
+
const excludeUnit = (file: string) => {
|
|
1501
|
+
compiledSources.delete(file)
|
|
1502
|
+
textualSources.add(file)
|
|
1503
|
+
for (const target of result.nativeTargets ?? []) {
|
|
1504
|
+
delete target.fileFlags[file]
|
|
1505
|
+
delete target.sourceDirectories[file]
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1427
1508
|
const workspace = installedXcodeWorkspace(options.projectRoot)
|
|
1428
1509
|
const installedTargets =
|
|
1429
1510
|
workspace && !options.reactNativeCore && !options.reactNativeProvider
|
|
@@ -1435,8 +1516,7 @@ export async function collectTurboSources(options: {
|
|
|
1435
1516
|
const installedByIdentity = new Map(
|
|
1436
1517
|
installedTargets.map((target) => [target.targetIdentity, target]),
|
|
1437
1518
|
)
|
|
1438
|
-
//
|
|
1439
|
-
// prefix header, which imports UIKit for every unit as GCC_PREFIX_HEADER does.
|
|
1519
|
+
// the same collected target can contain units from different CocoaPods targets.
|
|
1440
1520
|
const fileFlags = new Map(
|
|
1441
1521
|
installedTargets.flatMap((target) =>
|
|
1442
1522
|
Object.entries(target.objc?.fileFlags ?? {}).map(
|
|
@@ -1453,7 +1533,7 @@ export async function collectTurboSources(options: {
|
|
|
1453
1533
|
root: string,
|
|
1454
1534
|
relative: string,
|
|
1455
1535
|
compiled = true,
|
|
1456
|
-
) => {
|
|
1536
|
+
): string => {
|
|
1457
1537
|
// swiftpm infers an executable from a main filename even in a library target.
|
|
1458
1538
|
const staged = relative.replace(
|
|
1459
1539
|
/(^|\/)main(\.(?:c|cc|cpp|cxx|m|mm))$/,
|
|
@@ -1468,11 +1548,15 @@ export async function collectTurboSources(options: {
|
|
|
1468
1548
|
const disk = path.join(root, relative)
|
|
1469
1549
|
const installed = compiled ? fileFlags.get(fs.realpathSync(disk)) : undefined
|
|
1470
1550
|
if (installed?.flags.length) {
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1551
|
+
const prefixHeader = installed.prefixHeader
|
|
1552
|
+
? original(
|
|
1553
|
+
targetName,
|
|
1554
|
+
`${label}/cocoapods`,
|
|
1555
|
+
path.dirname(installed.prefixHeader),
|
|
1556
|
+
path.basename(installed.prefixHeader),
|
|
1557
|
+
false,
|
|
1558
|
+
)
|
|
1559
|
+
: null
|
|
1476
1560
|
result.nativeTargets ??= []
|
|
1477
1561
|
let native = result.nativeTargets.find(({ name }) => name === targetName)
|
|
1478
1562
|
if (!native) {
|
|
@@ -1488,7 +1572,7 @@ export async function collectTurboSources(options: {
|
|
|
1488
1572
|
: [],
|
|
1489
1573
|
flattensPublicHeaders: false,
|
|
1490
1574
|
bridgingHeader: null,
|
|
1491
|
-
prefixHeader,
|
|
1575
|
+
prefixHeader: null,
|
|
1492
1576
|
headerSearchPaths: [
|
|
1493
1577
|
`${targetPath(targetName)}/${targetName === TURBO_CORE_TARGET ? TURBO_CORE_PUBLIC_HEADERS : 'include'}`,
|
|
1494
1578
|
],
|
|
@@ -1509,7 +1593,9 @@ export async function collectTurboSources(options: {
|
|
|
1509
1593
|
}
|
|
1510
1594
|
result.nativeTargets.push(native)
|
|
1511
1595
|
}
|
|
1512
|
-
native.fileFlags[key] =
|
|
1596
|
+
native.fileFlags[key] = prefixHeader
|
|
1597
|
+
? ['-include', `${SWIFT_NATIVE_INPUT_ROOT}/${prefixHeader}`, ...installed.flags]
|
|
1598
|
+
: installed.flags
|
|
1513
1599
|
native.sourceDirectories[key] = path.posix.dirname(key)
|
|
1514
1600
|
}
|
|
1515
1601
|
const bytes = readPackageFile(root, disk, Infinity)
|
|
@@ -1620,10 +1706,11 @@ export async function collectTurboSources(options: {
|
|
|
1620
1706
|
}
|
|
1621
1707
|
// each provider's headers by the names its search paths give them, collected
|
|
1622
1708
|
// only once a compiled file includes one
|
|
1709
|
+
type PodHeader = { label: string; root: string; relative: string }
|
|
1623
1710
|
const podHeaders = new Map<
|
|
1624
1711
|
string,
|
|
1625
1712
|
{
|
|
1626
|
-
headers: Map<string,
|
|
1713
|
+
headers: Map<string, PodHeader>
|
|
1627
1714
|
label: string
|
|
1628
1715
|
root: string
|
|
1629
1716
|
searchPaths: string[]
|
|
@@ -1663,13 +1750,50 @@ export async function collectTurboSources(options: {
|
|
|
1663
1750
|
}
|
|
1664
1751
|
return original(from.targetName, 'installed-dependency', root, relative, false)
|
|
1665
1752
|
}
|
|
1753
|
+
// xcode finds headers on a case-insensitive file system, so <openssl/evp.h>
|
|
1754
|
+
// reaches OpenSSL.framework; a name that folds to two headers stays unmatched.
|
|
1755
|
+
const foldedPodHeaders = new Map<
|
|
1756
|
+
string,
|
|
1757
|
+
{ size: number; names: Map<string, string | null> }
|
|
1758
|
+
>()
|
|
1759
|
+
const podHeader = (targetName: string, include: string) => {
|
|
1760
|
+
const headers = podHeaders.get(targetName)?.headers
|
|
1761
|
+
const exact = headers?.get(include)
|
|
1762
|
+
if (exact || !headers) return exact
|
|
1763
|
+
let folded = foldedPodHeaders.get(targetName)
|
|
1764
|
+
if (folded?.size !== headers.size) {
|
|
1765
|
+
const names = new Map<string, string | null>()
|
|
1766
|
+
for (const name of headers.keys()) {
|
|
1767
|
+
const key = name.toLowerCase()
|
|
1768
|
+
names.set(key, names.has(key) ? null : name)
|
|
1769
|
+
}
|
|
1770
|
+
folded = { size: headers.size, names }
|
|
1771
|
+
foldedPodHeaders.set(targetName, folded)
|
|
1772
|
+
}
|
|
1773
|
+
const name = folded.names.get(include.toLowerCase())
|
|
1774
|
+
return name ? headers.get(name) : undefined
|
|
1775
|
+
}
|
|
1776
|
+
// a header beside the unit that includes it. a reached-only unit's is a
|
|
1777
|
+
// forwarder to TurboCore's file, the one its include aliases name, so pragma
|
|
1778
|
+
// once sees one header
|
|
1779
|
+
const ownHeader = (from: Scan, relative: string) => {
|
|
1780
|
+
if (!TURBO_REACHED_TARGETS.has(from.targetName))
|
|
1781
|
+
return original(from.targetName, from.label, from.root, relative, false)
|
|
1782
|
+
const header = original(TURBO_CORE_TARGET, from.label, from.root, relative, false)
|
|
1783
|
+
const adjacent = `${targetPath(from.targetName)}/upstream/${from.label}/${relative}`
|
|
1784
|
+
add(
|
|
1785
|
+
adjacent,
|
|
1786
|
+
`#include ${JSON.stringify(path.posix.relative(path.posix.dirname(adjacent), header))}\n`,
|
|
1787
|
+
)
|
|
1788
|
+
return adjacent
|
|
1789
|
+
}
|
|
1666
1790
|
const resolve = (from: Scan, include: string, quoted: boolean) => {
|
|
1667
1791
|
if (quoted) {
|
|
1668
1792
|
const relative = path.posix.normalize(
|
|
1669
1793
|
path.posix.join(path.posix.dirname(from.relative), include),
|
|
1670
1794
|
)
|
|
1671
1795
|
if (!relative.startsWith('../') && isHeaderFile(path.join(from.root, relative))) {
|
|
1672
|
-
|
|
1796
|
+
ownHeader(from, relative)
|
|
1673
1797
|
return
|
|
1674
1798
|
}
|
|
1675
1799
|
const podRelative = path.posix.normalize(include)
|
|
@@ -1678,9 +1802,10 @@ export async function collectTurboSources(options: {
|
|
|
1678
1802
|
!path.posix.isAbsolute(podRelative) &&
|
|
1679
1803
|
isHeaderFile(path.join(from.root, podRelative))
|
|
1680
1804
|
) {
|
|
1805
|
+
// another pod can use the same quoted path for its own header.
|
|
1681
1806
|
alias(
|
|
1682
|
-
|
|
1683
|
-
|
|
1807
|
+
path.posix.join(path.posix.dirname(from.key), podRelative),
|
|
1808
|
+
ownHeader(from, podRelative),
|
|
1684
1809
|
)
|
|
1685
1810
|
return
|
|
1686
1811
|
}
|
|
@@ -1688,12 +1813,9 @@ export async function collectTurboSources(options: {
|
|
|
1688
1813
|
const own = `${targetPath(from.targetName)}/include/${include}`
|
|
1689
1814
|
if (Object.hasOwn(result.files, own)) return
|
|
1690
1815
|
const pod = podHeaders.get(from.targetName)
|
|
1691
|
-
const
|
|
1692
|
-
if (
|
|
1693
|
-
alias(
|
|
1694
|
-
own,
|
|
1695
|
-
original(from.targetName, podHeader.label, podHeader.root, podHeader.relative),
|
|
1696
|
-
)
|
|
1816
|
+
const header = podHeader(from.targetName, include)
|
|
1817
|
+
if (header) {
|
|
1818
|
+
alias(own, original(from.targetName, header.label, header.root, header.relative))
|
|
1697
1819
|
return
|
|
1698
1820
|
}
|
|
1699
1821
|
if (pod)
|
|
@@ -1759,7 +1881,7 @@ export async function collectTurboSources(options: {
|
|
|
1759
1881
|
}
|
|
1760
1882
|
const found = [...files].find((file) => file.endsWith(`/${include}`))
|
|
1761
1883
|
if (found) {
|
|
1762
|
-
alias(own,
|
|
1884
|
+
alias(own, ownHeader(from, found))
|
|
1763
1885
|
return
|
|
1764
1886
|
}
|
|
1765
1887
|
}
|
|
@@ -1953,10 +2075,26 @@ export async function collectTurboSources(options: {
|
|
|
1953
2075
|
}
|
|
1954
2076
|
addUnits(REACT_NATIVE_UNITS)
|
|
1955
2077
|
|
|
2078
|
+
// TurboCore's headers reach a reached-only target as a search path; a package
|
|
2079
|
+
// dependency would also hand its Objective-C units SwiftPM's module maps for
|
|
2080
|
+
// TurboCore's Swift producers, which the build's own maps define again
|
|
2081
|
+
const reachedTarget = (name: string, cxxDefines: string[]) => {
|
|
2082
|
+
if (!result.targets.some((entry) => entry.name === name)) {
|
|
2083
|
+
result.targets.push(target(name, [], cxxDefines))
|
|
2084
|
+
add(`${targetPath(name)}/include/peach-reached-target.h`, '#pragma once\n')
|
|
2085
|
+
}
|
|
2086
|
+
return name
|
|
2087
|
+
}
|
|
2088
|
+
const appDelegateTarget = () =>
|
|
2089
|
+
reachedTarget(TURBO_APP_DELEGATE_TARGET, result.targets[0]!.cxxDefines ?? defines)
|
|
1956
2090
|
const addPodSources = (pods: FabricPodSources[]) => {
|
|
1957
2091
|
for (const pod of pods) {
|
|
1958
2092
|
const swift = pod.files.some((file) => file.endsWith('.swift'))
|
|
1959
|
-
const name = swift
|
|
2093
|
+
const name = swift
|
|
2094
|
+
? pod.module
|
|
2095
|
+
: pod.appDelegate
|
|
2096
|
+
? appDelegateTarget()
|
|
2097
|
+
: TURBO_CORE_TARGET
|
|
1960
2098
|
if (swift) {
|
|
1961
2099
|
if (!pod.swiftVersion || !/^[56](?:\.0)?$/.test(pod.swiftVersion))
|
|
1962
2100
|
throw new Error(
|
|
@@ -1970,6 +2108,12 @@ export async function collectTurboSources(options: {
|
|
|
1970
2108
|
result.rendererSwiftTargets.push(name)
|
|
1971
2109
|
}
|
|
1972
2110
|
for (const file of pod.files) {
|
|
2111
|
+
// a unit TurboCore already compiles stays its one definition
|
|
2112
|
+
if (
|
|
2113
|
+
name === TURBO_APP_DELEGATE_TARGET &&
|
|
2114
|
+
compiledSources.has(`${core}/upstream/react-native/${file}`)
|
|
2115
|
+
)
|
|
2116
|
+
continue
|
|
1973
2117
|
const collected = original(name, 'react-native', reactNative.root, file)
|
|
1974
2118
|
if (swift)
|
|
1975
2119
|
result.externalPodSources.push({ moduleName: pod.module, file: collected })
|
|
@@ -2000,6 +2144,10 @@ export async function collectTurboSources(options: {
|
|
|
2000
2144
|
relative: string
|
|
2001
2145
|
companionHeader?: string
|
|
2002
2146
|
}[] = []
|
|
2147
|
+
const deferredSwiftPods = new Map<
|
|
2148
|
+
string,
|
|
2149
|
+
{ label: string; root: string; files: string[] }
|
|
2150
|
+
>()
|
|
2003
2151
|
|
|
2004
2152
|
// generated code a provider does not ship comes from the app's own codegen,
|
|
2005
2153
|
// the ReactCodegen pod pod install builds
|
|
@@ -2017,6 +2165,7 @@ export async function collectTurboSources(options: {
|
|
|
2017
2165
|
provider,
|
|
2018
2166
|
options.appRoot,
|
|
2019
2167
|
options.installedPods?.get(provider.name),
|
|
2168
|
+
!provider.paper,
|
|
2020
2169
|
)
|
|
2021
2170
|
if (pod.installed)
|
|
2022
2171
|
providerTargetInput.clangSettings = [
|
|
@@ -2081,6 +2230,32 @@ export async function collectTurboSources(options: {
|
|
|
2081
2230
|
),
|
|
2082
2231
|
installed: pod.installed !== undefined,
|
|
2083
2232
|
})
|
|
2233
|
+
for (const framework of pod.installed?.binaryFrameworks ?? []) {
|
|
2234
|
+
for (const standin of framework.standins) {
|
|
2235
|
+
const previous = standinTargets.get(standin.module)
|
|
2236
|
+
if (previous && previous !== standin)
|
|
2237
|
+
throw new Error(`two installed binary frameworks provide ${standin.module}`)
|
|
2238
|
+
if (previous) continue
|
|
2239
|
+
standinTargets.set(standin.module, standin)
|
|
2240
|
+
result.targets.push({
|
|
2241
|
+
...target(standin.module, []),
|
|
2242
|
+
publicHeadersPath: standin.publicHeadersPath,
|
|
2243
|
+
})
|
|
2244
|
+
for (const [file, text] of Object.entries(standin.files))
|
|
2245
|
+
add(`${targetPath(standin.module)}/${file}`, text)
|
|
2246
|
+
}
|
|
2247
|
+
for (const relative of fs.readdirSync(framework.headers, {
|
|
2248
|
+
recursive: true,
|
|
2249
|
+
encoding: 'utf8',
|
|
2250
|
+
})) {
|
|
2251
|
+
if (HEADER.test(relative))
|
|
2252
|
+
headers.set(path.posix.join(framework.name, relative), {
|
|
2253
|
+
label: framework.name,
|
|
2254
|
+
root: framework.headers,
|
|
2255
|
+
relative,
|
|
2256
|
+
})
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2084
2259
|
const mappings = podHeaderMappings(pod)
|
|
2085
2260
|
// CocoaPods flattens a pod's headers: `Name.h` and `<pod>/Name.h`
|
|
2086
2261
|
const ambiguousHeaders = new Set<string>()
|
|
@@ -2092,14 +2267,12 @@ export async function collectTurboSources(options: {
|
|
|
2092
2267
|
if (ambiguousHeaders.has(name)) continue
|
|
2093
2268
|
const prior = headers.get(name)
|
|
2094
2269
|
if (prior && (prior.root !== entry.root || prior.relative !== entry.relative)) {
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
}
|
|
2102
|
-
throw new Error(`${label}: two pod headers are named ${name}`)
|
|
2270
|
+
// CocoaPods links flattened duplicates (across pods, or one pod's
|
|
2271
|
+
// per-arch copies) without error; pod-relative includes and header
|
|
2272
|
+
// maps still select their owning file when the alias is ambiguous.
|
|
2273
|
+
headers.delete(name)
|
|
2274
|
+
ambiguousHeaders.add(name)
|
|
2275
|
+
continue
|
|
2103
2276
|
}
|
|
2104
2277
|
headers.set(name, entry)
|
|
2105
2278
|
}
|
|
@@ -2185,15 +2358,27 @@ export async function collectTurboSources(options: {
|
|
|
2185
2358
|
relative: string
|
|
2186
2359
|
companionHeader?: string
|
|
2187
2360
|
}[] = []
|
|
2188
|
-
const
|
|
2189
|
-
moduleName: string
|
|
2190
|
-
label: string
|
|
2191
|
-
root: string
|
|
2192
|
-
files: string[]
|
|
2193
|
-
}[] = []
|
|
2361
|
+
const depSwiftModules = new Set<string>()
|
|
2194
2362
|
const externalDefines: string[] = []
|
|
2195
2363
|
const dependencies = podspecDependencies(pod)
|
|
2196
2364
|
const seenDependencies = new Set([pod.name, ...dependencies.map(({ name }) => name)])
|
|
2365
|
+
const addInstalledDependencies = (identities: readonly string[] = []) => {
|
|
2366
|
+
for (const identity of identities) {
|
|
2367
|
+
const dependency = installedByIdentity.get(identity)
|
|
2368
|
+
if (
|
|
2369
|
+
!dependency?.podRoot ||
|
|
2370
|
+
seenDependencies.has(dependency.name) ||
|
|
2371
|
+
reactNativePod(dependency.name)
|
|
2372
|
+
)
|
|
2373
|
+
continue
|
|
2374
|
+
seenDependencies.add(dependency.name)
|
|
2375
|
+
dependencies.push({ name: dependency.name, requirements: [], subspecs: [''] })
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
addInstalledDependencies(
|
|
2379
|
+
installedTargets.find((target) => target.name === pod.name && target.podRoot)
|
|
2380
|
+
?.targetDependencies,
|
|
2381
|
+
)
|
|
2197
2382
|
for (const dep of dependencies) {
|
|
2198
2383
|
const installed = installedHeaderPods.find(
|
|
2199
2384
|
(candidate) => candidate.name === dep.name,
|
|
@@ -2237,17 +2422,7 @@ export async function collectTurboSources(options: {
|
|
|
2237
2422
|
if (!resolved) continue
|
|
2238
2423
|
if (provider.reactModulesOnly && resolved.files.some((f) => f.endsWith('.swift')))
|
|
2239
2424
|
continue
|
|
2240
|
-
|
|
2241
|
-
const dependency = installedByIdentity.get(identity)
|
|
2242
|
-
if (
|
|
2243
|
-
!dependency?.podRoot ||
|
|
2244
|
-
seenDependencies.has(dependency.name) ||
|
|
2245
|
-
reactNativePod(dependency.name)
|
|
2246
|
-
)
|
|
2247
|
-
continue
|
|
2248
|
-
seenDependencies.add(dependency.name)
|
|
2249
|
-
dependencies.push({ name: dependency.name, requirements: [], subspecs: [''] })
|
|
2250
|
-
}
|
|
2425
|
+
addInstalledDependencies(installedTarget?.targetDependencies)
|
|
2251
2426
|
externalDefines.push(...resolved.defines)
|
|
2252
2427
|
const mappings = installed ? podHeaderMappings(installed) : []
|
|
2253
2428
|
const nativeHeaderPaths = new Map<string, string>()
|
|
@@ -2302,12 +2477,14 @@ export async function collectTurboSources(options: {
|
|
|
2302
2477
|
}
|
|
2303
2478
|
}
|
|
2304
2479
|
if (swiftFilesForDep.length > 0) {
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2480
|
+
depSwiftModules.add(resolved.moduleName)
|
|
2481
|
+
if (!deferredSwiftPods.has(resolved.moduleName)) {
|
|
2482
|
+
deferredSwiftPods.set(resolved.moduleName, {
|
|
2483
|
+
label: resolved.name,
|
|
2484
|
+
root: resolved.root,
|
|
2485
|
+
files: swiftFilesForDep,
|
|
2486
|
+
})
|
|
2487
|
+
}
|
|
2311
2488
|
}
|
|
2312
2489
|
}
|
|
2313
2490
|
// an external pod's units compile inside the provider target with the defines its podspec sets
|
|
@@ -2319,31 +2496,13 @@ export async function collectTurboSources(options: {
|
|
|
2319
2496
|
{ tool: 'cxx', flags },
|
|
2320
2497
|
]
|
|
2321
2498
|
}
|
|
2322
|
-
|
|
2323
|
-
if (!result.targets.some((t) => t.name === depPod.moduleName)) {
|
|
2324
|
-
result.targets.push(target(depPod.moduleName, []))
|
|
2325
|
-
for (const file of depPod.files)
|
|
2326
|
-
result.externalPodSources.push({
|
|
2327
|
-
moduleName: depPod.moduleName,
|
|
2328
|
-
file: original(depPod.moduleName, depPod.label, depPod.root, file),
|
|
2329
|
-
})
|
|
2330
|
-
add(
|
|
2331
|
-
`${targetPath(depPod.moduleName)}/_PeachTurboSwiftSupport.swift`,
|
|
2332
|
-
['@_exported import Foundation', '@_exported import UIKit', ''].join('\n'),
|
|
2333
|
-
)
|
|
2334
|
-
}
|
|
2335
|
-
}
|
|
2336
|
-
if (swiftSources.length > 0 || depSwiftPods.length > 0) {
|
|
2499
|
+
if (swiftSources.length > 0 || depSwiftModules.size > 0) {
|
|
2337
2500
|
const moduleName = podspecList(podSegments(pod)[0]!, 'module_name')
|
|
2338
2501
|
const swiftModule =
|
|
2339
2502
|
(Array.isArray(moduleName) ? moduleName[0] : undefined) ??
|
|
2340
2503
|
pod.name.replace(/[^A-Za-z0-9_]/g, '_').replace(/^[0-9]/, '_')
|
|
2341
2504
|
result.targets.push({
|
|
2342
|
-
...target(
|
|
2343
|
-
swiftModule,
|
|
2344
|
-
depSwiftPods.map((dep) => dep.moduleName),
|
|
2345
|
-
providerDefines,
|
|
2346
|
-
),
|
|
2505
|
+
...target(swiftModule, [...depSwiftModules], providerDefines),
|
|
2347
2506
|
cxxInterop: true,
|
|
2348
2507
|
})
|
|
2349
2508
|
for (const file of swiftSources) original(swiftModule, label, root, file)
|
|
@@ -2498,7 +2657,7 @@ export async function collectTurboSources(options: {
|
|
|
2498
2657
|
add(
|
|
2499
2658
|
`${targetPath(targetName)}/include/module.modulemap`,
|
|
2500
2659
|
`module ${targetName} { header "PeachTurboLoad.hpp"${
|
|
2501
|
-
swiftSources.length > 0 ||
|
|
2660
|
+
swiftSources.length > 0 || depSwiftModules.size > 0
|
|
2502
2661
|
? publicHeaders
|
|
2503
2662
|
.map((file) => {
|
|
2504
2663
|
const source = original(targetName, label, root, file)
|
|
@@ -2510,6 +2669,21 @@ export async function collectTurboSources(options: {
|
|
|
2510
2669
|
)
|
|
2511
2670
|
}
|
|
2512
2671
|
|
|
2672
|
+
// a later provider can own a swift pod already reached by a dependency.
|
|
2673
|
+
for (const [moduleName, pod] of deferredSwiftPods) {
|
|
2674
|
+
if (result.targets.some((target) => target.name === moduleName)) continue
|
|
2675
|
+
result.targets.push(target(moduleName, []))
|
|
2676
|
+
for (const file of pod.files)
|
|
2677
|
+
result.externalPodSources.push({
|
|
2678
|
+
moduleName,
|
|
2679
|
+
file: original(moduleName, pod.label, pod.root, file),
|
|
2680
|
+
})
|
|
2681
|
+
add(
|
|
2682
|
+
`${targetPath(moduleName)}/_PeachTurboSwiftSupport.swift`,
|
|
2683
|
+
['@_exported import Foundation', '@_exported import UIKit', ''].join('\n'),
|
|
2684
|
+
)
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2513
2687
|
// the host: the binding installed on the process's JSI runtime. C++ modules
|
|
2514
2688
|
// alone are answered from the global C++ module map as RCTTurboModuleManager
|
|
2515
2689
|
// answers a C++ module; an Objective-C module brings React Native's own
|
|
@@ -2638,30 +2812,40 @@ export async function collectTurboSources(options: {
|
|
|
2638
2812
|
'React/Base/RCTPerformanceLogger.mm',
|
|
2639
2813
|
'ReactCommon/cxxreact/ReactMarker.cpp',
|
|
2640
2814
|
])
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2815
|
+
if (options.standaloneProvider) {
|
|
2816
|
+
for (const provider of providers) {
|
|
2817
|
+
if (!provider.providerFabric) continue
|
|
2818
|
+
const codegen = packageManifest(provider.root)?.codegenConfig
|
|
2819
|
+
const ios = object(codegen) ? codegen.ios : undefined
|
|
2820
|
+
const components = object(ios) ? ios.componentProvider : undefined
|
|
2821
|
+
if (!object(components))
|
|
2822
|
+
throw new Error(`${provider.name} has no iOS component map`)
|
|
2823
|
+
for (const [name, className] of Object.entries(components)) {
|
|
2824
|
+
if (typeof className !== 'string')
|
|
2825
|
+
throw new Error(`${provider.name} has no class for ${name}`)
|
|
2826
|
+
fabricViews.push({ name, className })
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
} else if (!options.reactNativeProvider) {
|
|
2830
|
+
codegen ??= (await generateCodegen()).generatedRoot
|
|
2831
|
+
const generated = codegenSpecRoot(codegen)
|
|
2832
|
+
// some releases (0.78) emit no central provider file; their specs self-register
|
|
2833
|
+
if (fs.existsSync(path.join(generated, 'RCTModuleProviders.mm'))) {
|
|
2834
|
+
moduleProviders = true
|
|
2835
|
+
original(TURBO_CORE_TARGET, 'ReactCodegen', generated, 'RCTModuleProviders.mm')
|
|
2836
|
+
alias(
|
|
2837
|
+
`${core}/include/ReactCodegen/RCTModuleProviders.h`,
|
|
2838
|
+
original(TURBO_CORE_TARGET, 'ReactCodegen', generated, 'RCTModuleProviders.h'),
|
|
2839
|
+
)
|
|
2840
|
+
}
|
|
2841
|
+
const thirdParty = path.join(generated, 'RCTThirdPartyComponentsProvider.mm')
|
|
2842
|
+
if (fabricPackages.size > 0 && fs.existsSync(thirdParty))
|
|
2843
|
+
for (const [, name, className, owner] of fs
|
|
2844
|
+
.readFileSync(thirdParty, 'utf8')
|
|
2845
|
+
.matchAll(/@"([^"]+)": NSClassFromString\(@"([^"]+)"\), \/\/ (\S+)/g))
|
|
2846
|
+
if (fabricPackages.has(owner!))
|
|
2847
|
+
fabricViews.push({ name: name!, className: className! })
|
|
2655
2848
|
}
|
|
2656
|
-
// the app's components as its RCTThirdPartyComponentsProvider maps them,
|
|
2657
|
-
// less those of packages Peach answers itself, whose classes are not linked
|
|
2658
|
-
const thirdParty = path.join(generated, 'RCTThirdPartyComponentsProvider.mm')
|
|
2659
|
-
if (fabricPackages.size > 0 && fs.existsSync(thirdParty))
|
|
2660
|
-
for (const [, name, className, owner] of fs
|
|
2661
|
-
.readFileSync(thirdParty, 'utf8')
|
|
2662
|
-
.matchAll(/@"([^"]+)": NSClassFromString\(@"([^"]+)"\), \/\/ (\S+)/g))
|
|
2663
|
-
if (fabricPackages.has(owner!))
|
|
2664
|
-
fabricViews.push({ name: name!, className: className! })
|
|
2665
2849
|
// the host compiles with the first Fabric package's own settings, which
|
|
2666
2850
|
// reach the React Fabric headers its component views include
|
|
2667
2851
|
const hostTarget =
|
|
@@ -2709,6 +2893,7 @@ export async function collectTurboSources(options: {
|
|
|
2709
2893
|
fabricViews,
|
|
2710
2894
|
result.paperViewManagers,
|
|
2711
2895
|
appPresenter,
|
|
2896
|
+
paperWorkspace,
|
|
2712
2897
|
reactNative.version,
|
|
2713
2898
|
),
|
|
2714
2899
|
)
|
|
@@ -2718,6 +2903,11 @@ export async function collectTurboSources(options: {
|
|
|
2718
2903
|
)
|
|
2719
2904
|
}
|
|
2720
2905
|
}
|
|
2906
|
+
const hermesInterfaces = ['hermes.h', 'hermes-interfaces.h']
|
|
2907
|
+
.map((header) => path.join(reactNative.root, 'ReactCommon/jsi/jsi', header))
|
|
2908
|
+
.filter((file) => fs.existsSync(file))
|
|
2909
|
+
.map((file) => fs.readFileSync(file, 'utf8'))
|
|
2910
|
+
.join('\n')
|
|
2721
2911
|
let hasEventDispatcher = false
|
|
2722
2912
|
if (fabric || legacyBridge) {
|
|
2723
2913
|
hasEventDispatcher = fs.existsSync(
|
|
@@ -2742,17 +2932,12 @@ export async function collectTurboSources(options: {
|
|
|
2742
2932
|
throw new Error(
|
|
2743
2933
|
`the legacy bridge needs the installed hermes-engine headers in ${hermesHeaders}`,
|
|
2744
2934
|
)
|
|
2745
|
-
const
|
|
2746
|
-
|
|
2747
|
-
'
|
|
2935
|
+
const hermesHeader = fs.readFileSync(
|
|
2936
|
+
path.join(hermesHeaders, 'hermes/hermes.h'),
|
|
2937
|
+
'utf8',
|
|
2748
2938
|
)
|
|
2749
|
-
const hermesHeader =
|
|
2750
|
-
fs.readFileSync(path.join(hermesHeaders, 'hermes/hermes.h'), 'utf8') +
|
|
2751
|
-
(fs.existsSync(hermesInterfacesPath)
|
|
2752
|
-
? `\n${fs.readFileSync(hermesInterfacesPath, 'utf8')}`
|
|
2753
|
-
: '')
|
|
2754
2939
|
const runtimeUnit = `${core}/${PEACH_HERMES_RUNTIME_FILE}`
|
|
2755
|
-
add(runtimeUnit, platformHermesRuntime(hermesHeader))
|
|
2940
|
+
add(runtimeUnit, platformHermesRuntime(`${hermesHeader}\n${hermesInterfaces}`))
|
|
2756
2941
|
scanText(
|
|
2757
2942
|
{
|
|
2758
2943
|
key: runtimeUnit,
|
|
@@ -2764,6 +2949,35 @@ export async function collectTurboSources(options: {
|
|
|
2764
2949
|
result.files[runtimeUnit]!,
|
|
2765
2950
|
)
|
|
2766
2951
|
}
|
|
2952
|
+
// React-CoreModules, among the pods React-RCTAppDelegate reaches, links
|
|
2953
|
+
// SocketRocket; its sources include one another by CocoaPods' flat names
|
|
2954
|
+
if (legacyBridge && fabric) {
|
|
2955
|
+
const sources = socketRocketSources()
|
|
2956
|
+
for (const { source, text, sha256, header } of sources) {
|
|
2957
|
+
if (!header) continue
|
|
2958
|
+
const key = `${core}/include/${header}`
|
|
2959
|
+
add(key, text)
|
|
2960
|
+
result.sources.push({ file: key, source, sha256 })
|
|
2961
|
+
}
|
|
2962
|
+
const targetName = appDelegateTarget()
|
|
2963
|
+
for (const { relative, source, text, sha256, header } of sources) {
|
|
2964
|
+
if (header) continue
|
|
2965
|
+
const key = `${targetPath(targetName)}/dependencies/SocketRocket/${relative}`
|
|
2966
|
+
add(key, text)
|
|
2967
|
+
result.sources.push({ file: key, source, sha256 })
|
|
2968
|
+
scanText(
|
|
2969
|
+
{
|
|
2970
|
+
key,
|
|
2971
|
+
targetName,
|
|
2972
|
+
label: '',
|
|
2973
|
+
root: '',
|
|
2974
|
+
relative: `SocketRocket/${path.posix.basename(relative)}`,
|
|
2975
|
+
},
|
|
2976
|
+
text,
|
|
2977
|
+
true,
|
|
2978
|
+
)
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2767
2981
|
addPodSources(
|
|
2768
2982
|
installedFabricSources(reactNative.root, {
|
|
2769
2983
|
legacyBridge,
|
|
@@ -2771,6 +2985,24 @@ export async function collectTurboSources(options: {
|
|
|
2771
2985
|
appRoot: options.appRoot,
|
|
2772
2986
|
}),
|
|
2773
2987
|
)
|
|
2988
|
+
// wholly guarded units join the on-demand archive without being loaded by -ObjC
|
|
2989
|
+
if (legacyBridge && !removeLegacyArch) {
|
|
2990
|
+
const legacyDefines = result.targets[0]!.cxxDefines ?? defines
|
|
2991
|
+
for (const owner of [TURBO_CORE_TARGET, TURBO_APP_DELEGATE_TARGET]) {
|
|
2992
|
+
const prefix = `${targetPath(owner)}/upstream/react-native/`
|
|
2993
|
+
for (const key of [...compiledSources]) {
|
|
2994
|
+
if (!key.startsWith(prefix) || !wholeLegacyArchUnit(result.files[key]!))
|
|
2995
|
+
continue
|
|
2996
|
+
excludeUnit(key)
|
|
2997
|
+
original(
|
|
2998
|
+
reachedTarget(TURBO_LEGACY_ARCH_TARGET, legacyDefines),
|
|
2999
|
+
'react-native',
|
|
3000
|
+
reactNative.root,
|
|
3001
|
+
key.slice(prefix.length),
|
|
3002
|
+
)
|
|
3003
|
+
}
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
2774
3006
|
const patterns = installedRendererDependencyGlobs(reactNative.root, options.appRoot)
|
|
2775
3007
|
const matchers = new Map(
|
|
2776
3008
|
Object.entries(patterns).map(([name, globs]) => [name, globs.map(globRegex)]),
|
|
@@ -2830,6 +3062,7 @@ export async function collectTurboSources(options: {
|
|
|
2830
3062
|
fabric || legacyBridge,
|
|
2831
3063
|
hasEventDispatcher,
|
|
2832
3064
|
fabric,
|
|
3065
|
+
paperWorkspace,
|
|
2833
3066
|
)
|
|
2834
3067
|
: turboHostSource(withRuntime),
|
|
2835
3068
|
)
|
|
@@ -2877,17 +3110,9 @@ export async function collectTurboSources(options: {
|
|
|
2877
3110
|
const targetName = providerTarget(consumer.info.name)
|
|
2878
3111
|
const relative = PEACH_HERMES_RUNTIME_FILE
|
|
2879
3112
|
const key = `${targetPath(targetName)}/${relative}`
|
|
2880
|
-
const hermesInterfacesPath = path.join(
|
|
2881
|
-
reactNative.root,
|
|
2882
|
-
'ReactCommon/jsi/jsi/hermes-interfaces.h',
|
|
2883
|
-
)
|
|
2884
3113
|
const headerKey = `${targetPath(targetName)}/include/hermes/hermes.h`
|
|
2885
|
-
const
|
|
2886
|
-
|
|
2887
|
-
(fs.existsSync(hermesInterfacesPath)
|
|
2888
|
-
? `\n${fs.readFileSync(hermesInterfacesPath, 'utf8')}`
|
|
2889
|
-
: '')
|
|
2890
|
-
const hermesSource = platformHermesRuntime(hermesHeader)
|
|
3114
|
+
const header = result.files[hermesHeaderAliases.get(headerKey) ?? headerKey]!
|
|
3115
|
+
const hermesSource = platformHermesRuntime(`${header}\n${hermesInterfaces}`)
|
|
2891
3116
|
add(key, hermesSource)
|
|
2892
3117
|
scanText(
|
|
2893
3118
|
{ key, targetName, label: consumer.info.name, root: consumer.root, relative },
|
|
@@ -2899,8 +3124,7 @@ export async function collectTurboSources(options: {
|
|
|
2899
3124
|
}
|
|
2900
3125
|
// mapped public pod headers can themselves import their generated specs.
|
|
2901
3126
|
if (pendingCodegen.length) {
|
|
2902
|
-
codegen ??= (await
|
|
2903
|
-
.generatedRoot
|
|
3127
|
+
codegen ??= (await generateCodegen()).generatedRoot
|
|
2904
3128
|
for (const { from, include, quoted } of pendingCodegen) resolve(from, include, quoted)
|
|
2905
3129
|
for (let next = pending.shift(); next; next = pending.shift())
|
|
2906
3130
|
scanText(next, result.files[next.key]!)
|
|
@@ -2922,14 +3146,7 @@ export async function collectTurboSources(options: {
|
|
|
2922
3146
|
: [],
|
|
2923
3147
|
),
|
|
2924
3148
|
)
|
|
2925
|
-
for (const file of repeated)
|
|
2926
|
-
compiledSources.delete(file)
|
|
2927
|
-
textualSources.add(file)
|
|
2928
|
-
for (const target of result.nativeTargets ?? []) {
|
|
2929
|
-
delete target.fileFlags[file]
|
|
2930
|
-
delete target.sourceDirectories[file]
|
|
2931
|
-
}
|
|
2932
|
-
}
|
|
3149
|
+
for (const file of repeated) excludeUnit(file)
|
|
2933
3150
|
result.externalPodSources = result.externalPodSources.filter(
|
|
2934
3151
|
({ file }) => !repeated.has(file),
|
|
2935
3152
|
)
|