peachsim 0.1.1815 → 0.1.1818
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/cli/commands/agent-indicator-mode.ts +2 -1
- package/cli/commands/coverage-swift.ts +4 -3
- package/cli/commands/flow.ts +7 -0
- package/cli/commands/inspect/core.ts +1 -1
- package/cli/commands/maestro-compare.ts +7 -0
- package/cli/commands/package.ts +87 -31
- package/cli/commands/screenshot-mode.ts +2 -1
- package/cli/commands/shell-boolean-mode.ts +7 -3
- package/cli/commands/shell-url.ts +4 -0
- package/cli/commands/show-touches-mode.ts +2 -1
- package/cli/commands/test.ts +3 -2
- package/cli/commands/three-mode.ts +2 -1
- package/cli/outbound-endpoints.ts +1 -1
- package/cli/packaged-app-launcher.ts +6 -1
- 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 +5728 -7551
- 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 +13 -4
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +5234 -5704
- 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 +4913 -6811
- package/dist-lib/host/fetch-proxy-handler.cjs +13 -4
- 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 +40 -30
- 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 +39 -29
- package/dist-lib/native-app-identity-project.cjs +31 -26
- package/dist-lib/native-app-identity-project.mjs +295 -279
- 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 +29 -24
- package/dist-lib/public-origins-lib.json +121 -93
- 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 +2 -2
- package/dist-lib/sdk.mjs +2 -2
- package/dist-lib/skills.cjs +64622 -66476
- package/dist-lib/swift-compile.cjs +328 -265
- package/dist-lib/swift-compile.mjs +335 -270
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +52 -6
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +2405 -2262
- package/dist-lib/vite.cjs +13 -4
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +41 -0
- package/dist-types/packages/peach-engine/src/render-worker/mapServicesContract.d.ts +45 -0
- package/package.json +2 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes +1 -1
- package/sdk/ios/usr/include/module.modulemap +3 -0
- package/sdk/ios/usr/include/notify.modulemap +9 -0
- package/sdk/ios/usr/lib/swift/Darwin.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
- package/sdk/ios/usr/lib/swift/Dispatch.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -1
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -1
- package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
- package/sdk/ios/usr/lib/swift/SwiftUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +21 -0
- package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +6 -1
- package/sdk/ios/wasm/include/__header_time.h +4 -0
- package/sdk/ios/wasm/include/pthread.h +2 -0
- package/sdk/ios/wasm/include/sys/mman.h +1 -1
- package/sdk/ios/wasm/include/sys/resource.h +31 -0
- package/sdk/ios/wasm/include/unistd.h +4 -0
- package/src/answeredNativePackages.ts +43 -0
- package/src/cli-runtime.ts +2 -9
- package/src/expo-discovery-cache.ts +71 -52
- package/src/expo-kotlin-host.ts +11 -9
- package/src/expo-swift-host.ts +55 -13
- package/src/installed-native-libraries.ts +103 -20
- package/src/native-static-libraries.ts +69 -33
- package/src/nitro-adapter.ts +0 -9
- package/src/nitro-bundle.ts +8 -6
- package/src/nitro-compile.ts +45 -16
- package/src/nitro-compiler-digest.ts +2 -4
- package/src/nitro-superset.lock.json +19 -251
- package/src/nitro-superset.ts +63 -68
- package/src/plist-bytes.ts +9 -0
- package/src/portable-expo-workspace.ts +4 -3
- package/src/react-native-bridge-modules.ts +13 -19
- package/src/swift-compile.ts +379 -269
- package/src/swift-cxx-reachable.ts +13 -0
- package/src/swift-distribution.ts +3 -4
- package/src/swift-host.ts +5 -3
- package/src/swift-installed-targets.ts +32 -14
- package/src/swift-native-pin.ts +45 -0
- package/src/swift-objc-compile.ts +23 -1
- package/src/swift-objc-standin.ts +14 -7
- package/src/swift-package-manifest.ts +2 -2
- package/src/swift-root-lock.ts +4 -3
- package/src/swift-standins.ts +41 -38
- package/src/swift-toolchain.ts +69 -12
- package/src/swift-wasm-prune.ts +1 -0
- package/src/swift-xcframework.ts +23 -12
- package/src/swiftContract.ts +2 -0
- package/src/swiftNativePinContract.ts +68 -0
- package/src/turbo-bundle.ts +14 -6
- package/src/turbo-compile.ts +76 -11
- package/src/turbo-source.ts +93 -18
package/src/turbo-source.ts
CHANGED
|
@@ -12,8 +12,8 @@ import { createHash } from 'node:crypto'
|
|
|
12
12
|
import fs from 'node:fs'
|
|
13
13
|
import path from 'node:path'
|
|
14
14
|
import { promisify } from 'node:util'
|
|
15
|
-
import { PEACH_ANSWERED_NATIVE_PACKAGE_NAMES } from '../../peach-compat/src/generated/supported-native-packages'
|
|
16
15
|
import { rnxHomeDir } from './home-paths'
|
|
16
|
+
import { installedNativeSources } from './installed-native-libraries'
|
|
17
17
|
|
|
18
18
|
const execFileAsync = promisify(execFile)
|
|
19
19
|
|
|
@@ -24,6 +24,7 @@ function codegenSpecRoot(codegen: string): string {
|
|
|
24
24
|
const nested = path.join(codegen, 'ReactCodegen')
|
|
25
25
|
return fs.existsSync(nested) ? nested : codegen
|
|
26
26
|
}
|
|
27
|
+
import { peachAnsweredNativePackages } from './answeredNativePackages'
|
|
27
28
|
import {
|
|
28
29
|
glogSources,
|
|
29
30
|
nitroDependencyIncludes,
|
|
@@ -46,6 +47,7 @@ import {
|
|
|
46
47
|
installedRendererDependencyGlobs,
|
|
47
48
|
runInstalledTurboCodegen,
|
|
48
49
|
} from './turbo-codegen-intake'
|
|
50
|
+
import { installedXcodeWorkspace } from './xcode-project'
|
|
49
51
|
import type { SwiftCompileInput } from './swift-compile'
|
|
50
52
|
import type { SwiftPackageTarget } from './swift-package'
|
|
51
53
|
import type { SwiftNativeHeaderMap } from './swiftContract'
|
|
@@ -59,15 +61,22 @@ export interface TurboProvider {
|
|
|
59
61
|
podspecPath: string
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
export interface
|
|
64
|
+
export interface TurboInstalledSources {
|
|
63
65
|
root: string
|
|
64
66
|
files: string[]
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface TurboInstalledPod extends TurboInstalledSources {
|
|
65
70
|
publicHeaders: string[]
|
|
66
71
|
headerSearchPaths: string[]
|
|
72
|
+
dependencySearchPaths: { root: string; directory: string }[]
|
|
67
73
|
reactHeaderMaps: SwiftNativeHeaderMap[]
|
|
74
|
+
dependencyHeaderMaps: (SwiftNativeHeaderMap & { root: string })[]
|
|
68
75
|
mappedHeaders: [string, string][]
|
|
69
76
|
preprocessorFlags: { c: string[]; cxx: string[] }
|
|
70
77
|
library?: string
|
|
78
|
+
/** registered vendored framework implementations owned by the shared core. */
|
|
79
|
+
sharedLibrary?: string
|
|
71
80
|
}
|
|
72
81
|
|
|
73
82
|
/** source fragments for the common Swift host. the caller owns the executable,
|
|
@@ -104,7 +113,6 @@ const CODEGEN_OBJC = /@generated by codegen project: GenerateModuleObjCpp\b/
|
|
|
104
113
|
const UNIT = /\.(?:c|cc|cpp|cxx)$/
|
|
105
114
|
const HEADER = /\.(?:h|hh|hpp|hxx|inl|ipp)$/
|
|
106
115
|
const OBJC = /\.(?:m|mm)$/
|
|
107
|
-
const answeredPackages: ReadonlySet<string> = new Set(PEACH_ANSWERED_NATIVE_PACKAGE_NAMES)
|
|
108
116
|
// an Objective-C TurboModule: a class whose getTurboModule: returns the C++
|
|
109
117
|
// object React Native's TurboModule manager installs
|
|
110
118
|
const OBJC_TURBO =
|
|
@@ -882,18 +890,35 @@ function registers(root: string, files: Iterable<string>, objc = true): boolean
|
|
|
882
890
|
}
|
|
883
891
|
|
|
884
892
|
/** autolinked iOS pods that provide modules or original Fabric components. */
|
|
885
|
-
export async function discoverTurboProviders(
|
|
893
|
+
export async function discoverTurboProviders(
|
|
894
|
+
appRoot: string,
|
|
895
|
+
projectRoot?: string,
|
|
896
|
+
iosTarget?: string,
|
|
897
|
+
): Promise<TurboProvider[]> {
|
|
886
898
|
const providers: TurboProvider[] = []
|
|
899
|
+
const candidates: { provider: TurboProvider; fabric: boolean }[] = []
|
|
887
900
|
for (const { name, root, podspecPath } of await iosAutolinkedDependencies(appRoot)) {
|
|
888
901
|
// a package peach-compat answers keeps its answer, Fabric views included.
|
|
889
|
-
if (
|
|
902
|
+
if (peachAnsweredNativePackages().has(name)) continue
|
|
890
903
|
// a pod can register Nitro objects and Fabric components independently.
|
|
891
904
|
const fabric = fabricComponents(root)
|
|
892
905
|
if (!podspecPath) continue
|
|
893
|
-
|
|
906
|
+
candidates.push({ provider: { name, root, podspecPath }, fabric })
|
|
907
|
+
}
|
|
908
|
+
const installed =
|
|
909
|
+
projectRoot && installedXcodeWorkspace(projectRoot)
|
|
910
|
+
? installedNativeSources(
|
|
911
|
+
candidates.map(({ provider }) => provider),
|
|
912
|
+
projectRoot,
|
|
913
|
+
iosTarget,
|
|
914
|
+
)
|
|
915
|
+
: null
|
|
916
|
+
for (const { provider, fabric } of candidates) {
|
|
894
917
|
const pod = readPod(provider, appRoot)
|
|
895
|
-
const
|
|
896
|
-
|
|
918
|
+
const { root, files } = installed
|
|
919
|
+
? installed.get(provider.name)!
|
|
920
|
+
: { root: pod.root, files: fabric ? null : podGlobFiles(pod) }
|
|
921
|
+
if (fabric || (files !== null && registers(root, files))) {
|
|
897
922
|
const dependencies = await Promise.all(
|
|
898
923
|
podspecDependencies(pod.text).map((dep) =>
|
|
899
924
|
resolveExternalTurboPod(dep.name, dep.requirements, dep.subspecs),
|
|
@@ -1021,6 +1046,13 @@ export async function collectTurboSources(options: {
|
|
|
1021
1046
|
externalPodSources: [],
|
|
1022
1047
|
rendererSwiftTargets: [],
|
|
1023
1048
|
}
|
|
1049
|
+
const sharedLibrary = [...(options.installedPods?.values() ?? [])].find(
|
|
1050
|
+
(pod) => pod.sharedLibrary,
|
|
1051
|
+
)?.sharedLibrary
|
|
1052
|
+
if (sharedLibrary)
|
|
1053
|
+
result.libraries = {
|
|
1054
|
+
[TURBO_CORE_TARGET]: fs.readFileSync(sharedLibrary).toString('base64'),
|
|
1055
|
+
}
|
|
1024
1056
|
const add = (file: string, text: string) => {
|
|
1025
1057
|
if (Object.hasOwn(result.files, file)) {
|
|
1026
1058
|
if (result.files[file] !== text)
|
|
@@ -1177,10 +1209,16 @@ export async function collectTurboSources(options: {
|
|
|
1177
1209
|
label: string
|
|
1178
1210
|
root: string
|
|
1179
1211
|
searchPaths: string[]
|
|
1212
|
+
dependencySearchPaths: TurboInstalledPod['dependencySearchPaths']
|
|
1180
1213
|
reactHeaderMaps: {
|
|
1181
1214
|
flag: SwiftNativeHeaderMap['flag']
|
|
1182
1215
|
headers: Map<string, string>
|
|
1183
1216
|
}[]
|
|
1217
|
+
dependencyHeaderMaps: {
|
|
1218
|
+
flag: SwiftNativeHeaderMap['flag']
|
|
1219
|
+
root: string
|
|
1220
|
+
headers: Map<string, string>
|
|
1221
|
+
}[]
|
|
1184
1222
|
}
|
|
1185
1223
|
>()
|
|
1186
1224
|
// an include a file names, resolved as clang would against the pod's own
|
|
@@ -1340,6 +1378,44 @@ export async function collectTurboSources(options: {
|
|
|
1340
1378
|
)
|
|
1341
1379
|
return
|
|
1342
1380
|
}
|
|
1381
|
+
for (const map of quoted
|
|
1382
|
+
? [
|
|
1383
|
+
...(pod?.dependencyHeaderMaps.filter(({ flag }) => flag === '-iquote') ?? []),
|
|
1384
|
+
...(pod?.dependencyHeaderMaps.filter(({ flag }) => flag === '-I') ?? []),
|
|
1385
|
+
]
|
|
1386
|
+
: (pod?.dependencyHeaderMaps.filter(({ flag }) => flag === '-I') ?? [])) {
|
|
1387
|
+
const relative = map.headers.get(include)
|
|
1388
|
+
if (relative === undefined) continue
|
|
1389
|
+
// the workspace is a copy of the app. use the same pod-relative source
|
|
1390
|
+
// identity as public-header lookup so pragma once sees one file.
|
|
1391
|
+
const owner = installedHeaderPods.flatMap((candidate) => {
|
|
1392
|
+
const root = relativeInside(options.appRoot, candidate.root)
|
|
1393
|
+
const file = root === null ? null : relativeInside(root, relative)
|
|
1394
|
+
return file === null ? [] : [{ pod: candidate, file }]
|
|
1395
|
+
})[0]
|
|
1396
|
+
alias(
|
|
1397
|
+
own,
|
|
1398
|
+
owner
|
|
1399
|
+
? original(from.targetName, owner.pod.name, owner.pod.root, owner.file, false)
|
|
1400
|
+
: original(from.targetName, 'installed-dependency', map.root, relative, false),
|
|
1401
|
+
)
|
|
1402
|
+
return
|
|
1403
|
+
}
|
|
1404
|
+
// preserve installed cross-pod search roots without copying every header
|
|
1405
|
+
// in the sandbox. the original file's adjacent includes keep its own root.
|
|
1406
|
+
for (const search of pod?.dependencySearchPaths ?? []) {
|
|
1407
|
+
const candidate = path.resolve(search.root, search.directory, include)
|
|
1408
|
+
if (!fs.statSync(candidate, { throwIfNoEntry: false })?.isFile()) continue
|
|
1409
|
+
const file = fs.realpathSync(candidate)
|
|
1410
|
+
const relative = relativeInside(search.root, file)
|
|
1411
|
+
if (relative === null)
|
|
1412
|
+
throw new Error('installed dependency header escapes its workspace: ' + candidate)
|
|
1413
|
+
alias(
|
|
1414
|
+
own,
|
|
1415
|
+
original(from.targetName, 'installed-dependency', search.root, relative, false),
|
|
1416
|
+
)
|
|
1417
|
+
return
|
|
1418
|
+
}
|
|
1343
1419
|
resolveDependency(include)
|
|
1344
1420
|
}
|
|
1345
1421
|
const scanText = (from: Scan, text: string, dependency = false) => {
|
|
@@ -1480,12 +1556,16 @@ export async function collectTurboSources(options: {
|
|
|
1480
1556
|
(match) => match[1]!,
|
|
1481
1557
|
),
|
|
1482
1558
|
),
|
|
1559
|
+
dependencySearchPaths: pod.installed?.dependencySearchPaths ?? [],
|
|
1483
1560
|
reactHeaderMaps: (pod.installed?.reactHeaderMaps ?? []).map(
|
|
1484
1561
|
({ flag, entries }) => ({
|
|
1485
1562
|
flag,
|
|
1486
1563
|
headers: new Map(entries),
|
|
1487
1564
|
}),
|
|
1488
1565
|
),
|
|
1566
|
+
dependencyHeaderMaps: (pod.installed?.dependencyHeaderMaps ?? []).map(
|
|
1567
|
+
({ flag, root, entries }) => ({ flag, root, headers: new Map(entries) }),
|
|
1568
|
+
),
|
|
1489
1569
|
})
|
|
1490
1570
|
const mappings = podHeaderMappings(pod)
|
|
1491
1571
|
// CocoaPods flattens a pod's headers: `Name.h` and `<pod>/Name.h`
|
|
@@ -1891,15 +1971,6 @@ export async function collectTurboSources(options: {
|
|
|
1891
1971
|
'#import <UIKit/UIKit.h>',
|
|
1892
1972
|
'#endif',
|
|
1893
1973
|
'#if defined(__OBJC__) && !defined(__swift__)',
|
|
1894
|
-
'@class NSURLConnection;',
|
|
1895
|
-
'@class NSURLAuthenticationChallenge;',
|
|
1896
|
-
'@class NSURLProtectionSpace;',
|
|
1897
|
-
'@protocol NSURLConnectionDelegate <NSObject>',
|
|
1898
|
-
'@optional',
|
|
1899
|
-
'- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;',
|
|
1900
|
-
'- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace;',
|
|
1901
|
-
'- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;',
|
|
1902
|
-
'@end',
|
|
1903
1974
|
'@interface UIScreen (PeachTurboRuntime)',
|
|
1904
1975
|
'@property(nonatomic) CGFloat brightness;',
|
|
1905
1976
|
'@end',
|
|
@@ -1978,7 +2049,11 @@ export async function collectTurboSources(options: {
|
|
|
1978
2049
|
})
|
|
1979
2050
|
result.rendererSwiftTargets.push(name)
|
|
1980
2051
|
}
|
|
1981
|
-
for (const file of pod.files)
|
|
2052
|
+
for (const file of pod.files) {
|
|
2053
|
+
const collected = original(name, 'react-native', reactNative.root, file)
|
|
2054
|
+
if (swift)
|
|
2055
|
+
result.externalPodSources.push({ moduleName: pod.module, file: collected })
|
|
2056
|
+
}
|
|
1982
2057
|
}
|
|
1983
2058
|
const patterns = installedRendererDependencyGlobs(reactNative.root)
|
|
1984
2059
|
const matchers = new Map(
|