peachsim 0.1.634 → 0.1.635
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 +3 -3
- 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 +4 -4
- 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 +3 -3
- package/dist-lib/host/bridge-host.cjs +7 -7
- 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 -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 +1 -1
- 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 +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +43 -41
- package/dist-lib/swift-compile.cjs +15 -4
- package/dist-lib/swift-compile.mjs +14 -4
- 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 +2 -2
- package/dist-lib/vite-swift.cjs +13 -4
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/agent-daemon-client.ts +2 -2
- package/src/bridge-constants.ts +3 -3
- package/src/connect.ts +1 -1
- package/src/disk-cleanup.ts +1 -1
- package/src/home-paths.ts +2 -2
- package/src/host/bridge-host.ts +2 -2
- package/src/runtime-assets.ts +2 -2
- package/src/skills/builtin/compat-check.ts +2 -2
- package/src/swift-compile.ts +22 -3
|
@@ -4,14 +4,14 @@ import type { RNXSkill } from '../types'
|
|
|
4
4
|
|
|
5
5
|
export const skill: RNXSkill = {
|
|
6
6
|
name: 'compat-check',
|
|
7
|
-
description: 'Check package compatibility with
|
|
7
|
+
description: 'Check package compatibility with Peach',
|
|
8
8
|
type: 'review',
|
|
9
9
|
version: '1.0.0',
|
|
10
10
|
triggers: ['compatibility', 'compat', 'check package', 'supported packages'],
|
|
11
11
|
tools: [
|
|
12
12
|
{
|
|
13
13
|
name: 'check_compatibility',
|
|
14
|
-
description: 'Scan project dependencies for
|
|
14
|
+
description: 'Scan project dependencies for Peach compatibility',
|
|
15
15
|
parameters: {
|
|
16
16
|
packageName: {
|
|
17
17
|
type: 'string',
|
package/src/swift-compile.ts
CHANGED
|
@@ -224,7 +224,8 @@ export function swiftArtifactHash(
|
|
|
224
224
|
moduleRoot: string,
|
|
225
225
|
): string {
|
|
226
226
|
const hash = createHash('sha256')
|
|
227
|
-
|
|
227
|
+
// v2: sources compile with os(iOS) true (swiftSourceAsIOS)
|
|
228
|
+
hash.update(`swift-compile/v2\n${release}\n`)
|
|
228
229
|
if (input.oneModule) hash.update('one-module\n')
|
|
229
230
|
hash.update(linkedModuleDigest(moduleRoot))
|
|
230
231
|
for (const file of Object.keys(input.files).sort()) {
|
|
@@ -342,6 +343,24 @@ function syncSwiftTree(base: string, files: Map<string, string>): void {
|
|
|
342
343
|
}
|
|
343
344
|
}
|
|
344
345
|
|
|
346
|
+
// the app runs as iOS, but it compiles for wasm, where `os(iOS)` is false and
|
|
347
|
+
// every iOS branch of the app would compile out. a condition line names iOS
|
|
348
|
+
// as `true` padded to the same length, so diagnostics keep their columns;
|
|
349
|
+
// os(WASI) still holds for code written for wasm. only `#if` and `#elseif`
|
|
350
|
+
// lines change, and the artifact hash stays over the original text.
|
|
351
|
+
const CONDITION_LINE = /^([ \t]*#(?:if|elseif)\b)(.*)$/gm
|
|
352
|
+
const OS_IOS = /\bos\(\s*iOS\s*\)/g
|
|
353
|
+
export function swiftSourceAsIOS(source: string): string {
|
|
354
|
+
return source.replace(
|
|
355
|
+
CONDITION_LINE,
|
|
356
|
+
(_, directive: string, condition: string) =>
|
|
357
|
+
directive + condition.replace(OS_IOS, (match) => 'true'.padEnd(match.length)),
|
|
358
|
+
)
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const compiledSource = (file: string, contents: string) =>
|
|
362
|
+
file.endsWith('.swift') ? swiftSourceAsIOS(contents) : contents
|
|
363
|
+
|
|
345
364
|
export function writeSwiftProject(
|
|
346
365
|
layout: SwiftProjectLayout,
|
|
347
366
|
input: SwiftCompileInput,
|
|
@@ -352,7 +371,7 @@ export function writeSwiftProject(
|
|
|
352
371
|
if (targets.length === 0) {
|
|
353
372
|
for (const [file, contents] of Object.entries(input.files)) {
|
|
354
373
|
if (file === 'Package.swift') continue
|
|
355
|
-
files.set(path.join(layout.sources, file), contents)
|
|
374
|
+
files.set(path.join(layout.sources, file), compiledSource(file, contents))
|
|
356
375
|
}
|
|
357
376
|
let manifest = readFileSync(
|
|
358
377
|
path.join(moduleRoot, 'scripts/contrast-app-Package.swift'),
|
|
@@ -376,7 +395,7 @@ export function writeSwiftProject(
|
|
|
376
395
|
} else {
|
|
377
396
|
for (const [file, contents] of Object.entries(input.files)) {
|
|
378
397
|
if (file === 'Package.swift') continue
|
|
379
|
-
files.set(path.join(layout.root, file), contents)
|
|
398
|
+
files.set(path.join(layout.root, file), compiledSource(file, contents))
|
|
380
399
|
}
|
|
381
400
|
files.set(
|
|
382
401
|
path.join(layout.root, 'Package.swift'),
|