peachsim 0.1.751 → 0.1.753
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/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 +1 -1
- 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 +571 -300
- 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 +906 -135
- 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 +907 -136
- 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/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +767 -574
- 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-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +465 -194
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/home-paths.ts +1 -0
- package/src/native-firebase-config.ts +17 -111
- package/src/swift-host.ts +51 -18
- package/src/xcode-project.ts +590 -245
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.753 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/package.json
CHANGED
package/src/home-paths.ts
CHANGED
|
@@ -230,6 +230,7 @@ export function cliUpdateFilePath(): string {
|
|
|
230
230
|
// write one persisted value per choice.
|
|
231
231
|
|
|
232
232
|
export interface SharedConfig {
|
|
233
|
+
homeScreen?: import('@peach/globals').PeachHomeScreenConfig
|
|
233
234
|
telemetry?: boolean
|
|
234
235
|
onboardingVersion?: number
|
|
235
236
|
simulatorDriver?: 'electron' | 'playwright'
|
|
@@ -5,6 +5,7 @@ import { createRequire } from 'node:module'
|
|
|
5
5
|
import path from 'node:path'
|
|
6
6
|
import { isRecord } from './is-record'
|
|
7
7
|
import { parsePlistSource } from './plist'
|
|
8
|
+
import { listXcodeAppTargets, readXcodeAppTarget } from './xcode-project'
|
|
8
9
|
|
|
9
10
|
export function readNativeFirebaseConfig(
|
|
10
11
|
projectRoot: string,
|
|
@@ -52,114 +53,14 @@ export function readNativeFirebaseConfig(
|
|
|
52
53
|
if (projects.length > 1)
|
|
53
54
|
throw new Error('native Firebase configuration requires a selected Xcode project')
|
|
54
55
|
if (projects.length === 1) {
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
throw new Error('native Xcode project parser is unavailable')
|
|
59
|
-
const project: unknown = Reflect.apply(xcode.project, xcode, [
|
|
60
|
-
path.join(iosRoot, projects[0].name, 'project.pbxproj'),
|
|
61
|
-
])
|
|
62
|
-
if (!isRecord(project) || typeof project.parseSync !== 'function')
|
|
63
|
-
throw new Error('native Xcode project is malformed')
|
|
64
|
-
Reflect.apply(project.parseSync, project, [])
|
|
65
|
-
const hash = project.hash
|
|
66
|
-
const native = isRecord(hash) ? hash.project : null
|
|
67
|
-
const objects = isRecord(native) ? native.objects : null
|
|
68
|
-
if (!isRecord(objects)) throw new Error('native Xcode objects are malformed')
|
|
69
|
-
const unquote = (value: unknown) =>
|
|
70
|
-
typeof value === 'string' ? value.replace(/^"|"$/g, '') : ''
|
|
71
|
-
const targets = isRecord(objects.PBXNativeTarget)
|
|
72
|
-
? Object.values(objects.PBXNativeTarget).filter(
|
|
73
|
-
(target) =>
|
|
74
|
-
isRecord(target) &&
|
|
75
|
-
unquote(target.productType) === 'com.apple.product-type.application',
|
|
76
|
-
)
|
|
77
|
-
: []
|
|
78
|
-
if (targets.length > 1)
|
|
56
|
+
const xcodeproj = path.join(iosRoot, projects[0].name)
|
|
57
|
+
const appTargets = listXcodeAppTargets(xcodeproj)
|
|
58
|
+
if (appTargets.length > 1)
|
|
79
59
|
throw new Error('native Firebase configuration requires a selected app target')
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
const groups = isRecord(objects.PBXGroup) ? objects.PBXGroup : {}
|
|
85
|
-
const references = isRecord(objects.PBXFileReference)
|
|
86
|
-
? objects.PBXFileReference
|
|
87
|
-
: {}
|
|
88
|
-
const nativeProjects = isRecord(objects.PBXProject)
|
|
89
|
-
? Object.values(objects.PBXProject)
|
|
90
|
-
: []
|
|
91
|
-
const roots = nativeProjects.filter(isRecord).map((value) => value.mainGroup)
|
|
92
|
-
const pending = roots
|
|
93
|
-
.filter((id): id is string => typeof id === 'string')
|
|
94
|
-
.map((id) => ({ id, base: iosRoot }))
|
|
95
|
-
const visited = new Map<string, string>()
|
|
96
|
-
while (pending.length) {
|
|
97
|
-
const item = pending.pop()
|
|
98
|
-
if (!item) break
|
|
99
|
-
const previous = visited.get(item.id)
|
|
100
|
-
if (previous !== undefined) {
|
|
101
|
-
if (previous !== item.base)
|
|
102
|
-
throw new Error('native Xcode group has ambiguous parents')
|
|
103
|
-
continue
|
|
104
|
-
}
|
|
105
|
-
visited.set(item.id, item.base)
|
|
106
|
-
const group = groups[item.id]
|
|
107
|
-
if (!isRecord(group) || !Array.isArray(group.children)) continue
|
|
108
|
-
const sourceTree = unquote(group.sourceTree)
|
|
109
|
-
if (sourceTree && sourceTree !== '<group>' && sourceTree !== 'SOURCE_ROOT')
|
|
110
|
-
continue
|
|
111
|
-
const directory = path.resolve(
|
|
112
|
-
sourceTree === 'SOURCE_ROOT' ? iosRoot : item.base,
|
|
113
|
-
unquote(group.path),
|
|
114
|
-
)
|
|
115
|
-
for (const child of group.children) {
|
|
116
|
-
if (!isRecord(child) || typeof child.value !== 'string') continue
|
|
117
|
-
if (isRecord(groups[child.value])) {
|
|
118
|
-
pending.push({ id: child.value, base: directory })
|
|
119
|
-
continue
|
|
120
|
-
}
|
|
121
|
-
const file = references[child.value]
|
|
122
|
-
if (!isRecord(file)) continue
|
|
123
|
-
const tree = unquote(file.sourceTree)
|
|
124
|
-
if (tree !== '<group>' && tree !== 'SOURCE_ROOT') continue
|
|
125
|
-
const filePath = path.resolve(
|
|
126
|
-
tree === 'SOURCE_ROOT' ? iosRoot : directory,
|
|
127
|
-
unquote(file.path),
|
|
128
|
-
)
|
|
129
|
-
const values = filePaths.get(child.value) ?? new Set<string>()
|
|
130
|
-
values.add(filePath)
|
|
131
|
-
filePaths.set(child.value, values)
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
const buildFiles = isRecord(objects.PBXBuildFile) ? objects.PBXBuildFile : {}
|
|
135
|
-
const filesInPhase = (section: unknown, name: RegExp): string[] => {
|
|
136
|
-
if (!isRecord(section)) return []
|
|
137
|
-
const paths: string[] = []
|
|
138
|
-
for (const phase of buildPhases) {
|
|
139
|
-
if (!isRecord(phase) || typeof phase.value !== 'string') continue
|
|
140
|
-
const value = section[phase.value]
|
|
141
|
-
if (!isRecord(value) || !Array.isArray(value.files)) continue
|
|
142
|
-
for (const entry of value.files) {
|
|
143
|
-
if (!isRecord(entry) || typeof entry.value !== 'string') continue
|
|
144
|
-
const file = buildFiles[entry.value]
|
|
145
|
-
if (!isRecord(file) || typeof file.fileRef !== 'string') continue
|
|
146
|
-
const reference = references[file.fileRef]
|
|
147
|
-
if (
|
|
148
|
-
!isRecord(reference) ||
|
|
149
|
-
!name.test(path.basename(unquote(reference.path)))
|
|
150
|
-
)
|
|
151
|
-
continue
|
|
152
|
-
const candidates = filePaths.get(file.fileRef)
|
|
153
|
-
if (!candidates || candidates.size !== 1)
|
|
154
|
-
throw new Error('native Firebase build resource path is unresolved')
|
|
155
|
-
paths.push(...candidates)
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return paths
|
|
159
|
-
}
|
|
160
|
-
const delegates = filesInPhase(
|
|
161
|
-
objects.PBXSourcesBuildPhase,
|
|
162
|
-
/^AppDelegate\.(swift|mm|m)$/,
|
|
60
|
+
if (appTargets.length === 1) {
|
|
61
|
+
const app = readXcodeAppTarget(xcodeproj, appTargets[0])
|
|
62
|
+
const delegates = app.allSources.filter((file) =>
|
|
63
|
+
/^AppDelegate\.(swift|mm|m)$/.test(path.basename(file)),
|
|
163
64
|
)
|
|
164
65
|
const defaultConfigured = delegates.some((file) => {
|
|
165
66
|
const source = fs
|
|
@@ -195,15 +96,20 @@ export function readNativeFirebaseConfig(
|
|
|
195
96
|
return true
|
|
196
97
|
})
|
|
197
98
|
if (defaultConfigured) {
|
|
198
|
-
const resources =
|
|
199
|
-
|
|
200
|
-
/^GoogleService-Info\.plist$/,
|
|
99
|
+
const resources = app.resources.filter((file) =>
|
|
100
|
+
/^GoogleService-Info\.plist$/.test(path.basename(file)),
|
|
201
101
|
)
|
|
202
102
|
if (resources.length !== 1)
|
|
203
103
|
throw new Error(
|
|
204
104
|
'native Firebase default initialization requires one GoogleService-Info.plist build resource',
|
|
205
105
|
)
|
|
206
|
-
|
|
106
|
+
// the target's paths are canonical, so the base must be too
|
|
107
|
+
config.ios = {
|
|
108
|
+
googleServicesFile: path.relative(
|
|
109
|
+
fs.realpathSync(projectRoot),
|
|
110
|
+
resources[0],
|
|
111
|
+
),
|
|
112
|
+
}
|
|
207
113
|
}
|
|
208
114
|
}
|
|
209
115
|
}
|
package/src/swift-host.ts
CHANGED
|
@@ -198,7 +198,7 @@ export function openXcodeProject(
|
|
|
198
198
|
moduleRoot: string | undefined,
|
|
199
199
|
): string {
|
|
200
200
|
const app = readXcodeAppTarget(xcodeproj, target)
|
|
201
|
-
const root =
|
|
201
|
+
const root = app.rootDir
|
|
202
202
|
xcodeProjects.set(root, {
|
|
203
203
|
xcodeproj,
|
|
204
204
|
target: app.name,
|
|
@@ -219,7 +219,7 @@ function remotePackages(entry: XcodeProjectEntry, app: XcodeAppTarget): RemotePa
|
|
|
219
219
|
entry.remote = {
|
|
220
220
|
key,
|
|
221
221
|
packages: resolveRemotePackages(
|
|
222
|
-
|
|
222
|
+
app.rootDir,
|
|
223
223
|
app.packageResolved,
|
|
224
224
|
app.remoteProducts,
|
|
225
225
|
entry.provided,
|
|
@@ -230,17 +230,21 @@ function remotePackages(entry: XcodeProjectEntry, app: XcodeAppTarget): RemotePa
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
// the app target's sources compile as one executable target under this
|
|
233
|
-
// directory, each at its
|
|
234
|
-
//
|
|
233
|
+
// directory, each at its root-relative path, so a diagnostic still names the
|
|
234
|
+
// file; each framework target compiles as one target under its module's
|
|
235
|
+
// directory below XCODE_FRAMEWORKS_DIR; local package targets keep their own
|
|
236
|
+
// root-relative paths.
|
|
235
237
|
export const XCODE_APP_DIR = '__app__'
|
|
238
|
+
const XCODE_FRAMEWORKS_DIR = '__frameworks__'
|
|
236
239
|
// remote package checkouts compile here: swiftpm owns `.build` in the
|
|
237
240
|
// compile's package root as its scratch directory.
|
|
238
241
|
const XCODE_PACKAGES_DIR = '__packages__'
|
|
239
242
|
const CHECKOUTS_PREFIX = `${REMOTE_CHECKOUTS.split(path.sep).join(path.posix.sep)}/`
|
|
240
243
|
|
|
241
|
-
// the compile input key of a
|
|
242
|
-
function xcodeInputKey(
|
|
243
|
-
|
|
244
|
+
// the compile input key of a root-relative path in an xcode layout.
|
|
245
|
+
function xcodeInputKey(layout: XcodeLayout, file: string, relative: string): string {
|
|
246
|
+
const owner = layout.targetDirs.get(file)
|
|
247
|
+
if (owner) return path.posix.join(owner, relative)
|
|
244
248
|
return relative.startsWith(CHECKOUTS_PREFIX)
|
|
245
249
|
? path.posix.join(XCODE_PACKAGES_DIR, relative.slice(CHECKOUTS_PREFIX.length))
|
|
246
250
|
: relative
|
|
@@ -252,6 +256,8 @@ interface XcodeLayout {
|
|
|
252
256
|
targets: ReturnType<typeof swiftManifestTargets>
|
|
253
257
|
/** remote products that cannot compile, with why. */
|
|
254
258
|
unavailable: RemotePackages['unavailable']
|
|
259
|
+
/** the input directory each app and framework source compiles under. */
|
|
260
|
+
targetDirs: Map<string, string>
|
|
255
261
|
files: string[]
|
|
256
262
|
}
|
|
257
263
|
|
|
@@ -259,17 +265,40 @@ function xcodeLayout(root: string): XcodeLayout | null {
|
|
|
259
265
|
const registered = xcodeProjects.get(root)
|
|
260
266
|
if (!registered) return null
|
|
261
267
|
const app = readXcodeAppTarget(registered.xcodeproj, registered.target)
|
|
262
|
-
const files = new Set([app.
|
|
268
|
+
const files = new Set([...app.pbxprojs, ...app.sources, ...app.resources])
|
|
263
269
|
if (app.infoPlistFile) files.add(app.infoPlistFile)
|
|
270
|
+
const targetDirs = new Map(app.sources.map((file) => [file, XCODE_APP_DIR]))
|
|
264
271
|
const targets: XcodeLayout['targets'] = []
|
|
272
|
+
for (const framework of app.frameworks) {
|
|
273
|
+
const dir = path.posix.join(XCODE_FRAMEWORKS_DIR, framework.moduleName)
|
|
274
|
+
for (const file of framework.sources) {
|
|
275
|
+
if (targetDirs.has(file)) continue
|
|
276
|
+
targetDirs.set(file, dir)
|
|
277
|
+
files.add(file)
|
|
278
|
+
}
|
|
279
|
+
targets.push({
|
|
280
|
+
name: framework.moduleName,
|
|
281
|
+
path: dir,
|
|
282
|
+
executable: false,
|
|
283
|
+
resources: false,
|
|
284
|
+
languageMode: framework.languageMode,
|
|
285
|
+
mainActorIsolation: framework.mainActorIsolation,
|
|
286
|
+
})
|
|
287
|
+
}
|
|
265
288
|
for (const dir of app.localPackages) {
|
|
266
|
-
const
|
|
267
|
-
files.add(
|
|
289
|
+
const manifestFile = path.join(dir, 'Package.swift')
|
|
290
|
+
files.add(manifestFile)
|
|
291
|
+
const manifest = fs.readFileSync(manifestFile, 'utf8')
|
|
268
292
|
const prefix = path.relative(root, dir).split(path.sep).join(path.posix.sep)
|
|
269
|
-
|
|
270
|
-
|
|
293
|
+
// only target directories: a package at a repository's root holds the
|
|
294
|
+
// whole app beside its sources
|
|
295
|
+
const declared = swiftManifestTargets(manifest).filter((target) => !target.executable)
|
|
296
|
+
const all = declared.flatMap((target) =>
|
|
297
|
+
sourceTreeFiles(path.join(dir, target.path), root).map((file) =>
|
|
298
|
+
path.relative(dir, file).split(path.sep).join(path.posix.sep),
|
|
299
|
+
),
|
|
271
300
|
)
|
|
272
|
-
for (const target of swiftManifestTargets(
|
|
301
|
+
for (const target of swiftManifestTargets(manifest, all)) {
|
|
273
302
|
if (target.executable) continue
|
|
274
303
|
targets.push({ ...target, path: path.posix.join(prefix, target.path) })
|
|
275
304
|
for (const relative of all) {
|
|
@@ -295,6 +324,7 @@ function xcodeLayout(root: string): XcodeLayout | null {
|
|
|
295
324
|
app,
|
|
296
325
|
targets,
|
|
297
326
|
unavailable: remote.unavailable,
|
|
327
|
+
targetDirs,
|
|
298
328
|
files: [...files].sort(),
|
|
299
329
|
}
|
|
300
330
|
}
|
|
@@ -323,7 +353,11 @@ function xcodeManifest(layout: XcodeLayout): string {
|
|
|
323
353
|
function packageFiles(root: string): string[] {
|
|
324
354
|
const canonicalRoot = fs.realpathSync(root)
|
|
325
355
|
const xcode = xcodeLayout(canonicalRoot)
|
|
326
|
-
|
|
356
|
+
return xcode ? xcode.files : sourceTreeFiles(canonicalRoot, canonicalRoot)
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// every input file under `dir`, which must stay inside `canonicalRoot`.
|
|
360
|
+
function sourceTreeFiles(dir: string, canonicalRoot: string): string[] {
|
|
327
361
|
const found: string[] = []
|
|
328
362
|
const walk = (dir: string): void => {
|
|
329
363
|
for (const entry of fs
|
|
@@ -356,7 +390,7 @@ function packageFiles(root: string): string[] {
|
|
|
356
390
|
}
|
|
357
391
|
}
|
|
358
392
|
}
|
|
359
|
-
walk(
|
|
393
|
+
if (fs.existsSync(dir)) walk(fs.realpathSync(dir))
|
|
360
394
|
return found
|
|
361
395
|
}
|
|
362
396
|
|
|
@@ -682,12 +716,11 @@ export function icuUrl(origin: string, artifact: SwiftArtifact): string {
|
|
|
682
716
|
|
|
683
717
|
function packageSources(packagePath: string): Record<string, string> {
|
|
684
718
|
const xcode = xcodeLayout(packagePath)
|
|
685
|
-
const appSources = new Set(xcode?.app.sources)
|
|
686
719
|
const files: Record<string, string> = {}
|
|
687
720
|
for (const file of sourceFiles(packagePath)) {
|
|
688
721
|
const relative = path.relative(packagePath, file).split(path.sep).join(path.posix.sep)
|
|
689
722
|
if (xcode && path.basename(file) === 'Package.swift') continue
|
|
690
|
-
files[xcode ? xcodeInputKey(
|
|
723
|
+
files[xcode ? xcodeInputKey(xcode, file, relative) : relative] = readPackageFile(
|
|
691
724
|
packagePath,
|
|
692
725
|
file,
|
|
693
726
|
MAX_SWIFT_COMPILE_SOURCE_BYTES,
|
|
@@ -867,7 +900,7 @@ export function swiftApiGapReport(output: string): string | null {
|
|
|
867
900
|
if (!diagnostic || seen.has(line)) continue
|
|
868
901
|
seen.add(line)
|
|
869
902
|
const file = diagnostic[1]!
|
|
870
|
-
.replace(new RegExp(
|
|
903
|
+
.replace(new RegExp(`^(?:${XCODE_APP_DIR}|${XCODE_FRAMEWORKS_DIR}/[^/]+)/`), '')
|
|
871
904
|
.replace(new RegExp(`^${XCODE_PACKAGES_DIR}/`), '')
|
|
872
905
|
const message = diagnostic[4]!
|
|
873
906
|
const rule = API_GAP_PATTERNS.find(([pattern]) => pattern.test(message))
|