peachsim 0.1.2224 → 0.1.2228
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/bridge-flow-runner.ts +56 -3
- package/cli/commands/control.ts +27 -1
- package/cli/commands/flow.ts +26 -0
- package/cli/commands/package.ts +9 -2
- package/cli/drivers/playwright.ts +1 -0
- package/cli/drivers/types.ts +3 -0
- package/cli/internal-child.ts +4 -2
- 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 +931 -455
- 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 +867 -391
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +926 -450
- package/dist-lib/host/fetch-proxy-handler.cjs +55 -12
- 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 +60 -16
- 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 +11 -4
- package/dist-lib/metro-production-bundle.mjs +10 -4
- package/dist-lib/metro.cjs +60 -16
- package/dist-lib/native-app-identity-project.cjs +53 -9
- package/dist-lib/native-app-identity-project.mjs +84 -37
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +26 -24
- package/dist-lib/public-origins-lib.json +66 -54
- 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 +1049 -512
- package/dist-lib/swift-compile.cjs +557 -121
- package/dist-lib/swift-compile.mjs +693 -258
- 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 +38 -2
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1726 -1209
- package/dist-lib/vite.cjs +55 -12
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/bundle-parse-receipt.d.ts +17 -0
- package/dist-types/packages/peach-engine/src/engine/canvaskit-api.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/native-paragraph.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +7 -0
- package/dist-types/packages/peach-engine/src/engine/yoga-layout.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/metro-fingerprint.d.ts +3 -2
- package/dist-types/packages/peach-engine/src/preview/preview-room-contract.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -3
- package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +0 -5
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +2 -0
- package/dist-types/packages/peach-kit/src/internal.d.ts +1 -1
- package/dist-types/packages/peach-kit/src/ios-tint.d.ts +2 -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/CoreFoundation.framework/Headers/CFCGTypes.h +0 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIControl.h +0 -26
- package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +27 -0
- package/sdk/ios/usr/include/AvailabilityInternal.h +2 -2
- package/sdk/ios/usr/include/ObjectiveC.apinotes +380 -7
- package/sdk/ios/usr/include/peach/pthread.h +1 -7
- package/sdk/ios/wasm/include/TargetConditionals.h +2 -3
- package/sdk/ios/wasm/include/__struct_timeval.h +15 -0
- package/sdk/ios/wasm/include/__typedef_suseconds_t.h +9 -0
- package/sdk/ios/wasm/include/limits.h +1 -1
- package/sdk/ios/wasm/include/machine/_types.h +1 -1
- package/sdk/ios/wasm/include/machine/limits.h +1 -1
- package/sdk/ios/wasm/include/machine/param.h +2 -2
- package/sdk/ios/wasm/include/math.h +13 -0
- package/sdk/ios/wasm/include/pthread.h +1 -13
- package/sdk/ios/wasm/include/sys/resource.h +3 -0
- package/sdk/ios/wasm/include/sys/socket.h +0 -10
- package/sdk/ios/wasm/include/sys/stat.h +5 -2
- package/sdk/ios/wasm/include/sys/time.h +16 -3
- package/sdk/ios/wasm/include/sys/types.h +4 -1
- package/sdk/ios/wasm/include/time.h +2 -0
- package/sdk/ios/wasm/storage-include/TargetConditionals.h +2 -3
- package/sdk/native-hashes.json +14 -14
- package/src/metro-production-bundle.ts +15 -2
- package/src/native-slices.ts +3 -2
- package/src/native-static-libraries.ts +23 -23
- package/src/native-swift-slices.ts +2 -2
- package/src/nitro-adapter.lock.json +288 -288
- package/src/nitro-compiler-digest.ts +0 -1
- package/src/nitro-dependencies.ts +8 -9
- package/src/nitro-superset.lock.json +4 -4
- package/src/react-native-core-build.ts +2 -2
- package/src/swift-compile.ts +209 -47
- package/src/swift-compiler-digest.ts +2 -0
- package/src/swift-cxx-standin.ts +1 -1
- package/src/swift-darwin-records.ts +4 -4
- package/src/swift-distribution-contract.ts +2 -2
- package/src/swift-distribution.lock.json +13 -12
- package/src/swift-guest-compile.ts +6 -5
- package/src/swift-guest-image-ledger.ts +5 -5
- package/src/swift-guest-link.ts +1 -1
- package/src/swift-guest-linked-spans.ts +7 -4
- package/src/swift-guest-manifest.ts +2 -2
- package/src/swift-guest-source-inputs.ts +16 -5
- package/src/swift-host.ts +10 -5
- package/src/swift-icu.ts +1 -1
- package/src/swift-objc-compile.ts +9 -4
- package/src/swift-objc-standin.ts +1 -4
- package/src/swift-package-manifest.ts +5 -1
- package/src/swift-packages.ts +2 -2
- package/src/swift-shared-sdk.ts +1 -1
- package/src/swift-standin-emit.ts +3 -16
- package/src/swift-standins.ts +119 -87
- package/src/swift-toolchain.ts +37 -1
- package/src/swift-uniform-type-constants.ts +1 -1
- package/src/swift-wasm-prune.ts +17 -12
- package/src/swiftGuestImageContract.ts +4 -4
- package/src/swiftNativePinContract.ts +1 -1
- package/src/swiftRuntimeProductContract.ts +1 -1
- package/src/turbo-runtime.lock.json +28 -28
- package/src/wasm-narrow-boundary.ts +296 -0
- package/src/wasm-optimize.ts +59 -14
- package/src/xcode-project.ts +6 -4
package/src/wasm-optimize.ts
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { execFile } from 'node:child_process'
|
|
2
|
+
import { existsSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
|
|
3
|
+
import { dirname, join } from 'node:path'
|
|
4
|
+
import { promisify } from 'node:util'
|
|
3
5
|
import { installVerifiedTarball } from '@contrast/runtime-delivery'
|
|
4
6
|
import { BINARYEN_VERSION, wasmOpt } from 'wasm-opt'
|
|
5
7
|
import { windowAdmission } from './admitted-mac-build'
|
|
6
8
|
import { rnxHomeDir } from './home-paths'
|
|
9
|
+
import {
|
|
10
|
+
dropBoundaryExports,
|
|
11
|
+
NARROW_MERGE_NAMES,
|
|
12
|
+
narrowWasmBoundary,
|
|
13
|
+
} from './wasm-narrow-boundary'
|
|
7
14
|
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
15
|
+
// the linked wasm64 executable, made loadable: its host boundary narrowed to
|
|
16
|
+
// 32 bits and its memory and table lowered to 32-bit addresses, so pointers stay
|
|
17
|
+
// 8 bytes in memory while every browser runs the module. clang's own optimizer
|
|
18
|
+
// pass is off (-O0 on the link) so the artifact never depends on the machine;
|
|
19
|
+
// the pinned Binaryen size-optimizes once per cached artifact instead. the
|
|
20
|
+
// features are the ones the link declares.
|
|
12
21
|
const FEATURES = [
|
|
22
|
+
'memory64',
|
|
13
23
|
'threads',
|
|
14
24
|
'bulk-memory',
|
|
15
25
|
'bulk-memory-opt',
|
|
@@ -25,8 +35,10 @@ const FEATURES = [
|
|
|
25
35
|
// PEACH_SWIFT_NAMES=1 keeps the name section so a trap stack names its functions.
|
|
26
36
|
export const KEEP_WASM_NAMES = process.env.PEACH_SWIFT_NAMES === '1'
|
|
27
37
|
|
|
38
|
+
const LOWERING = ['--memory64-lowering', '--table64-lowering']
|
|
39
|
+
|
|
28
40
|
/** feeds the artifact hash: a new optimizer or flag set is a new artifact. */
|
|
29
|
-
export const
|
|
41
|
+
export const WASM_LOWER_IDENTITY = `binaryen ${BINARYEN_VERSION} narrow ${LOWERING.join(' ')} ${FEATURES.join(',')} unoptimized-names`
|
|
30
42
|
|
|
31
43
|
// the sha256 of each Binaryen release archive wasm-opt resolves for its own platform
|
|
32
44
|
// keys; update both when the wasm-opt package moves BINARYEN_VERSION.
|
|
@@ -61,6 +73,7 @@ const BINARYEN_RELEASES = new Map([
|
|
|
61
73
|
async function runWasmOpt(
|
|
62
74
|
file: string,
|
|
63
75
|
output: string,
|
|
76
|
+
optimize: boolean,
|
|
64
77
|
skipPasses: readonly string[],
|
|
65
78
|
binary: string,
|
|
66
79
|
): Promise<void> {
|
|
@@ -73,18 +86,44 @@ async function runWasmOpt(
|
|
|
73
86
|
? Math.min(admittedCores, requestedCores)
|
|
74
87
|
: admittedCores,
|
|
75
88
|
)
|
|
89
|
+
const features = FEATURES.map((feature) => `--enable-${feature}`)
|
|
90
|
+
// an unoptimized link keeps its name section, as before lowering, so a trap names its function
|
|
91
|
+
const names = optimize && !KEEP_WASM_NAMES ? [] : ['-g']
|
|
92
|
+
const narrowed = narrowWasmBoundary(readFileSync(file))
|
|
93
|
+
const merged = `${output}.narrowed`
|
|
94
|
+
if (narrowed) {
|
|
95
|
+
const guest = `${output}.guest`
|
|
96
|
+
const thunks = `${output}.thunks.wat`
|
|
97
|
+
writeFileSync(guest, narrowed.module)
|
|
98
|
+
writeFileSync(thunks, narrowed.thunks)
|
|
99
|
+
await promisify(execFile)(join(dirname(binary), 'wasm-merge'), [
|
|
100
|
+
...features,
|
|
101
|
+
...names,
|
|
102
|
+
guest,
|
|
103
|
+
NARROW_MERGE_NAMES.guest,
|
|
104
|
+
thunks,
|
|
105
|
+
NARROW_MERGE_NAMES.boundary,
|
|
106
|
+
'-o',
|
|
107
|
+
merged,
|
|
108
|
+
])
|
|
109
|
+
writeFileSync(merged, dropBoundaryExports(readFileSync(merged)))
|
|
110
|
+
rmSync(guest)
|
|
111
|
+
rmSync(thunks)
|
|
112
|
+
}
|
|
76
113
|
const result = await wasmOpt(
|
|
77
114
|
[
|
|
78
|
-
|
|
79
|
-
...(
|
|
115
|
+
...LOWERING,
|
|
116
|
+
...(optimize ? ['-Oz'] : []),
|
|
117
|
+
...names,
|
|
80
118
|
...skipPasses.flatMap((pass) => ['--skip-pass', pass]),
|
|
81
|
-
...
|
|
82
|
-
file,
|
|
119
|
+
...features,
|
|
120
|
+
narrowed ? merged : file,
|
|
83
121
|
'-o',
|
|
84
122
|
output,
|
|
85
123
|
],
|
|
86
124
|
{ env: environment },
|
|
87
125
|
)
|
|
126
|
+
if (narrowed) rmSync(merged)
|
|
88
127
|
if (result.status !== 0)
|
|
89
128
|
throw new Error(`wasm-opt exited ${result.status}: ${result.stderr}`)
|
|
90
129
|
}
|
|
@@ -110,10 +149,16 @@ async function installWasmOpt(): Promise<string> {
|
|
|
110
149
|
return binary
|
|
111
150
|
}
|
|
112
151
|
|
|
113
|
-
export async function
|
|
152
|
+
export async function lowerWasm(
|
|
114
153
|
file: string,
|
|
115
154
|
output: string,
|
|
116
|
-
|
|
155
|
+
options: { optimize: boolean; skipPasses?: readonly string[] },
|
|
117
156
|
): Promise<void> {
|
|
118
|
-
await runWasmOpt(
|
|
157
|
+
await runWasmOpt(
|
|
158
|
+
file,
|
|
159
|
+
output,
|
|
160
|
+
options.optimize,
|
|
161
|
+
options.skipPasses ?? [],
|
|
162
|
+
await installWasmOpt(),
|
|
163
|
+
)
|
|
119
164
|
}
|
package/src/xcode-project.ts
CHANGED
|
@@ -105,7 +105,7 @@ export interface XcodeModuleTarget {
|
|
|
105
105
|
/** the compilation conditions the build configuration defines, as `-D` passes them. */
|
|
106
106
|
defines: string[]
|
|
107
107
|
/** the resolved source iOS minimum, including for native package dependencies. */
|
|
108
|
-
iosDeploymentTarget: string
|
|
108
|
+
iosDeploymentTarget: string
|
|
109
109
|
/** the build settings xcode's asset catalog compile reads, by name, empty ones omitted. */
|
|
110
110
|
assetSettings: Record<string, string>
|
|
111
111
|
/** original swift settings and the compatibility products declared by CocoaPods. */
|
|
@@ -2441,7 +2441,8 @@ export function readXcodeAppTarget(
|
|
|
2441
2441
|
languageMode: swiftVersion >= 6 ? 6 : 5,
|
|
2442
2442
|
mainActorIsolation: settings('SWIFT_DEFAULT_ACTOR_ISOLATION') === 'MainActor',
|
|
2443
2443
|
defines: compilationConditions(settings),
|
|
2444
|
-
iosDeploymentTarget:
|
|
2444
|
+
iosDeploymentTarget:
|
|
2445
|
+
settings('IPHONEOS_DEPLOYMENT_TARGET') || XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET,
|
|
2445
2446
|
assetSettings: {
|
|
2446
2447
|
IPHONEOS_DEPLOYMENT_TARGET: XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET,
|
|
2447
2448
|
...Object.fromEntries(
|
|
@@ -2812,11 +2813,12 @@ export function readXcodeAppTarget(
|
|
|
2812
2813
|
value === 'YES' ? true : value === 'NO' ? false : value
|
|
2813
2814
|
}
|
|
2814
2815
|
if (settings('GENERATE_INFOPLIST_FILE') === 'YES') {
|
|
2815
|
-
const
|
|
2816
|
+
const generated = {
|
|
2817
|
+
CFBundleDevelopmentRegion: 'DEVELOPMENT_LANGUAGE',
|
|
2816
2818
|
CFBundleShortVersionString: 'MARKETING_VERSION',
|
|
2817
2819
|
CFBundleVersion: 'CURRENT_PROJECT_VERSION',
|
|
2818
2820
|
}
|
|
2819
|
-
for (const [key, setting] of Object.entries(
|
|
2821
|
+
for (const [key, setting] of Object.entries(generated)) {
|
|
2820
2822
|
const value = settings(setting)
|
|
2821
2823
|
if (info[key] === undefined && value) info[key] = value
|
|
2822
2824
|
}
|