peachsim 0.1.2129 → 0.1.2155
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 +1 -1
- package/cli/app-fonts.ts +1 -1
- package/cli/app-stubs.ts +1 -1
- package/cli/cli-release-origin.ts +1 -0
- package/cli/cli-update.ts +1 -1
- package/cli/cloud-box-artifact.ts +1 -1
- package/cli/cloud-test-tunnel.ts +1 -1
- package/cli/commands/compat.ts +1 -1
- package/cli/commands/control.ts +2 -0
- package/cli/commands/coverage.ts +1 -1
- package/cli/commands/flow.ts +8 -1
- package/cli/commands/inspect/core.ts +25 -4
- package/cli/commands/package.ts +21 -12
- package/cli/commands/shell-url.ts +8 -3
- package/cli/commands/upgrade.ts +1 -1
- package/cli/drivers/linux-browser-libs.ts +1 -1
- package/cli/outbound-endpoints.ts +4 -0
- package/cli/remote-project-bundle.ts +2 -2
- package/detox/index.ts +12 -5
- 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 +1795 -1801
- 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 +2 -2
- package/dist-lib/config.mjs +2 -2
- package/dist-lib/detox/index.cjs +31 -8
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +41 -33
- package/dist-lib/expo-swift-metadata.cjs +10 -2
- package/dist-lib/expo-swift-metadata.mjs +9 -2
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +276 -243
- package/dist-lib/host/fetch-proxy-handler.cjs +459 -484
- 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 +266 -266
- 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 +2 -2
- package/dist-lib/metro-production-bundle.mjs +2 -2
- package/dist-lib/metro.cjs +320 -336
- package/dist-lib/native-app-identity-project.cjs +134 -159
- package/dist-lib/native-app-identity-project.mjs +428 -459
- package/dist-lib/native-app-identity.cjs +18 -18
- package/dist-lib/native-app-identity.mjs +18 -18
- package/dist-lib/native-firebase-metadata.cjs +2 -2
- package/dist-lib/native-firebase-metadata.mjs +2 -2
- 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 +32 -36
- package/dist-lib/public-origins-lib.json +135 -161
- 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 +2 -2
- package/dist-lib/sdk.cjs +20 -2
- package/dist-lib/sdk.mjs +20 -2
- package/dist-lib/skills.cjs +587 -531
- package/dist-lib/swift-compile.cjs +23 -8
- package/dist-lib/swift-compile.mjs +23 -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 -39
- package/dist-lib/vite.cjs +745 -768
- 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 +1 -1
- package/dist-types/packages/peach-engine/src/engine/secureItemHostContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/expo-widgets-activityContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/one-native-contentContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/worklet-serialize.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-wire.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/globalsContract.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/package-versions.d.ts +16 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/androidAutolinkingContract.ts +1 -1
- package/src/androidRootModuleContract.ts +1 -1
- package/src/bundle-channel.mjs +1 -1
- package/src/config.ts +1 -1
- package/src/configured-bundle-producer.ts +1 -1
- package/src/expo-swift-host.ts +34 -4
- package/src/expoKotlinContract.ts +4 -1
- package/src/expoSwiftContract.ts +18 -4
- package/src/guest-bundle.ts +1 -1
- package/src/host/dev-server-package-versions.ts +1 -1
- package/src/host/fetch-proxy-handler.ts +1 -1
- package/src/installed-native-build-options.ts +2 -2
- package/src/installed-package-versions.ts +7 -7
- package/src/metro-plugin.ts +1 -1
- package/src/metro-production-bundle.ts +1 -1
- package/src/native-app-identity.ts +1 -1
- package/src/native-firebase-metadata.ts +1 -1
- package/src/nitro-adapter.lock.json +244 -244
- package/src/nitro-superset.lock.json +4 -4
- package/src/nitroContract.ts +1 -1
- package/src/oneSdkContract.ts +1 -1
- package/src/react-native-coverage/capability-reference-resolution.ts +4 -4
- package/src/storageSnapshotContract.ts +2 -2
- package/src/swift-compile.ts +24 -7
- package/src/swift-coverage/source.ts +1 -1
- package/src/swift-distribution.lock.json +8 -8
- package/src/turbo-runtime.lock.json +18 -18
- package/src/vite-plugin-one.ts +4 -4
- package/src/vite-plugin.ts +6 -6
- package/src/bundleGlobalFooter.ts +0 -137
- package/src/packageVersionsContract.ts +0 -131
- /package/dist-types/packages/{peach-compat/src/stubs → peach-engine/src/guest}/native-evaluation-lease.d.ts +0 -0
- /package/dist-types/packages/{peach-compat → peach-globals}/src/secure-item-store.d.ts +0 -0
- /package/dist-types/packages/{peach-compat/src/stubs → peach-kit/src}/ring-mode-state.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2155 | (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,4 +1,4 @@
|
|
|
1
|
-
import { type SecureItemNamespace, type SecureItemRecord } from '../../../peach-
|
|
1
|
+
import { type SecureItemNamespace, type SecureItemRecord } from '../../../peach-globals/src/secure-item-store.d.ts';
|
|
2
2
|
export type SecureItemHostOperation = {
|
|
3
3
|
type: 'read';
|
|
4
4
|
namespace: SecureItemNamespace;
|
package/dist-types/packages/peach-engine/src/render-worker/expo-widgets-activityContract.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { ShellNativeEvaluationOwner } from '../guest/native-evaluation-lease.d.ts';
|
|
1
2
|
import type { ExpoWidgetExtension } from './expo-widgetContract.d.ts';
|
|
2
|
-
import type { ShellNativeEvaluationOwner } from '../../../peach-compat/src/stubs/native-evaluation-lease.d.ts';
|
|
3
3
|
export interface ExpoWidgetsActivity {
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly name: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { type PackageVersions } from '../../../peach-globals/src/package-versions.d.ts';
|
|
1
2
|
import { type PeachBundleConfig } from '../../../../../src/config.ts';
|
|
2
3
|
import { type NativeFirebaseConfig } from '../../../../../src/native-firebase-metadata.ts';
|
|
3
4
|
import { type ExpoKotlinCompilationResult } from '../../../../../src/expoKotlinContract.ts';
|
|
4
5
|
import { type ExpoSwiftCompilationResult } from '../../../../../src/expoSwiftContract.ts';
|
|
5
6
|
import { type NitroCompiledModule, type TurboCompiledModule } from '../../../../../src/nitroContract.ts';
|
|
6
7
|
import { type OneSDKCompilation } from '../../../../../src/oneSdkContract.ts';
|
|
7
|
-
import { type PackageVersions } from '../../../../../src/packageVersionsContract.ts';
|
|
8
8
|
import { type AppCatalog } from '../engine/app-catalog-wire.d.ts';
|
|
9
9
|
import { type RolldownModulePreparation } from '../rolldown-production-module.d.ts';
|
|
10
10
|
import type { MetroModuleIdentity } from '../metro-identity-contract.d.ts';
|
|
@@ -661,7 +661,7 @@ type NativeUIRequestBody = import('../capture/nativeScreenCaptureContract.d.ts')
|
|
|
661
661
|
requestId: number;
|
|
662
662
|
spec: AlertSpec;
|
|
663
663
|
traitScheme?: 'light' | 'dark' | null;
|
|
664
|
-
owner?: import('
|
|
664
|
+
owner?: import('../guest/native-evaluation-lease.d.ts').ShellNativeEvaluationOwner;
|
|
665
665
|
} | {
|
|
666
666
|
kind: 'alert.dismiss';
|
|
667
667
|
requestId: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ShellNativeEvaluationOwner } from '
|
|
1
|
+
import type { ShellNativeEvaluationOwner } from '../guest/native-evaluation-lease.d.ts';
|
|
2
2
|
export interface OneWidgetData {
|
|
3
3
|
readonly title: string;
|
|
4
4
|
readonly value: string;
|
|
@@ -144,7 +144,7 @@ export type HostToWorker = {
|
|
|
144
144
|
duoFold: DuoFoldWireState;
|
|
145
145
|
bodyPose: InterfacePose;
|
|
146
146
|
reactNativeConfiguration: ReactNativeConfigurationSnapshot;
|
|
147
|
-
ringMode: import('../../../peach-
|
|
147
|
+
ringMode: import('../../../peach-kit/src/ring-mode-state.d.ts').RingMode | null;
|
|
148
148
|
nativeResourcesPort: MessagePort;
|
|
149
149
|
canvasKitWasmModule?: WebAssembly.Module;
|
|
150
150
|
engineBase: string;
|
|
@@ -156,7 +156,7 @@ export type HostToWorker = {
|
|
|
156
156
|
storageScopeUrl?: string;
|
|
157
157
|
securityGroupCarry?: readonly import('../../../sootsim-swift/src/securityHostContract.d.ts').SwiftSecurityGroupSnapshot[];
|
|
158
158
|
simScopeId?: string;
|
|
159
|
-
secureItemDeviceDomain: import('../../../peach-
|
|
159
|
+
secureItemDeviceDomain: import('../../../peach-globals/src/secure-item-store.d.ts').SecureItemDeviceDomain;
|
|
160
160
|
appLoad: AppLoadRequest;
|
|
161
161
|
rolldownInventory?: import('../rolldown-bundle-inventory.d.ts').RolldownInventoryReceipt;
|
|
162
162
|
localStorageEntries?: Array<[string, string]>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NativeDynamicSynchronizableStorage, type SynchronizableArenaKey } from './native-dynamic-synchronizable.d.ts';
|
|
2
2
|
import { type ReanimatedAnimationKind } from './reanimated-readiness.d.ts';
|
|
3
3
|
import { type ClosureSpec, type NativeSerializableValueSpec, type ValueSpec, type WorkletBundleModule, type WorkletFunctionSpec, type WorkletViewRef } from './worklet-wire.d.ts';
|
|
4
|
+
import type { NativeEvaluationLease } from '../guest/native-evaluation-lease.d.ts';
|
|
4
5
|
import type { WorkletRuntime } from './worklet-runtime.d.ts';
|
|
5
|
-
import type { NativeEvaluationLease } from '../../../peach-compat/src/stubs/native-evaluation-lease.d.ts';
|
|
6
6
|
import type { ReanimatedAnimationProfile } from '../../../peach-globals/src/profilerContract.d.ts';
|
|
7
7
|
export declare const OBJECT_ID_BASE = 4294967296;
|
|
8
8
|
export type WorkletClosure = Record<string, unknown> | unknown[];
|
|
@@ -3,11 +3,11 @@ import { type NativeCSSEvent } from './reanimated-css-contract.d.ts';
|
|
|
3
3
|
import { type ReanimatedAnimationKind, type SharedValuePlayback } from './reanimated-readiness.d.ts';
|
|
4
4
|
import { type WorkletPeerEpoch } from './worklet-sab.d.ts';
|
|
5
5
|
import type { NativeRenderer } from '../../../../../src/config.ts';
|
|
6
|
-
import type { WorkletsStaticFlags } from '../../../../../src/packageVersionsContract.ts';
|
|
7
6
|
import type { DemoBundleMode } from '../demo/demo-bundle-platform.d.ts';
|
|
8
7
|
import type { AnimatedDrivenStyleLease, AnimatedDrivenStyleRetirement } from '../engine/animated-driven-style.d.ts';
|
|
9
8
|
import type { SyncReplyBuffer } from './nativeSyncReplyContract.d.ts';
|
|
10
9
|
import type { WorkletThreadIdentity } from './workletThreadIdentityContract.d.ts';
|
|
10
|
+
import type { WorkletsStaticFlags } from '../../../peach-globals/src/package-versions.d.ts';
|
|
11
11
|
import type { ReanimatedAnimationProfile } from '../../../peach-globals/src/profilerContract.d.ts';
|
|
12
12
|
export type WorkletBuiltinName = string;
|
|
13
13
|
export interface WorkletViewOwner {
|
|
@@ -452,7 +452,7 @@ export interface SootSimDirectGlobals {
|
|
|
452
452
|
__sootsimCliVersion: string;
|
|
453
453
|
__peachDesktopHostInstalled: boolean;
|
|
454
454
|
__peachWorkerHost: {
|
|
455
|
-
pullSurface?: (source: HTMLCanvasElement, kx?: number, ky?: number) => Promise<
|
|
455
|
+
pullSurface?: (source: HTMLCanvasElement, kx?: number, ky?: number) => Promise<HTMLCanvasElement | null>;
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
458
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NativeBuildOptions } from './index.d.ts';
|
|
2
|
+
export type PackageVersions = Record<string, string>;
|
|
3
|
+
export declare const NATIVE_BUILD_OPTIONS_KEY = "@peach/native-build-options";
|
|
4
|
+
export declare function readNativeBuildOptions(versions: PackageVersions | null): NativeBuildOptions;
|
|
5
|
+
export declare const PACKAGE_VERSIONS_HEADER = "X-Peach-Package-Versions";
|
|
6
|
+
export declare function readPackageVersions(value: unknown): PackageVersions;
|
|
7
|
+
export declare function readPackageVersionsFooter(source: string): PackageVersions | null;
|
|
8
|
+
export declare function insertPackageVersionsFooter(source: string, versions: PackageVersions): string;
|
|
9
|
+
export declare function detachPackageVersionsFooter(source: string): {
|
|
10
|
+
source: string;
|
|
11
|
+
versions: PackageVersions | null;
|
|
12
|
+
};
|
|
13
|
+
export declare const WORKLETS_STATIC_FLAGS_KEY = "react-native-worklets/staticFlags.json";
|
|
14
|
+
export type WorkletsStaticFlags = Readonly<Record<string, boolean>>;
|
|
15
|
+
export declare function resolveWorkletsStaticFlags(defaults: unknown, appManifest: unknown): string;
|
|
16
|
+
export declare function readWorkletsStaticFlags(versions: PackageVersions | null): WorkletsStaticFlags | null;
|
package/package.json
CHANGED
package/runtime-companion.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"abi":1,"sha256":"
|
|
1
|
+
{"abi":1,"sha256":"9b370a218cb12559cba2bb30e1e33d168ccd0f310e473c5428133b85938be20a","file":"node/cli-9b370a218cb12559cba2bb30e1e33d168ccd0f310e473c5428133b85938be20a.cjs"}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
detachBundleGlobalFooter,
|
|
3
3
|
insertBundleGlobalFooter,
|
|
4
4
|
readBundleGlobalFooter,
|
|
5
|
-
} from '
|
|
5
|
+
} from '@peach/globals/bundle-global-footer'
|
|
6
6
|
|
|
7
7
|
// the component the Android launcher activity starts react native with. it
|
|
8
8
|
// travels apart from the native app identity: an unbuilt app has no merged
|
package/src/bundle-channel.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { nodeHttpFetch } from './node-http-fetch'
|
|
|
14
14
|
import {
|
|
15
15
|
detachPackageVersionsFooter,
|
|
16
16
|
insertPackageVersionsFooter,
|
|
17
|
-
} from '
|
|
17
|
+
} from '@peach/globals/package-versions'
|
|
18
18
|
import { terminateProcessGroup } from './process-group'
|
|
19
19
|
import { discoverAppCatalog } from '../cli/app-catalog'
|
|
20
20
|
import { captureStagedHostFiles } from './host/staged-host-files'
|
package/src/config.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// export default defineConfig({ modules: { ... }, env: { ... } })
|
|
6
6
|
|
|
7
7
|
import { isValidRuntimeVersion } from '@contrast/runtime-delivery/version'
|
|
8
|
-
import { findBundleFooter } from '
|
|
8
|
+
import { findBundleFooter } from '@peach/globals/bundle-global-footer'
|
|
9
9
|
import { isRecord } from './is-record'
|
|
10
10
|
import { isNativeViewSource, type NativeViewSource } from './nativeViewSourceContract'
|
|
11
11
|
export type { NativeViewSource } from './nativeViewSourceContract'
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// the generated prefix runs as ordinary bundle code in browser and workerd tenants.
|
|
3
3
|
import fs from 'node:fs'
|
|
4
4
|
import path from 'node:path'
|
|
5
|
+
import { findBundleFooter } from '@peach/globals/bundle-global-footer'
|
|
5
6
|
import { transform } from 'sucrase'
|
|
6
7
|
import { minify } from 'terser'
|
|
7
8
|
import { splitExportDeclarators } from '../../contrast-bundler/src/dependencies'
|
|
8
9
|
import { compileReplacementModule } from '../../contrast-bundler/src/replacementModule'
|
|
9
|
-
import { findBundleFooter } from './bundleGlobalFooter'
|
|
10
10
|
import {
|
|
11
11
|
collectConfiguredFileModules,
|
|
12
12
|
createPeachBundleConfigFooter,
|
package/src/expo-swift-host.ts
CHANGED
|
@@ -95,6 +95,7 @@ import type { PeachConfig } from './config'
|
|
|
95
95
|
import type {
|
|
96
96
|
ExpoSwiftSourceUnit,
|
|
97
97
|
ExpoSwiftCompilationResult,
|
|
98
|
+
ExpoSwiftDiscoveryResult,
|
|
98
99
|
ExpoSwiftPreparationOptions,
|
|
99
100
|
} from './expoSwiftContract'
|
|
100
101
|
import type { NativeAppIdentity } from './native-app-identity'
|
|
@@ -1007,6 +1008,7 @@ export async function collectExpoSwiftSources(
|
|
|
1007
1008
|
installedWorkspace?: string,
|
|
1008
1009
|
prepareNative = false,
|
|
1009
1010
|
iosTarget?: string,
|
|
1011
|
+
metadataOnly = false,
|
|
1010
1012
|
): Promise<ExpoSwiftSourceUnit[] | null> {
|
|
1011
1013
|
if (traceStore.getStore())
|
|
1012
1014
|
return collectExpoSwiftSourcesUncached(
|
|
@@ -1015,10 +1017,11 @@ export async function collectExpoSwiftSources(
|
|
|
1015
1017
|
installedWorkspace,
|
|
1016
1018
|
prepareNative,
|
|
1017
1019
|
iosTarget,
|
|
1020
|
+
metadataOnly,
|
|
1018
1021
|
)
|
|
1019
1022
|
signal?.throwIfAborted()
|
|
1020
1023
|
installSwiftInputTrace()
|
|
1021
|
-
const key = await discoveryKey(appRoot, installedWorkspace, prepareNative, iosTarget)
|
|
1024
|
+
const key = `${await discoveryKey(appRoot, installedWorkspace, prepareNative, iosTarget)}\0${metadataOnly}`
|
|
1022
1025
|
const cached = discoveryCache.get(key)
|
|
1023
1026
|
if (cached && (await witnessMatches(cached.witness))) {
|
|
1024
1027
|
signal?.throwIfAborted()
|
|
@@ -1032,6 +1035,7 @@ export async function collectExpoSwiftSources(
|
|
|
1032
1035
|
installedWorkspace,
|
|
1033
1036
|
prepareNative,
|
|
1034
1037
|
iosTarget,
|
|
1038
|
+
metadataOnly,
|
|
1035
1039
|
),
|
|
1036
1040
|
)
|
|
1037
1041
|
if (witness.marks.size > 0 && (await witnessMatches(witness)))
|
|
@@ -1045,6 +1049,7 @@ async function collectExpoSwiftSourcesUncached(
|
|
|
1045
1049
|
installedWorkspace?: string,
|
|
1046
1050
|
prepareNative = false,
|
|
1047
1051
|
iosTarget?: string,
|
|
1052
|
+
metadataOnly = false,
|
|
1048
1053
|
): Promise<ExpoSwiftSourceUnit[] | null> {
|
|
1049
1054
|
const started = performance.now()
|
|
1050
1055
|
const report = (message: string) =>
|
|
@@ -1236,7 +1241,7 @@ async function collectExpoSwiftSourcesUncached(
|
|
|
1236
1241
|
peachAnsweredNativePackages().has(packageName)
|
|
1237
1242
|
if (answered) {
|
|
1238
1243
|
answeredInstalled = true
|
|
1239
|
-
if (installed || prepareNative) {
|
|
1244
|
+
if (installed || prepareNative || metadataOnly) {
|
|
1240
1245
|
processed.add(packageName)
|
|
1241
1246
|
continue
|
|
1242
1247
|
}
|
|
@@ -1292,7 +1297,7 @@ async function collectExpoSwiftSourcesUncached(
|
|
|
1292
1297
|
subscriberNames.length === 0 &&
|
|
1293
1298
|
handlerNames.length === 0)
|
|
1294
1299
|
if (dependencyOnly) {
|
|
1295
|
-
if (installed || prepareNative || !Array.isArray(namespaces)) {
|
|
1300
|
+
if (installed || prepareNative || metadataOnly || !Array.isArray(namespaces)) {
|
|
1296
1301
|
processed.add(packageName)
|
|
1297
1302
|
continue
|
|
1298
1303
|
}
|
|
@@ -1543,7 +1548,7 @@ async function collectExpoSwiftSourcesUncached(
|
|
|
1543
1548
|
walkFrameworks(canonical)
|
|
1544
1549
|
// this path compiles Swift alone; the report names the cause when a
|
|
1545
1550
|
// Swift file then fails on the pod's own Objective-C or C types.
|
|
1546
|
-
if (nativeSources.size > 0 && !prepareNative)
|
|
1551
|
+
if (nativeSources.size > 0 && !prepareNative && !metadataOnly)
|
|
1547
1552
|
report(
|
|
1548
1553
|
`${packageName}: ${namespace} has Objective-C or C sources (${[...nativeSources].sort()[0]}), which compile only from a CocoaPods workspace a Mac prepares; compiling its Swift alone`,
|
|
1549
1554
|
)
|
|
@@ -1780,6 +1785,7 @@ async function collectExpoSwiftSourcesUncached(
|
|
|
1780
1785
|
}
|
|
1781
1786
|
// an app whose installed modules a seam answers still links native modules.
|
|
1782
1787
|
if (units.length === 0) return answeredInstalled ? [] : null
|
|
1788
|
+
if (metadataOnly) return units
|
|
1783
1789
|
if (installed)
|
|
1784
1790
|
enrichInstalledUnits(
|
|
1785
1791
|
units,
|
|
@@ -2904,6 +2910,30 @@ export async function handleExpoSwiftRequest(
|
|
|
2904
2910
|
return true
|
|
2905
2911
|
}
|
|
2906
2912
|
const iosTarget = url.searchParams.get('iosTarget') ?? undefined
|
|
2913
|
+
if (url.searchParams.get('discover') === '1') {
|
|
2914
|
+
try {
|
|
2915
|
+
const units = await collectExpoSwiftSources(
|
|
2916
|
+
key,
|
|
2917
|
+
undefined,
|
|
2918
|
+
undefined,
|
|
2919
|
+
false,
|
|
2920
|
+
iosTarget,
|
|
2921
|
+
true,
|
|
2922
|
+
)
|
|
2923
|
+
const metadata: ExpoSwiftDiscoveryResult | null = units && {
|
|
2924
|
+
namespaces: units.map((unit) => unit.moduleId),
|
|
2925
|
+
}
|
|
2926
|
+
res.writeHead(200, {
|
|
2927
|
+
'Content-Type': 'application/json',
|
|
2928
|
+
'Cache-Control': 'no-store',
|
|
2929
|
+
})
|
|
2930
|
+
res.end(JSON.stringify(metadata))
|
|
2931
|
+
} catch (error) {
|
|
2932
|
+
res.writeHead(500, { 'Content-Type': 'text/plain' })
|
|
2933
|
+
res.end(error instanceof Error ? error.message : String(error))
|
|
2934
|
+
}
|
|
2935
|
+
return true
|
|
2936
|
+
}
|
|
2907
2937
|
const flightKey = `${host}\0${key}\0${iosTarget ?? ''}`
|
|
2908
2938
|
const prepared = openPreparations.take(
|
|
2909
2939
|
flightKey,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
insertBundleGlobalFooter,
|
|
3
|
+
readBundleGlobalFooter,
|
|
4
|
+
} from '@peach/globals/bundle-global-footer'
|
|
2
5
|
import { isRecord } from './is-record'
|
|
3
6
|
|
|
4
7
|
// what the dev server answers for an app's local Expo Kotlin modules on an
|
package/src/expoSwiftContract.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
insertBundleGlobalFooter,
|
|
3
|
+
readBundleGlobalFooter,
|
|
4
|
+
} from '@peach/globals/bundle-global-footer'
|
|
2
5
|
import { isRecord } from './is-record'
|
|
3
6
|
import { isNativeAppIdentity, type NativeAppIdentity } from './native-app-identity'
|
|
4
7
|
import { isSwiftResourcePath } from './swiftContract'
|
|
@@ -7,6 +10,7 @@ import type {
|
|
|
7
10
|
SwiftHeaderAliases,
|
|
8
11
|
SwiftResourceBundle,
|
|
9
12
|
} from './swiftContract'
|
|
13
|
+
import type { ExpoSwiftFailure } from '@peach/globals/guest-modules/expo-swift-failure'
|
|
10
14
|
|
|
11
15
|
export interface ExpoSwiftPreparationOptions {
|
|
12
16
|
signal?: AbortSignal
|
|
@@ -51,19 +55,29 @@ export interface ExpoSwiftCompiledModule {
|
|
|
51
55
|
bundleFiles?: Record<string, string>
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
export interface
|
|
55
|
-
nativeAppIdentity?: NativeAppIdentity
|
|
58
|
+
export interface ExpoSwiftDiscoveryResult {
|
|
56
59
|
namespaces: string[]
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ExpoSwiftCompilationResult extends ExpoSwiftDiscoveryResult {
|
|
63
|
+
nativeAppIdentity?: NativeAppIdentity
|
|
57
64
|
// the namespaces that are legacy bridge modules rather than Expo modules
|
|
58
65
|
bridgeModules?: string[]
|
|
59
66
|
modules: ExpoSwiftCompiledModule[]
|
|
60
|
-
failures:
|
|
67
|
+
failures: ExpoSwiftFailure[]
|
|
61
68
|
}
|
|
62
69
|
|
|
63
70
|
function strings(value: unknown): value is string[] {
|
|
64
71
|
return Array.isArray(value) && value.every((item) => typeof item === 'string')
|
|
65
72
|
}
|
|
66
73
|
|
|
74
|
+
export function readExpoSwiftDiscovery(value: unknown): ExpoSwiftDiscoveryResult | null {
|
|
75
|
+
if (value === null) return null
|
|
76
|
+
if (!isRecord(value) || !strings(value.namespaces))
|
|
77
|
+
throw new Error('invalid Expo Swift discovery metadata')
|
|
78
|
+
return { namespaces: value.namespaces }
|
|
79
|
+
}
|
|
80
|
+
|
|
67
81
|
export function isExpoSwiftCompilationResult(
|
|
68
82
|
value: unknown,
|
|
69
83
|
): value is ExpoSwiftCompilationResult {
|
package/src/guest-bundle.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { insertPackageVersionsFooter } from '@peach/globals/package-versions'
|
|
1
2
|
// the built-in guests use the existing Metro runtime and host module seam.
|
|
2
3
|
// the author supplies Swift or Kotlin; an entry carries no engine or compiler
|
|
3
4
|
// code, only the registration of the host module's root.
|
|
@@ -7,7 +8,6 @@ import {
|
|
|
7
8
|
RNX_METRO_MODULE_IDENTITY_VERSION,
|
|
8
9
|
} from './metro-production-bundle'
|
|
9
10
|
import { METRO_REQUIRE_POLYFILL } from './metro-runtime-source'
|
|
10
|
-
import { insertPackageVersionsFooter } from './packageVersionsContract'
|
|
11
11
|
|
|
12
12
|
export function swiftGuestBundle(packageName: string): string {
|
|
13
13
|
return guestBundle(
|
|
@@ -4,7 +4,7 @@ import { prebuiltExpoPods } from '../expo-pod-prebuilt'
|
|
|
4
4
|
import { readInstalledNativePackageVersionsAsync } from '../installed-package-versions.ts'
|
|
5
5
|
import { resolveMetroProjectRoot } from '../metro-project-root.ts'
|
|
6
6
|
import type { ExpoSwiftCompilationResult } from '../expoSwiftContract'
|
|
7
|
-
import type { PackageVersions } from '
|
|
7
|
+
import type { PackageVersions } from '@peach/globals/package-versions'
|
|
8
8
|
|
|
9
9
|
// a plain Metro or Expo dev server records no installed versions in its
|
|
10
10
|
// bundle. the bridge serving that bundle reads them from the project the
|
|
@@ -28,12 +28,12 @@ import http, { type IncomingMessage, type ServerResponse } from 'http'
|
|
|
28
28
|
import https from 'https'
|
|
29
29
|
import { Http2ServerRequest, type Http2ServerResponse } from 'node:http2'
|
|
30
30
|
import { finished, pipeline } from 'stream/promises'
|
|
31
|
+
import { PACKAGE_VERSIONS_HEADER } from '@peach/globals/package-versions'
|
|
31
32
|
import {
|
|
32
33
|
isLoopbackHost,
|
|
33
34
|
isTrustedBridgeRequest,
|
|
34
35
|
normalizeHostname,
|
|
35
36
|
} from '../backend-origin.ts'
|
|
36
|
-
import { PACKAGE_VERSIONS_HEADER } from '../packageVersionsContract'
|
|
37
37
|
import { readDevServerPackageVersions } from './dev-server-package-versions.ts'
|
|
38
38
|
import {
|
|
39
39
|
buildFetchProxyUpstreamHeaders,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import path from 'node:path'
|
|
3
|
-
import { resolveCompatVersionRange } from '@peach/
|
|
4
|
-
import type { PackageVersions } from './packageVersionsContract'
|
|
3
|
+
import { resolveCompatVersionRange } from '@peach/globals/guest-modules/version-range'
|
|
5
4
|
import type { NativeBuildOptions } from '@peach/globals'
|
|
5
|
+
import type { PackageVersions } from '@peach/globals/package-versions'
|
|
6
6
|
|
|
7
7
|
const RIVE_PACKAGE = '@rive-app/react-native'
|
|
8
8
|
const RIVE_05 = ['>=0.5.0 <0.6.0']
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
|
|
10
10
|
import fs from 'fs'
|
|
11
11
|
import path from 'path'
|
|
12
|
-
import { LAZY_STUB_PATTERNS } from '@peach/compat/lazy-stub-patterns'
|
|
13
12
|
import { NATIVE_RUNTIME_PACKAGE_NAMES } from '@peach/compat/native-package-names'
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
readInstalledNativeBuildOptions,
|
|
17
|
-
readInstalledNativeBuildOptionsAsync,
|
|
18
|
-
} from './installed-native-build-options'
|
|
13
|
+
import { LAZY_STUB_PATTERNS } from '@peach/globals/guest-modules/lazy-stub-patterns'
|
|
14
|
+
import { COMPAT_STUBS } from '@peach/globals/guest-modules/stub-manifest'
|
|
19
15
|
import {
|
|
20
16
|
NATIVE_BUILD_OPTIONS_KEY,
|
|
21
17
|
resolveWorkletsStaticFlags,
|
|
22
18
|
WORKLETS_STATIC_FLAGS_KEY,
|
|
23
19
|
type PackageVersions,
|
|
24
|
-
} from '
|
|
20
|
+
} from '@peach/globals/package-versions'
|
|
21
|
+
import {
|
|
22
|
+
readInstalledNativeBuildOptions,
|
|
23
|
+
readInstalledNativeBuildOptionsAsync,
|
|
24
|
+
} from './installed-native-build-options'
|
|
25
25
|
import { extractPackageFromPath } from './stub-pattern-matcher.ts'
|
|
26
26
|
|
|
27
27
|
type InstalledPackage = { root: string; manifest: object }
|
package/src/metro-plugin.ts
CHANGED
|
@@ -12,6 +12,7 @@ import fs from 'fs'
|
|
|
12
12
|
import { createRequire } from 'module'
|
|
13
13
|
import { randomUUID } from 'node:crypto'
|
|
14
14
|
import path from 'path'
|
|
15
|
+
import { insertPackageVersionsFooter } from '@peach/globals/package-versions'
|
|
15
16
|
import { resolveAppProject } from '../cli/app-project'
|
|
16
17
|
import { collectAndroidAutolinkedPackages } from './android-autolinking'
|
|
17
18
|
import { readAndroidLauncherRootModuleName } from './android-root-module'
|
|
@@ -41,7 +42,6 @@ import {
|
|
|
41
42
|
insertNativeFirebaseFooter,
|
|
42
43
|
readNativeFirebaseMetadata,
|
|
43
44
|
} from './native-firebase-metadata'
|
|
44
|
-
import { insertPackageVersionsFooter } from './packageVersionsContract'
|
|
45
45
|
import { parsePlistSource } from './plist'
|
|
46
46
|
import {
|
|
47
47
|
isRootRuntimeAssetPath,
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
// unchanged. tenant boot validates both before evaluation and clears the realm
|
|
9
9
|
// store when neither carries identity.
|
|
10
10
|
|
|
11
|
+
import { findBundleFooter } from '@peach/globals/bundle-global-footer'
|
|
11
12
|
import { nativeAppIdentityFromAndroidManifest } from './android-app-identity'
|
|
12
|
-
import { findBundleFooter } from './bundleGlobalFooter'
|
|
13
13
|
import { isRecord } from './is-record'
|
|
14
14
|
import {
|
|
15
15
|
resolveNativeAppIconArtwork,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// native Firebase options travel before the Metro module identity footer.
|
|
2
2
|
// the guest SDK snapshots these constants before its first getApp call.
|
|
3
|
-
import { findBundleFooter } from '
|
|
3
|
+
import { findBundleFooter } from '@peach/globals/bundle-global-footer'
|
|
4
4
|
|
|
5
5
|
export interface NativeFirebaseOptions {
|
|
6
6
|
apiKey: string
|