peachsim 0.1.2253 → 0.1.2257

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 (144) hide show
  1. package/cli/bridge-flow-runner.ts +41 -0
  2. package/cli/commands/compat.ts +1 -1
  3. package/cli/commands/control.ts +9 -3
  4. package/cli/commands/flow.ts +9 -0
  5. package/cli/commands/package.ts +1 -1
  6. package/cli/commands/runtime.ts +1 -1
  7. package/cli/commands/swift.ts +5 -0
  8. package/cli/commands/upgrade.ts +2 -5
  9. package/cli/commands/version.ts +1 -1
  10. package/cli/current-sim.ts +23 -15
  11. package/cli/native-input.ts +1 -1
  12. package/cli/outbound-endpoints.ts +0 -2
  13. package/cli/secure-file.ts +8 -2
  14. package/dist-lib/agent-daemon-client.cjs +1 -1
  15. package/dist-lib/agent-events.cjs +1 -1
  16. package/dist-lib/attached-projects.cjs +1 -1
  17. package/dist-lib/auth/shared-session.cjs +1 -1
  18. package/dist-lib/backend-origin.cjs +1 -1
  19. package/dist-lib/beta.cjs +1 -1
  20. package/dist-lib/beta.mjs +1 -1
  21. package/dist-lib/bridge-constants.cjs +1 -1
  22. package/dist-lib/bridge-contract-input.cjs +1 -1
  23. package/dist-lib/bridge-contract-input.mjs +1 -1
  24. package/dist-lib/bridge-contract.cjs +1 -1
  25. package/dist-lib/bridge-contract.mjs +1 -1
  26. package/dist-lib/bundle-channel.cjs +3295 -2329
  27. package/dist-lib/capture-contract.cjs +1 -1
  28. package/dist-lib/capture-contract.mjs +1 -1
  29. package/dist-lib/cloud-contract.cjs +1 -1
  30. package/dist-lib/cloud-contract.mjs +1 -1
  31. package/dist-lib/cloud-test-args.cjs +1 -1
  32. package/dist-lib/cloud-test-args.mjs +1 -1
  33. package/dist-lib/cloud.cjs +1 -1
  34. package/dist-lib/cloud.mjs +1 -1
  35. package/dist-lib/config.cjs +16 -1
  36. package/dist-lib/config.mjs +14 -1
  37. package/dist-lib/detox/index.cjs +16 -12
  38. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  39. package/dist-lib/expo-swift-bundle.cjs +3345 -2401
  40. package/dist-lib/expo-swift-metadata.cjs +1 -1
  41. package/dist-lib/expo-swift-metadata.mjs +1 -1
  42. package/dist-lib/home-paths.cjs +1 -1
  43. package/dist-lib/host/bridge-host.cjs +3869 -2832
  44. package/dist-lib/host/fetch-proxy-handler.cjs +3607 -1627
  45. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  46. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  47. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  48. package/dist-lib/host/websocket-proxy.cjs +1 -1
  49. package/dist-lib/index.cjs +14284 -12772
  50. package/dist-lib/jump-to-source-babel.cjs +1 -1
  51. package/dist-lib/jump-to-source-native.cjs +1 -1
  52. package/dist-lib/kotlin-host.cjs +6 -4
  53. package/dist-lib/menu.cjs +1 -1
  54. package/dist-lib/menu.mjs +1 -1
  55. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  56. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  57. package/dist-lib/metro-production-bundle.cjs +1 -1
  58. package/dist-lib/metro-production-bundle.mjs +1 -1
  59. package/dist-lib/metro.cjs +9796 -8347
  60. package/dist-lib/native-app-identity-project.cjs +2 -2
  61. package/dist-lib/native-app-identity-project.mjs +2 -3
  62. package/dist-lib/native-app-identity.cjs +1 -1
  63. package/dist-lib/native-app-identity.mjs +1 -1
  64. package/dist-lib/native-firebase-metadata.cjs +1 -1
  65. package/dist-lib/native-firebase-metadata.mjs +1 -1
  66. package/dist-lib/pdfium-raster.cjs +1 -1
  67. package/dist-lib/pdfium-raster.mjs +1 -1
  68. package/dist-lib/plist.cjs +1 -1
  69. package/dist-lib/plist.mjs +1 -1
  70. package/dist-lib/profiles.cjs +1 -1
  71. package/dist-lib/public-brand.cjs +1 -1
  72. package/dist-lib/public-origins-lib-esm.json +24 -24
  73. package/dist-lib/public-origins-lib.json +682 -292
  74. package/dist-lib/react-native-host-modules.cjs +1 -1
  75. package/dist-lib/react-native-host-modules.mjs +1 -1
  76. package/dist-lib/reap-browser.cjs +1 -1
  77. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  78. package/dist-lib/sdk.cjs +1 -1
  79. package/dist-lib/sdk.mjs +1 -1
  80. package/dist-lib/skills.cjs +4580 -3494
  81. package/dist-lib/swift-compile.cjs +426 -126
  82. package/dist-lib/swift-compile.mjs +429 -126
  83. package/dist-lib/swift-package.cjs +1 -1
  84. package/dist-lib/swift-package.mjs +1 -1
  85. package/dist-lib/swift-submit.cjs +1 -1
  86. package/dist-lib/swift-submit.mjs +1 -1
  87. package/dist-lib/swift-toolchain.cjs +1 -1
  88. package/dist-lib/swift.cjs +1 -1
  89. package/dist-lib/vite-swift.cjs +2529 -1611
  90. package/dist-lib/vite.cjs +7138 -4012
  91. package/dist-lib/worklet-executable.cjs +1 -1
  92. package/dist-lib/worklet-executable.mjs +1 -1
  93. package/dist-types/packages/peach-engine/src/config.d.ts +1 -1
  94. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -0
  95. package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -0
  96. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +33 -1
  97. package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +1 -0
  98. package/dist-types/packages/peach-globals/src/appLifecycleBridgeContract.d.ts +1 -0
  99. package/dist-types/packages/peach-globals/src/index.d.ts +2 -1
  100. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +12 -0
  101. package/dist-types/packages/peach-kit/src/transitions/screen-transition-math.d.ts +6 -0
  102. package/java-platform/licenses/android.txt +183 -0
  103. package/java-platform/licenses/arm-optimized-routines.txt +256 -0
  104. package/java-platform/licenses/fdlibm.txt +72 -0
  105. package/java-platform/licenses/icu.txt +50 -0
  106. package/java-platform/licenses/openjdk.txt +395 -0
  107. package/java-platform/licenses/teavm.txt +182 -0
  108. package/java-platform/licenses/threeten-backport.txt +29 -0
  109. package/kotlin/README.md +1 -1
  110. package/kotlin/sdk.tar.gz +0 -0
  111. package/package.json +2 -1
  112. package/runtime-companion.json +1 -1
  113. package/sdk/ios/wasm/include/__typedef_time_t.h +5 -0
  114. package/sdk/ios/wasm/include/ifaddrs.h +75 -0
  115. package/sdk/ios/wasm/include/machine/_types.h +1 -1
  116. package/sdk/ios/wasm/include/pthread.h +4 -0
  117. package/sdk/ios/wasm/include/unistd.h +2 -0
  118. package/{cli → src}/app-config.ts +5 -5
  119. package/src/bundle-channel.mjs +1 -1
  120. package/src/config.ts +29 -0
  121. package/src/core-data-entity-classes.ts +2 -2
  122. package/src/core-data-model.ts +681 -0
  123. package/src/expo-autolinking.ts +47 -4
  124. package/src/expo-pod-prebuilt.ts +96 -9
  125. package/src/expo-swift-host.ts +30 -10
  126. package/src/kotlin-host.ts +4 -2
  127. package/src/kotlinSdkContract.ts +1 -0
  128. package/src/metro-plugin.ts +1 -3
  129. package/src/native-package-slice.ts +810 -0
  130. package/src/native-prebuilt.ts +4 -0
  131. package/src/native-seam-manifest.ts +0 -8
  132. package/src/nitro-adapter.lock.json +261 -261
  133. package/src/nitro-bundle.ts +1 -1
  134. package/src/nitro-superset.lock.json +4 -4
  135. package/src/plist-bytes.ts +113 -0
  136. package/src/swift-compile.ts +2 -0
  137. package/src/swift-distribution.lock.json +11 -11
  138. package/src/swift-guest-image-ledger.ts +2 -1
  139. package/src/swift-host.ts +14 -2
  140. package/src/swift-link-roots.ts +23 -22
  141. package/src/swift-wasm-prune.ts +436 -105
  142. package/src/turbo-bundle.ts +1 -1
  143. package/src/turbo-runtime.lock.json +22 -22
  144. package/src/vite-plugin-one.ts +68 -0
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'node:module'
2
2
  import path from 'node:path'
