peachsim 0.1.2185 → 0.1.2187
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/cpu-profile.ts +6 -2
- package/cli/commands/shell-url.ts +3 -6
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +2755 -2385
- 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 +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +3265 -3223
- package/dist-lib/expo-swift-metadata.cjs +2 -1
- package/dist-lib/expo-swift-metadata.mjs +2 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +4587 -4217
- package/dist-lib/host/fetch-proxy-handler.cjs +8 -7
- 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 +474 -283
- 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 +647 -284
- 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 +775 -584
- package/dist-lib/native-app-identity-project.cjs +45 -4
- package/dist-lib/native-app-identity-project.mjs +45 -4
- package/dist-lib/native-app-identity.cjs +40 -2
- package/dist-lib/native-app-identity.mjs +40 -2
- 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 +24 -24
- package/dist-lib/public-origins-lib.json +99 -59
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +5257 -4878
- package/dist-lib/swift-compile.cjs +2 -2
- package/dist-lib/swift-compile.mjs +2 -2
- 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 +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +3 -3
- package/dist-lib/vite.cjs +8 -7
- 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-backend.d.ts +1 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +10 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIImageAsset.h +1 -1
- package/src/android-autolinking.ts +45 -4
- package/src/android-bridge-packages.ts +2 -2
- package/src/android-gradle-sources.ts +143 -0
- package/src/androidAutolinkingContract.ts +8 -0
- package/src/androidGradleContract.ts +14 -0
- package/src/expo-kotlin-host.ts +3 -0
- package/src/expo-native-workspace.ts +7 -1
- package/src/java-module-abi.ts +145 -0
- package/src/javaAbiContract.ts +14 -0
- package/src/kotlin-host.ts +57 -3
- package/src/native-app-identity-project.ts +10 -2
- package/src/native-app-identity.ts +15 -1
- package/src/nativeAppIconContract.ts +37 -0
- package/src/nitro-source.ts +2 -167
- package/src/react-native-autolinking.ts +153 -0
- package/src/swift-installed-targets.ts +8 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process'
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import { createRequire } from 'node:module'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import { promisify } from 'node:util'
|
|
6
|
+
import { PEACH_FORKED_SCRIPT_ENV } from './forked-script-contract'
|
|
7
|
+
import { isRecord } from './is-record'
|
|
8
|
+
|
|
9
|
+
const run = promisify(execFile)
|
|
10
|
+
function autolinkerJson(
|
|
11
|
+
command: string,
|
|
12
|
+
output: { stdout: string; stderr: string },
|
|
13
|
+
): unknown {
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(output.stdout)
|
|
16
|
+
} catch (cause) {
|
|
17
|
+
throw new Error(
|
|
18
|
+
`${command} exited 0 with ${output.stdout.length} bytes of stdout that is not JSON (${cause instanceof Error ? cause.message : cause}); stderr: ${output.stderr.trim().slice(0, 500) || '(empty)'}; stdout: ${output.stdout.slice(0, 200) || '(empty)'}`,
|
|
19
|
+
{ cause },
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// old CLI releases lack platform flags and Expo’s React Native command.
|
|
25
|
+
async function cliAdvertises(
|
|
26
|
+
cli: string,
|
|
27
|
+
args: string[],
|
|
28
|
+
token: string,
|
|
29
|
+
appRoot: string,
|
|
30
|
+
signal?: AbortSignal,
|
|
31
|
+
): Promise<boolean> {
|
|
32
|
+
const { stdout, stderr } = await run('node', [cli, ...args], {
|
|
33
|
+
cwd: appRoot,
|
|
34
|
+
signal,
|
|
35
|
+
timeout: 30_000,
|
|
36
|
+
maxBuffer: 1 * 1024 * 1024,
|
|
37
|
+
env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: '1' },
|
|
38
|
+
})
|
|
39
|
+
if (!stdout.trim())
|
|
40
|
+
throw new Error(
|
|
41
|
+
`${cli} ${args.join(' ')} returned empty help output${stderr.trim() ? `: ${stderr.trim()}` : ''}`,
|
|
42
|
+
)
|
|
43
|
+
return stdout.includes(token)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function declaresDependency(appRoot: string, name: string): boolean {
|
|
47
|
+
const manifest: unknown = JSON.parse(
|
|
48
|
+
fs.readFileSync(path.join(appRoot, 'package.json'), 'utf8'),
|
|
49
|
+
)
|
|
50
|
+
return (
|
|
51
|
+
isRecord(manifest) &&
|
|
52
|
+
['dependencies', 'devDependencies'].some((field) => {
|
|
53
|
+
const group = manifest[field]
|
|
54
|
+
return isRecord(group) && Object.hasOwn(group, name)
|
|
55
|
+
})
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function reactNativeAutolinkingConfig(
|
|
60
|
+
appRoot: string,
|
|
61
|
+
platform: 'ios' | 'android',
|
|
62
|
+
signal?: AbortSignal,
|
|
63
|
+
): Promise<unknown> {
|
|
64
|
+
appRoot = fs.realpathSync(appRoot)
|
|
65
|
+
const appRequire = createRequire(path.join(appRoot, 'package.json'))
|
|
66
|
+
const expoManifest = appRequire.resolve
|
|
67
|
+
.paths('expo')
|
|
68
|
+
?.map((directory) => path.join(directory, 'expo/package.json'))
|
|
69
|
+
.find((manifest) => fs.existsSync(manifest))
|
|
70
|
+
const expoRequire = expoManifest
|
|
71
|
+
? createRequire(fs.realpathSync(expoManifest))
|
|
72
|
+
: appRequire
|
|
73
|
+
const nativeFile = (
|
|
74
|
+
platform === 'ios'
|
|
75
|
+
? ['ios/Podfile']
|
|
76
|
+
: ['android/settings.gradle', 'android/settings.gradle.kts']
|
|
77
|
+
)
|
|
78
|
+
.map((name) => path.join(appRoot, name))
|
|
79
|
+
.find((file) => fs.existsSync(file))
|
|
80
|
+
const nativeSource = nativeFile ? fs.readFileSync(nativeFile, 'utf8') : null
|
|
81
|
+
const asksExpo =
|
|
82
|
+
process.env.EXPO_USE_COMMUNITY_AUTOLINKING !== '1' &&
|
|
83
|
+
(nativeSource === null
|
|
84
|
+
? declaresDependency(appRoot, 'expo')
|
|
85
|
+
: nativeSource.includes('expo-modules-autolinking') ||
|
|
86
|
+
(platform === 'android' &&
|
|
87
|
+
nativeSource.includes('expoAutolinking.rnConfigCommand')))
|
|
88
|
+
const expoAutolinker = asksExpo
|
|
89
|
+
? [appRequire, expoRequire]
|
|
90
|
+
.flatMap((req) => req.resolve.paths('expo-modules-autolinking') ?? [])
|
|
91
|
+
.map((directory) => path.join(directory, 'expo-modules-autolinking/package.json'))
|
|
92
|
+
.find((manifest) => fs.existsSync(manifest))
|
|
93
|
+
: undefined
|
|
94
|
+
if (expoAutolinker) {
|
|
95
|
+
const cli = path.join(path.dirname(expoAutolinker), 'bin/expo-modules-autolinking.js')
|
|
96
|
+
if (await cliAdvertises(cli, ['--help'], 'react-native-config', appRoot, signal)) {
|
|
97
|
+
const args = [
|
|
98
|
+
cli,
|
|
99
|
+
'react-native-config',
|
|
100
|
+
'--json',
|
|
101
|
+
'--platform',
|
|
102
|
+
platform,
|
|
103
|
+
'--project-root',
|
|
104
|
+
appRoot,
|
|
105
|
+
]
|
|
106
|
+
return autolinkerJson(
|
|
107
|
+
'expo-modules-autolinking react-native-config',
|
|
108
|
+
await run('node', args, {
|
|
109
|
+
timeout: 30_000,
|
|
110
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
111
|
+
env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: '1' },
|
|
112
|
+
// expo configuration resolves its project from cwd.
|
|
113
|
+
cwd: appRoot,
|
|
114
|
+
signal,
|
|
115
|
+
}),
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const cliRequire = declaresDependency(appRoot, 'one')
|
|
120
|
+
? createRequire(
|
|
121
|
+
createRequire(appRequire.resolve('one/package.json')).resolve(
|
|
122
|
+
'vxrn/package.json',
|
|
123
|
+
),
|
|
124
|
+
)
|
|
125
|
+
: appRequire
|
|
126
|
+
const cliManifest = cliRequire.resolve('@react-native-community/cli/package.json')
|
|
127
|
+
const cli: unknown = JSON.parse(fs.readFileSync(cliManifest, 'utf8'))
|
|
128
|
+
const bins = isRecord(cli) && isRecord(cli.bin) ? cli.bin : undefined
|
|
129
|
+
const bin = [bins?.['rnc-cli'], bins?.['react-native']].find(
|
|
130
|
+
(entry): entry is string => typeof entry === 'string',
|
|
131
|
+
)
|
|
132
|
+
if (bin === undefined) throw new Error(`${cliManifest} declares no CLI bin`)
|
|
133
|
+
const cliPath = path.join(path.dirname(cliManifest), bin)
|
|
134
|
+
const configArgs = (await cliAdvertises(
|
|
135
|
+
cliPath,
|
|
136
|
+
['config', '--help'],
|
|
137
|
+
'--platform',
|
|
138
|
+
appRoot,
|
|
139
|
+
signal,
|
|
140
|
+
))
|
|
141
|
+
? ['config', '--platform', platform]
|
|
142
|
+
: ['config']
|
|
143
|
+
return autolinkerJson(
|
|
144
|
+
`react-native ${configArgs.join(' ')}`,
|
|
145
|
+
await run('node', [cliPath, ...configArgs], {
|
|
146
|
+
cwd: appRoot,
|
|
147
|
+
signal,
|
|
148
|
+
timeout: 30_000,
|
|
149
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
150
|
+
env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: '1', NO_COLOR: '1' },
|
|
151
|
+
}),
|
|
152
|
+
)
|
|
153
|
+
}
|
|
@@ -201,6 +201,14 @@ export function applyInstalledSwiftTargets(
|
|
|
201
201
|
return !collection.targets.some((target) => target.name === module)
|
|
202
202
|
})
|
|
203
203
|
dropSuppliedHeaders(generated, native)
|
|
204
|
+
if (native.flattensPublicHeaders && native.publicHeaders.length > 0)
|
|
205
|
+
generated.swiftFlags = [
|
|
206
|
+
...(generated.swiftFlags ?? []),
|
|
207
|
+
'-Xcc',
|
|
208
|
+
'-I',
|
|
209
|
+
'-Xcc',
|
|
210
|
+
`$(PEACH_INPUT_ROOT)/.build/peach-cxx-headers/${native.name}`,
|
|
211
|
+
]
|
|
204
212
|
const flags = originalModuleFlags(native.flags)
|
|
205
213
|
generated.clangSettings = [
|
|
206
214
|
{ tool: 'c', flags: [...flags, ...ndebug, ...search] },
|