peachsim 0.1.2222 → 0.1.2224
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/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 +45 -29
- 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 +43 -27
- 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 +45 -29
- package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
- 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 +4 -4
- 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 +4 -4
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- 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 +24 -24
- package/dist-lib/public-origins-lib.json +53 -53
- 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 +46 -29
- package/dist-lib/swift-compile.cjs +24 -8
- package/dist-lib/swift-compile.mjs +24 -8
- 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 +41 -25
- package/dist-lib/vite.cjs +4 -4
- 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 +2 -1
- package/dist-types/packages/peach-engine/src/engine/glass-material.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +3 -6
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/browser-object-url.d.ts +10 -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/UIKit.framework/Headers/UISegmentedControl.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBar.h +1 -1
- package/src/conformance-comparison-contract.ts +9 -9
- package/src/conformance-pixel-comparison.ts +16 -3
- package/src/swift-compile.ts +4 -4
- package/src/swift-host.ts +23 -26
- package/src/swift-root-lock.ts +27 -4
- package/src/vite-plugin.ts +6 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const BrowserURL: {
|
|
2
|
+
new (url: string | URL, base?: string | URL): URL;
|
|
3
|
+
prototype: URL;
|
|
4
|
+
canParse(url: string | URL, base?: string | URL): boolean;
|
|
5
|
+
createObjectURL(obj: Blob | MediaSource): string;
|
|
6
|
+
parse(url: string | URL, base?: string | URL): URL | null;
|
|
7
|
+
revokeObjectURL(url: string): void;
|
|
8
|
+
};
|
|
9
|
+
export declare const createBrowserObjectURL: (obj: Blob | MediaSource) => string;
|
|
10
|
+
export declare const revokeBrowserObjectURL: (url: string) => void;
|
package/kotlin/sdk.tar.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/runtime-companion.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"abi":1,"sha256":"
|
|
1
|
+
{"abi":1,"sha256":"ef38a3e8be87c77f4035640cf265efa9aff735577a2de14feb63c8a09afabd42","file":"node/cli-ef38a3e8be87c77f4035640cf265efa9aff735577a2de14feb63c8a09afabd42.cjs"}
|
|
@@ -40,7 +40,7 @@ typedef NS_ENUM(NSInteger, UISegmentedControlSegment) {
|
|
|
40
40
|
@class UIImage, UIColor;
|
|
41
41
|
|
|
42
42
|
UIKIT_EXTERN API_AVAILABLE(ios(2.0)) API_UNAVAILABLE(watchos) NS_SWIFT_UI_ACTOR
|
|
43
|
-
@interface UISegmentedControl : UIControl <NSCoding>
|
|
43
|
+
PEACH_SWIFT_CLASS(UIKitCore) @interface UISegmentedControl : UIControl <NSCoding>
|
|
44
44
|
|
|
45
45
|
- (instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;
|
|
46
46
|
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
|
|
@@ -22,7 +22,7 @@ NS_HEADER_AUDIT_BEGIN(nullability, sendability)
|
|
|
22
22
|
@protocol UITabBarDelegate;
|
|
23
23
|
|
|
24
24
|
UIKIT_EXTERN API_AVAILABLE(ios(2.0)) API_UNAVAILABLE(watchos) NS_SWIFT_UI_ACTOR
|
|
25
|
-
@interface UITabBar : UIView
|
|
25
|
+
PEACH_SWIFT_CLASS(UIKitCore) @interface UITabBar : UIView
|
|
26
26
|
|
|
27
27
|
@property(nullable, nonatomic, weak) id<UITabBarDelegate> delegate; // weak reference. default is nil
|
|
28
28
|
@property(nullable, nonatomic, copy) NSArray<UITabBarItem *> *items; // get/set visible UITabBarItems. default is nil. changes not animated. shown in order
|
|
@@ -121,15 +121,6 @@ export function outsideDisplayPixels(
|
|
|
121
121
|
height: number,
|
|
122
122
|
): Uint8Array | null {
|
|
123
123
|
const count = width * height
|
|
124
|
-
let anyTransparent = false
|
|
125
|
-
for (let i = 0; i < count; i++) {
|
|
126
|
-
if (candidate[i * 4 + 3] !== 255) {
|
|
127
|
-
anyTransparent = true
|
|
128
|
-
break
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (!anyTransparent) return null
|
|
132
|
-
|
|
133
124
|
// a compared frame is the physical framebuffer or a one-pixel common-area
|
|
134
125
|
// crop of it (commonAreaSize), so the lookup probes the crop back up.
|
|
135
126
|
const spec =
|
|
@@ -168,6 +159,15 @@ export function outsideDisplayPixels(
|
|
|
168
159
|
return null
|
|
169
160
|
}
|
|
170
161
|
|
|
162
|
+
let anyTransparent = false
|
|
163
|
+
for (let i = 0; i < count; i++) {
|
|
164
|
+
if (candidate[i * 4 + 3] !== 255) {
|
|
165
|
+
anyTransparent = true
|
|
166
|
+
break
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (!anyTransparent) return null
|
|
170
|
+
|
|
171
171
|
const outside = new Uint8Array(count)
|
|
172
172
|
const corners = [
|
|
173
173
|
{ x0: 0, y0: 0, cx: radiiPx.topLeft, cy: radiiPx.topLeft, r: radiiPx.topLeft },
|
|
@@ -132,11 +132,24 @@ export function compareConformancePixels(options: {
|
|
|
132
132
|
}
|
|
133
133
|
if (identical) {
|
|
134
134
|
options.diff?.fill(0)
|
|
135
|
+
const columns = Math.ceil(options.width)
|
|
136
|
+
const excludedColumns =
|
|
137
|
+
region.cornerRadius > 0
|
|
138
|
+
? Math.min(
|
|
139
|
+
columns,
|
|
140
|
+
Math.ceil(region.cornerRadius) +
|
|
141
|
+
columns -
|
|
142
|
+
Math.max(0, Math.ceil(options.width - region.cornerRadius)),
|
|
143
|
+
)
|
|
144
|
+
: 0
|
|
135
145
|
let totalPixels = 0
|
|
136
146
|
for (let y = region.yStart; y < region.yEnd; y++) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
147
|
+
const globalY = region.globalYStart + y
|
|
148
|
+
totalPixels +=
|
|
149
|
+
globalY < region.cornerRadius ||
|
|
150
|
+
globalY >= region.fullHeight - region.cornerRadius
|
|
151
|
+
? columns - excludedColumns
|
|
152
|
+
: columns
|
|
140
153
|
}
|
|
141
154
|
return { differingPixels: 0, totalPixels }
|
|
142
155
|
}
|
package/src/swift-compile.ts
CHANGED
|
@@ -5337,10 +5337,10 @@ export function writeSwiftProject(
|
|
|
5337
5337
|
const moduleName = swiftTargetModuleName(name)
|
|
5338
5338
|
const originalMap = originalMaps.get(moduleName)
|
|
5339
5339
|
const stagedMap = sourceModuleMaps.get(moduleName)
|
|
5340
|
-
const originalPath =
|
|
5341
|
-
? path.join(layout.root, originalMap)
|
|
5342
|
-
|
|
5343
|
-
|
|
5340
|
+
const originalPath =
|
|
5341
|
+
stagedMap?.path ?? (originalMap ? path.join(layout.root, originalMap) : undefined)
|
|
5342
|
+
const originalContents =
|
|
5343
|
+
stagedMap?.contents ?? (originalMap && input.files[originalMap])
|
|
5344
5344
|
const originalTokens = originalContents ? moduleMapTokens(originalContents) : []
|
|
5345
5345
|
if (
|
|
5346
5346
|
originalPath &&
|
package/src/swift-host.ts
CHANGED
|
@@ -2812,6 +2812,28 @@ export function compileInput(
|
|
|
2812
2812
|
)
|
|
2813
2813
|
}
|
|
2814
2814
|
|
|
2815
|
+
export function swiftBuildRoot(packagePath: string, moduleRoot: string): string {
|
|
2816
|
+
if (process.env.CONTRAST_SWIFT_BUILD_ROOT) return process.env.CONTRAST_SWIFT_BUILD_ROOT
|
|
2817
|
+
const resolvedPath = path.resolve(packagePath)
|
|
2818
|
+
const parts = resolvedPath.split(path.sep)
|
|
2819
|
+
const scopedAt = Math.max(
|
|
2820
|
+
parts.lastIndexOf('peach-expo-swift'),
|
|
2821
|
+
parts.lastIndexOf('peach-nitro-swift'),
|
|
2822
|
+
)
|
|
2823
|
+
const buildKeyPath =
|
|
2824
|
+
scopedAt >= 0 && parts.length >= scopedAt + 3
|
|
2825
|
+
? parts.slice(0, scopedAt + 2).join(path.sep)
|
|
2826
|
+
: (sourceEntries().get(resolvedPath) ?? resolvedPath)
|
|
2827
|
+
return path.join(
|
|
2828
|
+
swiftCacheDir(),
|
|
2829
|
+
'swift-builds',
|
|
2830
|
+
createHash('sha256')
|
|
2831
|
+
.update(`${moduleRoot}\0${buildKeyPath}`)
|
|
2832
|
+
.digest('hex')
|
|
2833
|
+
.slice(0, 16),
|
|
2834
|
+
)
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2815
2837
|
// the compile input of an installed workspace with the binary frameworks its
|
|
2816
2838
|
// pods and project vendor, read from one layout.
|
|
2817
2839
|
export function installedWorkspaceInput(
|
|
@@ -2922,32 +2944,7 @@ async function compile(
|
|
|
2922
2944
|
// building each other's sources. each app and module checkout still gets
|
|
2923
2945
|
// its own root, so they do not queue and the same app keeps its
|
|
2924
2946
|
// incremental build across restarts.
|
|
2925
|
-
buildRoot: (
|
|
2926
|
-
if (process.env.CONTRAST_SWIFT_BUILD_ROOT)
|
|
2927
|
-
return process.env.CONTRAST_SWIFT_BUILD_ROOT
|
|
2928
|
-
const resolvedPath = path.resolve(packagePath)
|
|
2929
|
-
// units of one app or nitro module share a root so the module cache stays
|
|
2930
|
-
// warm across server restarts: peach-expo-swift/<app>/<scope>/<package>
|
|
2931
|
-
// and peach-nitro-swift/<module>/<scope> share <app> or <module>.
|
|
2932
|
-
// servers on one app or module queue on the root lock.
|
|
2933
|
-
const parts = resolvedPath.split(path.sep)
|
|
2934
|
-
const scopedAt = Math.max(
|
|
2935
|
-
parts.lastIndexOf('peach-expo-swift'),
|
|
2936
|
-
parts.lastIndexOf('peach-nitro-swift'),
|
|
2937
|
-
)
|
|
2938
|
-
const buildKeyPath =
|
|
2939
|
-
scopedAt >= 0 && parts.length >= scopedAt + 3
|
|
2940
|
-
? parts.slice(0, scopedAt + 2).join(path.sep)
|
|
2941
|
-
: (sourceEntries().get(resolvedPath) ?? resolvedPath)
|
|
2942
|
-
return path.join(
|
|
2943
|
-
swiftCacheDir(),
|
|
2944
|
-
'swift-builds',
|
|
2945
|
-
createHash('sha256')
|
|
2946
|
-
.update(`${moduleRoot}\0${buildKeyPath}`)
|
|
2947
|
-
.digest('hex')
|
|
2948
|
-
.slice(0, 16),
|
|
2949
|
-
)
|
|
2950
|
-
})(),
|
|
2947
|
+
buildRoot: swiftBuildRoot(packagePath, moduleRoot),
|
|
2951
2948
|
moduleRoot,
|
|
2952
2949
|
...toolchain,
|
|
2953
2950
|
signal,
|
package/src/swift-root-lock.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { readProcessTable, type ProcessRow } from './process-table.ts'
|
|
|
20
20
|
import type { Readable, Writable } from 'node:stream'
|
|
21
21
|
|
|
22
22
|
const POLL_MS = 250
|
|
23
|
+
const INSPECT_ATTEMPTS = 5
|
|
23
24
|
// ps derives a start time from the boot time, which drifts by a second or two
|
|
24
25
|
// on linux; a reused pid starts later than this.
|
|
25
26
|
const START_TOLERANCE_MS = 2_000
|
|
@@ -53,6 +54,24 @@ function processTable(pid?: number): ProcessRow[] {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
|
|
57
|
+
// a loaded host can stall ps past its deadline once without the table being
|
|
58
|
+
// broken, and the lock only ever waits on that answer, so lock acquisition
|
|
59
|
+
// asks again before giving up.
|
|
60
|
+
async function processTableWithRetry(
|
|
61
|
+
pid: number | undefined,
|
|
62
|
+
signal: AbortSignal | undefined,
|
|
63
|
+
): Promise<ProcessRow[]> {
|
|
64
|
+
for (let attempt = 1; ; attempt++) {
|
|
65
|
+
try {
|
|
66
|
+
return processTable(pid)
|
|
67
|
+
} catch (error) {
|
|
68
|
+
if (attempt >= INSPECT_ATTEMPTS) throw error
|
|
69
|
+
await pause(POLL_MS * attempt, signal)
|
|
70
|
+
signal?.throwIfAborted()
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
56
75
|
function sameProcess(row: ProcessRow, identity: Identity): boolean {
|
|
57
76
|
return (
|
|
58
77
|
row.pid === identity.pid && Math.abs(row.start - identity.start) <= START_TOLERANCE_MS
|
|
@@ -204,7 +223,11 @@ export async function withSwiftRootLock<T>(
|
|
|
204
223
|
)
|
|
205
224
|
mkdirSync(directory, { recursive: true })
|
|
206
225
|
const token = randomUUID()
|
|
207
|
-
const
|
|
226
|
+
const ownRow = (await processTableWithRetry(process.pid, signal)).find(
|
|
227
|
+
(candidate) => candidate.pid === process.pid && !candidate.zombie,
|
|
228
|
+
)
|
|
229
|
+
if (!ownRow) throw new Error(`swift root lock cannot find process ${process.pid}`)
|
|
230
|
+
const owner = JSON.stringify({ pid: process.pid, start: ownRow.start })
|
|
208
231
|
const pending = path.join(directory, `pending.${token}`)
|
|
209
232
|
let held = 0
|
|
210
233
|
for (;;) {
|
|
@@ -213,15 +236,15 @@ export async function withSwiftRootLock<T>(
|
|
|
213
236
|
const current = newest > 0 ? readGeneration(directory, newest) : null
|
|
214
237
|
if (newest > 0 && !current) continue
|
|
215
238
|
if (current && !current.released) {
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
239
|
+
const holder = await processTableWithRetry(current.holder.pid, signal)
|
|
240
|
+
if (holder.some((row) => !row.zombie && sameProcess(row, current.holder))) {
|
|
218
241
|
if (!wait) return undefined
|
|
219
242
|
await pause(POLL_MS, signal)
|
|
220
243
|
continue
|
|
221
244
|
}
|
|
222
245
|
const children = readChildren(directory, newest)
|
|
223
246
|
if (children.length) {
|
|
224
|
-
const table =
|
|
247
|
+
const table = await processTableWithRetry(undefined, signal)
|
|
225
248
|
if (children.some((child) => groupAlive(table, child))) {
|
|
226
249
|
if (!wait) return undefined
|
|
227
250
|
await pause(POLL_MS, signal)
|
package/src/vite-plugin.ts
CHANGED
|
@@ -839,11 +839,16 @@ export function hostBootChunkPlugin(): Plugin {
|
|
|
839
839
|
}
|
|
840
840
|
},
|
|
841
841
|
outputOptions(options) {
|
|
842
|
+
const chunkFileNames = options.chunkFileNames ?? 'assets/[name]-[hash].js'
|
|
842
843
|
return {
|
|
843
844
|
...options,
|
|
844
845
|
// host resource urls are relative to the runtime root.
|
|
845
846
|
chunkFileNames: (chunk) =>
|
|
846
|
-
chunk.name === 'host-home'
|
|
847
|
+
chunk.name === 'host-home'
|
|
848
|
+
? 'host-home-[hash].js'
|
|
849
|
+
: typeof chunkFileNames === 'function'
|
|
850
|
+
? chunkFileNames(chunk)
|
|
851
|
+
: chunkFileNames,
|
|
847
852
|
strictExecutionOrder: true,
|
|
848
853
|
codeSplitting: {
|
|
849
854
|
groups: [
|