peachsim 0.1.656 → 0.1.657
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-config.ts +9 -6
- package/cli/app-project.ts +6 -6
- package/cli/commands/control.ts +20 -20
- package/cli/commands/flow.ts +3 -3
- package/detox/config-loader.ts +1 -1
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.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/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +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 +25 -25
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +14 -14
- 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 +2 -2
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +2 -2
- 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 +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.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/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +13 -15
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +94 -70
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +1 -1
- 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.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1 -1
- package/dist-lib/vite.cjs +2 -2
- package/package.json +1 -1
- package/scripts/dev-server-scanner.ts +3 -3
- package/scripts/optional-demo-registry.ts +1 -1
- package/src/config.ts +26 -26
package/src/config.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// peach.config.ts — per-app module resolution, turbo modules, env, state, and settings.
|
|
2
2
|
//
|
|
3
3
|
// usage:
|
|
4
4
|
// import { defineConfig } from 'peachsim/config'
|
|
@@ -17,7 +17,7 @@ export type ModuleResolution =
|
|
|
17
17
|
|
|
18
18
|
export type NativeModuleResolution = ModuleResolution | Record<string, any> // direct native module object for non-url configs
|
|
19
19
|
|
|
20
|
-
export interface
|
|
20
|
+
export interface PeachConfig<Settings extends Record<string, any> = Record<string, any>> {
|
|
21
21
|
// host-only engine selection. omitted means the current stable runtime.
|
|
22
22
|
runtimeVersion?: string
|
|
23
23
|
modules?: Record<string, ModuleResolution>
|
|
@@ -46,11 +46,11 @@ export interface RNXConfig<Settings extends Record<string, any> = Record<string,
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export const
|
|
49
|
+
export const PEACH_CONFIG_QUERY_PARAM = 'peachConfig'
|
|
50
50
|
|
|
51
51
|
export function defineConfig<Settings extends Record<string, any> = Record<string, any>>(
|
|
52
|
-
config:
|
|
53
|
-
):
|
|
52
|
+
config: PeachConfig<Settings>,
|
|
53
|
+
): PeachConfig<Settings> {
|
|
54
54
|
return config
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -58,9 +58,9 @@ function hasOwnKeys(value: Record<string, unknown> | undefined): boolean {
|
|
|
58
58
|
return !!value && Object.keys(value).length > 0
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export function
|
|
62
|
-
|
|
63
|
-
): config is
|
|
61
|
+
export function hasPeachConfig<
|
|
62
|
+
Settings extends Record<string, any> = Record<string, any>,
|
|
63
|
+
>(config?: PeachConfig<Settings> | null): config is PeachConfig<Settings> {
|
|
64
64
|
if (!config) return false
|
|
65
65
|
return (
|
|
66
66
|
(typeof config.runtimeVersion === 'string' && config.runtimeVersion.length > 0) ||
|
|
@@ -74,15 +74,15 @@ export function hasRNXConfig<Settings extends Record<string, any> = Record<strin
|
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
export function
|
|
77
|
+
export function mergePeachConfig<
|
|
78
78
|
Settings extends Record<string, any> = Record<string, any>,
|
|
79
79
|
>(
|
|
80
|
-
base?:
|
|
81
|
-
override?:
|
|
82
|
-
):
|
|
83
|
-
if (!
|
|
84
|
-
if (!
|
|
85
|
-
if (!
|
|
80
|
+
base?: PeachConfig<Settings> | null,
|
|
81
|
+
override?: PeachConfig<Settings> | null,
|
|
82
|
+
): PeachConfig<Settings> | undefined {
|
|
83
|
+
if (!hasPeachConfig(base) && !hasPeachConfig(override)) return undefined
|
|
84
|
+
if (!hasPeachConfig(base)) return override ? { ...override } : undefined
|
|
85
|
+
if (!hasPeachConfig(override)) return base ? { ...base } : undefined
|
|
86
86
|
|
|
87
87
|
return {
|
|
88
88
|
runtimeVersion: override.runtimeVersion ?? base.runtimeVersion,
|
|
@@ -104,29 +104,29 @@ export function mergeRNXConfig<
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
export function
|
|
107
|
+
export function readPeachConfigFromSearchParams<
|
|
108
108
|
Settings extends Record<string, any> = Record<string, any>,
|
|
109
|
-
>(searchParams: URLSearchParams):
|
|
110
|
-
const raw = searchParams.get(
|
|
109
|
+
>(searchParams: URLSearchParams): PeachConfig<Settings> | undefined {
|
|
110
|
+
const raw = searchParams.get(PEACH_CONFIG_QUERY_PARAM)
|
|
111
111
|
if (!raw) return undefined
|
|
112
112
|
try {
|
|
113
|
-
const parsed = JSON.parse(raw) as
|
|
114
|
-
return
|
|
113
|
+
const parsed = JSON.parse(raw) as PeachConfig<Settings>
|
|
114
|
+
return hasPeachConfig(parsed) ? parsed : undefined
|
|
115
115
|
} catch (error) {
|
|
116
116
|
const message = error instanceof Error ? error.message : String(error)
|
|
117
|
-
console.warn(`[peach] invalid ${
|
|
117
|
+
console.warn(`[peach] invalid ${PEACH_CONFIG_QUERY_PARAM}: ${message}`)
|
|
118
118
|
return undefined
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
export function
|
|
122
|
+
export function applyPeachConfigToUrl<
|
|
123
123
|
Settings extends Record<string, any> = Record<string, any>,
|
|
124
|
-
>(url: string, config?:
|
|
124
|
+
>(url: string, config?: PeachConfig<Settings> | null): string {
|
|
125
125
|
const parsed = new URL(url)
|
|
126
|
-
if (
|
|
127
|
-
parsed.searchParams.set(
|
|
126
|
+
if (hasPeachConfig(config)) {
|
|
127
|
+
parsed.searchParams.set(PEACH_CONFIG_QUERY_PARAM, JSON.stringify(config))
|
|
128
128
|
} else {
|
|
129
|
-
parsed.searchParams.delete(
|
|
129
|
+
parsed.searchParams.delete(PEACH_CONFIG_QUERY_PARAM)
|
|
130
130
|
}
|
|
131
131
|
return parsed.toString()
|
|
132
132
|
}
|