peachsim 0.1.1660 → 0.1.1673
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/cli/bridge-flow-runner.ts +6 -3
- package/cli/commands/box.ts +2 -0
- package/cli/commands/control.ts +56 -17
- package/cli/commands/coverage-swift.ts +291 -0
- package/cli/commands/coverage.ts +168 -24
- package/cli/commands/debug.ts +100 -9
- package/cli/commands/diagnose.ts +1 -19
- package/cli/commands/flow.ts +2 -2
- package/cli/commands/inspect/settle.ts +4 -2
- package/cli/commands/inspect/settling.ts +17 -14
- package/cli/commands/platform.ts +3 -0
- package/cli/commands/react.ts +3 -18
- package/cli/commands/screenshot.ts +1 -1
- package/cli/commands/screenshots-capture.ts +1 -1
- package/cli/current-sim.ts +21 -1
- package/cli/dev-build-freshness.ts +36 -2
- package/cli/drivers/playwright-provisioning.ts +1 -4
- package/cli/drivers/playwright.ts +15 -1
- package/cli/maestro-compare.ts +44 -14
- package/cli/main.ts +3 -0
- package/cli/material-symbol-fonts.ts +3 -100
- package/cli/output-redaction.ts +21 -6
- package/cli/parent-pid.ts +2 -2
- package/cli/scene-video.ts +1 -1
- package/cli/ui.ts +20 -0
- package/cli/ws-bridge.ts +26 -37
- package/detox/frame-identity.cjs +21 -0
- package/detox/frame-identity.d.cts +6 -0
- package/detox/index.ts +39 -33
- package/detox/jest-environment.cjs +4 -1
- package/detox/jest-setup-after-env.cjs +0 -4
- package/detox/navigation-lifecycle.ts +2 -2
- package/detox/proof-observer.ts +126 -0
- package/dist-lib/agent-daemon-client.cjs +29 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +10 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +2581 -27346
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +2752 -4982
- package/dist-lib/detox/jest-environment.cjs +4 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +2272 -27004
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +2801 -27484
- package/dist-lib/host/fetch-proxy-handler.cjs +7 -7
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +394 -49
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +10 -1
- package/dist-lib/metro-production-bundle.mjs +12 -1
- package/dist-lib/metro.cjs +235 -13
- package/dist-lib/native-app-identity-project.cjs +123 -13
- package/dist-lib/native-app-identity-project.mjs +123 -13
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +21 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +76 -28
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +590 -184
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +964 -0
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +18 -15
- package/dist-lib/sdk.mjs +18 -15
- package/dist-lib/skills.cjs +3900 -28409
- package/dist-lib/swift-compile.cjs +1227 -26292
- package/dist-lib/swift-compile.mjs +1156 -26221
- package/dist-lib/swift-package.cjs +34 -4
- package/dist-lib/swift-package.mjs +33 -4
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +52 -44
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +2317 -26955
- package/dist-lib/vite.cjs +132 -21
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/demo/demo-bundle-platform.d.ts +29 -0
- package/dist-types/packages/peach-engine/src/engine/app-font-registry.d.ts +13 -1
- package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +24 -0
- package/dist-types/packages/peach-engine/src/engine/fontDataContract.d.ts +73 -0
- package/dist-types/packages/peach-engine/src/engine/glass-material.d.ts +2 -3
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +21 -3
- package/dist-types/packages/peach-engine/src/engine/inspect-outline.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +1 -4
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +0 -1
- package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/ios/aux-shell-animated-sources.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +68 -0
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +11 -0
- package/dist-types/packages/peach-engine/src/render-worker/nativeSyncReplyContract.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +8 -1
- package/dist-types/packages/peach-engine/src/render-worker/shell-scene-schema.d.ts +10 -2
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime-kind.d.ts +24 -0
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +7 -2
- package/dist-types/packages/peach-engine/src/settings/devices.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/accessibilityBridgeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/androidDateTimePickerBridgeContract.d.ts +41 -0
- package/dist-types/packages/peach-globals/src/appLifecycleBridgeContract.d.ts +22 -0
- package/dist-types/packages/peach-globals/src/audioBridgeContract.d.ts +33 -0
- package/dist-types/packages/peach-globals/src/bridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/cameraBridgeContract.d.ts +94 -0
- package/dist-types/packages/peach-globals/src/captureBridgeContract.d.ts +36 -0
- package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +45 -0
- package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +31 -0
- package/dist-types/packages/peach-globals/src/debugBridgeContract.d.ts +27 -0
- package/dist-types/packages/peach-globals/src/electronBridgeContract.d.ts +29 -0
- package/dist-types/packages/peach-globals/src/eventBridgeContract.d.ts +200 -0
- package/dist-types/packages/peach-globals/src/globalsContract.d.ts +462 -0
- package/dist-types/packages/peach-globals/src/hostStorageBridgeContract.d.ts +3 -0
- package/dist-types/packages/peach-globals/src/imagePickerBridgeContract.d.ts +47 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +47 -3343
- package/dist-types/packages/peach-globals/src/interactionBridgeContract.d.ts +21 -0
- package/dist-types/packages/peach-globals/src/keyboardBridgeContract.d.ts +44 -0
- package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +77 -0
- package/dist-types/packages/peach-globals/src/nativeViewContract.d.ts +28 -0
- package/dist-types/packages/peach-globals/src/navigationBridgeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/nodeContract.d.ts +665 -0
- package/dist-types/packages/peach-globals/src/performanceBridgeContract.d.ts +100 -0
- package/dist-types/packages/peach-globals/src/permissionsBridgeContract.d.ts +152 -0
- package/dist-types/packages/peach-globals/src/photoLibraryBridgeContract.d.ts +36 -0
- package/dist-types/packages/peach-globals/src/portalBridgeContract.d.ts +9 -0
- package/dist-types/packages/peach-globals/src/recordingBridgeContract.d.ts +131 -0
- package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +125 -0
- package/dist-types/packages/peach-globals/src/sceneStreamBridgeContract.d.ts +37 -0
- package/dist-types/packages/peach-globals/src/settingsBridgeContract.d.ts +7 -0
- package/dist-types/packages/peach-globals/src/shareSheetBridgeContract.d.ts +14 -0
- package/dist-types/packages/peach-globals/src/shellBridgeContract.d.ts +82 -0
- package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +28 -0
- package/dist-types/packages/peach-globals/src/speechSynthesisBridgeContract.d.ts +25 -0
- package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +278 -0
- package/dist-types/packages/peach-globals/src/timelineBridgeContract.d.ts +58 -0
- package/dist-types/packages/peach-globals/src/videoBridgeContract.d.ts +80 -0
- package/dist-types/packages/peach-globals/src/webViewBridgeContract.d.ts +331 -0
- package/dist-types/packages/peach-globals/src/windowBridgeContract.d.ts +5 -0
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
- package/dist-types/packages/peach-kit/src/ui/popover-placement.d.ts +3 -5
- package/package.json +2 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsset.h +20 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsynchronousKeyValueLoading.h +15 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h +5 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataFormat.h +13 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataItem.h +16 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Headers/AVTimedMetadataGroup.h +13 -0
- package/sdk/ios/System/Library/Frameworks/AVFoundation.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h +19 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h +11 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h +17 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h +307 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h +174 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h +7 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.h +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchRequest.h +21 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchedResultsController.h +39 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h +10 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectContext.h +9 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectID.h +7 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectModel.h +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreCoordinator.h +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreRequest.h +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +221 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +316 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.h +46 -0
- package/sdk/ios/System/Library/Frameworks/CoreImage.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/CoreMedia.framework/Headers/CMTime.h +31 -0
- package/sdk/ios/System/Library/Frameworks/CoreMedia.framework/Headers/CMTimeRange.h +8 -0
- package/sdk/ios/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.h +3 -0
- package/sdk/ios/System/Library/Frameworks/CoreMedia.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h +12 -0
- package/sdk/ios/System/Library/Frameworks/CoreServices.framework/Headers/UTCoreTypes.h +1276 -0
- package/sdk/ios/System/Library/Frameworks/CoreServices.framework/Headers/UTType.h +644 -0
- package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h +20 -0
- package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreText.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +1441 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h +106 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h +429 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h +665 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h +2504 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h +634 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h +22 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h +18 -0
- package/sdk/ios/System/Library/Frameworks/ImageIO.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/MobileCoreServices.framework/Headers/MobileCoreServices.h +9 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +40 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h +14 -0
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerConfiguration.h +9 -0
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.h +2 -0
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecBase.h +3 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecItem.h +30 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +3 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStore.h +439 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreCopySpecific.h +216 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreKey.h +267 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetwork.h +204 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkConfiguration.h +1393 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkConnection.h +568 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkReachability.h +369 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferences.h +473 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferencesPath.h +179 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferencesSetSpecific.h +95 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCSchemaDefinitions.h +2395 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SystemConfiguration.h +184 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAppearance.h +5 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h +2 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +817 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Modules/module.modulemap +4 -0
- package/sdk/ios/usr/include/Availability.h +630 -0
- package/sdk/ios/usr/include/AvailabilityInternal.h +556 -0
- package/sdk/ios/usr/include/AvailabilityInternalLegacy.h +4346 -0
- package/sdk/ios/usr/include/AvailabilityVersions.h +547 -0
- package/sdk/ios/usr/include/CommonCrypto/CommonDigest.h +130 -0
- package/sdk/ios/usr/include/MacTypes.h +3 -0
- package/sdk/ios/usr/include/TargetConditionals.h +14 -0
- package/sdk/ios/usr/include/__xlocale.h +41 -0
- package/sdk/ios/usr/include/_bounds.h +67 -0
- package/sdk/ios/usr/include/_ctermid.h +42 -0
- package/sdk/ios/usr/include/_mb_cur_max.h +39 -0
- package/sdk/ios/usr/include/_printf.h +38 -0
- package/sdk/ios/usr/include/_stdio.h +510 -0
- package/sdk/ios/usr/include/_types/_intmax_t.h +40 -0
- package/sdk/ios/usr/include/_types/_locale_t.h +38 -0
- package/sdk/ios/usr/include/_types/_uint16_t.h +32 -0
- package/sdk/ios/usr/include/_types/_uint32_t.h +32 -0
- package/sdk/ios/usr/include/_types/_uint64_t.h +32 -0
- package/sdk/ios/usr/include/_types/_uint8_t.h +32 -0
- package/sdk/ios/usr/include/_types/_uintmax_t.h +40 -0
- package/sdk/ios/usr/include/_types.h +72 -0
- package/sdk/ios/usr/include/arm/_endian.h +105 -0
- package/sdk/ios/usr/include/arm/_mcontext.h +95 -0
- package/sdk/ios/usr/include/arm/_param.h +25 -0
- package/sdk/ios/usr/include/arm/_types.h +125 -0
- package/sdk/ios/usr/include/arm/endian.h +65 -0
- package/sdk/ios/usr/include/arm/signal.h +22 -0
- package/sdk/ios/usr/include/arm/types.h +110 -0
- package/sdk/ios/usr/include/asl.h +160 -0
- package/sdk/ios/usr/include/assert.h +14 -0
- package/sdk/ios/usr/include/dirent.h +224 -0
- package/sdk/ios/usr/include/dispatch/dispatch.h +114 -0
- package/sdk/ios/usr/include/dlfcn.h +16 -0
- package/sdk/ios/usr/include/errno.h +24 -0
- package/sdk/ios/usr/include/execinfo.h +11 -0
- package/sdk/ios/usr/include/fcntl.h +23 -0
- package/sdk/ios/usr/include/i386/_endian.h +105 -0
- package/sdk/ios/usr/include/i386/_mcontext.h +216 -0
- package/sdk/ios/usr/include/i386/_param.h +49 -0
- package/sdk/ios/usr/include/i386/_types.h +149 -0
- package/sdk/ios/usr/include/i386/endian.h +89 -0
- package/sdk/ios/usr/include/i386/signal.h +47 -0
- package/sdk/ios/usr/include/libkern/OSAtomic.h +51 -0
- package/sdk/ios/usr/include/libkern/OSAtomicDeprecated.h +1267 -0
- package/sdk/ios/usr/include/libkern/OSAtomicQueue.h +115 -0
- package/sdk/ios/usr/include/libkern/OSByteOrder.h +315 -0
- package/sdk/ios/usr/include/libkern/OSSpinLockDeprecated.h +212 -0
- package/sdk/ios/usr/include/libkern/_OSByteOrder.h +125 -0
- package/sdk/ios/usr/include/libkern/arm/_OSByteOrder.h +99 -0
- package/sdk/ios/usr/include/libkern/i386/_OSByteOrder.h +110 -0
- package/sdk/ios/usr/include/libkern/machine/OSByteOrder.h +147 -0
- package/sdk/ios/usr/include/limits.h +4 -0
- package/sdk/ios/usr/include/mach/arm/_structs.h +741 -0
- package/sdk/ios/usr/include/mach/boolean.h +4 -0
- package/sdk/ios/usr/include/mach/exception_types.h +40 -0
- package/sdk/ios/usr/include/mach/host_info.h +200 -0
- package/sdk/ios/usr/include/mach/i386/_structs.h +1316 -0
- package/sdk/ios/usr/include/mach/kern_return.h +61 -0
- package/sdk/ios/usr/include/mach/mach.h +16 -0
- package/sdk/ios/usr/include/mach/mach_error.h +10 -0
- package/sdk/ios/usr/include/mach/mach_host.h +18 -0
- package/sdk/ios/usr/include/mach/mach_init.h +15 -0
- package/sdk/ios/usr/include/mach/mach_port.h +11 -0
- package/sdk/ios/usr/include/mach/mach_time.h +14 -0
- package/sdk/ios/usr/include/mach/mach_types.h +20 -0
- package/sdk/ios/usr/include/mach/machine/_structs.h +40 -0
- package/sdk/ios/usr/include/mach/machine.h +144 -0
- package/sdk/ios/usr/include/mach/task.h +14 -0
- package/sdk/ios/usr/include/mach/task_info.h +23 -0
- package/sdk/ios/usr/include/mach/task_policy.h +29 -0
- package/sdk/ios/usr/include/mach/thread_act.h +12 -0
- package/sdk/ios/usr/include/mach/thread_info.h +32 -0
- package/sdk/ios/usr/include/mach/time_value.h +4 -0
- package/sdk/ios/usr/include/mach/vm_prot.h +8 -0
- package/sdk/ios/usr/include/mach/vm_region.h +43 -0
- package/sdk/ios/usr/include/mach/vm_statistics.h +491 -0
- package/sdk/ios/usr/include/mach/vm_types.h +8 -0
- package/sdk/ios/usr/include/mach-o/arch.h +21 -0
- package/sdk/ios/usr/include/mach-o/dyld.h +16 -0
- package/sdk/ios/usr/include/mach-o/dyld_images.h +71 -0
- package/sdk/ios/usr/include/mach-o/getsect.h +17 -0
- package/sdk/ios/usr/include/mach-o/loader.h +158 -0
- package/sdk/ios/usr/include/mach-o/nlist.h +38 -0
- package/sdk/ios/usr/include/mach-o/stab.h +33 -0
- package/sdk/ios/usr/include/mach-o/utils.h +10 -0
- package/sdk/ios/usr/include/machine/_endian.h +42 -0
- package/sdk/ios/usr/include/machine/_mcontext.h +39 -0
- package/sdk/ios/usr/include/machine/_param.h +39 -0
- package/sdk/ios/usr/include/machine/_types.h +39 -0
- package/sdk/ios/usr/include/machine/endian.h +42 -0
- package/sdk/ios/usr/include/machine/signal.h +39 -0
- package/sdk/ios/usr/include/machine/types.h +42 -0
- package/sdk/ios/usr/include/math.h +5 -0
- package/sdk/ios/usr/include/module.modulemap +4 -0
- package/sdk/ios/usr/include/net/if.h +20 -0
- package/sdk/ios/usr/include/net/if_dl.h +10 -0
- package/sdk/ios/usr/include/net/if_var.h +15 -0
- package/sdk/ios/usr/include/net/net_kev.h +100 -0
- package/sdk/ios/usr/include/netdb.h +5 -0
- package/sdk/ios/usr/include/netinet/in.h +670 -0
- package/sdk/ios/usr/include/netinet6/in6.h +676 -0
- package/sdk/ios/usr/include/notify.h +45 -0
- package/sdk/ios/usr/include/notify_keys.h +17 -0
- package/sdk/ios/usr/include/objc/NSObject.h +79 -0
- package/sdk/ios/usr/include/os/availability.h +140 -0
- package/sdk/ios/usr/include/os/lock.h +24 -0
- package/sdk/ios/usr/include/os/log.h +77 -0
- package/sdk/ios/usr/include/os/object.h +13 -0
- package/sdk/ios/usr/include/peach/darwin.h +6 -0
- package/sdk/ios/usr/include/peach/netdb.h +316 -0
- package/sdk/ios/usr/include/peach/pthread.h +19 -0
- package/sdk/ios/usr/include/pthread.h +4 -0
- package/sdk/ios/usr/include/secure/_common.h +45 -0
- package/sdk/ios/usr/include/secure/_stdio.h +130 -0
- package/sdk/ios/usr/include/signal.h +132 -0
- package/sdk/ios/usr/include/stdint.h +205 -0
- package/sdk/ios/usr/include/stdio.h +65 -0
- package/sdk/ios/usr/include/stdlib.h +17 -0
- package/sdk/ios/usr/include/string.h +8 -0
- package/sdk/ios/usr/include/sys/__endian.h +108 -0
- package/sdk/ios/usr/include/sys/_endian.h +152 -0
- package/sdk/ios/usr/include/sys/_posix_availability.h +73 -0
- package/sdk/ios/usr/include/sys/_pthread/_pthread_attr_t.h +32 -0
- package/sdk/ios/usr/include/sys/_pthread/_pthread_t.h +32 -0
- package/sdk/ios/usr/include/sys/_pthread/_pthread_types.h +120 -0
- package/sdk/ios/usr/include/sys/_symbol_aliasing.h +1093 -0
- package/sdk/ios/usr/include/sys/_types/_errno_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_filesec_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_gid_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_in_addr_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_in_port_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_ino_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_int16_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_int32_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_int64_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_int8_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_intptr_t.h +33 -0
- package/sdk/ios/usr/include/sys/_types/_iovec_t.h +35 -0
- package/sdk/ios/usr/include/sys/_types/_mode_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_null.h +54 -0
- package/sdk/ios/usr/include/sys/_types/_o_dsync.h +30 -0
- package/sdk/ios/usr/include/sys/_types/_o_sync.h +30 -0
- package/sdk/ios/usr/include/sys/_types/_off_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_pid_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_ptrdiff_t.h +56 -0
- package/sdk/ios/usr/include/sys/_types/_s_ifmt.h +74 -0
- package/sdk/ios/usr/include/sys/_types/_sa_family_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_seek_set.h +51 -0
- package/sdk/ios/usr/include/sys/_types/_sigaltstack.h +50 -0
- package/sdk/ios/usr/include/sys/_types/_sigset_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_size_t.h +56 -0
- package/sdk/ios/usr/include/sys/_types/_socklen_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_ssize_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_timespec.h +38 -0
- package/sdk/ios/usr/include/sys/_types/_timeval32.h +3 -0
- package/sdk/ios/usr/include/sys/_types/_u_int16_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_u_int32_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_u_int64_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_u_int8_t.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_ucontext.h +59 -0
- package/sdk/ios/usr/include/sys/_types/_uid_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_uintptr_t.h +37 -0
- package/sdk/ios/usr/include/sys/_types/_va_list.h +49 -0
- package/sdk/ios/usr/include/sys/_types/_wchar_t.h +59 -0
- package/sdk/ios/usr/include/sys/_types.h +103 -0
- package/sdk/ios/usr/include/sys/appleapiopts.h +61 -0
- package/sdk/ios/usr/include/sys/cdefs.h +341 -0
- package/sdk/ios/usr/include/sys/constrained_ctypes.h +622 -0
- package/sdk/ios/usr/include/sys/dirent.h +141 -0
- package/sdk/ios/usr/include/sys/errno.h +271 -0
- package/sdk/ios/usr/include/sys/fcntl.h +649 -0
- package/sdk/ios/usr/include/sys/mman.h +273 -0
- package/sdk/ios/usr/include/sys/proc.h +65 -0
- package/sdk/ios/usr/include/sys/qos.h +61 -0
- package/sdk/ios/usr/include/sys/signal.h +394 -0
- package/sdk/ios/usr/include/sys/socket.h +752 -0
- package/sdk/ios/usr/include/sys/stdio.h +61 -0
- package/sdk/ios/usr/include/sys/sysctl.h +74 -0
- package/sdk/ios/usr/include/sys/syslimits.h +11 -0
- package/sdk/ios/usr/include/sys/time.h +5 -0
- package/sdk/ios/usr/include/sys/types.h +21 -0
- package/sdk/ios/usr/include/sys/ucontext.h +41 -0
- package/sdk/ios/usr/include/sys/xattr.h +50 -0
- package/sdk/ios/usr/include/time.h +2 -0
- package/sdk/ios/usr/include/unistd.h +3 -0
- package/sdk/ios/usr/include/uuid/uuid.h +19 -0
- package/sdk/ios/usr/include/xlocale/_stdio.h +85 -0
- package/sdk/ios/usr/lib/swift/CoreGraphics.swiftmodule/arm64-apple-ios-simulator.swiftinterface +8 -0
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -0
- package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +20 -0
- package/sdk/ios/wasm/include/dlfcn.h +3 -0
- package/sdk/ios/wasm/include/netdb.h +4 -0
- package/sdk/ios/wasm/include/pthread.h +3 -0
- package/sdk/ios/wasm/include/stdlib.h +3 -0
- package/sdk/ios/wasm/include/string.h +3 -0
- package/sdk/ios/wasm/include/sys/socket.h +7 -0
- package/sdk/ios/wasm/include/sys/types.h +4 -0
- package/sdk/ios/wasm/include/sys/ucontext.h +38 -0
- package/src/bridge-contract.ts +42 -0
- package/src/chromium-admission.ts +196 -0
- package/src/cli-runtime.ts +5 -5
- package/src/conformance-comparison-contract.ts +146 -0
- package/src/conformance-pixel-comparison.ts +327 -0
- package/src/device-catalog.ts +12 -3
- package/src/host/bridge-host.ts +6 -43
- package/src/launch-deadline.ts +74 -0
- package/src/material-symbol-fonts.ts +107 -0
- package/src/nitro-adapter.lock.json +3 -3
- package/src/profiles.ts +21 -0
- package/src/react-native-coverage/capability-reference-resolution.ts +402 -0
- package/src/react-native-coverage/capability-source-references.ts +1296 -0
- package/src/react-native-coverage/native-typescript-parser.ts +74 -0
- package/src/react-native-coverage/project-aliases.ts +207 -0
- package/src/react-native-coverage/verified-reach.ts +47 -0
- package/src/reap-browser.ts +1019 -0
- package/src/skills/builtin/a11y-review.ts +1 -1
- package/src/skills/builtin/perf-profile.ts +1 -1
- package/src/skills/builtin/screenshot-all.ts +1 -1
- package/src/skills/builtin/visual-diff.ts +1 -1
- package/src/swift-compile.ts +584 -226
- package/src/swift-compiler-digest.ts +6 -2
- package/src/swift-coverage/indexdump.ts +80 -0
- package/src/swift-coverage/indexing.ts +147 -0
- package/src/swift-coverage/package.ts +230 -0
- package/src/swift-coverage/provenance.ts +47 -0
- package/src/swift-coverage/reader.ts +81 -0
- package/src/swift-coverage/source.ts +252 -0
- package/src/swift-coverage/types.ts +58 -0
- package/src/swift-coverage/xcode-assets.ts +175 -0
- package/src/swift-coverage/xcode-bridging.ts +160 -0
- package/src/swift-coverage/xcode-packages.ts +251 -0
- package/src/swift-coverage/xcode-strings.ts +78 -0
- package/src/swift-coverage/xcode.ts +656 -0
- package/src/swift-distribution.lock.json +8 -8
- package/src/swift-distribution.ts +2 -1
- package/src/swift-host.ts +47 -4
- package/src/swift-objc-compile.ts +72 -97
- package/src/swift-objc-import.ts +238 -38
- package/src/swift-objc-metadata.ts +54 -7
- package/src/swift-objc-sdk-tree.ts +17 -0
- package/src/swift-objc-sdk.ts +27 -25677
- package/src/swift-objc-standin.ts +4 -2
- package/src/swift-package-manifest.ts +134 -13
- package/src/swift-package.ts +46 -4
- package/src/swift-standins.ts +2 -2
- package/src/swift-submit.ts +2 -1
- package/src/swift-toolchain.ts +72 -61
- package/src/swift-vite-lifetime.ts +42 -0
- package/src/swiftContract.ts +54 -0
- package/src/vite-plugin-one.ts +36 -15
- package/src/vite-plugin-swift.ts +21 -2
- package/src/worker-system-chunks.ts +3 -10
- package/src/xcode-header-search.ts +114 -0
- package/src/xcode-project.ts +108 -14
- package/detox/attempt-events.cjs +0 -884
- package/detox/attempt-events.d.cts +0 -113
- package/detox/motion-change.cjs +0 -524
- package/detox/motion-change.d.cts +0 -140
- package/detox/motion-leg-starts.cjs +0 -20
- package/detox/motion-leg-starts.d.cts +0 -8
- package/detox/proof-frame.cjs +0 -190
- package/detox/record-block-execution.cjs +0 -78
package/src/swift-objc-import.ts
CHANGED
|
@@ -58,10 +58,25 @@ export async function swiftObjCPrivateImports(
|
|
|
58
58
|
asts: AsyncIterable<string>,
|
|
59
59
|
registeredClasses: readonly string[],
|
|
60
60
|
): Promise<string> {
|
|
61
|
+
const collected: string[] = []
|
|
62
|
+
for await (const ast of asts) collected.push(ast)
|
|
63
|
+
return swiftObjCPrivateAdapters(collected, registeredClasses)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function swiftObjCPrivateAdapters(
|
|
67
|
+
asts: Iterable<string>,
|
|
68
|
+
registeredClasses: readonly string[],
|
|
69
|
+
): string {
|
|
61
70
|
const registered = new Set(registeredClasses)
|
|
62
71
|
const implemented = new Set<string>()
|
|
63
72
|
const adapters: { name: string; nativeName: string }[] = []
|
|
64
|
-
|
|
73
|
+
const candidates: {
|
|
74
|
+
nativeName: string
|
|
75
|
+
ancestors: string[]
|
|
76
|
+
rooted: boolean
|
|
77
|
+
renamed: boolean
|
|
78
|
+
}[] = []
|
|
79
|
+
for (const ast of asts) {
|
|
65
80
|
if (!/^TranslationUnitDecl\b/.test(ast))
|
|
66
81
|
throw new SwiftObjCImportError('expected original Objective-C implementation AST')
|
|
67
82
|
const declarations = new Map<string, { parent?: string; renamed: boolean }>()
|
|
@@ -98,24 +113,45 @@ export async function swiftObjCPrivateImports(
|
|
|
98
113
|
}
|
|
99
114
|
}
|
|
100
115
|
for (const nativeName of implementations) {
|
|
101
|
-
|
|
116
|
+
if (implemented.has(nativeName))
|
|
102
117
|
throw new SwiftObjCImportError(
|
|
103
|
-
`Objective-C implementation ${nativeName}:
|
|
118
|
+
`Objective-C implementation ${nativeName}: duplicate original class implementation`,
|
|
104
119
|
)
|
|
105
|
-
}
|
|
106
|
-
if (implemented.has(nativeName)) fail('duplicate original class implementation')
|
|
107
120
|
implemented.add(nativeName)
|
|
108
121
|
if (registered.has(nativeName)) continue
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
122
|
+
// the ancestors between the class and the shared root
|
|
123
|
+
const ancestors: string[] = []
|
|
124
|
+
let declaration = declarations.get(nativeName)
|
|
125
|
+
while (declaration?.parent && declaration.parent !== 'NSObject') {
|
|
126
|
+
ancestors.push(declaration.parent)
|
|
127
|
+
declaration = declarations.get(declaration.parent)
|
|
128
|
+
}
|
|
129
|
+
candidates.push({
|
|
115
130
|
nativeName,
|
|
131
|
+
ancestors,
|
|
132
|
+
rooted: declaration?.parent === 'NSObject',
|
|
133
|
+
renamed: declarations.get(nativeName)?.renamed ?? false,
|
|
116
134
|
})
|
|
117
135
|
}
|
|
118
136
|
}
|
|
137
|
+
// a private class is allocated here only when every ancestor between it and the shared root is
|
|
138
|
+
// another original private implementation; any other hierarchy needs a qualified foreign proxy.
|
|
139
|
+
for (const { nativeName, ancestors, rooted, renamed } of candidates) {
|
|
140
|
+
if (
|
|
141
|
+
!rooted ||
|
|
142
|
+
!ancestors.every(
|
|
143
|
+
(ancestor) => implemented.has(ancestor) && !registered.has(ancestor),
|
|
144
|
+
)
|
|
145
|
+
)
|
|
146
|
+
throw new SwiftObjCImportError(
|
|
147
|
+
`Objective-C implementation ${nativeName}: private superclass requires a qualified foreign proxy hierarchy`,
|
|
148
|
+
)
|
|
149
|
+
if (renamed)
|
|
150
|
+
throw new SwiftObjCImportError(
|
|
151
|
+
`Objective-C implementation ${nativeName}: private runtime class renaming is unqualified`,
|
|
152
|
+
)
|
|
153
|
+
adapters.push({ name: `__PeachObjCPrivate_${hash(nativeName)}`, nativeName })
|
|
154
|
+
}
|
|
119
155
|
adapters.sort((left, right) => left.nativeName.localeCompare(right.nativeName))
|
|
120
156
|
return [
|
|
121
157
|
'',
|
|
@@ -170,6 +206,7 @@ export function swiftObjCImports(
|
|
|
170
206
|
const categories = new Map<string, Node[]>()
|
|
171
207
|
const functions = new Map<string, Node[]>()
|
|
172
208
|
const typedefs = new Map<string, string>()
|
|
209
|
+
const wrappedTypedefs = new Map<string, Node[]>()
|
|
173
210
|
const visit = (node: unknown): void => {
|
|
174
211
|
if (!record(node)) return
|
|
175
212
|
if (
|
|
@@ -204,6 +241,9 @@ export function swiftObjCImports(
|
|
|
204
241
|
) {
|
|
205
242
|
const canonical = node.type.desugaredQualType ?? node.type.qualType
|
|
206
243
|
if (typeof canonical === 'string') typedefs.set(node.name, canonical)
|
|
244
|
+
if (nodes(node.inner).some((attribute) => attribute.kind === 'SwiftNewTypeAttr')) {
|
|
245
|
+
wrappedTypedefs.set(node.name, [...(wrappedTypedefs.get(node.name) ?? []), node])
|
|
246
|
+
}
|
|
207
247
|
}
|
|
208
248
|
for (const child of nodes(node.inner)) visit(child)
|
|
209
249
|
}
|
|
@@ -211,15 +251,36 @@ export function swiftObjCImports(
|
|
|
211
251
|
fail('declarations', 'expected a complete Clang translation unit AST')
|
|
212
252
|
visit(options.clangAST)
|
|
213
253
|
|
|
214
|
-
const symbols = new Map<string, GraphSymbol>()
|
|
254
|
+
const symbols = new Map<string, GraphSymbol[]>()
|
|
255
|
+
const seenSymbols = new Set<string>()
|
|
215
256
|
for (const graph of graphs) {
|
|
216
257
|
if (graph.module.name !== options.module)
|
|
217
258
|
fail('declarations', `symbol graph belongs to ${graph.module.name}`)
|
|
218
259
|
for (const symbol of graph.symbols) {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
260
|
+
if (
|
|
261
|
+
symbol.availability?.some(
|
|
262
|
+
(entry) =>
|
|
263
|
+
entry.isUnconditionallyUnavailable &&
|
|
264
|
+
(!entry.domain || entry.domain === 'Swift' || entry.domain === 'iOS'),
|
|
265
|
+
)
|
|
266
|
+
)
|
|
267
|
+
continue
|
|
268
|
+
// callback and async imports share a clang USR. documentation and source
|
|
269
|
+
// locations do not distinguish declarations; their swift signatures do.
|
|
270
|
+
const key = JSON.stringify([
|
|
271
|
+
symbol.identifier.precise,
|
|
272
|
+
symbol.kind.identifier,
|
|
273
|
+
symbol.pathComponents,
|
|
274
|
+
symbol.declarationFragments,
|
|
275
|
+
symbol.functionSignature,
|
|
276
|
+
symbol.accessLevel,
|
|
277
|
+
symbol.availability,
|
|
278
|
+
])
|
|
279
|
+
if (seenSymbols.has(key)) continue
|
|
280
|
+
seenSymbols.add(key)
|
|
281
|
+
const overloads = symbols.get(symbol.identifier.precise) ?? []
|
|
282
|
+
overloads.push(symbol)
|
|
283
|
+
symbols.set(symbol.identifier.precise, overloads)
|
|
223
284
|
}
|
|
224
285
|
}
|
|
225
286
|
const classes: SwiftObjCImport['classes'] = []
|
|
@@ -234,7 +295,10 @@ export function swiftObjCImports(
|
|
|
234
295
|
types.set(name, nativeName)
|
|
235
296
|
}
|
|
236
297
|
for (const nativeName of [...selected].sort()) {
|
|
237
|
-
const
|
|
298
|
+
const candidates = symbols.get(`c:objc(cs)${nativeName}`)
|
|
299
|
+
if (candidates && candidates.length !== 1)
|
|
300
|
+
fail(nativeName, 'ambiguous imported class declaration')
|
|
301
|
+
const symbol = candidates?.[0]
|
|
238
302
|
const name = symbol?.pathComponents[0]
|
|
239
303
|
if (!symbol || symbol.kind.identifier !== 'swift.class' || !name || !identifier(name))
|
|
240
304
|
fail(nativeName, 'missing Swift-imported class declaration')
|
|
@@ -250,6 +314,107 @@ export function swiftObjCImports(
|
|
|
250
314
|
classes.push({ name, nativeName })
|
|
251
315
|
}
|
|
252
316
|
|
|
317
|
+
const wrapperMembers = new Map<string, GraphSymbol[]>()
|
|
318
|
+
const wrapperConformances = new Map<string, Set<string>>()
|
|
319
|
+
for (const graph of graphs)
|
|
320
|
+
for (const edge of graph.relationships)
|
|
321
|
+
if (edge.kind === 'conformsTo' && edge.source.includes('@T@')) {
|
|
322
|
+
const protocols = wrapperConformances.get(edge.source) ?? new Set<string>()
|
|
323
|
+
protocols.add(edge.target)
|
|
324
|
+
wrapperConformances.set(edge.source, protocols)
|
|
325
|
+
}
|
|
326
|
+
for (const candidates of symbols.values())
|
|
327
|
+
for (const member of candidates)
|
|
328
|
+
if (
|
|
329
|
+
member.pathComponents.length === 2 &&
|
|
330
|
+
['init(rawValue:)', 'init(_:)'].includes(member.pathComponents[1]!)
|
|
331
|
+
) {
|
|
332
|
+
const owner = member.pathComponents[0]!
|
|
333
|
+
wrapperMembers.set(owner, [...(wrapperMembers.get(owner) ?? []), member])
|
|
334
|
+
}
|
|
335
|
+
const stringWrappers = new Map<string, string>()
|
|
336
|
+
const wrapperSymbols = [...symbols]
|
|
337
|
+
.filter(
|
|
338
|
+
([usr, candidates]) =>
|
|
339
|
+
usr.includes('@T@') && candidates[0]?.kind.identifier === 'swift.struct',
|
|
340
|
+
)
|
|
341
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
342
|
+
for (const [usr, candidates] of wrapperSymbols) {
|
|
343
|
+
const nativeName = /^c:.*@T@([A-Za-z_]\w*)$/.exec(usr)?.[1]
|
|
344
|
+
if (!nativeName) continue
|
|
345
|
+
const originals = wrappedTypedefs.get(nativeName)
|
|
346
|
+
const declaration = originals?.[0]
|
|
347
|
+
if (!declaration || !record(declaration.type)) continue
|
|
348
|
+
const original = declaration.type.desugaredQualType ?? declaration.type.qualType
|
|
349
|
+
if (typeof original !== 'string' || original.replace(/\s/g, '') !== 'NSString*')
|
|
350
|
+
continue
|
|
351
|
+
const symbol = candidates[0]!
|
|
352
|
+
const name = symbol.pathComponents[0]
|
|
353
|
+
if (
|
|
354
|
+
candidates.length !== 1 ||
|
|
355
|
+
originals?.length !== 1 ||
|
|
356
|
+
symbol.pathComponents.length !== 1 ||
|
|
357
|
+
!name ||
|
|
358
|
+
!identifier(name) ||
|
|
359
|
+
types.has(name) ||
|
|
360
|
+
stringWrappers.has(name) ||
|
|
361
|
+
symbol.accessLevel !== 'public' ||
|
|
362
|
+
text(symbol.declarationFragments ?? []).trim() !== `struct ${name}` ||
|
|
363
|
+
symbol.availability?.length
|
|
364
|
+
)
|
|
365
|
+
fail(usr, 'typed string wrapper identity is unqualified')
|
|
366
|
+
if (
|
|
367
|
+
!['s:SY', 's:SH', 's:SQ', 's:s8SendableP'].every((protocol) =>
|
|
368
|
+
wrapperConformances.get(usr)?.has(protocol),
|
|
369
|
+
)
|
|
370
|
+
)
|
|
371
|
+
fail(usr, 'typed string wrapper conformances are unqualified')
|
|
372
|
+
const members = wrapperMembers.get(name) ?? []
|
|
373
|
+
const initializers = members.filter(
|
|
374
|
+
(member) => member.pathComponents[1] === 'init(rawValue:)',
|
|
375
|
+
)
|
|
376
|
+
if (
|
|
377
|
+
initializers.length !== 1 ||
|
|
378
|
+
initializers[0]!.kind.identifier !== 'swift.init' ||
|
|
379
|
+
initializers[0]!.accessLevel !== 'public' ||
|
|
380
|
+
text(initializers[0]!.declarationFragments ?? []).trim() !==
|
|
381
|
+
'init(rawValue: String)' ||
|
|
382
|
+
!initializers[0]!.declarationFragments?.some(
|
|
383
|
+
(part) => part.kind === 'typeIdentifier' && part.preciseIdentifier === 's:SS',
|
|
384
|
+
)
|
|
385
|
+
)
|
|
386
|
+
fail(usr, 'typed string wrapper raw initializer is unqualified')
|
|
387
|
+
const unlabelled = members.filter((member) => member.pathComponents[1] === 'init(_:)')
|
|
388
|
+
if (
|
|
389
|
+
unlabelled.length > 1 ||
|
|
390
|
+
(unlabelled.length === 1 &&
|
|
391
|
+
(unlabelled[0]!.kind.identifier !== 'swift.init' ||
|
|
392
|
+
unlabelled[0]!.accessLevel !== 'public' ||
|
|
393
|
+
text(unlabelled[0]!.declarationFragments ?? []).trim() !==
|
|
394
|
+
'init(_ rawValue: String)' ||
|
|
395
|
+
!unlabelled[0]!.declarationFragments?.some(
|
|
396
|
+
(part) => part.kind === 'typeIdentifier' && part.preciseIdentifier === 's:SS',
|
|
397
|
+
)))
|
|
398
|
+
)
|
|
399
|
+
fail(usr, 'typed string wrapper unlabeled initializer is unqualified')
|
|
400
|
+
stringWrappers.set(
|
|
401
|
+
name,
|
|
402
|
+
[
|
|
403
|
+
`public struct ${swiftName(name)}: Swift.RawRepresentable, Swift.Hashable, Swift.Equatable, Swift._SwiftNewtypeWrapper, Swift._ObjectiveCBridgeable, Swift.Sendable {`,
|
|
404
|
+
' public typealias RawValue = Swift.String',
|
|
405
|
+
' public typealias _ObjectiveCType = Foundation.NSString',
|
|
406
|
+
' private let _rawValue: Swift.String',
|
|
407
|
+
' public var rawValue: Swift.String { _rawValue }',
|
|
408
|
+
' public init(rawValue: Swift.String) { _rawValue = rawValue }',
|
|
409
|
+
...(unlabelled.length
|
|
410
|
+
? [' public init(_ rawValue: Swift.String) { _rawValue = rawValue }']
|
|
411
|
+
: []),
|
|
412
|
+
'}',
|
|
413
|
+
'',
|
|
414
|
+
].join('\n'),
|
|
415
|
+
)
|
|
416
|
+
}
|
|
417
|
+
|
|
253
418
|
const type = (parts: readonly SymbolFragment[], where: string): ImportType => {
|
|
254
419
|
const written = text(parts).trim()
|
|
255
420
|
const optional = /[?!]$/.test(written)
|
|
@@ -278,7 +443,7 @@ export function swiftObjCImports(
|
|
|
278
443
|
(part) =>
|
|
279
444
|
part.preciseIdentifier?.startsWith('c:') ||
|
|
280
445
|
(part.preciseIdentifier &&
|
|
281
|
-
symbols.get(part.preciseIdentifier)?.kind.identifier === 'swift.class'),
|
|
446
|
+
symbols.get(part.preciseIdentifier)?.[0]?.kind.identifier === 'swift.class'),
|
|
282
447
|
)
|
|
283
448
|
)
|
|
284
449
|
return {
|
|
@@ -291,7 +456,7 @@ export function swiftObjCImports(
|
|
|
291
456
|
const identifiers = parts.filter((part) => part.kind === 'typeIdentifier')
|
|
292
457
|
const id = identifiers.length === 1 ? identifiers[0]?.preciseIdentifier : undefined
|
|
293
458
|
const native = id && nativeClass(id)
|
|
294
|
-
const swiftClass = id ? symbols.get(id) : undefined
|
|
459
|
+
const swiftClass = id ? symbols.get(id)?.[0] : undefined
|
|
295
460
|
const resolved = native
|
|
296
461
|
? names.get(native)
|
|
297
462
|
: swiftClass?.kind.identifier === 'swift.class' &&
|
|
@@ -377,7 +542,8 @@ export function swiftObjCImports(
|
|
|
377
542
|
)
|
|
378
543
|
}
|
|
379
544
|
const membersByClass = new Map<string, GraphSymbol[]>()
|
|
380
|
-
|
|
545
|
+
const importedSymbols = [...symbols.values()].flat()
|
|
546
|
+
for (const symbol of importedSymbols) {
|
|
381
547
|
const owner = /^c:objc\(cs\)([A-Za-z_]\w*)\(/.exec(symbol.identifier.precise)?.[1]
|
|
382
548
|
if (owner && selected.has(owner)) {
|
|
383
549
|
const members = membersByClass.get(owner)
|
|
@@ -533,31 +699,58 @@ export function swiftObjCImports(
|
|
|
533
699
|
if (
|
|
534
700
|
member.kind === 'ObjCMethodDecl' &&
|
|
535
701
|
typeof member.name === 'string' &&
|
|
702
|
+
member.name !== 'init' &&
|
|
536
703
|
(/^init(?:$|[^a-z])/.test(member.name.replace(/^_+/, '')) ||
|
|
537
704
|
nodes(member.inner).some(
|
|
538
705
|
(attribute) =>
|
|
539
706
|
attribute.kind === 'NSConsumesSelfAttr' ||
|
|
540
707
|
attribute.kind === 'ObjCDesignatedInitializerAttr',
|
|
541
|
-
))
|
|
708
|
+
)) &&
|
|
709
|
+
!nodes(member.inner).some((attribute) => attribute.kind === 'UnavailableAttr')
|
|
542
710
|
)
|
|
543
711
|
fail(
|
|
544
712
|
`${nativeName}.${member.name}`,
|
|
545
713
|
'explicit or designated initialization is unqualified',
|
|
546
714
|
)
|
|
547
|
-
if (member.variadic === true)
|
|
548
|
-
fail(`${nativeName}.${member.name}`, 'variadic methods are unqualified')
|
|
549
715
|
}
|
|
550
|
-
const constructor = thunk(
|
|
551
|
-
`${nativeName}:new`,
|
|
552
|
-
raw,
|
|
553
|
-
[],
|
|
554
|
-
null,
|
|
555
|
-
`[[${nativeName} alloc] init]`,
|
|
556
|
-
)
|
|
557
716
|
const body = [
|
|
558
717
|
`public required init(_objcRetained: Swift.UnsafeMutableRawPointer) { precondition(Self.self == ${swiftName(name)}.self, "Swift subclass construction is unqualified"); super.init(_objcRetained: _objcRetained) }`,
|
|
559
|
-
`public init() { precondition(Self.self == ${swiftName(name)}.self, "Swift subclass construction is unqualified"); super.init(_objcRetained: ${constructor}()!) }`,
|
|
560
718
|
]
|
|
719
|
+
const defaultInitializer = members.find(
|
|
720
|
+
(member) =>
|
|
721
|
+
member.kind === 'ObjCMethodDecl' &&
|
|
722
|
+
member.instance === true &&
|
|
723
|
+
member.name === 'init',
|
|
724
|
+
)
|
|
725
|
+
const importedInitializer = symbols.get(`c:objc(cs)${nativeName}(im)init`)
|
|
726
|
+
const initializerSpelling = importedInitializer?.[0]
|
|
727
|
+
? text(importedInitializer[0].declarationFragments ?? []).trim()
|
|
728
|
+
: 'init()'
|
|
729
|
+
if (!/^init[?!]?\(\)$/.test(initializerSpelling))
|
|
730
|
+
fail(`${nativeName}.init`, 'default initializer signature is unqualified')
|
|
731
|
+
if (
|
|
732
|
+
!defaultInitializer ||
|
|
733
|
+
!nodes(defaultInitializer.inner).some(
|
|
734
|
+
(attribute) => attribute.kind === 'UnavailableAttr',
|
|
735
|
+
)
|
|
736
|
+
) {
|
|
737
|
+
if (
|
|
738
|
+
defaultInitializer &&
|
|
739
|
+
(importedInitializer?.length !== 1 ||
|
|
740
|
+
importedInitializer[0]?.kind.identifier !== 'swift.init')
|
|
741
|
+
)
|
|
742
|
+
fail(`${nativeName}.init`, 'missing Swift-imported default initializer')
|
|
743
|
+
const constructor = thunk(
|
|
744
|
+
`${nativeName}:new`,
|
|
745
|
+
raw,
|
|
746
|
+
[],
|
|
747
|
+
null,
|
|
748
|
+
`[[${nativeName} alloc] init]`,
|
|
749
|
+
)
|
|
750
|
+
body.push(
|
|
751
|
+
`public ${initializerSpelling} { precondition(Self.self == ${swiftName(name)}.self, "Swift subclass construction is unqualified"); ${/^init[?!]/.test(initializerSpelling) ? `guard let _peer = ${constructor}() else { return nil }; super.init(_objcRetained: _peer)` : `super.init(_objcRetained: ${constructor}()!)`} }`,
|
|
752
|
+
)
|
|
753
|
+
}
|
|
561
754
|
bodies.set(name, body)
|
|
562
755
|
const prefix = `c:objc(cs)${nativeName}`
|
|
563
756
|
for (const symbol of membersByClass.get(nativeName) ?? []) {
|
|
@@ -578,6 +771,8 @@ export function swiftObjCImports(
|
|
|
578
771
|
(property ? (m.class !== true) === instance : m.instance === instance),
|
|
579
772
|
)
|
|
580
773
|
if (!decl) fail(usr, 'member absent from original Clang interface')
|
|
774
|
+
if (decl.variadic === true)
|
|
775
|
+
fail(`${nativeName}.${selector}`, 'variadic methods are unqualified')
|
|
581
776
|
const parts = symbol.declarationFragments ?? []
|
|
582
777
|
const written = text(parts)
|
|
583
778
|
if (
|
|
@@ -586,13 +781,16 @@ export function swiftObjCImports(
|
|
|
586
781
|
)
|
|
587
782
|
fail(usr, 'availability and asynchronous or throwing imports are unqualified')
|
|
588
783
|
if (
|
|
589
|
-
nodes(decl.inner).some(
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
784
|
+
nodes(decl.inner).some(
|
|
785
|
+
(a) =>
|
|
786
|
+
/^(?:Unavailable|SwiftPrivate|SwiftAsync|SwiftError|ObjCRequiresSuper)Attr$/.test(
|
|
787
|
+
String(a.kind),
|
|
788
|
+
) ||
|
|
789
|
+
(a.kind === 'NSConsumesSelfAttr' && selector !== 'init'),
|
|
593
790
|
)
|
|
594
791
|
)
|
|
595
792
|
fail(usr, 'member attributes require a qualified importer path')
|
|
793
|
+
if (selector === 'init' && symbol.kind.identifier === 'swift.init') continue
|
|
596
794
|
const receiver = instance ? '_object' : nativeName
|
|
597
795
|
const access = symbol.accessLevel === 'open' ? 'open' : 'public'
|
|
598
796
|
const memberName = parts.find((part) => part.kind === 'identifier')?.spelling
|
|
@@ -677,7 +875,7 @@ export function swiftObjCImports(
|
|
|
677
875
|
}
|
|
678
876
|
|
|
679
877
|
const importedFunctions: string[] = []
|
|
680
|
-
for (const symbol of
|
|
878
|
+
for (const symbol of importedSymbols) {
|
|
681
879
|
if (symbol.kind.identifier !== 'swift.func') continue
|
|
682
880
|
const usr = symbol.identifier.precise
|
|
683
881
|
const native = /^c:@F@([A-Za-z_]\w*)$/.exec(usr)?.[1]
|
|
@@ -730,7 +928,7 @@ export function swiftObjCImports(
|
|
|
730
928
|
`public func ${swiftName(name)}(${argumentsSwift}) -> ${result.swift} { ${result.c === 'void' ? '' : 'return '}${local}(${parameters.map((p) => swiftName(p.name)).join(', ')}) }`,
|
|
731
929
|
)
|
|
732
930
|
}
|
|
733
|
-
if (!classes.length && !importedFunctions.length)
|
|
931
|
+
if (!classes.length && !importedFunctions.length && !stringWrappers.size)
|
|
734
932
|
fail('declarations', 'no represented original Objective-C classes or C functions')
|
|
735
933
|
|
|
736
934
|
const registerFunction = `_peachRegisterObjCImports_${hash(options.module)}`
|
|
@@ -745,12 +943,14 @@ export function swiftObjCImports(
|
|
|
745
943
|
'',
|
|
746
944
|
].join('\n')
|
|
747
945
|
const swift = [
|
|
748
|
-
...(classes.length ? ['import Foundation'
|
|
946
|
+
...(classes.length || stringWrappers.size ? ['import Foundation'] : []),
|
|
947
|
+
...(classes.length ? ['import PeachObjC'] : []),
|
|
749
948
|
'',
|
|
750
949
|
...external,
|
|
751
950
|
'',
|
|
752
951
|
...importedFunctions,
|
|
753
952
|
'',
|
|
953
|
+
...stringWrappers.values(),
|
|
754
954
|
...classes.flatMap((c) => [
|
|
755
955
|
`open class ${swiftName(c.name)}: PeachObjC._ObjCForeignObject {`,
|
|
756
956
|
...bodies.get(c.name)!.map((line) => ` ${line}`),
|
|
@@ -161,7 +161,9 @@ export function validateObjcPeerClasses(
|
|
|
161
161
|
if (!/^[A-Za-z_]\w*$/.test(peer.name) || names.has(peer.name))
|
|
162
162
|
throw new Error(`invalid or duplicate Objective-C metadata class: ${peer.name}`)
|
|
163
163
|
if (peer.name === 'NSSimpleCString' || peer.name === 'NSConstantString')
|
|
164
|
-
throw new Error(
|
|
164
|
+
throw new Error(
|
|
165
|
+
`${peer.name} metadata is emitted with NSString, not as its own peer`,
|
|
166
|
+
)
|
|
165
167
|
names.add(peer.name)
|
|
166
168
|
const header = /^(\w+)\/([\w./-]+\.h)$/.exec(peer.header)
|
|
167
169
|
if (
|
|
@@ -174,6 +176,19 @@ export function validateObjcPeerClasses(
|
|
|
174
176
|
)
|
|
175
177
|
throw new Error(`Objective-C peer header is outside the shared SDK: ${peer.header}`)
|
|
176
178
|
}
|
|
179
|
+
for (const peer of classes) {
|
|
180
|
+
if (!peer.private) continue
|
|
181
|
+
const { superclass, swift } = peer.private
|
|
182
|
+
const parent = classes.find((candidate) => candidate.name === superclass)
|
|
183
|
+
if (!parent || parent.private)
|
|
184
|
+
throw new Error(
|
|
185
|
+
`Objective-C private peer ${peer.name} needs the header class ${superclass} in the same list`,
|
|
186
|
+
)
|
|
187
|
+
if (!/^[A-Za-z_]\w*(\.self)?$/.test(swift))
|
|
188
|
+
throw new Error(
|
|
189
|
+
`Objective-C private peer ${peer.name} has invalid Swift type ${swift}`,
|
|
190
|
+
)
|
|
191
|
+
}
|
|
177
192
|
if (names.size === 0) throw new Error('Objective-C metadata requires peer classes')
|
|
178
193
|
return names
|
|
179
194
|
}
|
|
@@ -225,6 +240,15 @@ export function resolveObjcPeerTypes(
|
|
|
225
240
|
const defined = definedInterfaces([...views.values()])
|
|
226
241
|
const types = new Map<string, ObjcPeerType>()
|
|
227
242
|
for (const peer of classes) {
|
|
243
|
+
if (peer.private) {
|
|
244
|
+
// no header or importer symbol exists for it: the registration names the metatype.
|
|
245
|
+
types.set(peer.name, {
|
|
246
|
+
native: peer.name,
|
|
247
|
+
swift: peer.private.swift,
|
|
248
|
+
importerModule: peer.header.split('/')[0]!,
|
|
249
|
+
})
|
|
250
|
+
continue
|
|
251
|
+
}
|
|
228
252
|
if (!defined.has(peer.name))
|
|
229
253
|
throw new Error(
|
|
230
254
|
`Objective-C peer ${peer.name} has no @interface definition in ${peer.header}`,
|
|
@@ -297,6 +321,12 @@ function objcPeerViews(args: {
|
|
|
297
321
|
return views
|
|
298
322
|
}
|
|
299
323
|
|
|
324
|
+
const CORE_GRAPHICS_DATA = [
|
|
325
|
+
'const CGSize CGSizeZero = {0, 0};',
|
|
326
|
+
'const CGAffineTransform CGAffineTransformIdentity = {1, 0, 0, 1, 0, 0};',
|
|
327
|
+
'const CFStringRef kCGColorSpaceSRGB = (__bridge CFStringRef)@"kCGColorSpaceSRGB";',
|
|
328
|
+
]
|
|
329
|
+
|
|
300
330
|
/** emits class metadata and its startup registration; adapters own every method. */
|
|
301
331
|
export function compileObjcPeerMetadata(args: {
|
|
302
332
|
classes: readonly SwiftObjCPeerClass[]
|
|
@@ -335,6 +365,8 @@ export function compileObjcPeerMetadata(args: {
|
|
|
335
365
|
true,
|
|
336
366
|
)
|
|
337
367
|
}
|
|
368
|
+
const metatype = (peer: SwiftObjCPeerClass) =>
|
|
369
|
+
peer.private ? peer.private.swift : `\`${types.get(peer.name)!.swift}\`.self`
|
|
338
370
|
const source = path.join(args.work, 'peer-metadata.m')
|
|
339
371
|
const object = path.join(args.work, 'peer-metadata.o')
|
|
340
372
|
const log = path.join(args.work, 'peer-metadata.log')
|
|
@@ -357,15 +389,19 @@ export function compileObjcPeerMetadata(args: {
|
|
|
357
389
|
Number(right.name === 'NSObject') - Number(left.name === 'NSObject'),
|
|
358
390
|
)
|
|
359
391
|
.flatMap((peer) => [
|
|
360
|
-
` _objcRegisterPeerClass(
|
|
361
|
-
//
|
|
362
|
-
|
|
363
|
-
|
|
392
|
+
` _objcRegisterPeerClass(${metatype(peer)}, nativeName: "${peer.name}")`,
|
|
393
|
+
// each framework's adapters join the type it just registered; a private
|
|
394
|
+
// class inherits its header superclass's adapters through the runtime.
|
|
395
|
+
...(peer.header.startsWith('Foundation/') && !peer.private
|
|
396
|
+
? [` _objcInstallFoundationPeerMethods(${metatype(peer)})`]
|
|
397
|
+
: []),
|
|
398
|
+
...(peer.header.startsWith('UIKit/') && !peer.private
|
|
399
|
+
? [` _objcInstallUIKitPeerMethods(${metatype(peer)})`]
|
|
364
400
|
: []),
|
|
365
401
|
]),
|
|
366
402
|
'}()',
|
|
367
403
|
'@_cdecl("_peach_objc_register_peers")',
|
|
368
|
-
'public func _peachRegisterObjcPeers() {
|
|
404
|
+
'public func _peachRegisterObjcPeers() {\n _ = __peachPeerRegistration\n __peachRegisterPrivateImplementations()\n}',
|
|
369
405
|
'',
|
|
370
406
|
].join('\n'),
|
|
371
407
|
)
|
|
@@ -375,9 +411,20 @@ export function compileObjcPeerMetadata(args: {
|
|
|
375
411
|
...[...new Set(args.classes.map((peer) => peer.header))].map(
|
|
376
412
|
(header) => `#import <${header}>`,
|
|
377
413
|
),
|
|
414
|
+
// a private class has no header @interface, so its measured superclass declares it.
|
|
415
|
+
...args.classes.flatMap((peer) =>
|
|
416
|
+
peer.private
|
|
417
|
+
? [`@interface ${peer.name} : ${peer.private.superclass}\n@end`]
|
|
418
|
+
: [],
|
|
419
|
+
),
|
|
378
420
|
...[...args.classes.map((peer) => peer.name), ...literals].map(
|
|
379
421
|
(name) => `@implementation ${name}\n@end`,
|
|
380
422
|
),
|
|
423
|
+
// c data the headers declare extern: swift cannot define a named c global, so the values
|
|
424
|
+
// native publishes live here and the entry points that take them decode as native would.
|
|
425
|
+
...(args.classes.some((peer) => peer.header.startsWith('UIKit/'))
|
|
426
|
+
? CORE_GRAPHICS_DATA
|
|
427
|
+
: []),
|
|
381
428
|
'',
|
|
382
429
|
].join('\n'),
|
|
383
430
|
)
|
|
@@ -398,7 +445,7 @@ export function compileObjcPeerMetadata(args: {
|
|
|
398
445
|
'-Xclang',
|
|
399
446
|
'-disable-objc-default-synthesize-properties',
|
|
400
447
|
'-Werror=objc-root-class',
|
|
401
|
-
'-
|
|
448
|
+
'-iframework',
|
|
402
449
|
path.join(headers, 'System/Library/Frameworks'),
|
|
403
450
|
'-idirafter',
|
|
404
451
|
path.join(headers, 'usr/include'),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { readdirSync, readFileSync } from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
|
|
4
|
+
// every file under the sdk tree as [path under the sdk root, text], sorted by
|
|
5
|
+
// path. the tree is the sdk's source of truth and addresses the swift compiler.
|
|
6
|
+
export function readIosSdkTree(root: string): (readonly [string, string])[] {
|
|
7
|
+
return readdirSync(root, { recursive: true, withFileTypes: true })
|
|
8
|
+
.filter((entry) => entry.isFile())
|
|
9
|
+
.map((entry) => {
|
|
10
|
+
const file = path.join(entry.parentPath, entry.name)
|
|
11
|
+
return [
|
|
12
|
+
path.relative(root, file).split(path.sep).join('/'),
|
|
13
|
+
readFileSync(file, 'utf8'),
|
|
14
|
+
] as const
|
|
15
|
+
})
|
|
16
|
+
.sort(([a], [b]) => (a < b ? -1 : 1))
|
|
17
|
+
}
|