3
- import { loadRNXAppConfig } from '../cli/app-config'
4
3
  import { resolveAppProject } from '../cli/app-project'
4
+ import { loadRNXAppConfig } from './app-config'
5
5
  import { prebuiltExpoNative } from './expo-native-prebuilt'
6
6
  import { prepareNativeAppRoot } from './expo-native-workspace'
7
7
  import { installedNativeLibraries } from './installed-native-libraries'
@@ -8,11 +8,11 @@
8
8
  },
9
9
  "compiler": "swift-6.4.0-RELEASE-custom-fb42d2535739dfd2",
10
10
  "sdk": {
11
- "id": "swift-6.4.0-RELEASE_wasm-peach-11784d37",
12
- "checksum": "2f79c08f5df1a4c36803d1555e874d37d30c39f6f5f6c03c515812a5b71d2bbf"
11
+ "id": "swift-6.4.0-RELEASE_wasm-peach-6ff7e819",
12
+ "checksum": "ac7bf36166760fd4074f430847dcf1d12bdb6727c061919ee1425dbb9fb7f128"
13
13
  },
14
14
  "framework": {
15
- "distribution": "7eb5f6473249e4be",
15
+ "distribution": "0c0e33b4b191ff3a",
16
16
  "wireAbi": "38eed69f6b7391584112981b7892914e7033d7e0c17c2e8d4a4448030618bd2b"
17
17
  },
