peachsim 0.1.714 → 0.1.716
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/cli/commands/install-desktop.ts +74 -20
- package/cli/desktop-companion.ts +11 -6
- 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 +71 -25
- 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 +1 -1
- 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 +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/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 +82 -31
- package/dist-lib/swift-compile.cjs +56 -21
- package/dist-lib/swift-compile.mjs +56 -21
- package/dist-lib/swift-package.cjs +27 -5
- package/dist-lib/swift-package.mjs +26 -5
- 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 +63 -21
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/swift-compile.ts +43 -20
- package/src/swift-host.ts +9 -0
- package/src/swift-package.ts +42 -5
- package/src/swift-submit.ts +4 -0
package/src/swift-package.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface SwiftPackageTarget {
|
|
|
10
10
|
languageMode: number
|
|
11
11
|
/** true when the target declares `.defaultIsolation(MainActor.self)`. */
|
|
12
12
|
mainActorIsolation: boolean
|
|
13
|
-
/** true when
|
|
13
|
+
/** true when declared or implicit resources give the target `Bundle.module`. */
|
|
14
14
|
resources: boolean
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -20,6 +20,20 @@ export function isSwiftManifestFile(file: string): boolean {
|
|
|
20
20
|
return segments[segments.length - 1] === 'Package.swift'
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/** the files xcode recognizes as implicit resources, before target exclusions. */
|
|
24
|
+
export function swiftImplicitResourcePaths(paths: readonly string[]): string[] {
|
|
25
|
+
return paths
|
|
26
|
+
.filter(
|
|
27
|
+
(file) =>
|
|
28
|
+
!file.endsWith('.swift') &&
|
|
29
|
+
(/\.(xcassets|xcstrings|nib|xib|storyboard|xcdatamodeld|xcdatamodel|xcmappingmodel|metal|xcprivacy)(?:\/|$)/.test(
|
|
30
|
+
file,
|
|
31
|
+
) ||
|
|
32
|
+
/(?:^|\/)[^/]+\.lproj\/[^/]+$/.test(file)),
|
|
33
|
+
)
|
|
34
|
+
.sort()
|
|
35
|
+
}
|
|
36
|
+
|
|
23
37
|
/**
|
|
24
38
|
* the library and executable targets a sent root manifest declares, in order.
|
|
25
39
|
*
|
|
@@ -29,7 +43,11 @@ export function isSwiftManifestFile(file: string): boolean {
|
|
|
29
43
|
* early), and `name:` / `path:` are read from the call's own depth only, so
|
|
30
44
|
* a nested `.product(name: "SwiftUI", ...)` inside dependencies never wins.
|
|
31
45
|
*/
|
|
32
|
-
export function swiftManifestTargets(
|
|
46
|
+
export function swiftManifestTargets(
|
|
47
|
+
manifest: string,
|
|
48
|
+
resourcePaths: readonly string[] = [],
|
|
49
|
+
): SwiftPackageTarget[] {
|
|
50
|
+
const implicitResources = swiftImplicitResourcePaths(resourcePaths)
|
|
33
51
|
const code = manifest.replace(/\/\*[\s\S]*?\*\//g, '').replace(/\/\/[^\n]*/g, '')
|
|
34
52
|
const targets: SwiftPackageTarget[] = []
|
|
35
53
|
const pattern = /\.(executableTarget|target)\s*\(/g
|
|
@@ -77,7 +95,23 @@ export function swiftManifestTargets(manifest: string): SwiftPackageTarget[] {
|
|
|
77
95
|
/\.swiftLanguageMode\(\s*\.v(\d+)\s*\)/.exec(call)?.[1] ?? '5',
|
|
78
96
|
)
|
|
79
97
|
const mainActorIsolation = /\.defaultIsolation\(\s*MainActor\.self\s*\)/.test(call)
|
|
80
|
-
const
|
|
98
|
+
const excluded = [
|
|
99
|
+
...(/\bexclude\s*:\s*\[([^\]]*)\]/.exec(flat)?.[1] ?? '').matchAll(/"([^"]+)"/g),
|
|
100
|
+
].map((match) => match[1].replace(/^\.\//, '').replace(/\/+$/, ''))
|
|
101
|
+
const prefix = targetPath === '.' ? '' : `${targetPath}/`
|
|
102
|
+
const resources =
|
|
103
|
+
/\bresources\s*:/.test(flat) ||
|
|
104
|
+
implicitResources.some((file) => {
|
|
105
|
+
if (!file.startsWith(prefix)) return false
|
|
106
|
+
const relative = file.slice(prefix.length)
|
|
107
|
+
if (
|
|
108
|
+
excluded.some(
|
|
109
|
+
(exclude) => relative === exclude || relative.startsWith(`${exclude}/`),
|
|
110
|
+
)
|
|
111
|
+
)
|
|
112
|
+
return false
|
|
113
|
+
return true
|
|
114
|
+
})
|
|
81
115
|
targets.push({
|
|
82
116
|
name,
|
|
83
117
|
path: targetPath,
|
|
@@ -95,8 +129,11 @@ export function swiftManifestTargets(manifest: string): SwiftPackageTarget[] {
|
|
|
95
129
|
* executable target at the package root (`path: "."`) holds the whole project,
|
|
96
130
|
* which is the compiler's single-target shape, so it declares no partition.
|
|
97
131
|
*/
|
|
98
|
-
export function swiftPackagePartition(
|
|
99
|
-
|
|
132
|
+
export function swiftPackagePartition(
|
|
133
|
+
manifest: string,
|
|
134
|
+
resourcePaths: readonly string[] = [],
|
|
135
|
+
): SwiftPackageTarget[] {
|
|
136
|
+
const targets = swiftManifestTargets(manifest, resourcePaths)
|
|
100
137
|
return targets.length === 1 && targets[0].executable && targets[0].path === '.'
|
|
101
138
|
? []
|
|
102
139
|
: targets
|
package/src/swift-submit.ts
CHANGED
|
@@ -183,6 +183,8 @@ export type SwiftCompileSubmit = (work: {
|
|
|
183
183
|
files: Record<string, string>
|
|
184
184
|
/** the bundle pack; absent means the project packs none. */
|
|
185
185
|
resources?: Record<string, string>
|
|
186
|
+
/** project-relative resource paths used to associate implicit resources with targets. */
|
|
187
|
+
resourcePaths?: string[]
|
|
186
188
|
/** the photo rasters to publish; absent means the project packs none. */
|
|
187
189
|
images?: Record<string, SwiftImageUpload>
|
|
188
190
|
entry: string
|
|
@@ -330,6 +332,8 @@ export async function compileSwiftProject(
|
|
|
330
332
|
work: {
|
|
331
333
|
files: Record<string, string>
|
|
332
334
|
resources?: Record<string, string>
|
|
335
|
+
/** project-relative resource paths used to associate implicit resources with targets. */
|
|
336
|
+
resourcePaths?: string[]
|
|
333
337
|
images?: Record<string, SwiftImageUpload>
|
|
334
338
|
entry: string
|
|
335
339
|
packageId?: string
|