peachsim 0.1.1716 → 0.1.1728
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 +21 -3
- package/cli/app-bundle-resources.ts +2 -1
- package/cli/app-fonts.ts +4 -4
- package/cli/app-splash.ts +4 -4
- package/cli/app-stubs.ts +17 -0
- package/cli/command-registry.ts +1 -0
- package/cli/commands/control.ts +82 -822
- package/cli/commands/daemon.ts +8 -0
- package/cli/commands/detox.ts +3 -0
- package/cli/commands/doctor.ts +19 -2
- package/cli/commands/inspect/actions.ts +74 -14
- package/cli/commands/inspect/core.ts +5 -1
- package/cli/commands/inspect/settling.ts +5 -2
- package/cli/commands/inspect/wait-ready.ts +6 -0
- package/cli/commands/inspect.ts +48 -45
- package/cli/commands/kotlin.ts +12 -2
- package/cli/commands/package.ts +750 -0
- package/cli/commands/serve.ts +6 -0
- package/cli/commands/shell-url.ts +834 -0
- package/cli/commands/swift.ts +42 -102
- package/cli/commands/test.ts +20 -0
- package/cli/commands/upload.ts +1 -1
- package/cli/device-option.ts +1 -1
- package/cli/main.ts +13 -1
- package/cli/native-input.ts +199 -0
- package/cli/outbound-endpoints.ts +26 -1
- package/cli/packaged-app-launcher.ts +95 -0
- package/cli/scene-video.ts +13 -6
- package/detox/index.ts +187 -23
- 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 +38000 -31658
- 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 +184 -60
- package/dist-lib/dev-bundle-resolution.cjs +14 -13
- package/dist-lib/expo-swift-bundle.cjs +18199 -11834
- package/dist-lib/expo-swift-metadata.cjs +4 -1
- package/dist-lib/expo-swift-metadata.mjs +3 -1
- package/dist-lib/home-paths.cjs +21 -2
- package/dist-lib/host/bridge-host.cjs +26509 -23850
- package/dist-lib/host/fetch-proxy-handler.cjs +221 -222
- 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 +876 -389
- 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 +127 -16
- package/dist-lib/menu.cjs +7 -1
- package/dist-lib/menu.mjs +7 -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 +883 -404
- package/dist-lib/native-app-identity-project.cjs +694 -280
- package/dist-lib/native-app-identity-project.mjs +490 -83
- package/dist-lib/native-app-identity.cjs +13 -2
- package/dist-lib/native-app-identity.mjs +13 -2
- 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 +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +28 -23
- package/dist-lib/public-origins-lib.json +392 -224
- package/dist-lib/react-native-host-modules.cjs +32 -2
- package/dist-lib/react-native-host-modules.mjs +32 -2
- package/dist-lib/reap-browser.cjs +12 -4
- package/dist-lib/scripts/dev-server-scanner.cjs +15 -8
- package/dist-lib/sdk.cjs +17 -7
- package/dist-lib/sdk.mjs +16 -7
- package/dist-lib/skills.cjs +61838 -47851
- package/dist-lib/swift-compile.cjs +583 -360
- package/dist-lib/swift-compile.mjs +496 -275
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +105 -17
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +4453 -2231
- package/dist-lib/vite.cjs +230 -228
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +17 -8
- package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +7 -5
- package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -11
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +9 -0
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-ui-commandContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +23 -1
- package/dist-types/packages/peach-engine/src/shell-events.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/audioBridgeContract.d.ts +5 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/keyboardBridgeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/shellBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +9 -2
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +12 -25
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASFoundation.h +52 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSession.h +128 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSessionCallback.h +35 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/AuthenticationServices.h +3 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h +724 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +4 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h +27 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h +1301 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +21 -50
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +6 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +75 -9
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h +23 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +7 -9
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIOrientation.h +14 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIView.h +14 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h +16 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h +2 -0
- package/sdk/ios/usr/include/ConditionalMacros.h +619 -0
- package/sdk/ios/usr/include/module.modulemap +1 -0
- package/sdk/ios/usr/include/objc/objc-sync.h +59 -0
- package/sdk/ios/usr/include/os.modulemap +5 -0
- package/sdk/ios/usr/include/sys/cdefs.h +5 -0
- package/sdk/ios/usr/include/sys/ioccom.h +99 -0
- package/sdk/ios/usr/include/sys/syslog.h +236 -0
- package/sdk/ios/usr/include/syslog.h +24 -0
- package/sdk/ios/wasm/include/fcntl.h +4 -2
- package/sdk/ios/wasm/include/stdio.h +24 -0
- package/sdk/ios/wasm/include/stdlib.h +32 -7
- package/sdk/ios/wasm/include/sys/file.h +7 -0
- package/sdk/ios/wasm/include/sys/ioctl.h +6 -0
- package/sdk/ios/wasm/include/sys/syscall.h +9 -0
- package/sdk/ios/wasm/include/sys/time.h +10 -0
- package/sdk/ios/wasm/include/unistd.h +12 -3
- package/sdk/native-hashes.json +1 -0
- package/skills/contrast/SKILL.md +2 -1
- package/skills/peach-test/SKILL.md +7 -3
- package/src/admitted-mac-build.ts +3 -0
- package/src/android-app-identity.ts +18 -0
- package/src/android-root-module.ts +9 -9
- package/src/appPackageContract.ts +81 -0
- package/src/bridge-contract.ts +50 -0
- package/src/bundle-channel.mjs +21 -4
- package/src/dev-bundle-resolution.ts +7 -27
- package/src/dom-source-reference.ts +15 -0
- package/src/expo-discovery-cache.ts +127 -23
- package/src/expo-manifest-body.ts +33 -0
- package/src/expo-native-workspace.ts +38 -13
- package/src/expo-swift-host.ts +264 -62
- package/src/expoSwiftContract.ts +3 -0
- package/src/generated/swift-c-predefines.json +1 -1
- package/src/home-paths.ts +35 -1
- package/src/host/app-package-handler.ts +47 -0
- package/src/host/bridge-host.ts +3 -0
- package/src/host/staged-host-files.ts +18 -0
- package/src/index.ts +3 -0
- package/src/kotlin-host.ts +21 -18
- package/src/kotlin-instance-source.ts +126 -0
- package/src/menu.ts +7 -0
- package/src/native-app-identity-project.ts +7 -2
- package/src/native-app-identity.ts +11 -0
- package/src/native-firebase-config.ts +24 -1
- package/src/nitro-adapter.lock.json +268 -268
- package/src/nitro-bundle.ts +8 -0
- package/src/nitro-compile.ts +35 -9
- package/src/nitro-dependencies.ts +21 -19
- package/src/nitro-source.ts +4 -0
- package/src/nitroContract.ts +7 -0
- package/src/react-native-bridge-modules.ts +68 -42
- package/src/react-native-host-modules.ts +31 -1
- package/src/reactNativeConfigurationContract.ts +14 -0
- package/src/reap-browser.ts +15 -3
- package/src/sdk.ts +5 -0
- package/src/settingsContract.ts +27 -1
- package/src/sim-client.ts +4 -1
- package/src/storageSnapshotContract.ts +3 -0
- package/src/swift-compile.ts +221 -41
- package/src/swift-coverage/provenance.ts +1 -0
- package/src/swift-coverage/xcode-asset-symbols.ts +922 -0
- package/src/swift-coverage/xcode-assets.ts +89 -131
- package/src/swift-coverage/xcode.ts +1 -1
- package/src/swift-cxx-reachable.ts +2 -1
- package/src/swift-distribution.lock.json +14 -13
- package/src/swift-host.ts +95 -22
- package/src/swift-icu.ts +1 -1
- package/src/swift-link-roots.ts +118 -0
- package/src/swift-objc-compile.ts +144 -22
- package/src/swift-objc-import.ts +6 -0
- package/src/swift-objc-standin.ts +2 -14
- package/src/swift-package-manifest.ts +14 -6
- package/src/swift-packages.ts +75 -11
- package/src/swift-pdf-raster.ts +1 -0
- package/src/swift-root-lock.ts +17 -1
- package/src/swift-source-pods.ts +2 -10
- package/src/swift-standin-emit.ts +592 -57
- package/src/swift-standins.ts +430 -49
- package/src/swift-submit.ts +3 -1
- package/src/swift-toolchain.ts +140 -17
- package/src/turbo-codegen-intake.ts +91 -0
- package/src/vite-plugin-one.ts +13 -9
- package/src/vite-plugin.ts +28 -15
- package/src/xcode-project.ts +223 -22
package/src/nitro-bundle.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { PEACH_ANSWERED_NATIVE_PACKAGE_NAMES } from '../../peach-compat/src/gene
|
|
|
4
4
|
import { loadRNXAppConfig } from '../cli/app-config'
|
|
5
5
|
import { resolveAppProject } from '../cli/app-project'
|
|
6
6
|
import { isLoopbackHost } from './backend-origin'
|
|
7
|
+
import { prepareExpoNativeWorkspace } from './expo-native-workspace'
|
|
8
|
+
import { readIosAppTarget } from './native-app-identity-project'
|
|
7
9
|
import { NativePreparationReceipts } from './native-preparation'
|
|
8
10
|
import {
|
|
9
11
|
NATIVE_PREPARE_QUERY_PARAM,
|
|
@@ -62,11 +64,17 @@ export async function compileNitroApp(
|
|
|
62
64
|
throw new Error(
|
|
63
65
|
`Nitro compilation needs ${SWIFT_ENDPOINT_ENV} for the Swift distribution`,
|
|
64
66
|
)
|
|
67
|
+
// an expo app without its own ios project gets one from prebuild, the same
|
|
68
|
+
// prepared workspace its expo modules compile from
|
|
69
|
+
const projectRoot = readIosAppTarget(appRoot)
|
|
70
|
+
? appRoot
|
|
71
|
+
: (await prepareExpoNativeWorkspace(appRoot)).app
|
|
65
72
|
const { artifact, collection } = await compileNitroModule({
|
|
66
73
|
appRoot,
|
|
67
74
|
packageRoots,
|
|
68
75
|
answers,
|
|
69
76
|
moduleRoot: module,
|
|
77
|
+
projectRoot,
|
|
70
78
|
})
|
|
71
79
|
return {
|
|
72
80
|
artifact,
|
package/src/nitro-compile.ts
CHANGED
|
@@ -29,6 +29,29 @@ import {
|
|
|
29
29
|
import { appPodfileLock, collectSwiftSourcePods } from './swift-source-pods'
|
|
30
30
|
import type { SwiftCompileInput } from './swift-compile'
|
|
31
31
|
|
|
32
|
+
// C++ libraries a provider bundles whole (it ships the source, not a pod), keyed
|
|
33
|
+
// by the namespace they declare. providers pin their own version of each, and
|
|
34
|
+
// one executable links them all, so each bundling provider gets a private
|
|
35
|
+
// namespace: the same name in two providers would be duplicate symbols, and
|
|
36
|
+
// resolving them to one version would run a provider on code it did not ship.
|
|
37
|
+
const BUNDLED_CXX_NAMESPACES: Record<string, string> = { simdutf: 'simdutf.h' }
|
|
38
|
+
|
|
39
|
+
function bundledNamespaceDefines(
|
|
40
|
+
target: string,
|
|
41
|
+
targetPath: string,
|
|
42
|
+
files: Record<string, string>,
|
|
43
|
+
): string {
|
|
44
|
+
return Object.entries(BUNDLED_CXX_NAMESPACES)
|
|
45
|
+
.filter(([, header]) =>
|
|
46
|
+
Object.keys(files).some(
|
|
47
|
+
(file) =>
|
|
48
|
+
file.startsWith(`${targetPath}/upstream/`) && file.endsWith(`/${header}`),
|
|
49
|
+
),
|
|
50
|
+
)
|
|
51
|
+
.map(([namespace]) => `, .define("${namespace}", to: "${namespace}_${target}")`)
|
|
52
|
+
.join('')
|
|
53
|
+
}
|
|
54
|
+
|
|
32
55
|
// every selected installed implementation, its generated registration and the
|
|
33
56
|
// verified adapter archive form one executable. the archive carries the private
|
|
34
57
|
// adapter objects and links into NitroCore; the common Swift compiler owns
|
|
@@ -74,9 +97,12 @@ export function collectNitroCompileInput(
|
|
|
74
97
|
// every provider registers before the one runtime serves guest evaluation.
|
|
75
98
|
// the entry has no app to install the reactor's inline executor, so it does
|
|
76
99
|
// that first: a Task a HybridObject launches (Promise.async) runs on it.
|
|
100
|
+
// providers with no Swift launch no Task, so their entry imports only them
|
|
101
|
+
// and the executable links none of the distribution's frameworks.
|
|
102
|
+
const swift = Object.keys(files).some((file) => file.endsWith('.swift'))
|
|
77
103
|
files[entry] =
|
|
78
|
-
|
|
79
|
-
|
|
104
|
+
`${swift ? '@_spi(Peach) import PeachFoundation\n' : ''}import NitroCore\n${collection.registrations.map(({ target }) => `import ${target}\n`).join('')}` +
|
|
105
|
+
`${swift ? 'PeachHostDriver.installExecutor()\n' : ''}peachNitroInitialize()\n${collection.registrations.map(({ symbol }) => `${symbol}()\n`).join('')}`
|
|
80
106
|
files['Package.swift'] = [
|
|
81
107
|
'// swift-tools-version: 6.2',
|
|
82
108
|
'import PackageDescription',
|
|
@@ -84,7 +110,7 @@ export function collectNitroCompileInput(
|
|
|
84
110
|
...dependencyTargets,
|
|
85
111
|
...collection.targets.map(
|
|
86
112
|
(target) =>
|
|
87
|
-
`.target(name: ${JSON.stringify(target.name)}, dependencies: ${JSON.stringify(target.dependencies?.map((dependency) => dependency.name) ?? [])}, path: ${JSON.stringify(target.path)}, ${target.cxxInterop ? 'swiftSettings: [.interoperabilityMode(.Cxx)]' :
|
|
113
|
+
`.target(name: ${JSON.stringify(target.name)}, dependencies: ${JSON.stringify(target.dependencies?.map((dependency) => dependency.name) ?? [])}, path: ${JSON.stringify(target.path)}, ${target.cxxInterop ? 'swiftSettings: [.interoperabilityMode(.Cxx)]' : `cxxSettings: [.define("DEBUG")${bundledNamespaceDefines(target.name, target.path, files)}]`}),`,
|
|
88
114
|
),
|
|
89
115
|
`.executableTarget(name: "PeachNitroApp", dependencies: ${JSON.stringify(collection.registrations.map(({ target }) => target))}, swiftSettings: [.interoperabilityMode(.Cxx)]),`,
|
|
90
116
|
'], cxxLanguageStandard: .cxx20)',
|
|
@@ -94,6 +120,7 @@ export function collectNitroCompileInput(
|
|
|
94
120
|
files,
|
|
95
121
|
entry,
|
|
96
122
|
libraries: { NitroCore: adapter.base64 },
|
|
123
|
+
lazyDistribution: true,
|
|
97
124
|
...(dependencies?.nativeTargets ? { nativeTargets: dependencies.nativeTargets } : {}),
|
|
98
125
|
...(dependencies?.resourceBundles
|
|
99
126
|
? { resourceBundles: dependencies.resourceBundles }
|
|
@@ -126,12 +153,12 @@ function unresolvedFrameworkIncludes(files: Record<string, string>): string[] {
|
|
|
126
153
|
}
|
|
127
154
|
|
|
128
155
|
export async function compileNitroModule(
|
|
129
|
-
options: NitroSourceOptions & { moduleRoot: string },
|
|
156
|
+
options: NitroSourceOptions & { moduleRoot: string; projectRoot: string },
|
|
130
157
|
): Promise<{ artifact: SwiftArtifact; collection: NitroSourceCollection }> {
|
|
131
158
|
await prepareNitroSourceDependencies(options)
|
|
132
159
|
const collection = collectNitroSources(options)
|
|
133
160
|
let dependencies: SwiftCompileInput | null = null
|
|
134
|
-
const podfileLock =
|
|
161
|
+
const podfileLock = appPodfileLock(options.projectRoot)
|
|
135
162
|
if (podfileLock) {
|
|
136
163
|
const available = new Set(
|
|
137
164
|
swiftAvailableModules(
|
|
@@ -149,12 +176,10 @@ export async function compileNitroModule(
|
|
|
149
176
|
)
|
|
150
177
|
}
|
|
151
178
|
// the compiled sources target the app's own declared iOS minimum
|
|
152
|
-
const iosDeploymentTarget = options.
|
|
153
|
-
? readIosAppTarget(options.appRoot)?.iosDeploymentTarget
|
|
154
|
-
: null
|
|
179
|
+
const iosDeploymentTarget = readIosAppTarget(options.projectRoot)?.iosDeploymentTarget
|
|
155
180
|
if (!iosDeploymentTarget)
|
|
156
181
|
throw new Error(
|
|
157
|
-
`Nitro compilation needs the app's Xcode project to declare an iOS deployment target: ${options.
|
|
182
|
+
`Nitro compilation needs the app's Xcode project to declare an iOS deployment target: ${options.projectRoot}`,
|
|
158
183
|
)
|
|
159
184
|
const input = collectNitroCompileInput(
|
|
160
185
|
collection,
|
|
@@ -183,6 +208,7 @@ export async function compileNitroModule(
|
|
|
183
208
|
)
|
|
184
209
|
const project = projectFor(packagePath)
|
|
185
210
|
project.libraries = input.libraries
|
|
211
|
+
project.lazyDistribution = input.lazyDistribution
|
|
186
212
|
project.nativeTargets = input.nativeTargets
|
|
187
213
|
project.resourceBundles = input.resourceBundles
|
|
188
214
|
project.bundleFiles = input.resources
|
|
@@ -24,14 +24,26 @@ interface NitroDependency extends Download {
|
|
|
24
24
|
headers: { from: string; to: string }
|
|
25
25
|
/** an attributed native backport of one upstream commit, applied in memory;
|
|
26
26
|
* the archive and its extracted tree stay unchanged. */
|
|
27
|
-
backport?: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
backport?: NativeBackport & { file: string }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface NativeBackport {
|
|
31
|
+
upstreamCommit: string
|
|
32
|
+
originalSha256: string
|
|
33
|
+
derivedSha256: string
|
|
34
|
+
before: string
|
|
35
|
+
after: string
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// double-conversion 1.1.6's utils.h stops at an architecture allowlist with
|
|
39
|
+
// no wasm32 entry. the owner approved this one upstream target-recognition
|
|
40
|
+
// backport (specs/sootsim-engine/unistyles-native-boundary.md).
|
|
41
|
+
export const DOUBLE_CONVERSION_WASM32_BACKPORT: NativeBackport = {
|
|
42
|
+
upstreamCommit: '8857767d5b2f5a035321e3712e8cd0008840ba6b',
|
|
43
|
+
originalSha256: 'b495b11f7b61693486894f747add5b454894b8b3ca41aa1610d370ba16407ab7',
|
|
44
|
+
derivedSha256: '642d9f83289672def295f6a0a4f8c94823c20c3186e2b1b9ec36b436cb366da8',
|
|
45
|
+
before: ' defined(__AARCH64EL__)\n',
|
|
46
|
+
after: ' defined(__AARCH64EL__) || defined(__wasm32__)\n',
|
|
35
47
|
}
|
|
36
48
|
|
|
37
49
|
export interface NitroDependencyHeader {
|
|
@@ -65,22 +77,12 @@ const RN_DEPENDENCIES: Record<string, NitroDependency[]> = {
|
|
|
65
77
|
},
|
|
66
78
|
{
|
|
67
79
|
// the podspec's prepare_command renames src to double-conversion.
|
|
68
|
-
// 1.1.6 stops at an architecture allowlist with no wasm32 entry; the
|
|
69
|
-
// owner approved this one upstream target-recognition backport.
|
|
70
80
|
name: 'DoubleConversion',
|
|
71
81
|
url: 'https://github.com/google/double-conversion/archive/v1.1.6.tar.gz',
|
|
72
82
|
sha256: '6b850acd8e88515764472c52973277744a945f9a769a93968efc42efef64d67a',
|
|
73
83
|
prefix: 'double-conversion-1.1.6',
|
|
74
84
|
headers: { from: 'src', to: 'double-conversion' },
|
|
75
|
-
backport: {
|
|
76
|
-
file: 'src/utils.h',
|
|
77
|
-
upstreamCommit: '8857767d5b2f5a035321e3712e8cd0008840ba6b',
|
|
78
|
-
originalSha256:
|
|
79
|
-
'b495b11f7b61693486894f747add5b454894b8b3ca41aa1610d370ba16407ab7',
|
|
80
|
-
derivedSha256: '642d9f83289672def295f6a0a4f8c94823c20c3186e2b1b9ec36b436cb366da8',
|
|
81
|
-
before: ' defined(__AARCH64EL__)\n',
|
|
82
|
-
after: ' defined(__AARCH64EL__) || defined(__wasm32__)\n',
|
|
83
|
-
},
|
|
85
|
+
backport: { file: 'src/utils.h', ...DOUBLE_CONVERSION_WASM32_BACKPORT },
|
|
84
86
|
},
|
|
85
87
|
{
|
|
86
88
|
name: 'fmt',
|
package/src/nitro-source.ts
CHANGED
|
@@ -286,6 +286,10 @@ async function autolinkingConfig(
|
|
|
286
286
|
timeout: 30_000,
|
|
287
287
|
maxBuffer: 8 * 1024 * 1024,
|
|
288
288
|
env: { ...process.env, [RNX_FORKED_SCRIPT_ENV]: '1' },
|
|
289
|
+
// expo's react-native.config.js calls findProjectRootSync() on the
|
|
290
|
+
// process cwd and ignores --project-root. the corpus bridge starts
|
|
291
|
+
// outside the app, where that walk finds no package.json.
|
|
292
|
+
cwd: appRoot,
|
|
289
293
|
},
|
|
290
294
|
)
|
|
291
295
|
return JSON.parse(stdout)
|
package/src/nitroContract.ts
CHANGED
|
@@ -8,6 +8,13 @@ import { isSwiftResourcePath, type SwiftEntryOptions } from './swiftContract'
|
|
|
8
8
|
/** the guest platform every Nitro compile targets. */
|
|
9
9
|
export const NITRO_GUEST_PLATFORM = 'ios'
|
|
10
10
|
|
|
11
|
+
/** installed Nitro providers whose original native source Peach compiles in
|
|
12
|
+
* place of any hand-written answer. */
|
|
13
|
+
export const COMPILED_NITRO_NATIVE_PACKAGES: readonly string[] = [
|
|
14
|
+
'react-native-nitro-base64',
|
|
15
|
+
'react-native-nitro-buffer',
|
|
16
|
+
]
|
|
17
|
+
|
|
11
18
|
export interface NitroCompiledModule {
|
|
12
19
|
platform: typeof NITRO_GUEST_PLATFORM
|
|
13
20
|
/** the original providers this one executable registers, by package name,
|
|
@@ -340,64 +340,87 @@ export function collectBridgeModuleSources(
|
|
|
340
340
|
const app = readXcodeAppTarget(project, targets[0]!, 'Release', {
|
|
341
341
|
requireSources: false,
|
|
342
342
|
})
|
|
343
|
-
const own = (file: string) => {
|
|
344
|
-
const resolved = fs.realpathSync(file)
|
|
345
|
-
if (
|
|
346
|
-
[file, resolved].some((name) =>
|
|
347
|
-
name.split(path.sep).some((part) => part === 'Pods' || part === 'node_modules'),
|
|
348
|
-
)
|
|
349
|
-
)
|
|
350
|
-
return false
|
|
351
|
-
const relative = path.relative(projectRoot, resolved)
|
|
352
|
-
if (
|
|
353
|
-
relative === '..' ||
|
|
354
|
-
relative.startsWith(`..${path.sep}`) ||
|
|
355
|
-
path.isAbsolute(relative)
|
|
356
|
-
)
|
|
357
|
-
throw new Error(`${file}: app native source outside ${projectRoot}`)
|
|
358
|
-
return true
|
|
359
|
-
}
|
|
360
343
|
const units: ExpoSwiftSourceUnit[] = []
|
|
361
344
|
const failures: { namespace: string; diagnostic: string }[] = []
|
|
362
345
|
// the reader owns dependency order and visits a shared framework only once.
|
|
363
346
|
// each target keeps its own Swift module identity and compilation settings.
|
|
364
347
|
for (const target of [...app.frameworks, app]) {
|
|
365
348
|
signal?.throwIfAborted()
|
|
349
|
+
const namespace = target.moduleName.replace(/[^A-Za-z0-9_]/g, '_')
|
|
350
|
+
const outside: string[] = []
|
|
351
|
+
// a source outside the app root is never read or compiled. it may register
|
|
352
|
+
// modules into the app binary, so the target is unavailable rather than a
|
|
353
|
+
// silently reduced copy of what native builds.
|
|
354
|
+
const own = (file: string) => {
|
|
355
|
+
const resolved = fs.realpathSync(file)
|
|
356
|
+
if (
|
|
357
|
+
[file, resolved].some((name) =>
|
|
358
|
+
name.split(path.sep).some((part) => part === 'Pods' || part === 'node_modules'),
|
|
359
|
+
)
|
|
360
|
+
)
|
|
361
|
+
return false
|
|
362
|
+
const relative = path.relative(projectRoot, resolved)
|
|
363
|
+
if (
|
|
364
|
+
relative === '..' ||
|
|
365
|
+
relative.startsWith(`..${path.sep}`) ||
|
|
366
|
+
path.isAbsolute(relative)
|
|
367
|
+
) {
|
|
368
|
+
outside.push(file)
|
|
369
|
+
return false
|
|
370
|
+
}
|
|
371
|
+
return true
|
|
372
|
+
}
|
|
373
|
+
const accepted = target.allSources.filter(own)
|
|
366
374
|
const objc = [
|
|
367
375
|
...new Set(
|
|
368
|
-
|
|
369
|
-
.filter((file) => /\.mm?$/.test(file)
|
|
376
|
+
accepted
|
|
377
|
+
.filter((file) => /\.mm?$/.test(file))
|
|
370
378
|
.map((file) => fs.realpathSync(file)),
|
|
371
379
|
),
|
|
372
380
|
]
|
|
373
|
-
if (objc.length === 0) continue
|
|
374
381
|
// headers declare the superclasses; they sit beside the sources that import them
|
|
375
|
-
const headers =
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
.
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
382
|
+
const headers =
|
|
383
|
+
objc.length === 0
|
|
384
|
+
? []
|
|
385
|
+
: [...new Set(objc.map((file) => path.dirname(file)))].flatMap((dir) =>
|
|
386
|
+
fs
|
|
387
|
+
.readdirSync(dir)
|
|
388
|
+
.filter((name) => name.endsWith('.h'))
|
|
389
|
+
.sort()
|
|
390
|
+
.map((name) => path.join(dir, name))
|
|
391
|
+
.filter(own),
|
|
392
|
+
)
|
|
393
|
+
if (outside.length > 0) {
|
|
394
|
+
failures.push({
|
|
395
|
+
namespace,
|
|
396
|
+
diagnostic: `${outside[0]}: app native source outside ${projectRoot}${outside.length > 1 ? ` (and ${outside.length - 1} more)` : ''}. Peach reads and compiles only app-owned source inside the app root, so target ${target.name} is unavailable.`,
|
|
397
|
+
})
|
|
398
|
+
continue
|
|
399
|
+
}
|
|
400
|
+
if (objc.length === 0) continue
|
|
383
401
|
const declarations = parseObjectiveCModules(
|
|
384
402
|
[...objc, ...headers].map((file) => ({
|
|
385
403
|
file,
|
|
386
404
|
text: fs.readFileSync(file, 'utf8'),
|
|
387
405
|
})),
|
|
388
406
|
)
|
|
389
|
-
|
|
390
|
-
//
|
|
391
|
-
//
|
|
392
|
-
//
|
|
393
|
-
//
|
|
394
|
-
//
|
|
395
|
-
//
|
|
396
|
-
|
|
407
|
+
// an @implementation defining getTurboModule: is a React Native TurboModule.
|
|
408
|
+
// with no RCT_EXPORT_MODULE/RCT_EXTERN_MODULE macro it is a codegen module
|
|
409
|
+
// the macro scan above registers nothing for; with the macro but no
|
|
410
|
+
// exported method or constants its whole surface is the C++ object
|
|
411
|
+
// getTurboModule: returns, and registering the class would present an
|
|
412
|
+
// empty module that native does not have. name either instead of staying
|
|
413
|
+
// silent: the guest would otherwise boot with no native module, or an
|
|
414
|
+
// empty one, and fail with no cause.
|
|
415
|
+
const registered = new Set(declarations.modules.map((module) => module.className))
|
|
416
|
+
const cxxTurboModules = new Set<string>()
|
|
397
417
|
for (const [className, selectors] of declarations.implementations) {
|
|
398
418
|
signal?.throwIfAborted()
|
|
399
|
-
if (declared.has(className)) continue
|
|
400
419
|
if (!selectors.has('getTurboModule:')) continue
|
|
420
|
+
const exported =
|
|
421
|
+
(declarations.methods.get(className)?.length ?? 0) > 0 ||
|
|
422
|
+
selectors.has('constantsToExport')
|
|
423
|
+
if (registered.has(className) && exported) continue
|
|
401
424
|
const file =
|
|
402
425
|
objc.find((candidate) =>
|
|
403
426
|
new RegExp(`@implementation\\s+${className}\\b`).test(
|
|
@@ -406,13 +429,16 @@ export function collectBridgeModuleSources(
|
|
|
406
429
|
) ?? objc[0]!
|
|
407
430
|
failures.push({
|
|
408
431
|
namespace: `${namespace}.${className}`,
|
|
409
|
-
diagnostic:
|
|
432
|
+
diagnostic: registered.has(className)
|
|
433
|
+
? `${file}: ${className} implements getTurboModule: and exports no methods or constants, so its surface is the C++ TurboModule it returns. Peach compiles legacy bridge modules registered with RCT_EXPORT_MODULE/RCT_EXTERN_MODULE and Expo Swift modules; it does not compile C++ or codegen TurboModule bodies.`
|
|
434
|
+
: `${file}: ${className} implements getTurboModule: with no RCT_EXPORT_MODULE or RCT_EXTERN_MODULE registration, so it is a React Native codegen TurboModule. Peach compiles legacy bridge modules registered with RCT_EXPORT_MODULE/RCT_EXTERN_MODULE and Expo Swift modules; it does not compile codegen TurboModule bodies.`,
|
|
410
435
|
})
|
|
411
|
-
|
|
436
|
+
cxxTurboModules.add(className)
|
|
412
437
|
}
|
|
413
|
-
if (declarations.modules.
|
|
438
|
+
if (declarations.modules.every((module) => cxxTurboModules.has(module.className)))
|
|
439
|
+
continue
|
|
414
440
|
const swiftFiles: Record<string, string> = {}
|
|
415
|
-
for (const file of target.sources
|
|
441
|
+
for (const file of target.sources) {
|
|
416
442
|
const relative = path.relative(projectRoot, fs.realpathSync(file))
|
|
417
443
|
swiftFiles[`Sources/${namespace}/${relative.split(path.sep).join('/')}`] =
|
|
418
444
|
`#sourceLocation(file: ${JSON.stringify(file)}, line: 1)\n${fs.readFileSync(file, 'utf8')}`
|
|
@@ -420,7 +446,7 @@ export function collectBridgeModuleSources(
|
|
|
420
446
|
const seen = new Set<string>()
|
|
421
447
|
for (const module of declarations.modules) {
|
|
422
448
|
signal?.throwIfAborted()
|
|
423
|
-
if (seen.has(module.className)) continue
|
|
449
|
+
if (cxxTurboModules.has(module.className) || seen.has(module.className)) continue
|
|
424
450
|
seen.add(module.className)
|
|
425
451
|
const moduleId = `${namespace}.${module.className}`
|
|
426
452
|
const methods = declarations.methods.get(module.className) ?? []
|
|
@@ -9,6 +9,18 @@ export const REACT_NATIVE_PASSTHROUGH_SPECIFIERS: readonly string[] = [
|
|
|
9
9
|
// one's native bootstrap runs the upstream environment entry.
|
|
10
10
|
'react-native/setup-env',
|
|
11
11
|
'react-native/src/setup-env',
|
|
12
|
+
// upstream initialization owns the native DOM constructors for its version.
|
|
13
|
+
'react-native/Libraries/Core/InitializeCore',
|
|
14
|
+
'react-native/Libraries/Core/setUpGlobals',
|
|
15
|
+
'react-native/Libraries/Core/setUpRegeneratorRuntime',
|
|
16
|
+
'react-native/src/private/setup/setUpDefaultReactNativeEnvironment',
|
|
17
|
+
'react-native/src/private/setup/setUpDefaltReactNativeEnvironment',
|
|
18
|
+
'react-native/src/private/setup/setUpDOM',
|
|
19
|
+
'react-native/src/private/core/setUpDOM',
|
|
20
|
+
'react-native/Libraries/Utilities/PolyfillFunctions',
|
|
21
|
+
'react-native/Libraries/Utilities/GlobalPerformanceLogger',
|
|
22
|
+
'react-native/Libraries/Utilities/createPerformanceLogger',
|
|
23
|
+
'react-native/Libraries/Utilities/infoLog',
|
|
12
24
|
// sdk 58 reads these upstream getters and wraps the original metro logger.
|
|
13
25
|
'react-native/unstable-internals-do-not-use',
|
|
14
26
|
'react-native/src/unstable-internals-do-not-use',
|
|
@@ -31,12 +43,16 @@ export const REACT_NATIVE_PASSTHROUGH_SPECIFIERS: readonly string[] = [
|
|
|
31
43
|
'react-native/Libraries/NativeModules/specs/NativeDevSettings',
|
|
32
44
|
'react-native/Libraries/NativeModules/specs/NativeLogBox',
|
|
33
45
|
'react-native/Libraries/NativeModules/specs/NativeRedBox',
|
|
46
|
+
'react-native/src/private/debugging/FuseboxSessionObserver',
|
|
34
47
|
'react-native/src/private/devsupport/rndevtools/FuseboxSessionObserver',
|
|
35
48
|
'react-native/src/private/devsupport/rndevtools/GlobalStateObserver',
|
|
36
49
|
'react-native/src/private/devsupport/rndevtools/TracingStateObserver',
|
|
37
50
|
'react-native/src/private/specs_DEPRECATED/modules/NativeDevSettings',
|
|
38
51
|
'react-native/src/private/specs_DEPRECATED/modules/NativeLogBox',
|
|
39
52
|
'react-native/src/private/specs_DEPRECATED/modules/NativeRedBox',
|
|
53
|
+
'react-native/src/private/specs/modules/NativeDevSettings',
|
|
54
|
+
'react-native/src/private/specs/modules/NativeLogBox',
|
|
55
|
+
'react-native/src/private/specs/modules/NativeRedBox',
|
|
40
56
|
'react-native/src/private/utilities/toError',
|
|
41
57
|
'react-native/src/private/utilities/toExtendedError',
|
|
42
58
|
// already-passthrough modules import these at evaluation.
|
|
@@ -64,6 +80,15 @@ export const REACT_NATIVE_PASSTHROUGH_SPECIFIERS: readonly string[] = [
|
|
|
64
80
|
'react-native/src/private/specs_DEPRECATED/modules/NativeBlobModule',
|
|
65
81
|
'react-native/Libraries/vendor/emitter',
|
|
66
82
|
'react-native/Libraries/Components/View/ReactNativeStyleAttributes',
|
|
83
|
+
// view's javascript prop mapping runs over the registered RCTView native seam.
|
|
84
|
+
'react-native/Libraries/Components/View/View.js',
|
|
85
|
+
// text and press-target debugging retain their upstream javascript wrappers.
|
|
86
|
+
'react-native/Libraries/Text/Text.js',
|
|
87
|
+
'react-native/Libraries/Pressability/PressabilityDebug.js',
|
|
88
|
+
// pressable's upstream wrapper runs over the stubbed Pressability
|
|
89
|
+
// implementation and the passthrough View, like Text.js above.
|
|
90
|
+
'react-native/Libraries/Components/Pressable/Pressable.js',
|
|
91
|
+
'react-native/Libraries/Components/Pressable/useAndroidRippleForView.js',
|
|
67
92
|
'react-native/Libraries/StyleSheet',
|
|
68
93
|
'react-native/Libraries/Utilities/differ',
|
|
69
94
|
'react-native/Libraries/Utilities/stringifySafe',
|
|
@@ -72,10 +97,11 @@ export const REACT_NATIVE_PASSTHROUGH_SPECIFIERS: readonly string[] = [
|
|
|
72
97
|
'react-native/Libraries/TurboModule/TurboModuleRegistry',
|
|
73
98
|
'react-native/Libraries/Utilities/Platform',
|
|
74
99
|
'react-native/Libraries/Utilities/NativePlatformConstants',
|
|
100
|
+
'react-native/src/private/specs/modules/NativePlatformConstants',
|
|
75
101
|
'react-native/src/private/specs_DEPRECATED/modules/NativePlatformConstants',
|
|
76
102
|
// pure javascript in Libraries/Core and Libraries/Utilities, from the
|
|
77
103
|
// eval-time graph of InitializeCore, ExceptionsManager, HMRClient, and
|
|
78
|
-
// LogBox.
|
|
104
|
+
// LogBox. host-owned installers stay overrides. Dimensions, DevLoadingView,
|
|
79
105
|
// NativeExceptionsManager, JSTimers, and BackHandler.android.js evaluate an
|
|
80
106
|
// unregistered native spec, so they stay on the explicit error. the
|
|
81
107
|
// BackHandler names include the extension so the android file stays out.
|
|
@@ -89,6 +115,10 @@ export const REACT_NATIVE_PASSTHROUGH_SPECIFIERS: readonly string[] = [
|
|
|
89
115
|
'react-native/Libraries/Core/Timers/queueMicrotask',
|
|
90
116
|
'react-native/Libraries/Core/Devtools/openFileInEditor',
|
|
91
117
|
'react-native/Libraries/Utilities/Appearance',
|
|
118
|
+
// Appearance reads its spec through TurboModuleRegistry.get('Appearance'),
|
|
119
|
+
// which the engine registers.
|
|
120
|
+
'react-native/Libraries/Utilities/NativeAppearance',
|
|
121
|
+
'react-native/src/private/specs_DEPRECATED/modules/NativeAppearance',
|
|
92
122
|
'react-native/Libraries/Utilities/useColorScheme',
|
|
93
123
|
'react-native/Libraries/Utilities/FeatureDetection',
|
|
94
124
|
'react-native/Libraries/Utilities/HMRClientProdShim',
|
|
@@ -7,6 +7,7 @@ export const DEFAULT_REACT_NATIVE_CONFIGURATION = {
|
|
|
7
7
|
// scheme reaches workers through Appearance
|
|
8
8
|
colorScheme: 'auto',
|
|
9
9
|
language: 'en',
|
|
10
|
+
preferredLanguages: Array<string>(),
|
|
10
11
|
region: 'US',
|
|
11
12
|
fontSize: 1,
|
|
12
13
|
boldText: false,
|
|
@@ -34,3 +35,16 @@ export const REACT_NATIVE_CONFIGURATION_KEYS = Object.keys(
|
|
|
34
35
|
).filter(
|
|
35
36
|
(key): key is ReactNativeConfigurationKey => key in DEFAULT_REACT_NATIVE_CONFIGURATION,
|
|
36
37
|
)
|
|
38
|
+
|
|
39
|
+
export function configurationValuesEqual(
|
|
40
|
+
left: ReactNativeConfigurationSnapshot[ReactNativeConfigurationKey],
|
|
41
|
+
right: ReactNativeConfigurationSnapshot[ReactNativeConfigurationKey],
|
|
42
|
+
): boolean {
|
|
43
|
+
return (
|
|
44
|
+
left === right ||
|
|
45
|
+
(Array.isArray(left) &&
|
|
46
|
+
Array.isArray(right) &&
|
|
47
|
+
left.length === right.length &&
|
|
48
|
+
left.every((value, index) => value === right[index]))
|
|
49
|
+
)
|
|
50
|
+
}
|
package/src/reap-browser.ts
CHANGED
|
@@ -64,6 +64,10 @@ export type BrowserLaunchPolicy = {
|
|
|
64
64
|
processCommand?: (pid: number) => string
|
|
65
65
|
processIdentity?: (pid: number) => string | null
|
|
66
66
|
admission?: ChromiumLaunchAdmission
|
|
67
|
+
// a published simulator on a user's machine renders the way its sim host
|
|
68
|
+
// does: GPU-less Linux and Windows servers use the bundled browser in
|
|
69
|
+
// software, a Mac requires its GPU. unset keeps softwareChromeAllowed.
|
|
70
|
+
software?: boolean
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
export type ChromiumLaunchAdmission = {
|
|
@@ -847,8 +851,11 @@ function platformChromeLaunch<B>(
|
|
|
847
851
|
): () => Promise<B> {
|
|
848
852
|
return async () => {
|
|
849
853
|
const runtime = policy.runtime ?? currentRuntime()
|
|
850
|
-
if (softwareChromeAllowed(runtime)) {
|
|
851
|
-
return launchWithPauseAwareDeadline(
|
|
854
|
+
if (policy.software ?? softwareChromeAllowed(runtime)) {
|
|
855
|
+
return launchWithPauseAwareDeadline(
|
|
856
|
+
launch,
|
|
857
|
+
softwareChromeLaunchOptions(opts, runtime),
|
|
858
|
+
)
|
|
852
859
|
}
|
|
853
860
|
const gpuOptions = chromeLaunchOptions(opts, runtime)
|
|
854
861
|
let browser: B
|
|
@@ -970,7 +977,12 @@ export function chromeLaunchOptions(
|
|
|
970
977
|
): Record<string, unknown> {
|
|
971
978
|
if (signalShutdownClaimed) {
|
|
972
979
|
// the owner needs the browser alive until its asynchronous cleanup finishes.
|
|
973
|
-
opts = {
|
|
980
|
+
opts = {
|
|
981
|
+
...opts,
|
|
982
|
+
handleSIGINT: false,
|
|
983
|
+
handleSIGTERM: false,
|
|
984
|
+
handleSIGHUP: false,
|
|
985
|
+
}
|
|
974
986
|
}
|
|
975
987
|
return softwareChromeAllowed(runtime)
|
|
976
988
|
? softwareChromeLaunchOptions(opts, runtime)
|
package/src/sdk.ts
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
export * from './sim-client'
|
|
9
9
|
export * from '../cli/commands/inspect/core'
|
|
10
10
|
export * from '../cli/commands/inspect/actions'
|
|
11
|
+
export type {
|
|
12
|
+
SimTapDiagnostics,
|
|
13
|
+
SimTapResult,
|
|
14
|
+
SimTapResultReason,
|
|
15
|
+
} from './bridge-contract'
|
|
11
16
|
export {
|
|
12
17
|
IdleObservationError,
|
|
13
18
|
RuntimeReadinessUnsupportedError,
|
package/src/settingsContract.ts
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
type TextPresetName,
|
|
30
30
|
} from './screenshots/preset-names.ts'
|
|
31
31
|
|
|
32
|
-
export type SettingType = 'string' | 'number' | 'boolean' | 'enum'
|
|
32
|
+
export type SettingType = 'string' | 'number' | 'boolean' | 'enum' | 'string-array'
|
|
33
33
|
|
|
34
34
|
export interface SettingDef<T = any> {
|
|
35
35
|
type: SettingType
|
|
@@ -107,6 +107,7 @@ export interface SettingsValues {
|
|
|
107
107
|
glassTintAmount: number
|
|
108
108
|
// locale
|
|
109
109
|
language: string
|
|
110
|
+
preferredLanguages: string[]
|
|
110
111
|
region: string
|
|
111
112
|
// simulator
|
|
112
113
|
renderDensity: number
|
|
@@ -115,6 +116,7 @@ export interface SettingsValues {
|
|
|
115
116
|
// the Performance pane's chosen recording categories, comma separated
|
|
116
117
|
profilerCategories: string
|
|
117
118
|
showTouches: boolean
|
|
119
|
+
systemCursor: boolean
|
|
118
120
|
showFrame: boolean
|
|
119
121
|
showMenuBar: boolean
|
|
120
122
|
showRail: boolean
|
|
@@ -307,6 +309,23 @@ export const settingsSchema: Record<SettingKey, SettingDef> = {
|
|
|
307
309
|
description: 'language code (ISO 639-1)',
|
|
308
310
|
group: 'locale',
|
|
309
311
|
},
|
|
312
|
+
preferredLanguages: {
|
|
313
|
+
type: 'string-array',
|
|
314
|
+
default: DEFAULT_REACT_NATIVE_CONFIGURATION.preferredLanguages,
|
|
315
|
+
description: 'ordered preferred language tags; empty follows language and region',
|
|
316
|
+
group: 'locale',
|
|
317
|
+
validate: (value: unknown) => {
|
|
318
|
+
if (!Array.isArray(value)) return false
|
|
319
|
+
return value.every((tag: unknown) => {
|
|
320
|
+
if (typeof tag !== 'string' || !tag) return false
|
|
321
|
+
try {
|
|
322
|
+
return Intl.getCanonicalLocales(tag).length === 1
|
|
323
|
+
} catch {
|
|
324
|
+
return false
|
|
325
|
+
}
|
|
326
|
+
})
|
|
327
|
+
},
|
|
328
|
+
},
|
|
310
329
|
region: {
|
|
311
330
|
type: 'string',
|
|
312
331
|
default: DEFAULT_REACT_NATIVE_CONFIGURATION.region,
|
|
@@ -349,6 +368,12 @@ export const settingsSchema: Record<SettingKey, SettingDef> = {
|
|
|
349
368
|
description: 'show touch indicators',
|
|
350
369
|
group: 'simulator',
|
|
351
370
|
},
|
|
371
|
+
systemCursor: {
|
|
372
|
+
type: 'boolean',
|
|
373
|
+
default: false,
|
|
374
|
+
description: 'keep the computer pointer instead of a touch cursor',
|
|
375
|
+
group: 'simulator',
|
|
376
|
+
},
|
|
352
377
|
showFrame: {
|
|
353
378
|
type: 'boolean',
|
|
354
379
|
default: true,
|
|
@@ -538,6 +563,7 @@ const SETTING_VALUE_TYPES = {
|
|
|
538
563
|
enum: 'string',
|
|
539
564
|
number: 'number',
|
|
540
565
|
boolean: 'boolean',
|
|
566
|
+
'string-array': 'object',
|
|
541
567
|
} as const satisfies Record<SettingType, string>
|
|
542
568
|
|
|
543
569
|
// the one gate for every write and load: a value of the wrong type (an object
|
package/src/sim-client.ts
CHANGED
|
@@ -621,7 +621,10 @@ export class SimClient implements WsBridge, InspectBridge {
|
|
|
621
621
|
: outcome.failure === 'missed'
|
|
622
622
|
? (outcome.result?.reason ?? 'press missed')
|
|
623
623
|
: outcome.payload?.ambiguous
|
|
624
|
-
?
|
|
624
|
+
? (outcome.payload.error ??
|
|
625
|
+
(outcome.payload.total === undefined
|
|
626
|
+
? 'ambiguous target'
|
|
627
|
+
: `ambiguous: ${outcome.payload.total} matches`))
|
|
625
628
|
: (outcome.result?.reason ?? outcome.payload?.error ?? 'tap failed')
|
|
626
629
|
throw new SimTapError(`tap ${JSON.stringify(label)} failed: ${reason}`, outcome)
|
|
627
630
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// storage-snapshot.ts owns the browser side (dump and restore) and re-exports
|
|
8
8
|
// everything here, so callers keep importing one module.
|
|
9
9
|
|
|
10
|
+
import { NATIVE_HTTP_COOKIE_STORAGE_PREFIX } from '../../peach-compat/src/stubs/native-cookie-storage-contract'
|
|
10
11
|
import type { AppSettingsSnapshot } from '#peach-cli-contract/permissions/app-settings-client'
|
|
11
12
|
import type {
|
|
12
13
|
SootSimExternalAppResetResult,
|
|
@@ -31,6 +32,7 @@ export const SECURE_STORE_PLAINTEXT_PREFIX = '__sootsim_secure_store_plaintext:'
|
|
|
31
32
|
export const SWIFT_SECURITY_STORAGE_PREFIX = '__peach_security_items:'
|
|
32
33
|
export const RESET_NATIVE_AUTH_COOKIE_KEY = '__rnx_native_auth_cookies'
|
|
33
34
|
export const CREDENTIAL_STORAGE_SNAPSHOT_PREFIXES = [
|
|
35
|
+
NATIVE_HTTP_COOKIE_STORAGE_PREFIX,
|
|
34
36
|
SECURE_STORE_PLAINTEXT_PREFIX,
|
|
35
37
|
SWIFT_SECURITY_STORAGE_PREFIX,
|
|
36
38
|
] as const
|
|
@@ -69,6 +71,7 @@ export function resetStorageKindForKey(key: string): ResetStorageKind | null {
|
|
|
69
71
|
if (key.startsWith(RESET_USER_DEFAULTS_PREFIX)) return 'user-defaults'
|
|
70
72
|
if (
|
|
71
73
|
key.startsWith(SECURE_STORE_PLAINTEXT_PREFIX) ||
|
|
74
|
+
key.startsWith(NATIVE_HTTP_COOKIE_STORAGE_PREFIX) ||
|
|
72
75
|
key === RESET_NATIVE_AUTH_COOKIE_KEY
|
|
73
76
|
)
|
|
74
77
|
return 'secure-store'
|