peachsim 0.1.634 → 0.1.636

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.
Files changed (74) hide show
  1. package/dist-lib/agent-daemon-client.cjs +3 -3
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/agent-identity.cjs +1 -1
  4. package/dist-lib/agent-sessions.cjs +1 -1
  5. package/dist-lib/attached-projects.cjs +1 -1
  6. package/dist-lib/auth/shared-session.cjs +1 -1
  7. package/dist-lib/backend-origin.cjs +1 -1
  8. package/dist-lib/beta.cjs +1 -1
  9. package/dist-lib/beta.mjs +1 -1
  10. package/dist-lib/bridge-constants.cjs +4 -4
  11. package/dist-lib/bridge-contract-input.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.mjs +1 -1
  13. package/dist-lib/bridge-contract.cjs +1 -1
  14. package/dist-lib/bridge-contract.mjs +1 -1
  15. package/dist-lib/capture-contract.cjs +1 -1
  16. package/dist-lib/capture-contract.mjs +1 -1
  17. package/dist-lib/cli-constants.cjs +1 -1
  18. package/dist-lib/cloud-contract.cjs +1 -1
  19. package/dist-lib/cloud-contract.mjs +1 -1
  20. package/dist-lib/cloud-test-args.cjs +1 -1
  21. package/dist-lib/cloud-test-args.mjs +1 -1
  22. package/dist-lib/cloud.cjs +1 -1
  23. package/dist-lib/cloud.mjs +1 -1
  24. package/dist-lib/config.cjs +1 -1
  25. package/dist-lib/detox/index.cjs +1 -1
  26. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  27. package/dist-lib/home-paths.cjs +3 -3
  28. package/dist-lib/host/bridge-host.cjs +7 -7
  29. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  30. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  31. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  32. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  33. package/dist-lib/host/websocket-proxy.cjs +1 -1
  34. package/dist-lib/index.cjs +2 -2
  35. package/dist-lib/jump-to-source-babel.cjs +1 -1
  36. package/dist-lib/jump-to-source-native.cjs +1 -1
  37. package/dist-lib/kotlin-host.cjs +1 -1
  38. package/dist-lib/menu.cjs +1 -1
  39. package/dist-lib/menu.mjs +1 -1
  40. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  41. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  42. package/dist-lib/metro-production-bundle.cjs +1 -1
  43. package/dist-lib/metro-production-bundle.mjs +1 -1
  44. package/dist-lib/metro.cjs +1 -1
  45. package/dist-lib/native-app-identity.cjs +1 -1
  46. package/dist-lib/native-app-identity.mjs +1 -1
  47. package/dist-lib/profiles.cjs +1 -1
  48. package/dist-lib/public-brand.cjs +1 -1
  49. package/dist-lib/react-native-host-modules.cjs +1 -1
  50. package/dist-lib/react-native-host-modules.mjs +1 -1
  51. package/dist-lib/render-mode.cjs +1 -1
  52. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  53. package/dist-lib/sdk.cjs +1 -1
  54. package/dist-lib/sdk.mjs +1 -1
  55. package/dist-lib/skills.cjs +43 -41
  56. package/dist-lib/swift-compile.cjs +15 -4
  57. package/dist-lib/swift-compile.mjs +14 -4
  58. package/dist-lib/swift-package.cjs +1 -1
  59. package/dist-lib/swift-package.mjs +1 -1
  60. package/dist-lib/swift-submit.cjs +1 -1
  61. package/dist-lib/swift-submit.mjs +1 -1
  62. package/dist-lib/swift.cjs +2 -2
  63. package/dist-lib/vite-swift.cjs +13 -4
  64. package/dist-lib/vite.cjs +1 -1
  65. package/package.json +1 -1
  66. package/src/agent-daemon-client.ts +2 -2
  67. package/src/bridge-constants.ts +3 -3
  68. package/src/connect.ts +1 -1
  69. package/src/disk-cleanup.ts +1 -1
  70. package/src/home-paths.ts +2 -2
  71. package/src/host/bridge-host.ts +2 -2
  72. package/src/runtime-assets.ts +2 -2
  73. package/src/skills/builtin/compat-check.ts +2 -2
  74. 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 peach',
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 peach compatibility',
14
+ description: 'Scan project dependencies for Peach compatibility',
15
15
  parameters: {
16
16
  packageName: {
17
17
  type: 'string',
@@ -224,7 +224,8 @@ export function swiftArtifactHash(
224
224
  moduleRoot: string,
225
225
  ): string {
226
226
  const hash = createHash('sha256')
227
- hash.update(`swift-compile/v1\n${release}\n`)
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'),