peachsim 0.1.2441 → 0.1.2457
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/README.md +4 -49
- package/cli/app-catalog.ts +8 -7
- package/cli/app-stubs.ts +98 -70
- package/cli/cloud-box-artifact.ts +2 -5
- package/cli/cloud-client.ts +12 -1
- package/cli/commands/box.ts +41 -2
- package/cli/commands/compat.ts +5 -3
- package/cli/commands/cpu-profile.ts +11 -14
- package/cli/commands/diagnose.ts +5 -18
- package/cli/commands/inspect/describe.ts +4 -8
- package/cli/commands/maestro-generate.ts +4 -8
- package/cli/commands/mode.ts +3 -19
- package/cli/commands/perf.ts +3 -19
- package/cli/commands/permissions.ts +2 -6
- package/cli/commands/platform.ts +22 -14
- package/cli/commands/react.ts +7 -21
- package/cli/commands/record-three.ts +6 -10
- package/cli/commands/record.ts +38 -62
- package/cli/commands/screenshot-command.ts +8 -25
- package/cli/commands/storage.ts +4 -16
- package/cli/commands/three-mode.ts +6 -10
- package/cli/outbound-endpoints.ts +4 -5
- package/cli/parse-args.ts +45 -0
- package/cli/remote-metro.ts +1 -1
- package/cli/remote-simulators.ts +5 -1
- package/cli/send-to-box.ts +3 -1
- package/detox/index.ts +20 -1
- package/dist-lib/agent-daemon-client.cjs +2 -2
- 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 +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +240 -316
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +14 -1
- package/dist-lib/cloud-contract.mjs +5 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -6
- package/dist-lib/config.mjs +5 -9
- package/dist-lib/detox/index.cjs +17 -5
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-FRQNHKFC.mjs → acorn-73XUBXBT.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-IRMC5BCX.mjs → chunk-7V2QJGVI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-PMGJ7FLI.mjs → chunk-BHQEYJAF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BAYRN7ZL.mjs → chunk-DSPFMVBM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4HEUXQGM.mjs → chunk-GA73RJSG.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-ABMB3G7I.mjs → chunk-IGBAFWZ3.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-ZCMAKWHN.mjs → chunk-IKZDUGT6.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VAQJQDWI.mjs → chunk-IP5ZV36U.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-O4EOBXAP.mjs → chunk-KGHQ4GK2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4BZ3Z3IQ.mjs → chunk-KY63O76W.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-QYYJESMK.mjs → chunk-LJ74MO6Y.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-DJMWTW2B.mjs → chunk-LJX42YVT.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-XO5GX4PI.mjs → chunk-O4KAW2JJ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6A6JEVIF.mjs → chunk-OIFM356B.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-NPLEBOWJ.mjs → chunk-P63DPATT.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VCAJFWZD.mjs → chunk-SCCOZKCP.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QUBR7LHU.mjs → chunk-TAZL253K.mjs} +41 -15
- package/dist-lib/esm-chunks/{chunk-ORYS5CC4.mjs → chunk-UBXCWZL3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4ZRMJ5YO.mjs → chunk-ZQWWO33G.mjs} +14 -2
- package/dist-lib/esm-chunks/{metro-layout-parser-AUAVE5VL.mjs → metro-layout-parser-HNQRTPVE.mjs} +3 -3
- package/dist-lib/expo-swift-bundle.cjs +197 -336
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +276 -381
- package/dist-lib/host/fetch-proxy-handler.cjs +35 -43
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +4 -2
- package/dist-lib/index.cjs +2 -105
- package/dist-lib/kotlin-host.cjs +6 -4
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +12 -12
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +64 -64
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +107 -85
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -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 +7 -7
- package/dist-lib/skills.cjs +310 -310
- package/dist-lib/swift-compile.cjs +37 -11
- package/dist-lib/swift-compile.mjs +8 -8
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +5 -5
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +14770 -0
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +2790 -0
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/bplist-parser.cjs +1 -1
- package/dist-lib/vendor/ignore.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/plist.cjs +1 -1
- package/dist-lib/vendor/prism.wasm +0 -0
- package/dist-lib/vendor/smol-toml.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +3710 -0
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts +0 -3
- package/dist-types/packages/peach-engine/src/config.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/text-line-break.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/engine/text-paint.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/text-runs.d.ts +6 -1
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +22 -14
- package/skills/peach-setup/references/native-config.md +3 -3
- package/src/app-config.ts +7 -15
- package/src/cloud-contract.ts +35 -0
- package/src/config.ts +2 -6
- package/src/estree-walk.ts +13 -0
- package/src/host/network-policy.ts +4 -1
- package/src/index.ts +0 -1
- package/src/one-native-app-config.ts +14 -15
- package/src/podspec-prism.ts +7 -1
- package/src/process-group.ts +4 -1
- package/src/process-table.ts +6 -1
- package/src/swift-compile.ts +38 -8
- package/src/swift-host.ts +10 -4
- package/cli/commands/box/bundle-plane.ts +0 -154
- package/dist-lib/jump-to-source-babel.cjs +0 -131
- package/dist-lib/jump-to-source-native.cjs +0 -235
- package/src/java-static-imports.ts +0 -68
- package/src/jump-to-source-babel.ts +0 -143
- package/src/jump-to-source-native.ts +0 -200
- package/src/kotlin-jvm-sources.ts +0 -35
package/dist-lib/vendor/zod.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2457 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2457 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2457 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
parse
|
|
4
|
-
} from "./esm-chunks/chunk-
|
|
4
|
+
} from "./esm-chunks/chunk-BHQEYJAF.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__privateAdd,
|
|
7
7
|
__privateGet,
|
|
8
8
|
__publicField
|
|
9
|
-
} from "./esm-chunks/chunk-
|
|
9
|
+
} from "./esm-chunks/chunk-LJ74MO6Y.mjs";
|
|
10
10
|
|
|
11
11
|
// src/worklet-kernel.ts
|
|
12
12
|
var Unsupported = class extends Error {
|
package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts
CHANGED
|
@@ -44,9 +44,6 @@ interface HandlerEntry {
|
|
|
44
44
|
viewIsUIControl: boolean;
|
|
45
45
|
state: number;
|
|
46
46
|
lastPointer: LastPointer;
|
|
47
|
-
cleanup: (() => void) | null;
|
|
48
|
-
cleanupConsumed: boolean;
|
|
49
|
-
cleanupRuns: number;
|
|
50
47
|
activationCount: number;
|
|
51
48
|
simultaneousNativeScroll: boolean;
|
|
52
49
|
pointerHandlers: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { PEACH_CONFIG_QUERY_PARAM, applyPeachConfigToUrl, collectConfiguredFileModules,
|
|
1
|
+
export { PEACH_CONFIG_QUERY_PARAM, applyPeachConfigToUrl, collectConfiguredFileModules, hasPeachConfig, matchConfigModule, mergePeachConfig, readPeachConfigFromSearchParams, } from '../../../../src/config.ts';
|
|
2
2
|
export type { PeachConfig, ModuleResolution, NativeModuleResolution, NativeViewResolution, } from '../../../../src/config.ts';
|
|
@@ -445,6 +445,7 @@ export declare class SceneTable {
|
|
|
445
445
|
publishPaintContext(): void;
|
|
446
446
|
paintExtent(slot: number, x: number, y: number, width: number, height: number, skipPortalViews: boolean, subtree: boolean): Float64Array | null;
|
|
447
447
|
node(slot: number): object | undefined;
|
|
448
|
+
parentSlot(slot: number): number;
|
|
448
449
|
describeSlot(slot: number, generation: number): SlotDescription | null;
|
|
449
450
|
writeSharedNode(slot: number, update: {
|
|
450
451
|
boundary?: number;
|
|
@@ -6,16 +6,18 @@ export interface TextHyphenation {
|
|
|
6
6
|
readonly locale: string;
|
|
7
7
|
readonly factor: number;
|
|
8
8
|
}
|
|
9
|
+
export type TextRange = readonly [start: number, end: number];
|
|
9
10
|
export declare function readTextHyphenation(style: {
|
|
10
11
|
_hyphenationLocale?: unknown;
|
|
11
12
|
_hyphenationFactor?: unknown;
|
|
12
13
|
}): TextHyphenation | undefined;
|
|
13
14
|
export declare function textHyphenationKey(hyphenation: TextHyphenation | undefined): string;
|
|
14
15
|
export declare function installEnglishHyphenation(create: () => Hyphenator): void;
|
|
15
|
-
export declare function hyphenateParagraph(text: string, para: Paragraph, width: number, hyphenation: TextHyphenation | undefined, pushOut: boolean, build: (text: string) => Paragraph, rewritePushOut?: boolean): {
|
|
16
|
+
export declare function hyphenateParagraph(text: string, para: Paragraph, width: number, hyphenation: TextHyphenation | undefined, pushOut: boolean, build: (text: string, kernedLines?: readonly TextRange[]) => Paragraph, rewritePushOut?: boolean, kernHyphenatedLines?: boolean): {
|
|
16
17
|
text: string;
|
|
17
18
|
para: Paragraph;
|
|
18
19
|
layoutWidth: number;
|
|
20
|
+
kernedLines?: readonly TextRange[];
|
|
19
21
|
};
|
|
20
22
|
export declare function pushesOutLastWord(strategy: unknown): boolean;
|
|
21
23
|
export declare function relayoutPushOut(para: Paragraph, text: string, width: number, rewrite: boolean): boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TextRange } from './text-line-break.d.ts';
|
|
1
2
|
export { segmentGraphemes } from './grapheme-segmenter.d.ts';
|
|
2
3
|
export declare function isEmojiGrapheme(segment: string): boolean;
|
|
3
4
|
export interface TextRun {
|
|
@@ -14,6 +15,10 @@ export declare function tighteningSpacingAt(graphemes: readonly string[], index:
|
|
|
14
15
|
export interface TextRunStyles {
|
|
15
16
|
base: Record<string, any> & {
|
|
16
17
|
_tightening?: TextTightening;
|
|
18
|
+
fontFeatures?: readonly {
|
|
19
|
+
name: string;
|
|
20
|
+
value: number;
|
|
21
|
+
}[];
|
|
17
22
|
};
|
|
18
23
|
emoji: () => Record<string, any>;
|
|
19
24
|
sfSymbol: (style: Record<string, any>) => SfSymbolTextStyles;
|
|
@@ -40,4 +45,4 @@ export declare function addTextWithFallbackRuns(builder: {
|
|
|
40
45
|
pushStyle(style: any): void;
|
|
41
46
|
pop(): void;
|
|
42
47
|
addPlaceholder?: (width?: number, height?: number, alignment?: any, baseline?: any, offset?: number) => void;
|
|
43
|
-
}, text: string, styles: TextRunStyles): void;
|
|
48
|
+
}, text: string, styles: TextRunStyles, kernedLines?: readonly TextRange[]): void;
|
package/kotlin/sdk.tar.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "peachsim",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2457",
|
|
4
4
|
"description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
|
|
5
5
|
"author": "Tamagui LLC",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -111,13 +111,6 @@
|
|
|
111
111
|
"import": "./dist-lib/react-native-host-modules.mjs",
|
|
112
112
|
"default": "./dist-lib/react-native-host-modules.cjs"
|
|
113
113
|
},
|
|
114
|
-
"./jump-to-source-babel": {
|
|
115
|
-
"default": "./dist-lib/jump-to-source-babel.cjs"
|
|
116
|
-
},
|
|
117
|
-
"./jump-to-source-native": {
|
|
118
|
-
"types": "./src/jump-to-source-native.ts",
|
|
119
|
-
"default": "./dist-lib/jump-to-source-native.cjs"
|
|
120
|
-
},
|
|
121
114
|
"./menu": {
|
|
122
115
|
"import": "./dist-lib/menu.mjs",
|
|
123
116
|
"default": "./dist-lib/menu.cjs"
|
|
@@ -217,6 +210,7 @@
|
|
|
217
210
|
"./detox/jest-preset": {
|
|
218
211
|
"default": "./dist-lib/detox/jest-preset.cjs"
|
|
219
212
|
},
|
|
213
|
+
"./vendor/prism.wasm": "./dist-lib/vendor/prism.wasm",
|
|
220
214
|
"./vendor/*": "./dist-lib/vendor/*.cjs",
|
|
221
215
|
"./package.json": "./package.json",
|
|
222
216
|
"./bundle-channel": {
|
|
@@ -260,12 +254,21 @@
|
|
|
260
254
|
"publish:linux-browser-libs": "bun scripts/linux-browser-libs.ts publish",
|
|
261
255
|
"pack:smoke": "bun scripts/pack-smoke.ts"
|
|
262
256
|
},
|
|
263
|
-
"
|
|
264
|
-
"
|
|
265
|
-
"
|
|
266
|
-
"
|
|
267
|
-
|
|
268
|
-
|
|
257
|
+
"peerDependencies": {
|
|
258
|
+
"bufferutil": "^4.0.1",
|
|
259
|
+
"playwright-core": "^1.64.1",
|
|
260
|
+
"utf-8-validate": ">=5.0.2"
|
|
261
|
+
},
|
|
262
|
+
"peerDependenciesMeta": {
|
|
263
|
+
"bufferutil": {
|
|
264
|
+
"optional": true
|
|
265
|
+
},
|
|
266
|
+
"playwright-core": {
|
|
267
|
+
"optional": true
|
|
268
|
+
},
|
|
269
|
+
"utf-8-validate": {
|
|
270
|
+
"optional": true
|
|
271
|
+
}
|
|
269
272
|
},
|
|
270
273
|
"devDependencies": {
|
|
271
274
|
"@contrast/runtime-delivery": "workspace:*",
|
|
@@ -274,16 +277,20 @@
|
|
|
274
277
|
"@peach/compat": "workspace:*",
|
|
275
278
|
"@peach/globals": "workspace:*",
|
|
276
279
|
"@peculiar/x509": "1.14.3",
|
|
280
|
+
"@ruby/prism": "2.1.0",
|
|
277
281
|
"@types/plist": "3.0.5",
|
|
278
282
|
"@types/ws": "^8.5.13",
|
|
279
283
|
"acorn": "^8.16.0",
|
|
280
284
|
"bplist-parser": "0.3.2",
|
|
281
285
|
"ignore": "7.0.5",
|
|
286
|
+
"jiti": "2.7.0",
|
|
282
287
|
"json5": "^2.2.3",
|
|
283
288
|
"magic-string": "^0.30.21",
|
|
289
|
+
"oxc-parser": "^0.112.0",
|
|
284
290
|
"peach-engine": "workspace:*",
|
|
285
291
|
"peach-kit": "workspace:*",
|
|
286
292
|
"pixelmatch": "catalog:",
|
|
293
|
+
"playwright-core": "1.64.1",
|
|
287
294
|
"plist": "3.1.1",
|
|
288
295
|
"pngjs": "catalog:",
|
|
289
296
|
"rollup": "4.62.2",
|
|
@@ -296,6 +303,7 @@
|
|
|
296
303
|
"typescript": "7.1.0-beta",
|
|
297
304
|
"valibot": "^1.3.1",
|
|
298
305
|
"vite": "8.3.3",
|
|
306
|
+
"ws": "^8.18.0",
|
|
299
307
|
"yaml": "^2.8.3",
|
|
300
308
|
"zod": "4.6.7"
|
|
301
309
|
},
|
|
@@ -14,9 +14,9 @@ shows one missing (an empty view where content belongs, a "native module not
|
|
|
14
14
|
found" error), add it to `peach.config.ts` at the app root:
|
|
15
15
|
|
|
16
16
|
```ts
|
|
17
|
-
import {
|
|
17
|
+
import type { PeachConfig } from 'peachsim/config'
|
|
18
18
|
|
|
19
|
-
export default
|
|
19
|
+
export default {
|
|
20
20
|
packages: {
|
|
21
21
|
// keyed by the package the names live in; `peach doctor` prints it
|
|
22
22
|
'my-app': {
|
|
@@ -28,7 +28,7 @@ export default defineConfig({
|
|
|
28
28
|
},
|
|
29
29
|
'react-native-acme-analytics': 'noop', // every native name it asks for is inert
|
|
30
30
|
},
|
|
31
|
-
}
|
|
31
|
+
} satisfies PeachConfig
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
a view file default-exports a component that receives the native view's
|
package/src/app-config.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs'
|
|
2
|
+
import { createRequire } from 'node:module'
|
|
2
3
|
import path from 'node:path'
|
|
3
|
-
import { createJiti } from 'jiti'
|
|
4
4
|
import { resolveAppProject, type ResolvedAppProject } from '../cli/app-project'
|
|
5
5
|
import { resolveAppStubs, wireSlotMigration, type AppStubs } from '../cli/app-stubs'
|
|
6
|
-
import * as peachConfigModule from './config'
|
|
7
6
|
import { isPeachConfig, type PeachConfig } from './config'
|
|
8
|
-
import { rnxPublicBrand } from './public-brand'
|
|
9
7
|
import { readSettingsProfile } from './settingsContract'
|
|
10
8
|
import { loadStoreKitTestStore } from './storekit-test-store'
|
|
11
9
|
|
|
@@ -74,18 +72,12 @@ async function loadConfigFile(
|
|
|
74
72
|
): Promise<PeachConfig | undefined> {
|
|
75
73
|
if (!project.configPath) return undefined
|
|
76
74
|
try {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
[`${rnxPublicBrand.packageName}/config`]: peachConfigModule,
|
|
84
|
-
},
|
|
85
|
-
})
|
|
86
|
-
const loaded: unknown = project.configPath.endsWith('.json')
|
|
87
|
-
? JSON.parse(readFileSync(project.configPath, 'utf8'))
|
|
88
|
-
: await jiti.import(project.configPath, { default: true })
|
|
75
|
+
const configPath = path.resolve(project.configPath)
|
|
76
|
+
// a long-running server reads the config again after an edit
|
|
77
|
+
delete createRequire(import.meta.url).cache[configPath]
|
|
78
|
+
const loaded: unknown = configPath.endsWith('.json')
|
|
79
|
+
? JSON.parse(readFileSync(configPath, 'utf8'))
|
|
80
|
+
: Reflect.get(await import(configPath), 'default')
|
|
89
81
|
if (!isPeachConfig(loaded)) {
|
|
90
82
|
throw new Error('the default export must be a peach config object')
|
|
91
83
|
}
|
package/src/cloud-contract.ts
CHANGED
|
@@ -242,6 +242,18 @@ export type RnxCloudSimStatus =
|
|
|
242
242
|
|
|
243
243
|
// one simulator as the instance list reports it: the lifecycle view plus the
|
|
244
244
|
// labels it was created with.
|
|
245
|
+
export type MicroSimulatorView = {
|
|
246
|
+
simId: string
|
|
247
|
+
boxId: string
|
|
248
|
+
name: string | null
|
|
249
|
+
device: string | null
|
|
250
|
+
labels: Record<string, string>
|
|
251
|
+
createdAt: number
|
|
252
|
+
status: 'open'
|
|
253
|
+
size: 'micro'
|
|
254
|
+
path: string
|
|
255
|
+
}
|
|
256
|
+
|
|
245
257
|
export interface RnxCloudSimView {
|
|
246
258
|
simId: string
|
|
247
259
|
status: RnxCloudSimStatus
|
|
@@ -348,3 +360,26 @@ export function isRnxCloudSimStatus(value: string): value is RnxCloudSimStatus {
|
|
|
348
360
|
value === 'deleted'
|
|
349
361
|
)
|
|
350
362
|
}
|
|
363
|
+
|
|
364
|
+
// the longest launch url a create may carry. a launch url is a link, not a
|
|
365
|
+
// payload: iOS hands an app a URL, and anything this long is a caller trying
|
|
366
|
+
// to smuggle state through the wrong door.
|
|
367
|
+
const RNX_MAX_LAUNCH_URL_LENGTH = 2048
|
|
368
|
+
|
|
369
|
+
// a launch url is absolute — the app's own scheme (`myapp://path`) or an https
|
|
370
|
+
// universal link. anything else is a normal launch and reads as null, which is
|
|
371
|
+
// what a home-screen tap gives an app.
|
|
372
|
+
export function readRnxLaunchUrl(value: unknown): string | null {
|
|
373
|
+
if (
|
|
374
|
+
typeof value !== 'string' ||
|
|
375
|
+
value.length === 0 ||
|
|
376
|
+
value.length > RNX_MAX_LAUNCH_URL_LENGTH
|
|
377
|
+
) {
|
|
378
|
+
return null
|
|
379
|
+
}
|
|
380
|
+
try {
|
|
381
|
+
return new URL(value).href.length > 0 ? value : null
|
|
382
|
+
} catch {
|
|
383
|
+
return null
|
|
384
|
+
}
|
|
385
|
+
}
|
package/src/config.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// peach.config.ts — per-app module resolution, native stubs, env, state, and settings profiles.
|
|
2
2
|
//
|
|
3
3
|
// usage:
|
|
4
|
-
// import {
|
|
5
|
-
// export default
|
|
4
|
+
// import type { PeachConfig } from 'peachsim/config'
|
|
5
|
+
// export default { modules: { ... }, env: { ... } } satisfies PeachConfig
|
|
6
6
|
|
|
7
7
|
import { isValidRuntimeVersion } from '@contrast/runtime-delivery/version'
|
|
8
8
|
import { findBundleFooter } from '@peach/globals/bundle-global-footer'
|
|
@@ -306,10 +306,6 @@ export function detachPeachBundleConfigFooter(source: string): {
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
export function defineConfig(config: PeachConfig): PeachConfig {
|
|
310
|
-
return config
|
|
311
|
-
}
|
|
312
|
-
|
|
313
309
|
function hasOwnKeys(value: Record<string, unknown> | undefined): boolean {
|
|
314
310
|
return !!value && Object.keys(value).length > 0
|
|
315
311
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isRecord } from './is-record'
|
|
2
|
+
import type { AnyNode } from 'acorn'
|
|
3
|
+
|
|
4
|
+
function isNode(value: unknown): value is AnyNode {
|
|
5
|
+
return isRecord(value) && typeof value.type === 'string'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function visitNodes(node: AnyNode, enter: (node: AnyNode) => void): void {
|
|
9
|
+
enter(node)
|
|
10
|
+
for (const value of Object.values(node))
|
|
11
|
+
for (const child of Array.isArray(value) ? value : [value])
|
|
12
|
+
if (isNode(child)) visitNodes(child, enter)
|
|
13
|
+
}
|
|
@@ -5,7 +5,7 @@ import { pathToFileURL } from 'node:url'
|
|
|
5
5
|
// asked the bridge (or its browser) to send may be sent. the bridge asks at
|
|
6
6
|
// every point it transmits on a page's behalf: each http hop of a proxied
|
|
7
7
|
// request (redirects included), each websocket handshake and each client
|
|
8
|
-
// frame,
|
|
8
|
+
// frame, each tcp relay connection and each udp send. a browser launched through the
|
|
9
9
|
// network policy proxy asks the same policy for the traffic it sends directly.
|
|
10
10
|
// no policy configured means ordinary behavior; a configured policy that is
|
|
11
11
|
// missing, fails to load, throws, rejects, times out or answers anything but
|
|
@@ -34,6 +34,7 @@ export type NetworkEvent =
|
|
|
34
34
|
// a relay socket's endpoint; its bytes are an opaque stream the policy
|
|
35
35
|
// cannot read, so a policy decides on the endpoint alone
|
|
36
36
|
| { kind: 'tcp'; host: string; port: number; tls: boolean }
|
|
37
|
+
| { kind: 'udp'; host: string; port: number }
|
|
37
38
|
// a tls tunnel opened by a browser: opaque to the proxy like tcp
|
|
38
39
|
| { kind: 'tunnel'; host: string; port: number }
|
|
39
40
|
// name resolution can itself send the queried name to a resolver
|
|
@@ -63,6 +64,8 @@ function describeEvent(event: NetworkEvent): string {
|
|
|
63
64
|
return `websocket frame opcode ${event.opcode} (${event.data.byteLength} bytes) to ${new URL(event.url).origin}`
|
|
64
65
|
case 'tcp':
|
|
65
66
|
return `tcp ${event.host}:${event.port}`
|
|
67
|
+
case 'udp':
|
|
68
|
+
return `udp ${event.host}:${event.port}`
|
|
66
69
|
case 'tunnel':
|
|
67
70
|
return `tunnel ${event.host}:${event.port}`
|
|
68
71
|
case 'dns':
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import path from 'node:path'
|
|
3
|
-
import {
|
|
3
|
+
import { parse, type Expression, type ObjectExpression } from 'acorn'
|
|
4
|
+
import { transform } from 'sucrase'
|
|
5
|
+
import { visitNodes } from './estree-walk'
|
|
4
6
|
import { isRecord } from './is-record'
|
|
5
|
-
import { visitParsedProgram } from './visit-parsed-program'
|
|
6
7
|
|
|
7
8
|
const CONFIG_FILES = [
|
|
8
9
|
'vite.config.ts',
|
|
@@ -35,10 +36,6 @@ function staticValue(node: Expression): unknown {
|
|
|
35
36
|
return typeof value === 'number' ? -value : NOT_STATIC
|
|
36
37
|
}
|
|
37
38
|
return NOT_STATIC
|
|
38
|
-
case 'TSAsExpression':
|
|
39
|
-
case 'TSSatisfiesExpression':
|
|
40
|
-
case 'ParenthesizedExpression':
|
|
41
|
-
return staticValue(node.expression)
|
|
42
39
|
case 'ArrayExpression': {
|
|
43
40
|
const items: unknown[] = []
|
|
44
41
|
for (const element of node.elements) {
|
|
@@ -80,16 +77,18 @@ function staticObject(node: ObjectExpression): Record<string, unknown> {
|
|
|
80
77
|
export function readOneNativeApp(root: string): Record<string, unknown> | null {
|
|
81
78
|
const file = oneConfigPath(root)
|
|
82
79
|
if (!file) return null
|
|
83
|
-
const {
|
|
80
|
+
const { code } = transform(fs.readFileSync(file, 'utf8'), {
|
|
81
|
+
transforms: /\.[cm]?ts$/.test(file) ? ['typescript'] : [],
|
|
82
|
+
disableESTransforms: true,
|
|
83
|
+
})
|
|
84
84
|
let app: Record<string, unknown> | null = null
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
85
|
+
visitNodes(parse(code, { ecmaVersion: 'latest', sourceType: 'module' }), (call) => {
|
|
86
|
+
if (app || call.type !== 'CallExpression') return
|
|
87
|
+
if (call.callee.type !== 'Identifier' || call.callee.name !== 'one') return
|
|
88
|
+
const [options] = call.arguments
|
|
89
|
+
if (options?.type !== 'ObjectExpression') return
|
|
90
|
+
const { native } = staticObject(options)
|
|
91
|
+
if (isRecord(native) && isRecord(native.app)) app = native.app
|
|
93
92
|
})
|
|
94
93
|
return app
|
|
95
94
|
}
|
package/src/podspec-prism.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { parsePrism } from '@ruby/prism/src/parsePrism.js'
|
|
|
8
8
|
import type { ProgramNode } from '@ruby/prism/src/nodes.js'
|
|
9
9
|
|
|
10
10
|
declare const __PEACH_PRISM_WASM__: string | undefined
|
|
11
|
+
// the published library ships the wasm under its own export instead
|
|
12
|
+
declare const __PEACH_PRISM_WASM_MODULE__: string | undefined
|
|
11
13
|
|
|
12
14
|
export class RubySyntaxError extends Error {}
|
|
13
15
|
|
|
@@ -20,7 +22,11 @@ function prism(): PrismExports {
|
|
|
20
22
|
typeof __PEACH_PRISM_WASM__ === 'string'
|
|
21
23
|
? Buffer.from(__PEACH_PRISM_WASM__, 'base64')
|
|
22
24
|
: fs.readFileSync(
|
|
23
|
-
createRequire(import.meta.url).resolve(
|
|
25
|
+
createRequire(import.meta.url).resolve(
|
|
26
|
+
typeof __PEACH_PRISM_WASM_MODULE__ === 'string'
|
|
27
|
+
? __PEACH_PRISM_WASM_MODULE__
|
|
28
|
+
: '@ruby/prism/src/prism.wasm',
|
|
29
|
+
),
|
|
24
30
|
)
|
|
25
31
|
let memory: WebAssembly.Memory | null = null
|
|
26
32
|
const EBADF = 8
|
package/src/process-group.ts
CHANGED
|
@@ -15,6 +15,9 @@ import { readProcessTable } from './process-table.ts'
|
|
|
15
15
|
|
|
16
16
|
const GRACEFUL_TIMEOUT_MS = 3_000
|
|
17
17
|
const FORCED_EXIT_TIMEOUT_MS = 1_000
|
|
18
|
+
// confirming exit scans the whole host table, which a busy builder cannot read in
|
|
19
|
+
// the forced-exit window. an unfinished scan would report a gone group as alive.
|
|
20
|
+
const EXIT_SCAN_TIMEOUT_MS = 10_000
|
|
18
21
|
// a thrashing mac takes seconds to spawn each pgrep, so the frozen walk gets
|
|
19
22
|
// the process table's own budget rather than the graceful one.
|
|
20
23
|
const INSPECTION_TIMEOUT_MS = 10_000
|
|
@@ -200,7 +203,7 @@ function processesHaveExited(pids: number[], pgid: number): boolean {
|
|
|
200
203
|
if (!mayExist) return true
|
|
201
204
|
const knownPids = new Set(pids)
|
|
202
205
|
try {
|
|
203
|
-
return !readProcessTable(
|
|
206
|
+
return !readProcessTable(EXIT_SCAN_TIMEOUT_MS).some(
|
|
204
207
|
(row) => (row.pgid === pgid || knownPids.has(row.pid)) && !row.zombie,
|
|
205
208
|
)
|
|
206
209
|
} catch {
|
package/src/process-table.ts
CHANGED
|
@@ -47,7 +47,12 @@ export function readProcessTable(timeoutMs = 10_000, pid?: number): ProcessRow[]
|
|
|
47
47
|
try {
|
|
48
48
|
stat = readFileSync(`/proc/${name}/stat`, 'utf8')
|
|
49
49
|
} catch (error) {
|
|
50
|
-
if (
|
|
50
|
+
if (
|
|
51
|
+
error instanceof Error &&
|
|
52
|
+
'code' in error &&
|
|
53
|
+
(error.code === 'ENOENT' || error.code === 'ESRCH')
|
|
54
|
+
)
|
|
55
|
+
continue
|
|
51
56
|
throw error
|
|
52
57
|
}
|
|
53
58
|
// comm can contain spaces, newlines and parentheses; fields begin after
|
package/src/swift-compile.ts
CHANGED
|
@@ -5488,6 +5488,9 @@ export function writeSwiftProject(
|
|
|
5488
5488
|
}
|
|
5489
5489
|
continue
|
|
5490
5490
|
}
|
|
5491
|
+
const textualIncludes = entries
|
|
5492
|
+
.map(([file]) => file)
|
|
5493
|
+
.filter((file) => /\.(?:inc|inl|ipp|def)$/.test(file))
|
|
5491
5494
|
native.set(target.name, {
|
|
5492
5495
|
path: target.path,
|
|
5493
5496
|
includeDirectory: path.join(layout.root, includes),
|
|
@@ -5495,9 +5498,7 @@ export function writeSwiftProject(
|
|
|
5495
5498
|
lateSources: late.map(([file]) => file.slice(prefix.length)),
|
|
5496
5499
|
exclude: [
|
|
5497
5500
|
...late.map(([file]) => file.slice(prefix.length)),
|
|
5498
|
-
...
|
|
5499
|
-
.filter(([file]) => /\.(?:inc|inl|ipp|def)$/.test(file))
|
|
5500
|
-
.map(([file]) => file.slice(prefix.length)),
|
|
5501
|
+
...textualIncludes.map((file) => file.slice(prefix.length)),
|
|
5501
5502
|
],
|
|
5502
5503
|
...(late.length > 0
|
|
5503
5504
|
? {
|
|
@@ -5510,16 +5511,45 @@ export function writeSwiftProject(
|
|
|
5510
5511
|
}
|
|
5511
5512
|
: {}),
|
|
5512
5513
|
})
|
|
5513
|
-
if (late.length
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5514
|
+
if (late.length === 0) {
|
|
5515
|
+
const headers = path.posix.join(target.path, target.publicHeadersPath ?? 'include')
|
|
5516
|
+
const fragments = textualIncludes.filter(
|
|
5517
|
+
(file) => headers === '.' || file.startsWith(`${headers}/`),
|
|
5518
|
+
)
|
|
5519
|
+
const name = swiftTargetModuleName(target.name)
|
|
5520
|
+
const map = path.posix.join(headers, 'module.modulemap')
|
|
5521
|
+
if (
|
|
5522
|
+
fragments.length > 0 &&
|
|
5523
|
+
!Object.hasOwn(input.files, map) &&
|
|
5524
|
+
!files.has(path.join(layout.root, map)) &&
|
|
5525
|
+
!Object.hasOwn(input.files, path.posix.join(headers, `${name}.h`)) &&
|
|
5526
|
+
!Object.hasOwn(input.files, path.posix.join(headers, name, `${name}.h`))
|
|
5517
5527
|
)
|
|
5528
|
+
stageTargetFile(
|
|
5529
|
+
target.name,
|
|
5530
|
+
path.join(layout.root, map),
|
|
5531
|
+
[
|
|
5532
|
+
`module ${name} {`,
|
|
5533
|
+
' umbrella "."',
|
|
5534
|
+
...fragments.map(
|
|
5535
|
+
(file) =>
|
|
5536
|
+
` textual header ${JSON.stringify(path.posix.relative(headers, file))}`,
|
|
5537
|
+
),
|
|
5538
|
+
' export *',
|
|
5539
|
+
'}',
|
|
5540
|
+
'',
|
|
5541
|
+
].join('\n'),
|
|
5542
|
+
)
|
|
5543
|
+
continue
|
|
5544
|
+
}
|
|
5545
|
+
files.set(
|
|
5546
|
+
path.join(layout.root, target.path, 'PeachSwiftImplementation/module.modulemap'),
|
|
5547
|
+
`module ${swiftTargetModuleName(`${target.name}SwiftImplementation`)} { export * }\n`,
|
|
5548
|
+
)
|
|
5518
5549
|
// only declaration roots belong to the imported clang module. headers
|
|
5519
5550
|
// consuming swift's generated output belong to its implementation target.
|
|
5520
5551
|
// a package that ships its own module map keeps it.
|
|
5521
5552
|
if (
|
|
5522
|
-
late.length === 0 ||
|
|
5523
5553
|
entries.some(
|
|
5524
5554
|
([file, contents]) =>
|
|
5525
5555
|
file.endsWith('/module.modulemap') &&
|
package/src/swift-host.ts
CHANGED
|
@@ -2205,7 +2205,7 @@ export function buildSwiftResourceTable(
|
|
|
2205
2205
|
registered.set(`${sha256}.metal`, { bytes, contentType: 'text/plain; charset=utf-8' })
|
|
2206
2206
|
}
|
|
2207
2207
|
let imageBytes = 0
|
|
2208
|
-
for (const { name, file, scale, bundlePath, renderingMode } of found) {
|
|
2208
|
+
for (const { name, file, scale, bundlePath, renderingMode, fileNames } of found) {
|
|
2209
2209
|
const disk = byRelative.get(file)
|
|
2210
2210
|
if (!disk) continue
|
|
2211
2211
|
if (Object.keys(images).length >= limits.images) {
|
|
@@ -2252,12 +2252,15 @@ export function buildSwiftResourceTable(
|
|
|
2252
2252
|
imageBytes += bytes.length
|
|
2253
2253
|
const hash = createHash('sha256').update(bytes).digest('hex').slice(0, 16)
|
|
2254
2254
|
const bundle = table[bundlePath] ?? Object.create(null)
|
|
2255
|
-
const
|
|
2256
|
-
variants.push({
|
|
2255
|
+
const variant = {
|
|
2257
2256
|
uri: `${baseUrl}${RESOURCE_PATH}${hash}${ext}`,
|
|
2258
2257
|
scale: variantScale,
|
|
2259
2258
|
...(renderingMode ? { renderingMode } : {}),
|
|
2260
|
-
}
|
|
2259
|
+
}
|
|
2260
|
+
for (const lookup of [name, ...(fileNames ?? [])]) {
|
|
2261
|
+
const variants = (bundle[lookup] ??= [])
|
|
2262
|
+
variants.push(variant)
|
|
2263
|
+
}
|
|
2261
2264
|
table[bundlePath] = bundle
|
|
2262
2265
|
const key = layout ? xcodeInputKey(layout, disk, file) : file
|
|
2263
2266
|
images[key] = {
|
|
@@ -2274,6 +2277,9 @@ export function buildSwiftResourceTable(
|
|
|
2274
2277
|
contentType: RESOURCE_CONTENT_TYPES[ext] ?? 'application/octet-stream',
|
|
2275
2278
|
})
|
|
2276
2279
|
}
|
|
2280
|
+
for (const bundle of Object.values(table))
|
|
2281
|
+
for (const variants of Object.values(bundle))
|
|
2282
|
+
variants.sort((a, b) => a.scale - b.scale)
|
|
2277
2283
|
// a colorset or symbolset edit re-resolves like an imageset edit.
|
|
2278
2284
|
for (const file of relative) {
|
|
2279
2285
|
if (file.endsWith('.colorset/Contents.json') || file.includes('.symbolset/'))
|