peachsim 0.1.871 → 0.1.873
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/swift.ts +39 -12
- 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/bundle-channel.cjs +10 -9
- 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/expo-swift-bundle.cjs +10 -9
- 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 +48 -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 +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +2 -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 +2 -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 +39 -6
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +55 -14
- 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 +10 -9
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
- package/scripts/dev-server-scanner.ts +38 -19
- package/src/swift-distribution.lock.json +8 -8
- package/src/swift-host.ts +65 -0
- package/src/swiftDiscoveryContract.ts +32 -0
- package/src/xcode-project.ts +2 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "cf49b84963eae4ec",
|
|
3
3
|
"release": "swift-6.3-RELEASE",
|
|
4
4
|
"wasmSdkId": "swift-6.3-RELEASE_wasm-peach-41921598-peach-edd95e37",
|
|
5
5
|
"wasmSdkUrl": "https://r2.rnxsim.com/swift-wasm-sdk/swift-6.3-RELEASE_wasm-peach-41921598-peach-edd95e37.artifactbundle.tar.gz",
|
|
6
6
|
"wasmSdkChecksum": "e8b76a6b78c21e9e16a6943a691ea001aeb0a18518d775a26130520303eb5c6d",
|
|
7
|
-
"source": "
|
|
7
|
+
"source": "7b29f31b65a02aea2d28fd0518e0118f2337f2b7",
|
|
8
8
|
"hosts": {
|
|
9
9
|
"darwin-arm64": {
|
|
10
|
-
"sha256": "
|
|
11
|
-
"size":
|
|
10
|
+
"sha256": "c120569e34e16edb81fe0fabe92a9d7c4c5f64b06363726b466f996cdb05588b",
|
|
11
|
+
"size": 43318901
|
|
12
12
|
},
|
|
13
13
|
"linux-x64": {
|
|
14
|
-
"sha256": "
|
|
15
|
-
"size":
|
|
14
|
+
"sha256": "d8a65a3f77d7302ed3547f525c4274a6c7aa2bdccdf9a41f4864ad305d0ae643",
|
|
15
|
+
"size": 43324299
|
|
16
16
|
},
|
|
17
17
|
"linux-arm64": {
|
|
18
|
-
"sha256": "
|
|
19
|
-
"size":
|
|
18
|
+
"sha256": "d47964d033ac59af2417939703335148993ea2d3e931a7db048a8080780c5de6",
|
|
19
|
+
"size": 43323284
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
package/src/swift-host.ts
CHANGED
|
@@ -479,6 +479,71 @@ function resourceCandidateFiles(root: string): string[] {
|
|
|
479
479
|
)
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
+
// discovery reads only the app target's catalog, before the first compile.
|
|
483
|
+
export function swiftProjectAppInfo(packagePath: string): {
|
|
484
|
+
name: string
|
|
485
|
+
icon: { bytes: Buffer; contentType: string } | null
|
|
486
|
+
} {
|
|
487
|
+
const registered = xcodeProjects.get(packagePath)
|
|
488
|
+
const app = registered
|
|
489
|
+
? readXcodeAppTarget(registered.xcodeproj, registered.target)
|
|
490
|
+
: null
|
|
491
|
+
const files = app?.resources ?? resourceCandidateFiles(packagePath)
|
|
492
|
+
const catalogs = files.filter(
|
|
493
|
+
(file) =>
|
|
494
|
+
file.endsWith('.appiconset/Contents.json') &&
|
|
495
|
+
(!app?.appIconName ||
|
|
496
|
+
path.basename(path.dirname(file)) === `${app.appIconName}.appiconset`),
|
|
497
|
+
)
|
|
498
|
+
let icon: { bytes: Buffer; contentType: string } | null = null
|
|
499
|
+
for (const contents of catalogs) {
|
|
500
|
+
const value: unknown = JSON.parse(fs.readFileSync(contents, 'utf8'))
|
|
501
|
+
if (
|
|
502
|
+
!value ||
|
|
503
|
+
typeof value !== 'object' ||
|
|
504
|
+
!('images' in value) ||
|
|
505
|
+
!Array.isArray(value.images)
|
|
506
|
+
)
|
|
507
|
+
continue
|
|
508
|
+
const images: { filename: string; pixels: number }[] = []
|
|
509
|
+
const entries: readonly unknown[] = value.images
|
|
510
|
+
for (const image of entries) {
|
|
511
|
+
if (
|
|
512
|
+
!image ||
|
|
513
|
+
typeof image !== 'object' ||
|
|
514
|
+
!('filename' in image) ||
|
|
515
|
+
typeof image.filename !== 'string' ||
|
|
516
|
+
path.basename(image.filename) !== image.filename ||
|
|
517
|
+
!/\.(png|jpe?g|webp)$/i.test(image.filename)
|
|
518
|
+
)
|
|
519
|
+
continue
|
|
520
|
+
if (
|
|
521
|
+
'idiom' in image &&
|
|
522
|
+
(typeof image.idiom !== 'string' ||
|
|
523
|
+
!['iphone', 'ios-marketing', 'universal'].includes(image.idiom))
|
|
524
|
+
)
|
|
525
|
+
continue
|
|
526
|
+
if ('appearances' in image) continue
|
|
527
|
+
const size =
|
|
528
|
+
'size' in image && typeof image.size === 'string' ? parseFloat(image.size) : 0
|
|
529
|
+
const scale =
|
|
530
|
+
'scale' in image && typeof image.scale === 'string' ? parseFloat(image.scale) : 1
|
|
531
|
+
images.push({ filename: image.filename, pixels: size * scale })
|
|
532
|
+
}
|
|
533
|
+
const picked = images.sort((a, b) => b.pixels - a.pixels)[0]
|
|
534
|
+
if (!picked) continue
|
|
535
|
+
const file = path.join(path.dirname(contents), picked.filename)
|
|
536
|
+
if (!files.includes(file)) continue
|
|
537
|
+
icon = {
|
|
538
|
+
bytes: fs.readFileSync(file),
|
|
539
|
+
contentType:
|
|
540
|
+
RESOURCE_CONTENT_TYPES[path.extname(file).toLowerCase()] ?? 'image/png',
|
|
541
|
+
}
|
|
542
|
+
break
|
|
543
|
+
}
|
|
544
|
+
return { name: app?.name ?? path.basename(packagePath), icon }
|
|
545
|
+
}
|
|
546
|
+
|
|
482
547
|
// the hosted compile service caps what a project sends it; a local compile
|
|
483
548
|
// reads the author's own files, so nothing caps them there.
|
|
484
549
|
const HOSTED_LIMITS = {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// the foreground swift host's signature, shared by its server and scanner.
|
|
2
|
+
export const SWIFT_DISCOVERY_PATH = '/__peach/swift-host'
|
|
3
|
+
export const SWIFT_GUEST_PATH = '/__peach/swift-guest.js'
|
|
4
|
+
export const SWIFT_ICON_PATH = '/__peach/swift-icon'
|
|
5
|
+
|
|
6
|
+
export interface SwiftHostDiscovery {
|
|
7
|
+
framework: 'swift'
|
|
8
|
+
projectName: string
|
|
9
|
+
status: 'compiling' | 'ready' | 'error'
|
|
10
|
+
iconPath?: typeof SWIFT_ICON_PATH
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function parseSwiftHostDiscovery(value: unknown): SwiftHostDiscovery | null {
|
|
14
|
+
if (!value || typeof value !== 'object') return null
|
|
15
|
+
if (
|
|
16
|
+
!('framework' in value) ||
|
|
17
|
+
value.framework !== 'swift' ||
|
|
18
|
+
!('projectName' in value) ||
|
|
19
|
+
typeof value.projectName !== 'string' ||
|
|
20
|
+
!('status' in value) ||
|
|
21
|
+
(value.status !== 'compiling' && value.status !== 'ready' && value.status !== 'error')
|
|
22
|
+
)
|
|
23
|
+
return null
|
|
24
|
+
return {
|
|
25
|
+
framework: value.framework,
|
|
26
|
+
projectName: value.projectName,
|
|
27
|
+
status: value.status,
|
|
28
|
+
...('iconPath' in value && value.iconPath === SWIFT_ICON_PATH
|
|
29
|
+
? { iconPath: SWIFT_ICON_PATH }
|
|
30
|
+
: {}),
|
|
31
|
+
}
|
|
32
|
+
}
|
package/src/xcode-project.ts
CHANGED
|
@@ -141,6 +141,7 @@ export interface XcodeAppTarget extends XcodeModuleTarget {
|
|
|
141
141
|
/** the target's processed launch plist, including generated build settings. */
|
|
142
142
|
infoPlist: string
|
|
143
143
|
infoPlistFile: string | null
|
|
144
|
+
appIconName: string
|
|
144
145
|
/** the target's compiled sources in every language, swift or not. */
|
|
145
146
|
allSources: string[]
|
|
146
147
|
/**
|
|
@@ -966,6 +967,7 @@ export function readXcodeAppTarget(input: string, targetName?: string): XcodeApp
|
|
|
966
967
|
].map((dir) => fs.realpathSync(dir)),
|
|
967
968
|
),
|
|
968
969
|
projectFiles: [...new Set(used.map((project) => project.projectFile))].sort(),
|
|
970
|
+
appIconName: settings('ASSETCATALOG_COMPILER_APPICON_NAME'),
|
|
969
971
|
infoPlist: plist.build(info),
|
|
970
972
|
infoPlistFile,
|
|
971
973
|
frameworks,
|