18
18
  "archives": [
@@ -20,71 +20,71 @@
20
20
  "headers": {
21
21
  "reactNativeJsi": "0f8c2defbca69a27a848a81ae72363073bf9602fd316e57a75811be1a0528358"
22
22
  },
23
- "sha256": "ec1db15c0c1cdafcfbb0d6e46b70218479e7987e46db0fecbb12e3227fb557f0",
24
- "size": 26171
23
+ "sha256": "5342f72977d90aea9aba94e9eaa47c384ef574784902c746844011412da629ea",
24
+ "size": 26177
25
25
  },
26
26
  {
27
27
  "headers": {
28
28
  "reactNativeJsi": "21a624ea24fd17d56bf26832d496fc1177067f89640414c20e6486c7984dfb0a"
29
29
  },
30
- "sha256": "27eba9bd34fbdc8c80ebfc192b31b3ee89d027d2ae9816b7ada54e3de42c3d8b",
31
- "size": 26913
30
+ "sha256": "b22da620504ce03ad3a3cb64d670c937c0434921a97c0f53b05b76777331403f",
31
+ "size": 26915
32
32
  },
33
33
  {
34
34
  "headers": {
35
35
  "reactNativeJsi": "324aefd8591d9ce688bce7589c4c2b516cd33ecb95d35c47239a87a8fcf6a8da"
36
36
  },
37
- "sha256": "78831ce6c2e1fe1d164998aead5bbfc1283c31250426f6ee06311ba56551f802",
38
- "size": 26167
37
+ "sha256": "9f3b3cfba36850c6730d5f387e69a39b658139f9ee2f7e5c92b20720c6436b53",
38
+ "size": 26173
39
39
  },
40
40
  {
41
41
  "headers": {
42
42
  "reactNativeJsi": "33596664ee7d7a6623f0796a6feb429543316c3a41b211150acda6e1d835286c"
43
43
  },
44
- "sha256": "9e64875f841d719b3f2b81fc2bd459e4c293f812a60c07d8b811991d443ec97d",
45
- "size": 25954
44
+ "sha256": "4b09d9f54a0a7c5c9a8a6ccdbcd6697113eaa0b81fce5521183a6932821a9ebb",
45
+ "size": 25956
46
46
  },
