peachsim 0.1.1728 → 0.1.1738
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/control.ts +1 -0
- package/cli/commands/coverage-swift.ts +112 -4
- package/cli/commands/package.ts +11 -1
- package/cli/commands/shell-url.ts +4 -0
- package/cli/scene-video.ts +24 -7
- package/detox/index.ts +9 -1
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +5 -2
- package/dist-lib/auth/shared-session.cjs +5 -2
- 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 +3592 -1918
- 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 -5
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +1329 -1022
- package/dist-lib/expo-swift-metadata.cjs +2 -2
- package/dist-lib/expo-swift-metadata.mjs +2 -2
- package/dist-lib/home-paths.cjs +7 -2
- package/dist-lib/host/bridge-host.cjs +3773 -2149
- package/dist-lib/host/fetch-proxy-handler.cjs +16 -5
- 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 +97 -68
- 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 +209 -32
- 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 +93 -65
- package/dist-lib/native-app-identity-project.cjs +37 -31
- package/dist-lib/native-app-identity-project.mjs +37 -31
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +5 -2
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +23 -23
- package/dist-lib/public-origins-lib.json +79 -53
- package/dist-lib/react-native-host-modules.cjs +5 -2
- package/dist-lib/react-native-host-modules.mjs +5 -2
- 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 +4486 -2789
- package/dist-lib/swift-compile.cjs +53 -60
- package/dist-lib/swift-compile.mjs +52 -60
- 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 +17 -17
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1056 -870
- package/dist-lib/vite.cjs +20 -8
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +7 -4
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +0 -5
- package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +8 -0
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +4 -1
- package/dist-types/packages/peach-engine/src/engine/render-damage.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/engine/text-paragraph.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +7 -2
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +13 -1
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
- package/kotlin/README.md +3 -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/Accounts.framework/Headers/ACAccount.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountCredential.h +35 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountStore.h +94 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountType.h +53 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACError.h +37 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/Accounts.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/AccountsDefines.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +58 -3
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +636 -37
- package/sdk/ios/usr/include/os/signpost.h +414 -0
- package/sdk/ios/usr/include/os.modulemap +5 -0
- package/sdk/ios/wasm/include/errno.h +4 -20
- package/sdk/ios/wasm/include/pthread.h +3 -0
- package/sdk/ios/wasm/include/setjmp.h +57 -0
- package/sdk/ios/wasm/include/sys/resource.h +2 -2
- package/sdk/native-hashes.json +3 -3
- package/skills/peach-debug/SKILL.md +0 -1
- package/skills/peach-perf/SKILL.md +0 -1
- package/skills/peach-setup/SKILL.md +0 -1
- package/skills/peach-test/SKILL.md +0 -1
- package/skills/peach-visual/SKILL.md +0 -1
- package/src/android-autolinking.ts +1 -0
- package/src/android-bridge-packages.ts +279 -0
- package/src/appPackageContract.ts +2 -0
- package/src/bundle-channel.mjs +20 -2
- package/src/cli-runtime.ts +9 -5
- package/src/expo-discovery-cache.ts +7 -3
- package/src/expo-kotlin-host.ts +97 -26
- package/src/expo-native-workspace.ts +135 -40
- package/src/expo-swift-host.ts +93 -20
- package/src/expo-swift-ready.ts +5 -1
- package/src/expoKotlinContract.ts +12 -2
- package/src/expoSwiftContract.ts +9 -2
- package/src/generated/swift-c-predefines.json +1 -1
- package/src/home-paths.ts +6 -1
- package/src/host/bridge-host.ts +5 -0
- package/src/host/fetch-proxy-handler.ts +10 -0
- package/src/kotlin-host.ts +204 -30
- package/src/kotlinSdkContract.ts +2 -1
- package/src/menu.ts +7 -0
- package/src/native-prebuilt.ts +154 -0
- package/src/nitro-adapter.lock.json +251 -251
- package/src/nitro-adapter.ts +56 -50
- package/src/nitro-bundle.ts +84 -74
- package/src/nitro-compile.ts +10 -5
- package/src/nitro-dependencies.ts +43 -28
- package/src/nitro-source.ts +60 -26
- package/src/nitroAdapterContract.ts +146 -98
- package/src/nitroContract.ts +64 -21
- package/src/react-native-bridge-modules.ts +2 -0
- package/src/react-native-host-modules.ts +4 -1
- package/src/settingsContract.ts +11 -0
- package/src/storageSnapshotContract.ts +29 -81
- package/src/swift-compile.ts +49 -50
- package/src/swift-coverage/indexdump.ts +22 -6
- package/src/swift-coverage/indexing.ts +4 -4
- package/src/swift-coverage/sdk.ts +104 -20
- package/src/swift-coverage/types.ts +34 -0
- package/src/swift-coverage/xcode.ts +9 -1
- package/src/swift-distribution.lock.json +15 -12
- package/src/swift-host.ts +3 -0
- package/src/swift-standin-emit.ts +6 -1
- package/src/swift-standins.ts +172 -10
- package/src/swift-submit.ts +5 -1
- package/src/swift-toolchain.ts +16 -16
- package/src/turbo-bundle.ts +81 -0
- package/src/turbo-compile.ts +120 -0
- package/src/turbo-runtime.lock.json +69 -0
- package/src/turbo-source.ts +754 -0
- package/src/vite-plugin-one.ts +4 -3
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto'
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import os from 'node:os'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import { readIosAppTarget } from './native-app-identity-project'
|
|
6
|
+
import {
|
|
7
|
+
committedAdapterLocks,
|
|
8
|
+
resolveAdapterArchive,
|
|
9
|
+
type AdapterArchive,
|
|
10
|
+
} from './nitro-adapter'
|
|
11
|
+
import { syncSwiftTree, type SwiftCompileInput } from './swift-compile'
|
|
12
|
+
import { artifactFor, projectFor, type SwiftArtifact } from './swift-host'
|
|
13
|
+
import {
|
|
14
|
+
collectTurboSources,
|
|
15
|
+
prepareTurboSourceDependencies,
|
|
16
|
+
TURBO_CORE_TARGET,
|
|
17
|
+
type TurboProvider,
|
|
18
|
+
type TurboSourceCollection,
|
|
19
|
+
} from './turbo-source'
|
|
20
|
+
|
|
21
|
+
// every provider's original sources, React Native's TurboModule core and the
|
|
22
|
+
// verified runtime archive form one executable. the entry runs each provider's
|
|
23
|
+
// transcribed +load, as the app's image loads them before React Native starts,
|
|
24
|
+
// then installs the binding on the archive's runtime.
|
|
25
|
+
export function collectTurboCompileInput(
|
|
26
|
+
collection: TurboSourceCollection,
|
|
27
|
+
runtime: AdapterArchive,
|
|
28
|
+
iosDeploymentTarget: string,
|
|
29
|
+
): SwiftCompileInput {
|
|
30
|
+
const files = { ...collection.files }
|
|
31
|
+
const entry = 'Sources/PeachTurboApp/main.swift'
|
|
32
|
+
const loaders = [...new Set(collection.loads.map(({ target }) => target))]
|
|
33
|
+
files[entry] =
|
|
34
|
+
`import ${TURBO_CORE_TARGET}\n${loaders.map((target) => `import ${target}\n`).join('')}` +
|
|
35
|
+
`${collection.loads.map(({ symbol }) => `${symbol}()\n`).join('')}peachTurboInitialize()\n`
|
|
36
|
+
files['Package.swift'] = [
|
|
37
|
+
'// swift-tools-version: 6.2',
|
|
38
|
+
'import PackageDescription',
|
|
39
|
+
`let package = Package(name: "PeachNativeModule", platforms: [.iOS(${JSON.stringify(iosDeploymentTarget)})], targets: [`,
|
|
40
|
+
...collection.targets.map(
|
|
41
|
+
(target) =>
|
|
42
|
+
`.target(name: ${JSON.stringify(target.name)}, dependencies: ${JSON.stringify(target.dependencies?.map((dependency) => dependency.name) ?? [])}, path: ${JSON.stringify(target.path)}, cxxSettings: [${(
|
|
43
|
+
target.cxxDefines ?? []
|
|
44
|
+
)
|
|
45
|
+
.map((define) => {
|
|
46
|
+
const [name, ...value] = define.split('=')
|
|
47
|
+
return value.length
|
|
48
|
+
? `.define(${JSON.stringify(name)}, to: ${JSON.stringify(value.join('='))})`
|
|
49
|
+
: `.define(${JSON.stringify(name)})`
|
|
50
|
+
})
|
|
51
|
+
.join(', ')}]),`,
|
|
52
|
+
),
|
|
53
|
+
`.executableTarget(name: "PeachTurboApp", dependencies: ${JSON.stringify([TURBO_CORE_TARGET, ...loaders])}, swiftSettings: [.interoperabilityMode(.Cxx)]),`,
|
|
54
|
+
'], cxxLanguageStandard: .cxx20)',
|
|
55
|
+
'',
|
|
56
|
+
].join('\n')
|
|
57
|
+
return {
|
|
58
|
+
files,
|
|
59
|
+
entry,
|
|
60
|
+
libraries: { [TURBO_CORE_TARGET]: runtime.base64 },
|
|
61
|
+
lazyDistribution: true,
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function compileTurboModule(options: {
|
|
66
|
+
appRoot: string
|
|
67
|
+
reactNativeRoot: string
|
|
68
|
+
providers: TurboProvider[]
|
|
69
|
+
moduleRoot: string
|
|
70
|
+
projectRoot: string
|
|
71
|
+
}): Promise<{ artifact: SwiftArtifact; collection: TurboSourceCollection }> {
|
|
72
|
+
await prepareTurboSourceDependencies(options.reactNativeRoot)
|
|
73
|
+
const key = createHash('sha256')
|
|
74
|
+
.update(options.providers.map(({ root }) => fs.realpathSync(root)).join('\0'))
|
|
75
|
+
.update('\0')
|
|
76
|
+
.update(fs.realpathSync(options.moduleRoot))
|
|
77
|
+
.digest('hex')
|
|
78
|
+
const scratch = path.join(os.tmpdir(), 'peach-turbo-swift', key)
|
|
79
|
+
// the codegen intake writes only into a new or empty directory
|
|
80
|
+
fs.rmSync(path.join(scratch, 'codegen'), { recursive: true, force: true })
|
|
81
|
+
const collection = await collectTurboSources({
|
|
82
|
+
appRoot: options.appRoot,
|
|
83
|
+
reactNativeRoot: options.reactNativeRoot,
|
|
84
|
+
providers: options.providers,
|
|
85
|
+
codegenDir: path.join(scratch, 'codegen'),
|
|
86
|
+
})
|
|
87
|
+
// the compiled sources target the app's own declared iOS minimum
|
|
88
|
+
const iosDeploymentTarget = readIosAppTarget(options.projectRoot)?.iosDeploymentTarget
|
|
89
|
+
if (!iosDeploymentTarget)
|
|
90
|
+
throw new Error(
|
|
91
|
+
`TurboModule compilation needs the app's Xcode project to declare an iOS deployment target: ${options.projectRoot}`,
|
|
92
|
+
)
|
|
93
|
+
const input = collectTurboCompileInput(
|
|
94
|
+
collection,
|
|
95
|
+
await resolveAdapterArchive(
|
|
96
|
+
'turbo',
|
|
97
|
+
{ reactNative: collection.reactNative.root },
|
|
98
|
+
options.moduleRoot,
|
|
99
|
+
committedAdapterLocks.turbo,
|
|
100
|
+
),
|
|
101
|
+
iosDeploymentTarget,
|
|
102
|
+
)
|
|
103
|
+
const packagePath = path.join(scratch, 'package')
|
|
104
|
+
syncSwiftTree(
|
|
105
|
+
packagePath,
|
|
106
|
+
new Map(
|
|
107
|
+
Object.entries(input.files).map(([file, source]) => [
|
|
108
|
+
path.join(packagePath, file),
|
|
109
|
+
source,
|
|
110
|
+
]),
|
|
111
|
+
),
|
|
112
|
+
)
|
|
113
|
+
const project = projectFor(packagePath)
|
|
114
|
+
project.libraries = input.libraries
|
|
115
|
+
project.lazyDistribution = input.lazyDistribution
|
|
116
|
+
return {
|
|
117
|
+
artifact: await artifactFor(project, input.entry, options.moduleRoot),
|
|
118
|
+
collection,
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": 2,
|
|
3
|
+
"platform": "ios",
|
|
4
|
+
"target": "wasm32-unknown-wasip1",
|
|
5
|
+
"recipe": "704fe0a2e79278bce00a7af1b1dc1846943873c3f54942a174833a515d222b79",
|
|
6
|
+
"adapter": {
|
|
7
|
+
"sha256": "0d31912293226deb3354b3b32f2944e9c61c68590e3020d8b5af0c12a6677893"
|
|
8
|
+
},
|
|
9
|
+
"compiler": "swift-6.4.0-RELEASE-custom-81b2c791c27276bf",
|
|
10
|
+
"sdk": {
|
|
11
|
+
"id": "swift-6.4.0-RELEASE_wasm-peach-b26c1c1d",
|
|
12
|
+
"checksum": "d3bec118d62c1015e0a2b30e0f09b8fab25613d0ac98e0dee31e68c5521bc747"
|
|
13
|
+
},
|
|
14
|
+
"framework": {
|
|
15
|
+
"distribution": "c1636d7b2e11fc76",
|
|
16
|
+
"wireAbi": "246b8412514b644113e6a26252c8ebd6de49ab4156ac5f5c98bb9e4c2ff2568b"
|
|
17
|
+
},
|
|
18
|
+
"archives": [
|
|
19
|
+
{
|
|
20
|
+
"headers": {
|
|
21
|
+
"reactNativeJsi": "0f8c2defbca69a27a848a81ae72363073bf9602fd316e57a75811be1a0528358"
|
|
22
|
+
},
|
|
23
|
+
"sha256": "f1652a56346d7042f118c2694b13f870af04a6fadb4131f9a0ed356f6c569f55",
|
|
24
|
+
"size": 25399
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"headers": {
|
|
28
|
+
"reactNativeJsi": "324aefd8591d9ce688bce7589c4c2b516cd33ecb95d35c47239a87a8fcf6a8da"
|
|
29
|
+
},
|
|
30
|
+
"sha256": "70ce25d883d54c1a285eb5be7b6f9f579b96e17004bd290e45f554166610eb43",
|
|
31
|
+
"size": 25398
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"headers": {
|
|
35
|
+
"reactNativeJsi": "66b2cd5a38511195207f6c8a76aba735f9b9cc66a52a0d00780ffe5d331623f7"
|
|
36
|
+
},
|
|
37
|
+
"sha256": "c983243dce2d889c0aaea3aaa9d34d1af7050b2f26866e465a1473dc066fa6dd",
|
|
38
|
+
"size": 25396
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"headers": {
|
|
42
|
+
"reactNativeJsi": "96db4e758dd53e9320cef7cad485e00aa06e7a982cefd920f17007de8a5bd9f9"
|
|
43
|
+
},
|
|
44
|
+
"sha256": "d651a6f69f016264a9a72ff0fd9303c6fb8b9ed30db545ce462ceadd1d9e2c1b",
|
|
45
|
+
"size": 26143
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"headers": {
|
|
49
|
+
"reactNativeJsi": "aeab590ddd1218df963462242d3954ce467b0fa88f70e91429e4ffc74d230893"
|
|
50
|
+
},
|
|
51
|
+
"sha256": "293fb5ae79d60939eeb341cda359faf1d9868dd8e4ff0db3c3f3eee8285d5504",
|
|
52
|
+
"size": 26138
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"headers": {
|
|
56
|
+
"reactNativeJsi": "b5fb260522384dd7ab07d740cdc534b529922446fcec798341c7817d9eaa49f4"
|
|
57
|
+
},
|
|
58
|
+
"sha256": "ecec13cfa871c6732c394a7eb620ec764227aecf237bf605534ac9b2e75dc460",
|
|
59
|
+
"size": 25265
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"headers": {
|
|
63
|
+
"reactNativeJsi": "c6b391a1e870ccf7cdd534be63582862840f8245b99ebd253317deece1e6ffd5"
|
|
64
|
+
},
|
|
65
|
+
"sha256": "7da7688735e62030faeff9722ce932e0c0262762981df2988bcb5bb5fff3d3e4",
|
|
66
|
+
"size": 26144
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|