peachsim 0.1.1625 → 0.1.1640
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +15 -2
- package/cli/app-config.ts +18 -6
- package/cli/app-fonts.ts +37 -17
- package/cli/app-stubs.ts +284 -20
- package/cli/bridge-flow-runner.ts +66 -45
- package/cli/cloud-client.ts +60 -40
- package/cli/command-registry.ts +1 -0
- package/cli/commands/control.ts +283 -49
- package/cli/commands/doctor.ts +30 -189
- package/cli/commands/flow.ts +79 -11
- package/cli/commands/inspect/core.ts +10 -5
- package/cli/commands/inspect/settling.ts +14 -2
- package/cli/commands/inspect/shared.ts +9 -4
- package/cli/commands/inspect/wait-ready.ts +12 -0
- package/cli/commands/inspect.ts +91 -50
- package/cli/commands/install-desktop.ts +1 -0
- package/cli/commands/maestro-compare.ts +97 -38
- package/cli/commands/maestro.ts +9 -1
- package/cli/commands/preview.ts +1 -1
- package/cli/commands/record.ts +118 -48
- package/cli/commands/screenshot.ts +23 -1
- package/cli/commands/serve.ts +7 -2
- package/cli/commands/setup.ts +19 -42
- package/cli/commands/swift.ts +14 -3
- package/cli/commands/upload.ts +93 -48
- package/cli/desktop-companion.ts +102 -17
- package/cli/drivers/desktop.ts +14 -1
- package/cli/drivers/playwright-sim-host.ts +103 -45
- package/cli/drivers/playwright.ts +9 -8
- package/cli/drivers/types.ts +5 -0
- package/cli/maestro-accessibility.ts +1 -1
- package/cli/maestro-compare.ts +84 -12
- package/cli/main.ts +3 -2
- package/cli/outbound-endpoints.ts +20 -6
- package/cli/pause-aware-timeout.ts +106 -0
- package/cli/scene-video.ts +89 -0
- package/cli/ws-bridge.ts +37 -19
- package/detox/attempt-events.cjs +66 -5
- package/detox/attempt-events.d.cts +7 -0
- package/detox/expectations.ts +7 -3
- package/detox/index.ts +269 -170
- package/detox/motion-change.cjs +206 -21
- package/detox/motion-change.d.cts +39 -2
- package/detox/navigation-lifecycle.ts +35 -3
- 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 +8 -7
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +13 -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 +14 -8
- package/dist-lib/bridge-contract.mjs +13 -7
- package/dist-lib/bundle-channel.cjs +11887 -7900
- 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 +6 -3
- package/dist-lib/config.mjs +6 -3
- package/dist-lib/detox/index.cjs +1379 -725
- package/dist-lib/dev-bundle-resolution.cjs +14 -2
- package/dist-lib/expo-swift-bundle.cjs +9341 -5462
- package/dist-lib/expo-swift-metadata.cjs +11 -7
- package/dist-lib/expo-swift-metadata.mjs +11 -7
- package/dist-lib/home-paths.cjs +32 -3
- package/dist-lib/host/bridge-host.cjs +50204 -7258
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- 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 +3541 -448
- 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 +2931 -104
- package/dist-lib/native-app-identity-project.cjs +289 -49
- package/dist-lib/native-app-identity-project.mjs +289 -49
- package/dist-lib/native-app-identity.cjs +77 -26
- package/dist-lib/native-app-identity.mjs +76 -26
- 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/react-native-host-modules.cjs +6 -2
- package/dist-lib/react-native-host-modules.mjs +6 -2
- package/dist-lib/scripts/dev-server-scanner.cjs +22 -8
- package/dist-lib/sdk.cjs +27 -11
- package/dist-lib/sdk.mjs +27 -10
- package/dist-lib/skills.cjs +72201 -26208
- package/dist-lib/swift-compile.cjs +1007 -140
- package/dist-lib/swift-compile.mjs +1049 -174
- package/dist-lib/swift-package.cjs +12 -3
- package/dist-lib/swift-package.mjs +12 -3
- package/dist-lib/swift-submit.cjs +13 -5
- package/dist-lib/swift-submit.mjs +11 -5
- package/dist-lib/swift-toolchain.cjs +423 -33
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +8628 -5268
- package/dist-lib/vite.cjs +2859 -12
- package/dist-lib/worklet-executable.cjs +14 -2
- package/dist-lib/worklet-executable.mjs +14 -2
- package/kotlin/AppSources/dev/peach/app/PeachDrawable.kt +21 -14
- package/kotlin/Sources/androidx/annotation/DrawableRes.kt +14 -0
- package/package.json +1 -1
- package/scripts/dev-server-scanner.ts +2 -1
- package/skills/peach-perf/SKILL.md +11 -5
- package/skills/peach-setup/SKILL.md +16 -19
- package/src/backend-origin.ts +13 -6
- package/src/bridge-constants.ts +11 -0
- package/src/bridge-contract.ts +22 -34
- package/src/config.ts +15 -0
- package/src/desktop-host-delivery.ts +5 -1
- package/src/dev-bundle-resolution.ts +2 -1
- package/src/expo-manifest-body.ts +13 -0
- package/src/expo-swift-host.ts +196 -49
- package/src/expo-swift-ready.ts +78 -0
- package/src/expoKotlinContract.ts +4 -7
- package/src/expoSwiftContract.ts +17 -6
- package/src/home-paths.ts +48 -2
- package/src/host/bridge-host.ts +5 -2
- package/src/host/staged-host-files.ts +9 -0
- package/src/native-app-identity-project.ts +27 -6
- package/src/native-app-identity.ts +91 -4
- package/src/native-firebase-config.ts +209 -13
- package/src/nativeAppIconContract.ts +1 -4
- package/src/output-lock-stdio.ts +36 -0
- package/src/process-group.ts +25 -2
- package/src/react-native-bridge-modules.ts +431 -0
- package/src/react-native-host-modules.ts +8 -1
- package/src/settings-bundle.ts +1 -4
- package/src/swift-binary-modules.ts +2 -2
- package/src/swift-compile.ts +918 -109
- package/src/swift-compiler-digest.ts +14 -0
- package/src/swift-distribution.lock.json +24 -12
- package/src/swift-distribution.ts +103 -4
- package/src/swift-host.ts +180 -55
- package/src/swift-icu.ts +27 -13
- package/src/swift-objc-compile.ts +355 -0
- package/src/swift-objc-sdk.ts +821 -27
- package/src/swift-objc-standin.ts +148 -14
- package/src/swift-package-manifest.ts +60 -7
- package/src/swift-package.ts +15 -1
- package/src/swift-packages.ts +154 -81
- package/src/swift-standin-emit.ts +96 -15
- package/src/swift-standins.ts +530 -116
- package/src/swift-submit.ts +13 -5
- package/src/swift-toolchain.ts +500 -42
- package/src/vite-plugin.ts +12 -1
- package/src/worker-system-chunks.ts +11 -12
- package/src/worklet-executable.ts +19 -1
- package/src/xcode-project.ts +270 -30
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto'
|
|
2
|
+
import { readFileSync } from 'node:fs'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
|
|
5
|
+
// the lowering and manifest code in swift-compile.ts and its design-time lowering
|
|
6
|
+
// decide the emitted output, so their text addresses every swift artifact. bundled
|
|
7
|
+
// builds cannot read these files at runtime, so build-cli injects this digest.
|
|
8
|
+
export function swiftCompilerSourceDigest(srcDir: string): string {
|
|
9
|
+
const hash = createHash('sha256')
|
|
10
|
+
for (const file of ['swift-compile.ts', 'swift-design-time.ts']) {
|
|
11
|
+
hash.update(readFileSync(path.join(srcDir, file)))
|
|
12
|
+
}
|
|
13
|
+
return hash.digest('hex')
|
|
14
|
+
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
3
|
-
"release": "swift-6.4.0-RELEASE",
|
|
4
|
-
"wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-
|
|
5
|
-
"wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-
|
|
6
|
-
"wasmSdkChecksum": "
|
|
7
|
-
"source": "
|
|
2
|
+
"id": "77123740e6b79652",
|
|
3
|
+
"release": "swift-6.4.0-RELEASE-custom-0d775d32d7c74eae",
|
|
4
|
+
"wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-21f60db0",
|
|
5
|
+
"wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-21f60db0.artifactbundle.tar.gz",
|
|
6
|
+
"wasmSdkChecksum": "7b7573fd23120549fc928581a42968676f5f00f9ef63e5618032a6928a724e16",
|
|
7
|
+
"source": "7625fb75d15f047f1e8c0b14b73407c50263f0c4",
|
|
8
8
|
"targets": [
|
|
9
|
+
"ImagePlayground",
|
|
10
|
+
"QuickLookThumbnailing",
|
|
11
|
+
"libxml2",
|
|
12
|
+
"CarPlay",
|
|
9
13
|
"System",
|
|
10
14
|
"_LocationEssentials",
|
|
11
15
|
"GeoToolbox",
|
|
@@ -36,12 +40,14 @@
|
|
|
36
40
|
"FoundationNetworking",
|
|
37
41
|
"DeveloperToolsSupport",
|
|
38
42
|
"SwiftUI",
|
|
43
|
+
"os_workgroup",
|
|
39
44
|
"Dispatch",
|
|
40
45
|
"DarwinRecords",
|
|
41
46
|
"Darwin",
|
|
42
47
|
"MachO",
|
|
43
48
|
"ObjectiveC",
|
|
44
49
|
"PeachObjC",
|
|
50
|
+
"UIUtilities",
|
|
45
51
|
"UIKitCore",
|
|
46
52
|
"PeachICU",
|
|
47
53
|
"PeachCMark",
|
|
@@ -54,6 +60,7 @@
|
|
|
54
60
|
"DeviceCheck",
|
|
55
61
|
"PassKit",
|
|
56
62
|
"Translation",
|
|
63
|
+
"TipKit",
|
|
57
64
|
"CoreSpotlight",
|
|
58
65
|
"CoreVideo",
|
|
59
66
|
"CoreMedia",
|
|
@@ -137,7 +144,12 @@
|
|
|
137
144
|
"FoundationModels",
|
|
138
145
|
"CoreTransferable",
|
|
139
146
|
"AudioToolbox",
|
|
147
|
+
"CoreAudioTypes",
|
|
148
|
+
"AudioUnit",
|
|
140
149
|
"Intents",
|
|
150
|
+
"IntentsUI",
|
|
151
|
+
"WatchConnectivity",
|
|
152
|
+
"CoreServices",
|
|
141
153
|
"MobileCoreServices",
|
|
142
154
|
"ImageIO",
|
|
143
155
|
"CoreLocationEnums",
|
|
@@ -179,16 +191,16 @@
|
|
|
179
191
|
},
|
|
180
192
|
"hosts": {
|
|
181
193
|
"darwin-arm64": {
|
|
182
|
-
"sha256": "
|
|
183
|
-
"size":
|
|
194
|
+
"sha256": "cc4a8f39ea9e3f12864196793a248bea28c05917ef4e7220ad516447da88d582",
|
|
195
|
+
"size": 71374056
|
|
184
196
|
},
|
|
185
197
|
"linux-x64": {
|
|
186
|
-
"sha256": "
|
|
187
|
-
"size":
|
|
198
|
+
"sha256": "c3938547ce5a453c63dc261e98753be6420ee8f2501b64d3622ef16f63d8bd1f",
|
|
199
|
+
"size": 71380196
|
|
188
200
|
},
|
|
189
201
|
"linux-arm64": {
|
|
190
|
-
"sha256": "
|
|
191
|
-
"size":
|
|
202
|
+
"sha256": "0b32aaf29f8ad7a1ca021a42f889bc4da28d239680c4cff82ca96a803c3d31e1",
|
|
203
|
+
"size": 71378226
|
|
192
204
|
}
|
|
193
205
|
}
|
|
194
206
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// build carries, and unpacks it under the peach home
|
|
6
6
|
// (docs/swift-distribution.md). no path here asks Contrast to compile.
|
|
7
7
|
import fs from 'node:fs'
|
|
8
|
+
import os from 'node:os'
|
|
8
9
|
import path from 'node:path'
|
|
9
10
|
import { installVerifiedTarball } from '@contrast/runtime-delivery'
|
|
10
11
|
import { rnxHomeDir } from './home-paths'
|
|
@@ -16,7 +17,17 @@ import {
|
|
|
16
17
|
swiftDistributionKey,
|
|
17
18
|
} from './swift-distribution-contract'
|
|
18
19
|
import lockJson from './swift-distribution.lock.json' with { type: 'json' }
|
|
19
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
confineSwiftScratch,
|
|
22
|
+
installSwiftWasmSdk,
|
|
23
|
+
swiftCompiler,
|
|
24
|
+
swiftCompilerInstallSteps,
|
|
25
|
+
swiftHostCompilerArchive,
|
|
26
|
+
swiftToolchain,
|
|
27
|
+
swiftToolchainBin,
|
|
28
|
+
verifySwiftHostCompiler,
|
|
29
|
+
type SwiftWasmSdk,
|
|
30
|
+
} from './swift-toolchain'
|
|
20
31
|
|
|
21
32
|
export const SWIFT_ENDPOINT_ENV = 'PEACH_SWIFT_ENDPOINT'
|
|
22
33
|
|
|
@@ -51,9 +62,9 @@ export async function swiftDistributionRoot(
|
|
|
51
62
|
`peach has no Swift distribution for ${process.platform}-${process.arch}; it ships for macOS arm64 and Linux x64 and arm64`,
|
|
52
63
|
)
|
|
53
64
|
}
|
|
54
|
-
// the archive is useless without its compiler, so
|
|
55
|
-
//
|
|
56
|
-
|
|
65
|
+
// the archive is useless without its compiler, so the toolchain installs
|
|
66
|
+
// or fails before the download
|
|
67
|
+
await installSwiftToolchain(lock.release, lock, signal)
|
|
57
68
|
const dir = path.join(rnxHomeDir(), 'swift', `${lock.id}-${host}`)
|
|
58
69
|
let pending = installs.get(dir)
|
|
59
70
|
if (pending?.controller.signal.aborted) pending = undefined
|
|
@@ -126,6 +137,93 @@ export async function swiftDistributionRoot(
|
|
|
126
137
|
}
|
|
127
138
|
}
|
|
128
139
|
|
|
140
|
+
/**
|
|
141
|
+
* the pinned compiler and wasm SDK, installed on first use without root: the
|
|
142
|
+
* compiler under PEACH_HOME/swift/toolchains (macOS: ~/Library/Developer/Toolchains) unless CONTRAST_SWIFT_TOOLCHAINS
|
|
143
|
+
* or an existing /opt/swift install selects another (swiftToolchainBin), the
|
|
144
|
+
* SDK in the --swift-sdks-path directory, PEACH_HOME/swift/sdks by default.
|
|
145
|
+
* a compiler in a directory the user selected is verified, never replaced.
|
|
146
|
+
*/
|
|
147
|
+
async function installSwiftToolchain(
|
|
148
|
+
release: string,
|
|
149
|
+
sdk: SwiftWasmSdk,
|
|
150
|
+
signal?: AbortSignal,
|
|
151
|
+
): Promise<void> {
|
|
152
|
+
process.env.PEACH_SWIFT_SDKS_PATH ??= path.join(rnxHomeDir(), 'swift', 'sdks')
|
|
153
|
+
if (swiftToolchainReady(release, sdk)) return
|
|
154
|
+
const root = path.resolve(swiftToolchainBin(release), '../..')
|
|
155
|
+
// macOS installs where the locator looks first, the user's Toolchains
|
|
156
|
+
// directory, and only into a directory without a compiler; linux installs
|
|
157
|
+
// into the Peach-owned directory.
|
|
158
|
+
const owned =
|
|
159
|
+
process.platform === 'darwin'
|
|
160
|
+
? path.join(os.homedir(), 'Library/Developer/Toolchains', `${release}.xctoolchain`)
|
|
161
|
+
: path.join(rnxHomeDir(), 'swift', 'toolchains', release)
|
|
162
|
+
const selectedCompiler =
|
|
163
|
+
process.platform === 'darwin' && fs.existsSync(path.join(root, 'usr/bin/swift'))
|
|
164
|
+
if (
|
|
165
|
+
release.includes('-custom-') &&
|
|
166
|
+
root === owned &&
|
|
167
|
+
!selectedCompiler &&
|
|
168
|
+
!swiftCompilerReady(release)
|
|
169
|
+
) {
|
|
170
|
+
const archive = swiftHostCompilerArchive(release)
|
|
171
|
+
process.stderr.write(`peach: installing Swift compiler ${release} to ${root}…\n`)
|
|
172
|
+
await installVerifiedTarball({
|
|
173
|
+
signal,
|
|
174
|
+
url: archive.url,
|
|
175
|
+
digest: { algorithm: 'sha256', encoding: 'hex', value: archive.checksum },
|
|
176
|
+
destDir: root,
|
|
177
|
+
installedMarker: 'compiler.json',
|
|
178
|
+
stripComponents: 1,
|
|
179
|
+
label: `Swift compiler ${release}`,
|
|
180
|
+
verify: (dir) => verifySwiftHostCompiler(release, dir),
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
swiftCompiler(release)
|
|
185
|
+
} catch (error) {
|
|
186
|
+
const reason = error instanceof Error ? error.message : String(error)
|
|
187
|
+
throw new Error(
|
|
188
|
+
`Swift compiler ${release} is unavailable or differs from its pin: ${reason}\n${swiftCompilerInstallSteps(release)}\nthen run the command again; it installs the SDK.`,
|
|
189
|
+
{ cause: error },
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
if (swiftToolchainReady(release, sdk)) return
|
|
193
|
+
signal?.throwIfAborted()
|
|
194
|
+
const directory = process.env.PEACH_SWIFT_SDKS_PATH
|
|
195
|
+
process.stderr.write(`peach: installing Swift SDK ${sdk.wasmSdkId} to ${directory}…\n`)
|
|
196
|
+
try {
|
|
197
|
+
installSwiftWasmSdk(release, sdk)
|
|
198
|
+
} catch (error) {
|
|
199
|
+
const reason = error instanceof Error ? error.message : String(error)
|
|
200
|
+
throw new Error(
|
|
201
|
+
`could not install Swift SDK ${sdk.wasmSdkId} to ${directory}: ${reason}`,
|
|
202
|
+
{
|
|
203
|
+
cause: error,
|
|
204
|
+
},
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function swiftCompilerReady(release: string): boolean {
|
|
210
|
+
try {
|
|
211
|
+
swiftCompiler(release)
|
|
212
|
+
return true
|
|
213
|
+
} catch {
|
|
214
|
+
return false
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function swiftToolchainReady(release: string, sdk: SwiftWasmSdk): boolean {
|
|
219
|
+
try {
|
|
220
|
+
swiftToolchain(release, sdk)
|
|
221
|
+
return true
|
|
222
|
+
} catch {
|
|
223
|
+
return false
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
129
227
|
/** the module this process compiles app Swift against: the checkout beside a
|
|
130
228
|
* source peach, else the distribution, else null. `required` callers compile
|
|
131
229
|
* nothing without it, so a checkout's toolchain error surfaces to them. */
|
|
@@ -134,6 +232,7 @@ export async function resolveSwiftModule({
|
|
|
134
232
|
signal,
|
|
135
233
|
}: { required?: boolean; signal?: AbortSignal } = {}): Promise<SwiftModule | null> {
|
|
136
234
|
signal?.throwIfAborted()
|
|
235
|
+
confineSwiftScratch(path.join(rnxHomeDir(), 'cache', 'swift-tmp'))
|
|
137
236
|
const checkout = path.resolve(import.meta.dirname, '../../sootsim-swift')
|
|
138
237
|
if (fs.existsSync(path.join(checkout, 'toolchain.json'))) {
|
|
139
238
|
// a checkout is implicit: without its toolchain, apps run without their
|