47
47
  {
48
48
  "headers": {
49
49
  "reactNativeJsi": "66b2cd5a38511195207f6c8a76aba735f9b9cc66a52a0d00780ffe5d331623f7"
50
50
  },
51
- "sha256": "68b2b211a2f5c2ed00497fce5e0f433ce76afa96de2cc6ba934343e6e0de06f6",
52
- "size": 26168
51
+ "sha256": "a2c0cc17a8a2d6f460146065b278fbf02636ce448ab79c09eb81f2903312b871",
52
+ "size": 26176
53
53
  },
54
54
  {
55
55
  "headers": {
56
56
  "reactNativeJsi": "96db4e758dd53e9320cef7cad485e00aa06e7a982cefd920f17007de8a5bd9f9"
57
57
  },
58
- "sha256": "ee90b76a0d9ccbf7056451855820bfef97f39c9b45730155a1bfa160dba85b07",
59
- "size": 26910
58
+ "sha256": "620f9a7a0651e7f940ea754331e878537bbe9799d325dee525dc53c76c29b16c",
59
+ "size": 26911
60
60
  },
61
61
  {
62
62
  "headers": {
63
63
  "reactNativeJsi": "aeab590ddd1218df963462242d3954ce467b0fa88f70e91429e4ffc74d230893"
64
64
  },
65
- "sha256": "97881f12d2e6168645984291a920961f1667a61bd9c448e546a40456a4cfe9b3",
66
- "size": 26911
65
+ "sha256": "10359242755f0cf752cf56d5bfae72d17b1c605aa7adb72fabc22ccac8c3a088",
66
+ "size": 26913
67
67
  },
68
68
  {
69
69
  "headers": {
70
70
  "reactNativeJsi": "b5fb260522384dd7ab07d740cdc534b529922446fcec798341c7817d9eaa49f4"
71
71
  },
72
- "sha256": "e97b334fd4105e356bb3958214b52b953928828f31f35c9d273b150736530be1",
72
+ "sha256": "50a30bfb2d01e9cd2f62426ebe0350bfb47a62dabb55c68b1498dde6dd394068",
73
73
  "size": 26045
74
74
  },
75
75
  {
76
76
  "headers": {
77
77
  "reactNativeJsi": "c6b391a1e870ccf7cdd534be63582862840f8245b99ebd253317deece1e6ffd5"
78
78
  },
79
- "sha256": "3be1e1c6f5dda70945a1afb2cea67fc1093704c71e20f4eb3d344371fdfea755",
80
- "size": 26911
79
+ "sha256": "82e9cc7b7478bc9a430d7885814b237e36fa087e7b728ffe9bc64b87689342e1",
80
+ "size": 26912
81
81
  },
82
82
  {
83
83
  "headers": {
84
84
  "reactNativeJsi": "c8270f1315745ecc204c4209a4f50f58ff6f14b4a385ad6820a69800270b53c6"
85
85
  },
86
- "sha256": "76d5af4649ecf90a32a2c25739747e08deefeebe0054a030c6bc718d872c4625",
87
- "size": 25918
86
+ "sha256": "9b8e5e762ead8d4a2e2efe55530b455c4b8a5202f9e636202ea079d99fd9d8a0",
87
+ "size": 25919
88
88
  }
89
89
  ]
90
90
  }
@@ -18,8 +18,11 @@ import {
18
18
  PACKAGE_VERSIONS_HEADER,
19
19
  } from '@peach/globals/package-versions'
20
20
  import { WebSocket, WebSocketServer } from 'ws'
21
+ import { resolveAppProject } from '../cli/app-project'
22
+ import { loadRNXAppConfig } from './app-config'
21
23
  import { DEFAULT_SOOTSIM_BRIDGE_PORT } from './bridge-constants'
22
24
  import { getCliRuntime } from './cli-runtime'
