peachsim 0.1.1406 → 0.1.1463
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/LICENSE +8 -4
- package/README.md +22 -2
- package/cli/app-fonts.ts +50 -44
- package/cli/bin.ts +5 -4
- package/cli/bridge-diagnostics.ts +5 -0
- package/cli/bridge-flow-runner.ts +21 -13
- package/cli/cloud-client.ts +4 -3
- package/cli/commands/control.ts +155 -123
- package/cli/commands/daemon-mac-app.ts +3 -3
- package/cli/commands/daemon.ts +2 -2
- package/cli/commands/do-chain.ts +9 -2
- package/cli/commands/electron.ts +4 -1
- package/cli/commands/inspect/core.ts +1 -1
- package/cli/commands/inspect/settle.ts +19 -7
- package/cli/commands/inspect/settling.ts +92 -56
- package/cli/commands/inspect/wait-idle.ts +21 -9
- package/cli/commands/inspect/wait-ready.ts +22 -8
- package/cli/commands/inspect.ts +101 -134
- package/cli/commands/setup.ts +26 -16
- package/cli/commands/upgrade.ts +53 -9
- package/cli/desktop-companion.ts +1 -1
- package/cli/drivers/playwright-sim-host.ts +22 -13
- package/cli/drivers/playwright.ts +3 -3
- package/cli/main.ts +14 -5
- package/cli/outbound-endpoints.ts +1 -9
- package/detox/index.ts +6 -1
- 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 +3 -3
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +322 -274
- 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 +322 -45
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +69 -33
- 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 +3650 -3528
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- 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 +327 -123
- 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 +10 -5
- 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 +49 -47
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +1 -1
- 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 +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +23 -17
- package/dist-lib/sdk.cjs +99 -61
- package/dist-lib/sdk.mjs +97 -61
- package/dist-lib/skills.cjs +2959 -2780
- package/dist-lib/swift-compile.cjs +26 -12
- package/dist-lib/swift-compile.mjs +26 -12
- 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 +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +66 -31
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/kotlin/AppSources/android/view/Window.kt +2 -0
- package/kotlin/AppSources/dev/peach/app/PeachApp.kt +1 -1
- package/kotlin/ComposeSources/PeachComposeHost.kt +35 -9
- package/kotlin/ExpoComposeSources/dev/peach/expo/PeachExpoCompose.kt +2 -2
- package/kotlin/ExpoSources/dev/peach/expo/PeachExpoRuntime.kt +9 -6
- package/kotlin/ExpoSources/dev/peach/expo/PeachExpoTypes.kt +4 -4
- package/kotlin/ExpoSources/expo/modules/kotlin/modules/Module.kt +2 -2
- package/kotlin/ExpoSources/expo/modules/kotlin/viewevent/ViewEvent.kt +22 -8
- package/kotlin/ExpoSources/expo/modules/kotlin/views/ExpoView.kt +0 -3
- package/kotlin/ExpoSources/expo/modules/kotlin/views/ViewDefinitionBuilder.kt +10 -9
- package/kotlin/ExpoSources/expo/modules/kotlin/views/ViewProps.kt +6 -5
- package/kotlin/fixtures/import-drawing/Drawing.d.kt.ts +7 -0
- package/kotlin/fixtures/import-drawing/Drawing.kt +101 -0
- package/kotlin/fixtures/import-drawing/ImportDrawing.native.tsx +18 -0
- package/kotlin/fixtures/import-drawing/README.md +34 -0
- package/kotlin/fixtures/import-drawing/app/_layout.tsx +4 -0
- package/kotlin/fixtures/import-drawing/app/index+spa.tsx +1 -0
- package/kotlin/fixtures/import-drawing/package.json +23 -0
- package/kotlin/fixtures/import-drawing/tsconfig.json +20 -0
- package/kotlin/fixtures/import-drawing/vite.config.ts +20 -0
- package/kotlin/fixtures/import-scroll/ImportNested.native.tsx +10 -0
- package/kotlin/fixtures/import-scroll/Nested.d.kt.ts +4 -0
- package/kotlin/fixtures/import-scroll/README.md +15 -0
- package/kotlin/fixtures/import-scroll/app/nested+spa.tsx +1 -0
- package/kotlin/fixtures/import-values/ImportValues.native.tsx +26 -0
- package/kotlin/fixtures/import-values/README.md +6 -1
- package/kotlin/fixtures/import-values/Values.d.kt.ts +4 -0
- package/kotlin/fixtures/import-values/Values.kt +18 -0
- package/kotlin/tools/expo-types.main.kts +17 -5
- package/package.json +2 -1
- package/scripts/dev-server-scanner.ts +33 -23
- package/src/assetCatalogContract.ts +7 -0
- package/src/bridge-contract.ts +21 -3
- package/src/connect.ts +18 -5
- package/src/desktop-host-delivery.ts +33 -3
- package/src/expo-swift-host.ts +6 -3
- package/src/host/bridge-host.ts +2 -0
- package/src/host/fetch-proxy-transport.ts +8 -0
- package/src/kotlin-host.ts +11 -5
- package/src/native-firebase-config.ts +95 -54
- package/src/process-output.ts +16 -0
- package/src/sdk.ts +6 -1
- package/src/sim-client.ts +6 -1
- package/src/swift-compile.ts +36 -15
- package/src/swift-distribution.lock.json +8 -8
- package/src/swift-standin-emit.ts +10 -1
- package/src/swift-standins.ts +21 -7
- package/src/swift-submit.ts +6 -1
- /package/kotlin/fixtures/{kotlin-app-variants → import-scroll}/Nested.kt +0 -0
package/src/swift-compile.ts
CHANGED
|
@@ -612,7 +612,7 @@ const FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
|
612
612
|
const ONE_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "One"'
|
|
613
613
|
|
|
614
614
|
/** bump with any change to the emitted multi-target manifest text. */
|
|
615
|
-
export const MULTI_MANIFEST_VERSION =
|
|
615
|
+
export const MULTI_MANIFEST_VERSION = 19
|
|
616
616
|
|
|
617
617
|
export function swiftArtifactHash(
|
|
618
618
|
input: SwiftCompileInput,
|
|
@@ -620,6 +620,7 @@ export function swiftArtifactHash(
|
|
|
620
620
|
moduleRoot: string,
|
|
621
621
|
): string {
|
|
622
622
|
const hash = createHash('sha256')
|
|
623
|
+
// v24: distribution objects use an ordered linker response file
|
|
623
624
|
// v22: Foundation sources see Darwin, which carries the libc and Mach
|
|
624
625
|
// v21: Foundation sources see the ObservableObject and Published aliases
|
|
625
626
|
// v20: supplied table editing and swipe methods preserve objective-c selectors
|
|
@@ -638,7 +639,7 @@ export function swiftArtifactHash(
|
|
|
638
639
|
// v6: app and scene delegate classes compile final
|
|
639
640
|
// (v5: a target declaring resources gets SwiftPM's Bundle.module accessor;
|
|
640
641
|
// v4: sources compile through swiftSourceAsIOS)
|
|
641
|
-
hash.update(`swift-compile/
|
|
642
|
+
hash.update(`swift-compile/v24\n${release}\n`)
|
|
642
643
|
if (input.oneModule) hash.update('one-module\n')
|
|
643
644
|
hash.update(swiftModuleDigest(moduleRoot))
|
|
644
645
|
for (const file of Object.keys(input.files).sort()) {
|
|
@@ -721,6 +722,8 @@ export function emitSwiftPackageManifest(args: {
|
|
|
721
722
|
spriteKit?: boolean
|
|
722
723
|
/** link the prebuilt distribution at moduleRoot instead of its sources. */
|
|
723
724
|
distribution?: SwiftDistributionManifest
|
|
725
|
+
/** ordered distribution objects, read by the linker without expanding argv. */
|
|
726
|
+
distributionLink?: { path: string; files: Map<string, string | Buffer> }
|
|
724
727
|
/** the static library each target links, by target name. */
|
|
725
728
|
libraries?: Map<string, string>
|
|
726
729
|
}): string {
|
|
@@ -741,11 +744,27 @@ export function emitSwiftPackageManifest(args: {
|
|
|
741
744
|
}
|
|
742
745
|
// the distribution builder names each object lib/<target>-<file>.o.
|
|
743
746
|
// preserve link order while leaving unreached optional module objects out.
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
747
|
+
const distributionLink = args.distributionLink
|
|
748
|
+
if (distribution && !distributionLink)
|
|
749
|
+
throw new Error(
|
|
750
|
+
'swift-compile: distribution linking requires its object response file',
|
|
751
|
+
)
|
|
752
|
+
if (distribution && distributionLink) {
|
|
753
|
+
const objects = distribution.objects.filter((object) =>
|
|
754
|
+
[...OPTIONAL_FRAMEWORKS, 'SpriteKit', 'PeachBox2D'].every(
|
|
755
|
+
(name) => !object.startsWith(`lib/${name}-`) || reachedFrameworks.has(name),
|
|
756
|
+
),
|
|
757
|
+
)
|
|
758
|
+
distributionLink.files.set(
|
|
759
|
+
distributionLink.path,
|
|
760
|
+
objects
|
|
761
|
+
.map(
|
|
762
|
+
(object) =>
|
|
763
|
+
`"${path.join(moduleRoot, object).replaceAll('\\', '\\\\').replaceAll('"', '\\"')}"`,
|
|
764
|
+
)
|
|
765
|
+
.join('\n') + '\n',
|
|
766
|
+
)
|
|
767
|
+
}
|
|
749
768
|
const executable = targets.find((target) => target.executable)
|
|
750
769
|
if (!executable) throw new Error('swift-compile: no executable target to emit')
|
|
751
770
|
// each target compiles in the language mode and default isolation its
|
|
@@ -807,14 +826,12 @@ export function emitSwiftPackageManifest(args: {
|
|
|
807
826
|
: [`"${dependency}"`],
|
|
808
827
|
),
|
|
809
828
|
].join(', ')
|
|
810
|
-
const library =
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
.join('')
|
|
817
|
-
: ''
|
|
829
|
+
const library =
|
|
830
|
+
distribution && distributionLink
|
|
831
|
+
? ['-Xlinker', `@${distributionLink.path}`, ...distribution.link]
|
|
832
|
+
.map((flag) => `, ${JSON.stringify(flag)}`)
|
|
833
|
+
.join('')
|
|
834
|
+
: ''
|
|
818
835
|
const kind = target.executable ? '.executableTarget' : '.target'
|
|
819
836
|
const link = target.executable
|
|
820
837
|
? `,
|
|
@@ -2554,6 +2571,10 @@ export function writeSwiftProject(
|
|
|
2554
2571
|
oneModule: input.oneModule,
|
|
2555
2572
|
spriteKit: importsSpriteKit(input.files),
|
|
2556
2573
|
distribution: distribution ?? undefined,
|
|
2574
|
+
distributionLink: {
|
|
2575
|
+
path: path.join(layout.root, '.peach-distribution-objects.rsp'),
|
|
2576
|
+
files,
|
|
2577
|
+
},
|
|
2557
2578
|
libraries,
|
|
2558
2579
|
}) + moduleFiles,
|
|
2559
2580
|
)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "c60899948fe25af8",
|
|
3
3
|
"release": "swift-6.4.0-RELEASE",
|
|
4
4
|
"wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-e4629014",
|
|
5
5
|
"wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-e4629014.artifactbundle.tar.gz",
|
|
6
6
|
"wasmSdkChecksum": "522f3ff98e951872d64751376d45e36394e572ec2aa4e0a52fb0027824bf41f6",
|
|
7
|
-
"source": "
|
|
7
|
+
"source": "22d7666f9c66ec4b558db482661d440e581d84ff",
|
|
8
8
|
"targets": [
|
|
9
9
|
"ExpoModulesCore",
|
|
10
10
|
"PeachJSON",
|
|
@@ -118,16 +118,16 @@
|
|
|
118
118
|
],
|
|
119
119
|
"hosts": {
|
|
120
120
|
"darwin-arm64": {
|
|
121
|
-
"sha256": "
|
|
122
|
-
"size":
|
|
121
|
+
"sha256": "4661b87b8d627792bd28ef41d856bc9abcc913eb816efa448075d48e88abe823",
|
|
122
|
+
"size": 55595616
|
|
123
123
|
},
|
|
124
124
|
"linux-x64": {
|
|
125
|
-
"sha256": "
|
|
126
|
-
"size":
|
|
125
|
+
"sha256": "85dc5fc24acd33568f5ddccb3d69905c638162f5d5d767eefbbc16f9a4cca845",
|
|
126
|
+
"size": 55601101
|
|
127
127
|
},
|
|
128
128
|
"linux-arm64": {
|
|
129
|
-
"sha256": "
|
|
130
|
-
"size":
|
|
129
|
+
"sha256": "009f687e2f5a03cf2af277638861543aead3ad907136c2de8e48a6a702040182",
|
|
130
|
+
"size": 55600268
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -862,7 +862,16 @@ export function emitSwiftStandin(
|
|
|
862
862
|
if (fix && !/^(?:prefix|infix|postfix)\b/.test(spelled))
|
|
863
863
|
spelled = `${fix} ${spelled}`
|
|
864
864
|
}
|
|
865
|
-
|
|
865
|
+
const measured = behavior.get(path)
|
|
866
|
+
if (measured) used.add(path)
|
|
867
|
+
const overloadBody = /\basync\b/.test(spelled)
|
|
868
|
+
? measured?.asyncBody
|
|
869
|
+
: /\bResult</.test(spelled)
|
|
870
|
+
? measured?.resultBody
|
|
871
|
+
: undefined
|
|
872
|
+
emit(
|
|
873
|
+
`${attrs}public ${spelled} { ${overloadBody ?? measured?.body ?? trap(path)} }`,
|
|
874
|
+
)
|
|
866
875
|
} else if (kind === 'swift.var') {
|
|
867
876
|
const parsed = splitAccessors(text(symbol).replace(/^let /, 'var '))
|
|
868
877
|
// a measured global keeps the sdk's declaration with a working getter,
|
package/src/swift-standins.ts
CHANGED
|
@@ -15,6 +15,7 @@ import fs from 'node:fs'
|
|
|
15
15
|
import os from 'node:os'
|
|
16
16
|
import path from 'node:path'
|
|
17
17
|
import { getCliVersion } from './cli-version'
|
|
18
|
+
import { parsePlistSource } from './plist'
|
|
18
19
|
import {
|
|
19
20
|
swiftDistributionAt,
|
|
20
21
|
swiftMacroPlugins,
|
|
@@ -773,6 +774,25 @@ function crateFor(root: string, name: string): string | null {
|
|
|
773
774
|
return walk(root, 4)
|
|
774
775
|
}
|
|
775
776
|
|
|
777
|
+
// the simulator slice's static library as the xcframework's Info.plist
|
|
778
|
+
// declares it, the name Xcode links; the archive itself may be unbuilt.
|
|
779
|
+
function simulatorLibraryName(dir: string): string | undefined {
|
|
780
|
+
const info = parsePlistSource(fs.readFileSync(path.join(dir, 'Info.plist'), 'utf8'))
|
|
781
|
+
const libraries =
|
|
782
|
+
info && typeof info === 'object' ? Reflect.get(info, 'AvailableLibraries') : undefined
|
|
783
|
+
if (!Array.isArray(libraries)) return undefined
|
|
784
|
+
return libraries
|
|
785
|
+
.filter(
|
|
786
|
+
(entry: unknown): entry is object =>
|
|
787
|
+
typeof entry === 'object' &&
|
|
788
|
+
entry !== null &&
|
|
789
|
+
Reflect.get(entry, 'SupportedPlatform') === 'ios' &&
|
|
790
|
+
Reflect.get(entry, 'SupportedPlatformVariant') === 'simulator',
|
|
791
|
+
)
|
|
792
|
+
.map((entry): unknown => Reflect.get(entry, 'LibraryPath'))
|
|
793
|
+
.find((name): name is string => typeof name === 'string' && /^lib.+\.a$/.test(name))
|
|
794
|
+
}
|
|
795
|
+
|
|
776
796
|
/**
|
|
777
797
|
* the WebAssembly static library a c stand-in links in place of its traps,
|
|
778
798
|
* or null when it has none. a build the developer supplies in the
|
|
@@ -785,13 +805,7 @@ export function standinLibrary(
|
|
|
785
805
|
searchRoot: string,
|
|
786
806
|
): string | null {
|
|
787
807
|
const dir = xcframework(binary).dir
|
|
788
|
-
const
|
|
789
|
-
.readdirSync(dir)
|
|
790
|
-
.filter((name) => /^ios-.+-simulator$/.test(name))
|
|
791
|
-
.sort()[0]
|
|
792
|
-
const library = slice
|
|
793
|
-
? fs.readdirSync(path.join(dir, slice)).find((name) => /^lib.+\.a$/.test(name))
|
|
794
|
-
: undefined
|
|
808
|
+
const library = simulatorLibraryName(dir)
|
|
795
809
|
const supplied = path.join(dir, RUST_TARGET)
|
|
796
810
|
if (fs.existsSync(supplied)) {
|
|
797
811
|
const found = fs.readdirSync(supplied).filter((name) => name.endsWith('.a'))
|
package/src/swift-submit.ts
CHANGED
|
@@ -98,7 +98,12 @@ export const MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES = 16 * 1024 * 1024
|
|
|
98
98
|
// 39: canvas image draw operations retain their target bundle.
|
|
99
99
|
// 40: implicit animations retain typed value changes through a generation marker.
|
|
100
100
|
// 41: original compiled SwiftUI libraries retain data and deferred URL inputs.
|
|
101
|
-
|
|
101
|
+
// 42: shader image arguments retain system symbol identity and content textures.
|
|
102
|
+
// 43: Foundation preferences retain property-list values through the tenant owner.
|
|
103
|
+
// 44: swift scene phase follows the tenant's application lifecycle.
|
|
104
|
+
// 45: confirmation dialogs present from a measured `presentationSource`, and a
|
|
105
|
+
// refreshable's pull ends on the host's `refreshEnded` request.
|
|
106
|
+
export const SWIFT_HOST_ABI = 45
|
|
102
107
|
|
|
103
108
|
export interface SwiftImageUpload {
|
|
104
109
|
/** the raster file picked for the asset (has the extension). */
|
|
File without changes
|