peachsim 0.1.1728 → 0.1.1738

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 (172) hide show
  1. package/cli/commands/control.ts +1 -0
  2. package/cli/commands/coverage-swift.ts +112 -4
  3. package/cli/commands/package.ts +11 -1
  4. package/cli/commands/shell-url.ts +4 -0
  5. package/cli/scene-video.ts +24 -7
  6. package/detox/index.ts +9 -1
  7. package/dist-lib/agent-daemon-client.cjs +1 -1
  8. package/dist-lib/agent-events.cjs +1 -1
  9. package/dist-lib/attached-projects.cjs +5 -2
  10. package/dist-lib/auth/shared-session.cjs +5 -2
  11. package/dist-lib/backend-origin.cjs +1 -1
  12. package/dist-lib/beta.cjs +1 -1
  13. package/dist-lib/beta.mjs +1 -1
  14. package/dist-lib/bridge-constants.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.mjs +1 -1
  17. package/dist-lib/bridge-contract.cjs +1 -1
  18. package/dist-lib/bridge-contract.mjs +1 -1
  19. package/dist-lib/bundle-channel.cjs +3592 -1918
  20. package/dist-lib/capture-contract.cjs +1 -1
  21. package/dist-lib/capture-contract.mjs +1 -1
  22. package/dist-lib/cloud-contract.cjs +1 -1
  23. package/dist-lib/cloud-contract.mjs +1 -1
  24. package/dist-lib/cloud-test-args.cjs +1 -1
  25. package/dist-lib/cloud-test-args.mjs +1 -1
  26. package/dist-lib/cloud.cjs +1 -1
  27. package/dist-lib/cloud.mjs +1 -1
  28. package/dist-lib/config.cjs +1 -1
  29. package/dist-lib/config.mjs +1 -1
  30. package/dist-lib/detox/index.cjs +13 -5
  31. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  32. package/dist-lib/expo-swift-bundle.cjs +1329 -1022
  33. package/dist-lib/expo-swift-metadata.cjs +2 -2
  34. package/dist-lib/expo-swift-metadata.mjs +2 -2
  35. package/dist-lib/home-paths.cjs +7 -2
  36. package/dist-lib/host/bridge-host.cjs +3773 -2149
  37. package/dist-lib/host/fetch-proxy-handler.cjs +16 -5
  38. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  39. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  40. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  41. package/dist-lib/host/websocket-proxy.cjs +1 -1
  42. package/dist-lib/index.cjs +97 -68
  43. package/dist-lib/jump-to-source-babel.cjs +1 -1
  44. package/dist-lib/jump-to-source-native.cjs +1 -1
  45. package/dist-lib/kotlin-host.cjs +209 -32
  46. package/dist-lib/menu.cjs +7 -1
  47. package/dist-lib/menu.mjs +7 -1
  48. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  49. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  50. package/dist-lib/metro-production-bundle.cjs +1 -1
  51. package/dist-lib/metro-production-bundle.mjs +1 -1
  52. package/dist-lib/metro.cjs +93 -65
  53. package/dist-lib/native-app-identity-project.cjs +37 -31
  54. package/dist-lib/native-app-identity-project.mjs +37 -31
  55. package/dist-lib/native-app-identity.cjs +1 -1
  56. package/dist-lib/native-app-identity.mjs +1 -1
  57. package/dist-lib/native-firebase-metadata.cjs +1 -1
  58. package/dist-lib/native-firebase-metadata.mjs +1 -1
  59. package/dist-lib/plist.cjs +1 -1
  60. package/dist-lib/plist.mjs +1 -1
  61. package/dist-lib/profiles.cjs +5 -2
  62. package/dist-lib/public-brand.cjs +1 -1
  63. package/dist-lib/public-origins-lib-esm.json +23 -23
  64. package/dist-lib/public-origins-lib.json +79 -53
  65. package/dist-lib/react-native-host-modules.cjs +5 -2
  66. package/dist-lib/react-native-host-modules.mjs +5 -2
  67. package/dist-lib/reap-browser.cjs +1 -1
  68. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  69. package/dist-lib/sdk.cjs +1 -1
  70. package/dist-lib/sdk.mjs +1 -1
  71. package/dist-lib/skills.cjs +4486 -2789
  72. package/dist-lib/swift-compile.cjs +53 -60
  73. package/dist-lib/swift-compile.mjs +52 -60
  74. package/dist-lib/swift-package.cjs +1 -1
  75. package/dist-lib/swift-package.mjs +1 -1
  76. package/dist-lib/swift-submit.cjs +2 -2
  77. package/dist-lib/swift-submit.mjs +2 -2
  78. package/dist-lib/swift-toolchain.cjs +17 -17
  79. package/dist-lib/swift.cjs +1 -1
  80. package/dist-lib/vite-swift.cjs +1056 -870
  81. package/dist-lib/vite.cjs +20 -8
  82. package/dist-lib/worklet-executable.cjs +1 -1
  83. package/dist-lib/worklet-executable.mjs +1 -1
  84. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +7 -4
  85. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +2 -1
  86. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +0 -5
  87. package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +8 -0
  88. package/dist-types/packages/peach-engine/src/engine/node.d.ts +4 -1
  89. package/dist-types/packages/peach-engine/src/engine/render-damage.d.ts +2 -2
  90. package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +5 -0
  91. package/dist-types/packages/peach-engine/src/engine/text-paragraph.d.ts +1 -0
  92. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +2 -0
  93. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +7 -2
  94. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +1 -0
  95. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +13 -1
  96. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  97. package/kotlin/README.md +3 -0
  98. package/kotlin/sdk.tar.gz +0 -0
  99. package/package.json +1 -1
  100. package/runtime-companion.json +1 -1
  101. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccount.h +55 -0
  102. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountCredential.h +35 -0
  103. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountStore.h +94 -0
  104. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountType.h +53 -0
  105. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACError.h +37 -0
  106. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/Accounts.h +13 -0
  107. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/AccountsDefines.h +13 -0
  108. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Modules/module.modulemap +5 -0
  109. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +1 -1
  110. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +58 -3
  111. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +636 -37
  112. package/sdk/ios/usr/include/os/signpost.h +414 -0
  113. package/sdk/ios/usr/include/os.modulemap +5 -0
  114. package/sdk/ios/wasm/include/errno.h +4 -20
  115. package/sdk/ios/wasm/include/pthread.h +3 -0
  116. package/sdk/ios/wasm/include/setjmp.h +57 -0
  117. package/sdk/ios/wasm/include/sys/resource.h +2 -2
  118. package/sdk/native-hashes.json +3 -3
  119. package/skills/peach-debug/SKILL.md +0 -1
  120. package/skills/peach-perf/SKILL.md +0 -1
  121. package/skills/peach-setup/SKILL.md +0 -1
  122. package/skills/peach-test/SKILL.md +0 -1
  123. package/skills/peach-visual/SKILL.md +0 -1
  124. package/src/android-autolinking.ts +1 -0
  125. package/src/android-bridge-packages.ts +279 -0
  126. package/src/appPackageContract.ts +2 -0
  127. package/src/bundle-channel.mjs +20 -2
  128. package/src/cli-runtime.ts +9 -5
  129. package/src/expo-discovery-cache.ts +7 -3
  130. package/src/expo-kotlin-host.ts +97 -26
  131. package/src/expo-native-workspace.ts +135 -40
  132. package/src/expo-swift-host.ts +93 -20
  133. package/src/expo-swift-ready.ts +5 -1
  134. package/src/expoKotlinContract.ts +12 -2
  135. package/src/expoSwiftContract.ts +9 -2
  136. package/src/generated/swift-c-predefines.json +1 -1
  137. package/src/home-paths.ts +6 -1
  138. package/src/host/bridge-host.ts +5 -0
  139. package/src/host/fetch-proxy-handler.ts +10 -0
  140. package/src/kotlin-host.ts +204 -30
  141. package/src/kotlinSdkContract.ts +2 -1
  142. package/src/menu.ts +7 -0
  143. package/src/native-prebuilt.ts +154 -0
  144. package/src/nitro-adapter.lock.json +251 -251
  145. package/src/nitro-adapter.ts +56 -50
  146. package/src/nitro-bundle.ts +84 -74
  147. package/src/nitro-compile.ts +10 -5
  148. package/src/nitro-dependencies.ts +43 -28
  149. package/src/nitro-source.ts +60 -26
  150. package/src/nitroAdapterContract.ts +146 -98
  151. package/src/nitroContract.ts +64 -21
  152. package/src/react-native-bridge-modules.ts +2 -0
  153. package/src/react-native-host-modules.ts +4 -1
  154. package/src/settingsContract.ts +11 -0
  155. package/src/storageSnapshotContract.ts +29 -81
  156. package/src/swift-compile.ts +49 -50
  157. package/src/swift-coverage/indexdump.ts +22 -6
  158. package/src/swift-coverage/indexing.ts +4 -4
  159. package/src/swift-coverage/sdk.ts +104 -20
  160. package/src/swift-coverage/types.ts +34 -0
  161. package/src/swift-coverage/xcode.ts +9 -1
  162. package/src/swift-distribution.lock.json +15 -12
  163. package/src/swift-host.ts +3 -0
  164. package/src/swift-standin-emit.ts +6 -1
  165. package/src/swift-standins.ts +172 -10
  166. package/src/swift-submit.ts +5 -1
  167. package/src/swift-toolchain.ts +16 -16
  168. package/src/turbo-bundle.ts +81 -0
  169. package/src/turbo-compile.ts +120 -0
  170. package/src/turbo-runtime.lock.json +69 -0
  171. package/src/turbo-source.ts +754 -0
  172. package/src/vite-plugin-one.ts +4 -3
