peachsim 0.1.1808 → 0.1.1812
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 +4 -2
- package/cli/app-bundle-resources.ts +15 -2
- package/cli/cloud-box-artifact.ts +115 -0
- package/cli/cloud-client.ts +148 -76
- package/cli/cloud-dispatch.ts +4 -4
- package/cli/cloud-session.ts +60 -22
- package/cli/commands/box.ts +8 -2
- package/cli/commands/compat.ts +7 -4
- package/cli/commands/control.ts +69 -3
- package/cli/commands/coverage.ts +14 -4
- package/cli/commands/daemon.ts +41 -0
- package/cli/commands/no-bridge-hint.ts +9 -0
- package/cli/commands/package.ts +31 -56
- package/cli/commands/platform.ts +71 -60
- package/cli/commands/preview.ts +73 -24
- package/cli/commands/record.ts +10 -2
- package/cli/commands/screenshot.ts +17 -60
- package/cli/commands/setup.ts +3 -1
- package/cli/commands/three-mode.ts +22 -12
- package/cli/commands/upload.ts +2 -1
- package/cli/desktop-companion.ts +6 -1
- package/cli/drivers/desktop.ts +4 -1
- package/cli/main.ts +12 -2
- package/cli/metro-bundle-assets.ts +14 -4
- package/cli/outbound-endpoints.ts +7 -3
- package/cli/output-redaction.ts +38 -0
- package/cli/privacy.ts +2 -2
- package/cli/recording-access.ts +5 -0
- package/cli/remote-project-bundle.ts +83 -0
- package/cli/shell-init.ts +7 -11
- package/cli/telemetry.ts +41 -4
- package/cli/usage-error.ts +3 -0
- package/cli/ws-bridge.ts +42 -6
- 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 +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 +42897 -40755
- package/dist-lib/capture-contract.cjs +7 -8
- package/dist-lib/capture-contract.mjs +7 -8
- 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 +13 -7
- package/dist-lib/dev-bundle-resolution.cjs +10 -4
- package/dist-lib/expo-swift-bundle.cjs +15889 -15553
- package/dist-lib/expo-swift-metadata.cjs +2 -1
- package/dist-lib/expo-swift-metadata.mjs +2 -1
- package/dist-lib/home-paths.cjs +2 -33
- package/dist-lib/host/bridge-host.cjs +20891 -18714
- package/dist-lib/host/fetch-proxy-handler.cjs +10 -11
- 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 +620 -553
- 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 +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +57 -28
- package/dist-lib/native-app-identity-project.cjs +47 -14
- package/dist-lib/native-app-identity-project.mjs +55 -20
- 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/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +27 -26
- package/dist-lib/public-origins-lib.json +104 -81
- 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 +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +30700 -24410
- package/dist-lib/swift-compile.cjs +336 -222
- package/dist-lib/swift-compile.mjs +378 -263
- package/dist-lib/swift-package.cjs +19 -7
- package/dist-lib/swift-package.mjs +16 -6
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +49 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +19213 -18937
- package/dist-lib/vite.cjs +11 -12
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/animated.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/engine/animation-graph.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/expo-manifest.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +8 -1
- package/dist-types/packages/peach-globals/src/electronBridgeContract.d.ts +2 -1
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCall.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCallCenter.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCarrier.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriber.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriberInfo.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionItem.h +1 -1
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/AVFoundation+MPNowPlayingInfoLanguageOptionAdditions.h +39 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/AVPlayerItem+MediaPlayerAdditions.h +26 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPContentItem.h +67 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPError.h +33 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaEntity.h +53 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItem.h +346 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItemCollection.h +42 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaLibrary.h +76 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPickerController.h +64 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPlayback.h +47 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPlaylist.h +82 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaQuery.h +120 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaQuerySection.h +26 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMoviePlayerController.h +444 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMoviePlayerViewController.h +43 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerApplicationController.h +47 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerController.h +147 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerQueueDescriptor.h +75 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoCenter.h +197 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoLanguageOption.h +107 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingSession.h +89 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentDataSource.h +59 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentDelegate.h +64 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentManager.h +46 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentManagerContext.h +32 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommand.h +143 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommandCenter.h +66 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommandEvent.h +128 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteControlTypes.h +27 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPVolumeSettings.h +20 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPVolumeView.h +82 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.apinotes +74 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.h +40 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayerDefines.h +84 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/NSUserActivity+MediaPlayerAdditions.h +20 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityCustomRotor.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAction.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBackgroundConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIButtonConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuInteraction.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDeferredMenuElement.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMenu.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerStyle.h +5 -5
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISlider.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewController.h +12 -50
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewControllerLayoutEnvironment.h +2 -8
- package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +62 -0
- package/sdk/ios/usr/include/dispatch.modulemap +22 -0
- package/sdk/ios/usr/include/module.modulemap +8 -3
- package/sdk/ios/usr/include/net/if.h +24 -0
- package/sdk/ios/usr/include/sys/time.h +1 -1
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +265 -0
- package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -0
- package/sdk/ios/wasm/include/fcntl.h +2 -0
- package/sdk/ios/wasm/include/pthread.h +3 -0
- package/sdk/ios/wasm/include/stdlib.h +2 -0
- package/sdk/ios/wasm/include/unistd.h +2 -2
- package/skills/contrast/SKILL.md +2 -2
- package/src/bundle-channel.mjs +9 -72
- package/src/capture-contract.ts +12 -9
- package/src/desktop-host-delivery.ts +16 -2
- package/src/dev-bundle-resolution.ts +12 -3
- package/src/expo-native-workspace.ts +113 -46
- package/src/expo-swift-host.ts +17 -12
- package/src/expo-swift-ready.ts +4 -1
- package/src/expoSwiftContract.ts +1 -0
- package/src/home-paths.ts +4 -48
- package/src/host/bridge-host.ts +1 -0
- package/src/installed-native-libraries.ts +2 -8
- package/src/metro-project-root.ts +2 -1
- package/src/native-bundles.ts +122 -0
- package/src/native-static-libraries.ts +65 -8
- package/src/nitro-adapter.lock.json +272 -272
- package/src/nitro-bundle.ts +2 -2
- package/src/nitro-compile.ts +68 -28
- package/src/nitro-source.ts +24 -6
- package/src/nitro-superset.lock.json +94 -34
- package/src/nitroContract.ts +3 -0
- package/src/podspec-sources.ts +1966 -0
- package/src/storageSnapshotContract.ts +40 -0
- package/src/swift-compile.ts +77 -26
- package/src/swift-design-time.ts +18 -1
- package/src/swift-distribution.lock.json +12 -12
- package/src/swift-distribution.ts +9 -6
- package/src/swift-host.ts +1 -2
- package/src/swift-link-roots.ts +13 -2
- package/src/swift-objc-compile.ts +12 -0
- package/src/swift-objc-standin.ts +321 -114
- package/src/swift-package-manifest.ts +4 -3
- package/src/swift-package.ts +31 -4
- package/src/swift-root-lock.ts +11 -0
- package/src/swift-shared-sdk.ts +10 -9
- package/src/swift-source-pods.ts +2 -2
- package/src/swift-standins.ts +40 -143
- package/src/swift-toolchain.ts +59 -0
- package/src/swift-wasm-prune.ts +53 -21
- package/src/turbo-bundle.ts +4 -5
- package/src/turbo-codegen-intake.ts +111 -108
- package/src/turbo-compile.ts +63 -33
- package/src/turbo-runtime.lock.json +22 -22
- package/src/turbo-source.ts +171 -76
- package/src/wasm-optimize.ts +31 -2
- package/src/xcode-project.ts +65 -15
|
@@ -11,84 +11,88 @@ import { createRequire } from 'node:module'
|
|
|
11
11
|
import path from 'node:path'
|
|
12
12
|
import { promisify } from 'node:util'
|
|
13
13
|
import { isRecord } from './is-record'
|
|
14
|
+
import { iosAutolinkingConfig } from './nitro-source'
|
|
15
|
+
import {
|
|
16
|
+
loadPodspec,
|
|
17
|
+
podspecModuleName,
|
|
18
|
+
podspecLibrarySpecs,
|
|
19
|
+
podspecName,
|
|
20
|
+
podspecSourceFiles,
|
|
21
|
+
podspecSourcePatterns,
|
|
22
|
+
podspecSubspec,
|
|
23
|
+
podspecSwiftVersion,
|
|
24
|
+
} from './podspec-sources'
|
|
14
25
|
|
|
15
26
|
const run = promisify(execFile)
|
|
16
27
|
|
|
17
|
-
/** native source globs
|
|
18
|
-
export
|
|
28
|
+
/** native source globs the installed third-party podspecs declare. */
|
|
29
|
+
export function installedRendererDependencyGlobs(
|
|
19
30
|
reactNativeRoot: string,
|
|
20
|
-
):
|
|
21
|
-
|
|
22
|
-
'-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
puts JSON.generate(result)`,
|
|
33
|
-
reactNativeRoot,
|
|
34
|
-
])
|
|
35
|
-
const value: unknown = JSON.parse(stdout)
|
|
36
|
-
if (!isRecord(value))
|
|
37
|
-
throw new Error('invalid CocoaPods renderer dependency source globs')
|
|
38
|
-
const result: Record<string, string[]> = {}
|
|
39
|
-
for (const [name, patterns] of Object.entries(value)) {
|
|
40
|
-
if (
|
|
41
|
-
!Array.isArray(patterns) ||
|
|
42
|
-
!patterns.every((pattern): pattern is string => typeof pattern === 'string')
|
|
43
|
-
)
|
|
44
|
-
throw new Error(`${name}: invalid CocoaPods source globs`)
|
|
45
|
-
result[name] = patterns
|
|
46
|
-
}
|
|
47
|
-
return result
|
|
31
|
+
): Record<string, string[]> {
|
|
32
|
+
return Object.fromEntries(
|
|
33
|
+
['RCT-Folly', 'DoubleConversion', 'fmt'].map((name) => {
|
|
34
|
+
const spec = loadPodspec(
|
|
35
|
+
path.join(reactNativeRoot, 'third-party-podspecs', `${name}.podspec`),
|
|
36
|
+
)
|
|
37
|
+
return [
|
|
38
|
+
name,
|
|
39
|
+
[...new Set(podspecLibrarySpecs(spec).flatMap(podspecSourcePatterns))],
|
|
40
|
+
]
|
|
41
|
+
}),
|
|
42
|
+
)
|
|
48
43
|
}
|
|
49
44
|
|
|
50
|
-
/** the source membership
|
|
45
|
+
/** the source membership the installed renderer podspecs declare. */
|
|
51
46
|
export interface FabricPodSources {
|
|
52
47
|
module: string
|
|
53
48
|
swiftVersion: string | null
|
|
54
49
|
files: string[]
|
|
55
50
|
}
|
|
56
51
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
52
|
+
const RENDERER_PODS = new Set([
|
|
53
|
+
'React-Fabric',
|
|
54
|
+
'React-FabricComponents',
|
|
55
|
+
'React-FabricImage',
|
|
56
|
+
'React-RCTFabric',
|
|
57
|
+
'React-RCTFBReactNativeSpec',
|
|
58
|
+
'React-graphics',
|
|
59
|
+
'React-rendererdebug',
|
|
60
|
+
'React-utils',
|
|
61
|
+
'React-Core',
|
|
62
|
+
'React-RCTImage',
|
|
63
|
+
'React-RCTText',
|
|
64
|
+
'React-RCTAnimation',
|
|
65
|
+
'React-jsi',
|
|
66
|
+
'React-logger',
|
|
67
|
+
'React-runtimescheduler',
|
|
68
|
+
'React-ImageManager',
|
|
69
|
+
'React-performancetimeline',
|
|
70
|
+
'React-jsinspectortracing',
|
|
71
|
+
'React-jsinspector',
|
|
72
|
+
'React-cxxreact',
|
|
73
|
+
'React-jserrorhandler',
|
|
74
|
+
'Yoga',
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
// renderer pods added between releases; compile those installed
|
|
78
|
+
const RENDERER_PODS_VERSIONED = new Set([
|
|
79
|
+
// missing in 0.78, present in 0.81
|
|
80
|
+
'React-renderercss',
|
|
81
|
+
'React-oscompat',
|
|
82
|
+
// added in react-native 0.82
|
|
83
|
+
'React-performancecdpmetrics',
|
|
84
|
+
// added in react-native 0.83
|
|
85
|
+
'RCTSwiftUIWrapper',
|
|
86
|
+
'RCTSwiftUI',
|
|
87
|
+
])
|
|
88
|
+
|
|
89
|
+
const COMPILED_SOURCE = /\.(?:c|cc|cpp|cxx|m|mm|swift)$/
|
|
90
|
+
|
|
91
|
+
export function installedFabricSources(reactNativeRoot: string): FabricPodSources[] {
|
|
92
|
+
const root = fs.realpathSync(reactNativeRoot)
|
|
89
93
|
const specs = ['React', 'ReactCommon', 'ReactApple', 'Libraries']
|
|
90
94
|
.flatMap((directory) =>
|
|
91
|
-
fs.readdirSync(path.join(
|
|
95
|
+
fs.readdirSync(path.join(root, directory), {
|
|
92
96
|
recursive: true,
|
|
93
97
|
withFileTypes: true,
|
|
94
98
|
}),
|
|
@@ -96,56 +100,46 @@ export async function installedFabricSources(
|
|
|
96
100
|
.filter(
|
|
97
101
|
(entry) =>
|
|
98
102
|
entry.isFile() &&
|
|
99
|
-
|
|
103
|
+
(RENDERER_PODS.has(path.basename(entry.name, '.podspec')) ||
|
|
104
|
+
RENDERER_PODS_VERSIONED.has(path.basename(entry.name, '.podspec'))) &&
|
|
100
105
|
entry.name.endsWith('.podspec'),
|
|
101
106
|
)
|
|
102
107
|
.map((entry) => path.join(entry.parentPath, entry.name))
|
|
103
|
-
.concat(path.join(
|
|
108
|
+
.concat(path.join(root, 'React-Core.podspec'))
|
|
104
109
|
.sort()
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const { stdout } = await run(
|
|
108
|
-
'ruby',
|
|
109
|
-
[
|
|
110
|
-
'-r',
|
|
111
|
-
'cocoapods',
|
|
112
|
-
'-r',
|
|
113
|
-
path.join(reactNativeRoot, 'scripts/react_native_pods.rb'),
|
|
114
|
-
'-e',
|
|
115
|
-
`root = Pathname.new(ARGV.shift).realpath
|
|
116
|
-
pods = ARGV.map do |file|
|
|
117
|
-
spec = Pod::Specification.from_file(file)
|
|
118
|
-
members = spec.name == 'React-Core' ? [spec.subspec_by_name('React-Core/Default')] : [spec] + spec.recursive_subspecs
|
|
119
|
-
files = members.reject { |subspec| subspec.test_specification? || subspec.app_specification? }.flat_map do |subspec|
|
|
120
|
-
Pod::Sandbox::FileAccessor.new(Pathname.new(file).dirname, subspec.consumer(:ios)).source_files
|
|
121
|
-
end
|
|
122
|
-
if spec.name == 'React-Core'
|
|
123
|
-
dev_support = spec.subspec_by_name('React-Core/DevSupport')
|
|
124
|
-
files.concat(Pod::Sandbox::FileAccessor.new(Pathname.new(file).dirname, dev_support.consumer(:ios)).source_files.select { |source| source.basename.to_s == 'RCTDevLoadingViewSetEnabled.m' })
|
|
125
|
-
end
|
|
126
|
-
{module: spec.module_name, swiftVersion: spec.consumer(:ios).pod_target_xcconfig['SWIFT_VERSION'], files: files.uniq.select { |source| source.to_s.match?(/\\.(?:c|cc|cpp|cxx|m|mm|swift)$/) }.map { |source| source.realpath.relative_path_from(root).to_s }.sort}
|
|
127
|
-
end
|
|
128
|
-
puts JSON.generate(pods)`,
|
|
129
|
-
reactNativeRoot,
|
|
130
|
-
...specs,
|
|
131
|
-
],
|
|
132
|
-
{ maxBuffer: 4 * 1024 * 1024 },
|
|
110
|
+
const required = specs.filter((file) =>
|
|
111
|
+
RENDERER_PODS.has(path.basename(file, '.podspec')),
|
|
133
112
|
)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
113
|
+
if (required.length !== RENDERER_PODS.size)
|
|
114
|
+
throw new Error(`${reactNativeRoot}: installed renderer podspecs are incomplete`)
|
|
115
|
+
return specs.map((file) => {
|
|
116
|
+
const directory = path.dirname(file)
|
|
117
|
+
const spec = loadPodspec(file)
|
|
118
|
+
// React-Core compiles its Default subspec and one DevSupport source
|
|
119
|
+
const core = podspecName(spec) === 'React-Core'
|
|
120
|
+
const files = (
|
|
121
|
+
core ? [podspecSubspec(spec, 'Default')] : podspecLibrarySpecs(spec)
|
|
122
|
+
).flatMap((member) => podspecSourceFiles(directory, member))
|
|
123
|
+
if (core) {
|
|
124
|
+
files.push(
|
|
125
|
+
...podspecSourceFiles(directory, podspecSubspec(spec, 'DevSupport')).filter(
|
|
126
|
+
(source) => path.posix.basename(source) === 'RCTDevLoadingViewSetEnabled.m',
|
|
127
|
+
),
|
|
145
128
|
)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
129
|
+
}
|
|
130
|
+
const relative = [...new Set(files)]
|
|
131
|
+
.map((source) =>
|
|
132
|
+
path.relative(root, path.join(directory, source)).split(path.sep).join('/'),
|
|
133
|
+
)
|
|
134
|
+
.filter((source) => COMPILED_SOURCE.test(source))
|
|
135
|
+
.sort()
|
|
136
|
+
if (relative.some((source) => source.startsWith('../')))
|
|
137
|
+
throw new Error(`${file}: source membership leaves the react-native package`)
|
|
138
|
+
return {
|
|
139
|
+
module: podspecModuleName(spec),
|
|
140
|
+
swiftVersion: podspecSwiftVersion(spec),
|
|
141
|
+
files: relative,
|
|
142
|
+
}
|
|
149
143
|
})
|
|
150
144
|
}
|
|
151
145
|
|
|
@@ -204,6 +198,15 @@ export async function runInstalledTurboCodegen(
|
|
|
204
198
|
throw new Error(`${outDir}: codegen output must be outside the app ${appRoot}`)
|
|
205
199
|
if (fs.existsSync(out) && fs.readdirSync(out).length > 0)
|
|
206
200
|
throw new Error(`${outDir}: codegen output directory must be new or empty`)
|
|
201
|
+
// `pod install` hands codegen the autolinker's dependency map the same way,
|
|
202
|
+
// so a package the app reaches only through another dependency generates its
|
|
203
|
+
// specs exactly as it links
|
|
204
|
+
const autolinking = path.join(outDir, 'build/generated/autolinking/autolinking.json')
|
|
205
|
+
fs.mkdirSync(path.dirname(autolinking), { recursive: true })
|
|
206
|
+
fs.writeFileSync(
|
|
207
|
+
autolinking,
|
|
208
|
+
JSON.stringify(await iosAutolinkingConfig(appRoot, signal)),
|
|
209
|
+
)
|
|
207
210
|
await run(
|
|
208
211
|
'node',
|
|
209
212
|
[
|
package/src/turbo-compile.ts
CHANGED
|
@@ -31,7 +31,6 @@ import {
|
|
|
31
31
|
swiftManifestCxxLanguageStandard,
|
|
32
32
|
swiftManifestSettings,
|
|
33
33
|
swiftManifestTargets,
|
|
34
|
-
swiftNativeSupportFiles,
|
|
35
34
|
} from './swift-package'
|
|
36
35
|
import {
|
|
37
36
|
collectTurboSources,
|
|
@@ -40,7 +39,7 @@ import {
|
|
|
40
39
|
type TurboProvider,
|
|
41
40
|
type TurboSourceCollection,
|
|
42
41
|
} from './turbo-source'
|
|
43
|
-
import {
|
|
42
|
+
import { installedXcodeWorkspace, requireInstalledXcodeWorkspace } from './xcode-project'
|
|
44
43
|
|
|
45
44
|
// every provider's original sources, React Native's TurboModule core and the
|
|
46
45
|
// verified runtime archive form one executable. the entry runs each provider's
|
|
@@ -54,7 +53,7 @@ export function collectTurboCompileInput(
|
|
|
54
53
|
): SwiftCompileInput {
|
|
55
54
|
const files = { ...collection.files }
|
|
56
55
|
const dependencyManifest = dependencies?.files['Package.swift'] ?? ''
|
|
57
|
-
|
|
56
|
+
let dependencyTargets = manifestCalls(dependencyManifest, [
|
|
58
57
|
'target',
|
|
59
58
|
'systemLibrary',
|
|
60
59
|
]).map(({ kind, call }) => `.${kind}(${call},`)
|
|
@@ -78,17 +77,20 @@ export function collectTurboCompileInput(
|
|
|
78
77
|
})
|
|
79
78
|
for (const [file, source] of Object.entries(dependencies?.files ?? {})) {
|
|
80
79
|
if (file === 'Package.swift') continue
|
|
80
|
+
const alias = collection.headerAliases?.[file]
|
|
81
|
+
if (alias && collection.files[alias] === source) continue
|
|
81
82
|
if (Object.hasOwn(files, file) && files[file] !== source)
|
|
82
83
|
throw new Error(`TurboModule dependency source collision: ${file}`)
|
|
83
84
|
files[file] = source
|
|
84
85
|
}
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
targets.some((provider) => provider.name === target.name),
|
|
86
|
+
if (parsedTargets.length !== dependencyTargets.length)
|
|
87
|
+
throw new Error(
|
|
88
|
+
`TurboModule pod targets have ambiguous declarations (parsed ${parsedTargets.length}, declared ${dependencyTargets.length})`,
|
|
89
89
|
)
|
|
90
|
+
const providerNames = new Set(targets.map((target) => target.name))
|
|
91
|
+
dependencyTargets = dependencyTargets.filter(
|
|
92
|
+
(_, index) => !providerNames.has(parsedTargets[index]!.name),
|
|
90
93
|
)
|
|
91
|
-
throw new Error('TurboModule pod targets have ambiguous names or declarations')
|
|
92
94
|
const entry = 'Sources/PeachTurboApp/main.swift'
|
|
93
95
|
const swift = Object.keys(files).some((file) => file.endsWith('.swift'))
|
|
94
96
|
const targetNames = targets.map(({ name }) => name)
|
|
@@ -144,7 +146,9 @@ export function collectTurboCompileInput(
|
|
|
144
146
|
lazyDistribution: true,
|
|
145
147
|
staticClangTargets: targets.map((target) => target.name),
|
|
146
148
|
nativeTargets: [
|
|
147
|
-
...(dependencies?.nativeTargets ?? [])
|
|
149
|
+
...(dependencies?.nativeTargets ?? []).filter(
|
|
150
|
+
({ name }) => !providerNames.has(name),
|
|
151
|
+
),
|
|
148
152
|
...(collection.nativeTargets ?? []),
|
|
149
153
|
],
|
|
150
154
|
headerAliases: { ...dependencies?.headerAliases, ...collection.headerAliases },
|
|
@@ -182,28 +186,31 @@ export async function compileTurboModule(options: {
|
|
|
182
186
|
reactNativeRoot: options.reactNativeRoot,
|
|
183
187
|
providers: options.providers,
|
|
184
188
|
codegenDir: path.join(scratch, 'codegen'),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
// without installed pods the podspecs' literal source membership applies
|
|
190
|
+
installedPods: installedXcodeWorkspace(options.projectRoot)
|
|
191
|
+
? installedNativeLibraries(
|
|
192
|
+
options.providers,
|
|
193
|
+
options.projectRoot,
|
|
194
|
+
options.moduleRoot,
|
|
195
|
+
options.iosTarget,
|
|
196
|
+
)
|
|
197
|
+
: undefined,
|
|
191
198
|
})
|
|
192
199
|
const swiftTargets = collection.targets.filter((target) =>
|
|
193
200
|
Object.keys(collection.files).some(
|
|
194
201
|
(file) => file.startsWith(target.path + '/') && file.endsWith('.swift'),
|
|
195
202
|
),
|
|
196
203
|
)
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
204
|
+
// react-native's own Swift renderer pods compile from its source; only a
|
|
205
|
+
// provider's Swift needs the installed workspace when none was prepared
|
|
206
|
+
const workspaceSwift = installedXcodeWorkspace(options.projectRoot)
|
|
207
|
+
? swiftTargets
|
|
208
|
+
: swiftTargets.filter(({ name }) => !collection.rendererSwiftTargets.includes(name))
|
|
209
|
+
if (workspaceSwift.length) {
|
|
210
|
+
const workspace = requireInstalledXcodeWorkspace(
|
|
211
|
+
options.projectRoot,
|
|
212
|
+
`Swift TurboModule providers (${workspaceSwift.map(({ name }) => name).join(', ')})`,
|
|
202
213
|
)
|
|
203
|
-
if (!workspace)
|
|
204
|
-
throw new Error(
|
|
205
|
-
'Swift TurboModule providers require their installed CocoaPods workspace',
|
|
206
|
-
)
|
|
207
214
|
await prepareXcodeSwiftPackages(workspace)
|
|
208
215
|
await withXcodeProject(
|
|
209
216
|
workspace,
|
|
@@ -221,8 +228,27 @@ export async function compileTurboModule(options: {
|
|
|
221
228
|
options.moduleRoot,
|
|
222
229
|
)
|
|
223
230
|
const names = new Set(swiftTargets.map(({ name }) => name))
|
|
224
|
-
|
|
225
|
-
|
|
231
|
+
const installed = swiftManifestTargets(snapshot.input.files['Package.swift']!)
|
|
232
|
+
for (const target of installed)
|
|
233
|
+
if (
|
|
234
|
+
Object.keys(snapshot.input.files).some(
|
|
235
|
+
(file) => file.startsWith(target.path + '/') && file.endsWith('.swift'),
|
|
236
|
+
)
|
|
237
|
+
)
|
|
238
|
+
names.add(target.name)
|
|
239
|
+
for (const target of swiftTargets) {
|
|
240
|
+
const original = installed.find(({ name }) => name === target.name)
|
|
241
|
+
if (!original) continue
|
|
242
|
+
target.dependencies = [
|
|
243
|
+
...new Map(
|
|
244
|
+
[...(target.dependencies ?? []), ...(original.dependencies ?? [])].map(
|
|
245
|
+
(dependency) => [dependency.name, dependency],
|
|
246
|
+
),
|
|
247
|
+
).values(),
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
// Swift dependencies retain their installed mixed-language targets;
|
|
251
|
+
// other React Native implementations already belong to TurboCore.
|
|
226
252
|
snapshot.input.nativeTargets = snapshot.input.nativeTargets?.filter(({ name }) =>
|
|
227
253
|
names.has(name),
|
|
228
254
|
)
|
|
@@ -255,6 +281,11 @@ export async function compileTurboModule(options: {
|
|
|
255
281
|
const missing = [
|
|
256
282
|
...new Set([
|
|
257
283
|
...missingSwiftModules(collection.files, available).keys(),
|
|
284
|
+
...collection.targets.flatMap(({ dependencies }) =>
|
|
285
|
+
(dependencies ?? [])
|
|
286
|
+
.map(({ name }) => name)
|
|
287
|
+
.filter((name) => !available.has(name)),
|
|
288
|
+
),
|
|
258
289
|
...Object.values(collection.files).flatMap((text) =>
|
|
259
290
|
[...text.matchAll(/^\s*@import\s+(\w+)/gm)]
|
|
260
291
|
.map((match) => match[1]!)
|
|
@@ -263,13 +294,10 @@ export async function compileTurboModule(options: {
|
|
|
263
294
|
]),
|
|
264
295
|
].sort()
|
|
265
296
|
if (missing.length > 0) {
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
fs.readdirSync(ios).filter((name) => name.endsWith('.xcworkspace')),
|
|
297
|
+
const workspace = requireInstalledXcodeWorkspace(
|
|
298
|
+
options.projectRoot,
|
|
299
|
+
`the modules no collected source provides (${missing.join(', ')})`,
|
|
270
300
|
)
|
|
271
|
-
if (!workspace)
|
|
272
|
-
throw new Error(`expected one installed CocoaPods workspace in ${ios}`)
|
|
273
301
|
await prepareXcodeSwiftPackages(workspace)
|
|
274
302
|
dependencies = await withXcodeProject(
|
|
275
303
|
workspace,
|
|
@@ -321,7 +349,9 @@ export async function compileTurboModule(options: {
|
|
|
321
349
|
project.staticClangTargets = input.staticClangTargets
|
|
322
350
|
project.nativeTargets = input.nativeTargets
|
|
323
351
|
project.headerAliases = input.headerAliases
|
|
324
|
-
|
|
352
|
+
// this is already a complete source snapshot. preserve installed target
|
|
353
|
+
// members whose original paths include directories the project walker skips.
|
|
354
|
+
project.nativeFiles = input.files
|
|
325
355
|
project.resourceBundles = input.resourceBundles
|
|
326
356
|
project.bundleFiles = input.resources
|
|
327
357
|
? { files: input.resources, bundles: input.resourceBundles ?? [], watched: [] }
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"adapter": {
|
|
7
7
|
"sha256": "0d31912293226deb3354b3b32f2944e9c61c68590e3020d8b5af0c12a6677893"
|
|
8
8
|
},
|
|
9
|
-
"compiler": "swift-6.4.0-RELEASE-custom-
|
|
9
|
+
"compiler": "swift-6.4.0-RELEASE-custom-a560ff35bf882b5c",
|
|
10
10
|
"sdk": {
|
|
11
|
-
"id": "swift-6.4.0-RELEASE_wasm-peach-
|
|
12
|
-
"checksum": "
|
|
11
|
+
"id": "swift-6.4.0-RELEASE_wasm-peach-5d385b68",
|
|
12
|
+
"checksum": "d91882af99821a296c3db4459896b46ceaef37e9a30caad14e5f24cf6b964ae9"
|
|
13
13
|
},
|
|
14
14
|
"framework": {
|
|
15
|
-
"distribution": "
|
|
15
|
+
"distribution": "af69e0877dcfc948",
|
|
16
16
|
"wireAbi": "246b8412514b644113e6a26252c8ebd6de49ab4156ac5f5c98bb9e4c2ff2568b"
|
|
17
17
|
},
|
|
18
18
|
"archives": [
|
|
@@ -20,64 +20,64 @@
|
|
|
20
20
|
"headers": {
|
|
21
21
|
"reactNativeJsi": "0f8c2defbca69a27a848a81ae72363073bf9602fd316e57a75811be1a0528358"
|
|
22
22
|
},
|
|
23
|
-
"sha256": "
|
|
24
|
-
"size":
|
|
23
|
+
"sha256": "42f42eaba0cbbc305c26bc45b64b19a9c22a1782550873707cc2a94d5226450e",
|
|
24
|
+
"size": 25406
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"headers": {
|
|
28
28
|
"reactNativeJsi": "21a624ea24fd17d56bf26832d496fc1177067f89640414c20e6486c7984dfb0a"
|
|
29
29
|
},
|
|
30
|
-
"sha256": "
|
|
31
|
-
"size":
|
|
30
|
+
"sha256": "5de281f851fc5bcc41103be001ac54fd3380fdbe508a306a80ef50065a828d4f",
|
|
31
|
+
"size": 26142
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"headers": {
|
|
35
35
|
"reactNativeJsi": "324aefd8591d9ce688bce7589c4c2b516cd33ecb95d35c47239a87a8fcf6a8da"
|
|
36
36
|
},
|
|
37
|
-
"sha256": "
|
|
38
|
-
"size":
|
|
37
|
+
"sha256": "a15c6b4b615e997e449bbc26c237d7b01c17518e290ec2d25290dd1afe5d8fec",
|
|
38
|
+
"size": 25398
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"headers": {
|
|
42
42
|
"reactNativeJsi": "33596664ee7d7a6623f0796a6feb429543316c3a41b211150acda6e1d835286c"
|
|
43
43
|
},
|
|
44
|
-
"sha256": "
|
|
45
|
-
"size":
|
|
44
|
+
"sha256": "d7e2c1bb4ae3f9e7ae7d72123b9ad32e2c0662607b124cbf42c47aa229e252c0",
|
|
45
|
+
"size": 25175
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"headers": {
|
|
49
49
|
"reactNativeJsi": "66b2cd5a38511195207f6c8a76aba735f9b9cc66a52a0d00780ffe5d331623f7"
|
|
50
50
|
},
|
|
51
|
-
"sha256": "
|
|
52
|
-
"size":
|
|
51
|
+
"sha256": "ad4a1e580e01af0f0af9d4f60c4cff765e8208297148674d0904c5a4bbb9bb0f",
|
|
52
|
+
"size": 25407
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"headers": {
|
|
56
56
|
"reactNativeJsi": "96db4e758dd53e9320cef7cad485e00aa06e7a982cefd920f17007de8a5bd9f9"
|
|
57
57
|
},
|
|
58
|
-
"sha256": "
|
|
59
|
-
"size":
|
|
58
|
+
"sha256": "59746bf6932eb3ac91e52a1117c7a03f3b7c2eedf4747dd9aa3cbfd2edc23daa",
|
|
59
|
+
"size": 26142
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"headers": {
|
|
63
63
|
"reactNativeJsi": "aeab590ddd1218df963462242d3954ce467b0fa88f70e91429e4ffc74d230893"
|
|
64
64
|
},
|
|
65
|
-
"sha256": "
|
|
66
|
-
"size":
|
|
65
|
+
"sha256": "6c9e3167ca6aa79c95ba785803d07548dc2f5f437f071128888ee7cca695b630",
|
|
66
|
+
"size": 26143
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"headers": {
|
|
70
70
|
"reactNativeJsi": "b5fb260522384dd7ab07d740cdc534b529922446fcec798341c7817d9eaa49f4"
|
|
71
71
|
},
|
|
72
|
-
"sha256": "
|
|
73
|
-
"size":
|
|
72
|
+
"sha256": "a19e57ff608a43a42d5832eda613cde0bd23c17de5580237681e92d891f8f90d",
|
|
73
|
+
"size": 25273
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
"headers": {
|
|
77
77
|
"reactNativeJsi": "c6b391a1e870ccf7cdd534be63582862840f8245b99ebd253317deece1e6ffd5"
|
|
78
78
|
},
|
|
79
|
-
"sha256": "
|
|
80
|
-
"size":
|
|
79
|
+
"sha256": "8df00d552caf87b6ca0119a827ed3ac63a1b2852f14541ec0edb63dc79d35df7",
|
|
80
|
+
"size": 26147
|
|
81
81
|
}
|
|
82
82
|
]
|
|
83
83
|
}
|