25
+ import { matchConfigModule, PEACH_WORKSPACE_MODULE_MARKER } from './config'
23
26
  import {
24
27
  launchRnxDesktop,
25
28
  resolveRnxDesktopAppName,
@@ -48,6 +51,7 @@ import { ensureRuntimePackFor } from './runtime-packs'
48
51
  import { SWIFT_HMR_PATH, SWIFT_PACKAGE_PATH } from './swift-submit'
49
52
  import { privateSwiftDistributionRoot } from './swift-toolchain'
50
53
  import { swiftViteLifetime } from './swift-vite-lifetime'
54
+ import type { PeachConfig } from './config'
51
55
  import type { OneWidgetPackage } from './oneWidgetContract'
52
56
  import type { PeachPluginOptions } from './vite'
53
57
  import type { IncomingMessage, ServerResponse } from 'node:http'
@@ -91,8 +95,72 @@ export function peachPlugin(options: PeachPluginOptions = {}): Plugin {
91
95
 
92
96
  api: {
93
97
  vxrnNative({ root, dev }: { root: string; dev: boolean }): Plugin {
98
+ let modules: PeachConfig['modules']
94
99
  return {
95
100
  name: 'peach:package-versions',
101
+ async buildStart() {
102
+ if (options.enabled === false || dev) return
103
+ modules = (await loadRNXAppConfig(resolveAppProject(root)))?.modules
104
+ },
105
+ transform(code, id) {
106
+ if (!modules || id.includes('/node_modules/')) return
107
+ const match = matchConfigModule(id.split('?')[0], modules)
108
+ if (!match) return
109
+ // production rolldown reads a module's exports by direct binding, so
110
+ // the tag lists each export name with the local it reads
111
+ const exported: string[] = []
112
+ for (const node of this.parse(code, {
113
+ lang: id.split('?')[0].endsWith('x') ? 'tsx' : 'ts',
114
+ }).body) {
115
+ if (node.type === 'ExportDefaultDeclaration') {
116
+ const declaration = node.declaration
117
+ if (!('id' in declaration) || declaration.id?.type !== 'Identifier')
118
+ throw new Error(
119
+ `${id}: a configured module needs a named default export`,
120
+ )
121
+ exported.push(`default:()=>${declaration.id.name}`)
122
+ } else if (
123
+ node.type === 'ExportNamedDeclaration' &&
124
+ node.exportKind !== 'type'
125
+ ) {
126
+ if (node.source)
127
+ throw new Error(
128
+ `${id}: a configured module cannot re-export from another module`,
129
+ )
130
+ for (const specifier of node.specifiers) {
131
+ const { exported: name, local } = specifier
132
+ if (specifier.exportKind === 'type') continue
133
+ if (local.type !== 'Identifier')
134
+ throw new Error(`${id}: a configured module needs plain exports`)
135
+ exported.push(
136
+ `${JSON.stringify('name' in name ? name.name : name.value)}:()=>${local.name}`,
137
+ )
138
+ }
139
+ const declaration = node.declaration
140
+ if (declaration?.type === 'VariableDeclaration') {
141
+ for (const declarator of declaration.declarations) {
142
+ if (declarator.id.type !== 'Identifier')
143
+ throw new Error(
144
+ `${id}: a configured module needs plain exported variables`,
145
+ )
146
+ exported.push(`${declarator.id.name}:()=>${declarator.id.name}`)
147
+ }
148
+ } else if (
149
+ (declaration?.type === 'FunctionDeclaration' ||
150
+ declaration?.type === 'ClassDeclaration' ||
151
+ declaration?.type === 'TSEnumDeclaration') &&
152
+ declaration.id?.type === 'Identifier'
153
+ ) {
154
+ exported.push(`${declaration.id.name}:()=>${declaration.id.name}`)
155
+ }
156
+ } else if (node.type === 'ExportAllDeclaration') {
157
+ throw new Error(
158
+ `${id}: a configured module cannot re-export from another module`,
159
+ )
160
+ }
161
+ }
162
+ return `${code}\nglobalThis.${PEACH_WORKSPACE_MODULE_MARKER}=[${JSON.stringify(match.pattern)},{${exported.join(',')}}];`
163
+ },
96
164
  async generateBundle(_options, bundle) {
97
165
  if (options.enabled === false || dev) return
98
166
  const versions = readInstalledNativePackageVersions(root)