@@ -0,0 +1,120 @@
1
+ import { createHash } from 'node:crypto'
2
+ import fs from 'node:fs'
3
+ import os from 'node:os'
4
+ import path from 'node:path'
5
+ import { readIosAppTarget } from './native-app-identity-project'
6
+ import {
7
+ committedAdapterLocks,
8
+ resolveAdapterArchive,
9
+ type AdapterArchive,
10
+ } from './nitro-adapter'
11
+ import { syncSwiftTree, type SwiftCompileInput } from './swift-compile'
12
+ import { artifactFor, projectFor, type SwiftArtifact } from './swift-host'
13
+ import {
14
+ collectTurboSources,
15
+ prepareTurboSourceDependencies,
16
+ TURBO_CORE_TARGET,
17
+ type TurboProvider,
18
+ type TurboSourceCollection,
19
+ } from './turbo-source'
20
+
21
+ // every provider's original sources, React Native's TurboModule core and the
22
+ // verified runtime archive form one executable. the entry runs each provider's
23
+ // transcribed +load, as the app's image loads them before React Native starts,
24
+ // then installs the binding on the archive's runtime.
25
+ export function collectTurboCompileInput(
26
+ collection: TurboSourceCollection,
27
+ runtime: AdapterArchive,
28
+ iosDeploymentTarget: string,
29
+ ): SwiftCompileInput {
30
+ const files = { ...collection.files }
31
+ const entry = 'Sources/PeachTurboApp/main.swift'
32
+ const loaders = [...new Set(collection.loads.map(({ target }) => target))]
33
+ files[entry] =
34
+ `import ${TURBO_CORE_TARGET}\n${loaders.map((target) => `import ${target}\n`).join('')}` +
35
+ `${collection.loads.map(({ symbol }) => `${symbol}()\n`).join('')}peachTurboInitialize()\n`
36
+ files['Package.swift'] = [
37
+ '// swift-tools-version: 6.2',
38
+ 'import PackageDescription',
39
+ `let package = Package(name: "PeachNativeModule", platforms: [.iOS(${JSON.stringify(iosDeploymentTarget)})], targets: [`,
40
+ ...collection.targets.map(
41
+ (target) =>
42
+ `.target(name: ${JSON.stringify(target.name)}, dependencies: ${JSON.stringify(target.dependencies?.map((dependency) => dependency.name) ?? [])}, path: ${JSON.stringify(target.path)}, cxxSettings: [${(
43
+ target.cxxDefines ?? []
44
+ )
45
+ .map((define) => {
46
+ const [name, ...value] = define.split('=')
47
+ return value.length
48
+ ? `.define(${JSON.stringify(name)}, to: ${JSON.stringify(value.join('='))})`
49
+ : `.define(${JSON.stringify(name)})`
50
+ })
51
+ .join(', ')}]),`,
52
+ ),
53
+ `.executableTarget(name: "PeachTurboApp", dependencies: ${JSON.stringify([TURBO_CORE_TARGET, ...loaders])}, swiftSettings: [.interoperabilityMode(.Cxx)]),`,
54
+ '], cxxLanguageStandard: .cxx20)',
55
+ '',
56
+ ].join('\n')
57
+ return {
58
+ files,
59
+ entry,
60
+ libraries: { [TURBO_CORE_TARGET]: runtime.base64 },
61
+ lazyDistribution: true,
62
+ }
63
+ }
64
+
65
+ export async function compileTurboModule(options: {
66
+ appRoot: string
67
+ reactNativeRoot: string
68
+ providers: TurboProvider[]
69
+ moduleRoot: string
70
+ projectRoot: string
71
+ }): Promise<{ artifact: SwiftArtifact; collection: TurboSourceCollection }> {
72
+ await prepareTurboSourceDependencies(options.reactNativeRoot)
73
+ const key = createHash('sha256')
74
+ .update(options.providers.map(({ root }) => fs.realpathSync(root)).join('\0'))
75
+ .update('\0')
76
+ .update(fs.realpathSync(options.moduleRoot))
77
+ .digest('hex')
78
+ const scratch = path.join(os.tmpdir(), 'peach-turbo-swift', key)
79
+ // the codegen intake writes only into a new or empty directory
80
+ fs.rmSync(path.join(scratch, 'codegen'), { recursive: true, force: true })
81
+ const collection = await collectTurboSources({
82
+ appRoot: options.appRoot,
83
+ reactNativeRoot: options.reactNativeRoot,
84
+ providers: options.providers,
85
+ codegenDir: path.join(scratch, 'codegen'),
86
+ })
87
+ // the compiled sources target the app's own declared iOS minimum
88
+ const iosDeploymentTarget = readIosAppTarget(options.projectRoot)?.iosDeploymentTarget
89
+ if (!iosDeploymentTarget)
90
+ throw new Error(
91
+ `TurboModule compilation needs the app's Xcode project to declare an iOS deployment target: ${options.projectRoot}`,
92
+ )
93
+ const input = collectTurboCompileInput(
94
+ collection,
95
+ await resolveAdapterArchive(
96
+ 'turbo',
97
+ { reactNative: collection.reactNative.root },
98
+ options.moduleRoot,
99
+ committedAdapterLocks.turbo,
100
+ ),
101
+ iosDeploymentTarget,
102
+ )
103
+ const packagePath = path.join(scratch, 'package')
104
+ syncSwiftTree(
105
+ packagePath,
106
+ new Map(
107
+ Object.entries(input.files).map(([file, source]) => [
108
+ path.join(packagePath, file),
109
+ source,
110
+ ]),
111
+ ),
112
+ )
113
+ const project = projectFor(packagePath)
114
+ project.libraries = input.libraries
115
+ project.lazyDistribution = input.lazyDistribution
116
+ return {
117
+ artifact: await artifactFor(project, input.entry, options.moduleRoot),
118
+ collection,
119
+ }
120
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "schema": 2,
3
+ "platform": "ios",
4
+ "target": "wasm32-unknown-wasip1",
5
+ "recipe": "704fe0a2e79278bce00a7af1b1dc1846943873c3f54942a174833a515d222b79",
6
+ "adapter": {
7
+ "sha256": "0d31912293226deb3354b3b32f2944e9c61c68590e3020d8b5af0c12a6677893"
8
+ },
9
+ "compiler": "swift-6.4.0-RELEASE-custom-81b2c791c27276bf",
10
+ "sdk": {
11
+ "id": "swift-6.4.0-RELEASE_wasm-peach-b26c1c1d",
12
+ "checksum": "d3bec118d62c1015e0a2b30e0f09b8fab25613d0ac98e0dee31e68c5521bc747"
13
+ },
14
+ "framework": {
15
+ "distribution": "c1636d7b2e11fc76",
16
+ "wireAbi": "246b8412514b644113e6a26252c8ebd6de49ab4156ac5f5c98bb9e4c2ff2568b"
17
+ },
18
+ "archives": [
19
+ {
20
+ "headers": {
21
+ "reactNativeJsi": "0f8c2defbca69a27a848a81ae72363073bf9602fd316e57a75811be1a0528358"
22
+ },
23
+ "sha256": "f1652a56346d7042f118c2694b13f870af04a6fadb4131f9a0ed356f6c569f55",
24
+ "size": 25399
25
+ },
26
+ {
27
+ "headers": {
28
+ "reactNativeJsi": "324aefd8591d9ce688bce7589c4c2b516cd33ecb95d35c47239a87a8fcf6a8da"
29
+ },
30
+ "sha256": "70ce25d883d54c1a285eb5be7b6f9f579b96e17004bd290e45f554166610eb43",
31
+ "size": 25398
32
+ },
33
+ {
34
+ "headers": {
35
+ "reactNativeJsi": "66b2cd5a38511195207f6c8a76aba735f9b9cc66a52a0d00780ffe5d331623f7"
36
+ },
37
+ "sha256": "c983243dce2d889c0aaea3aaa9d34d1af7050b2f26866e465a1473dc066fa6dd",
38
+ "size": 25396
39
+ },
40
+ {
41
+ "headers": {
42
+ "reactNativeJsi": "96db4e758dd53e9320cef7cad485e00aa06e7a982cefd920f17007de8a5bd9f9"
43
+ },
44
+ "sha256": "d651a6f69f016264a9a72ff0fd9303c6fb8b9ed30db545ce462ceadd1d9e2c1b",
45
+ "size": 26143
46
+ },
47
+ {
48
+ "headers": {
49
+ "reactNativeJsi": "aeab590ddd1218df963462242d3954ce467b0fa88f70e91429e4ffc74d230893"
50
+ },
51
+ "sha256": "293fb5ae79d60939eeb341cda359faf1d9868dd8e4ff0db3c3f3eee8285d5504",
52
+ "size": 26138
53
+ },
54
+ {
55
+ "headers": {
56
+ "reactNativeJsi": "b5fb260522384dd7ab07d740cdc534b529922446fcec798341c7817d9eaa49f4"
57
+ },
58
+ "sha256": "ecec13cfa871c6732c394a7eb620ec764227aecf237bf605534ac9b2e75dc460",
59
+ "size": 25265
60
+ },
61
+ {
62
+ "headers": {
63
+ "reactNativeJsi": "c6b391a1e870ccf7cdd534be63582862840f8245b99ebd253317deece1e6ffd5"
64
+ },
65
+ "sha256": "7da7688735e62030faeff9722ce932e0c0262762981df2988bcb5bb5fff3d3e4",
66
+ "size": 26144
67
+ }
68
+ ]
69
+ }