peachsim 0.1.2296 → 0.1.2299

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 (142) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +1 -1
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +1226 -1070
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +2 -2
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +129 -33
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +213 -57
  31. package/dist-lib/host/fetch-proxy-handler.cjs +8 -6
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +2392 -4522
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +14 -2
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +4537 -6668
  47. package/dist-lib/native-app-identity-project.cjs +4 -4
  48. package/dist-lib/native-app-identity-project.mjs +4 -4
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/pdfium-raster.cjs +1 -1
  54. package/dist-lib/pdfium-raster.mjs +1 -1
  55. package/dist-lib/plist.cjs +1 -1
  56. package/dist-lib/plist.mjs +1 -1
  57. package/dist-lib/profiles.cjs +1 -1
  58. package/dist-lib/public-brand.cjs +1 -1
  59. package/dist-lib/public-origins-lib-esm.json +24 -24
  60. package/dist-lib/public-origins-lib.json +81 -85
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/reap-browser.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +215 -59
  68. package/dist-lib/swift-compile.cjs +24 -2
  69. package/dist-lib/swift-compile.mjs +24 -2
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +1 -1
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +35 -9
  77. package/dist-lib/vite.cjs +8 -6
  78. package/dist-lib/worklet-executable.cjs +1 -1
  79. package/dist-lib/worklet-executable.mjs +1 -1
  80. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +10 -8
  81. package/dist-types/packages/peach-engine/src/engine/scroll-platform.d.ts +0 -1
  82. package/dist-types/packages/peach-engine/src/render-worker/nativeAnimMirrorContract.d.ts +2 -1
  83. package/dist-types/packages/peach-engine/src/render-worker/worker-input-runtime.d.ts +2 -1
  84. package/dist-types/packages/peach-engine/src/settings/device-spec-bus.d.ts +5 -0
  85. package/dist-types/packages/peach-kit/src/capabilities.d.ts +2 -2
  86. package/dist-types/packages/peach-kit/src/transitions/screen-transition-math.d.ts +23 -11
  87. package/kotlin/README.md +1 -1
  88. package/kotlin/sdk.tar.gz +0 -0
  89. package/kotlin/toolchain.json +5 -1
  90. package/package.json +1 -1
  91. package/runtime-companion.json +1 -1
  92. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXAction.h +34 -0
  93. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXAnswerCallAction.h +20 -0
  94. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXBase.h +20 -0
  95. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXCall.h +28 -0
  96. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXCallAction.h +23 -0
  97. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXCallController.h +53 -0
  98. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXCallDirectory.h +16 -0
  99. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXCallDirectoryExtensionContext.h +86 -0
  100. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXCallDirectoryManager.h +29 -0
  101. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXCallDirectoryProvider.h +21 -0
  102. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXCallObserver.h +34 -0
  103. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXCallUpdate.h +43 -0
  104. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXEndCallAction.h +20 -0
  105. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXError.h +66 -0
  106. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXHandle.h +31 -0
  107. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXPlayDTMFCallAction.h +33 -0
  108. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXProvider.h +127 -0
  109. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXProviderConfiguration.h +42 -0
  110. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXSetGroupCallAction.h +27 -0
  111. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXSetHeldCallAction.h +23 -0
  112. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXSetMutedCallAction.h +23 -0
  113. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXSetTranslatingCallAction.h +40 -0
  114. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXStartCallAction.h +33 -0
  115. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CXTransaction.h +34 -0
  116. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CallKit.apinotes +36 -0
  117. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Headers/CallKit.h +35 -0
  118. package/sdk/ios/System/Library/Frameworks/CallKit.framework/Modules/module.modulemap +6 -0
  119. package/sdk/ios/System/Library/Frameworks/React.framework/Headers/React.h +14 -0
  120. package/src/expo-autolinking.ts +1 -1
  121. package/src/expo-discovery-cache.ts +65 -4
  122. package/src/expo-swift-host.ts +5 -5
  123. package/src/kotlin-toolchain.ts +16 -1
  124. package/src/kotlinSdkContract.ts +2 -1
  125. package/src/metro-plugin.ts +1 -4
  126. package/src/native-swift-slices.ts +9 -2
  127. package/src/nitro-adapter.lock.json +284 -284
  128. package/src/nitro-compile.ts +69 -4
  129. package/src/nitro-superset.lock.json +4 -4
  130. package/src/one-sdk/source.ts +2 -1
  131. package/src/prepared-native-inventory.ts +8 -2
  132. package/src/react-native-autolinking.ts +28 -9
  133. package/src/swift-coverage/xcode-packages.ts +2 -1
  134. package/src/swift-distribution.lock.json +11 -11
  135. package/src/swift-host.ts +3 -1
  136. package/src/swift-standins.ts +6 -3
  137. package/src/swift-wasm-prune.ts +29 -0
  138. package/src/turbo-bundle.ts +14 -6
  139. package/src/turbo-codegen-intake.ts +3 -2
  140. package/src/turbo-runtime.lock.json +22 -22
  141. package/src/turbo-source.ts +2 -4
  142. package/src/xcode-project.ts +1 -1
@@ -29,12 +29,10 @@ async function cliAdvertises(
29
29
  args: string[],
30
30
  token: string,
31
31
  appRoot: string,
32
- signal?: AbortSignal,
33
32
  ): Promise<boolean> {
34
33
  const started = Date.now()
35
- const { stdout, stderr } = await run('node', [cli, ...args], {
34
+ const { stdout, stderr } = await run(process.execPath, [cli, ...args], {
36
35
  cwd: appRoot,
37
- signal,
38
36
  timeout: CLI_TIMEOUT_MS,
39
37
  maxBuffer: 1 * 1024 * 1024,
40
38
  env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: '1' },
@@ -59,12 +57,35 @@ function declaresDependency(appRoot: string, name: string): boolean {
59
57
  )
60
58
  }
61
59
 
60
+ // concurrent native preparations of one app share a single autolinker run.
61
+ const inFlight = new Map<string, Promise<unknown>>()
62
+
62
63
  export async function reactNativeAutolinkingConfig(
63
64
  appRoot: string,
64
65
  platform: 'ios' | 'android',
65
66
  signal?: AbortSignal,
66
67
  ): Promise<unknown> {
67
- appRoot = fs.realpathSync(appRoot)
68
+ signal?.throwIfAborted()
69
+ const root = fs.realpathSync(appRoot)
70
+ const key = `${platform}:${root}`
71
+ let shared = inFlight.get(key)
72
+ if (!shared) {
73
+ shared = readAutolinkingConfig(root, platform).finally(() => inFlight.delete(key))
74
+ inFlight.set(key, shared)
75
+ }
76
+ if (!signal) return shared
77
+ return Promise.race([
78
+ shared,
79
+ new Promise<never>((_, reject) =>
80
+ signal.addEventListener('abort', () => reject(signal.reason), { once: true }),
81
+ ),
82
+ ])
83
+ }
84
+
85
+ async function readAutolinkingConfig(
86
+ appRoot: string,
87
+ platform: 'ios' | 'android',
88
+ ): Promise<unknown> {
68
89
  const appRequire = createRequire(path.join(appRoot, 'package.json'))
69
90
  const expoManifest = appRequire.resolve
70
91
  .paths('expo')
@@ -96,7 +117,7 @@ export async function reactNativeAutolinkingConfig(
96
117
  : undefined
97
118
  if (expoAutolinker) {
98
119
  const cli = path.join(path.dirname(expoAutolinker), 'bin/expo-modules-autolinking.js')
99
- if (await cliAdvertises(cli, ['--help'], 'react-native-config', appRoot, signal)) {
120
+ if (await cliAdvertises(cli, ['--help'], 'react-native-config', appRoot)) {
100
121
  const args = [
101
122
  cli,
102
123
  'react-native-config',
@@ -108,13 +129,12 @@ export async function reactNativeAutolinkingConfig(
108
129
  ]
109
130
  return autolinkerJson(
110
131
  'expo-modules-autolinking react-native-config',
111
- await run('node', args, {
132
+ await run(process.execPath, args, {
112
133
  timeout: CLI_TIMEOUT_MS,
113
134
  maxBuffer: 8 * 1024 * 1024,
114
135
  env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: '1' },
115
136
  // expo configuration resolves its project from cwd.
116
137
  cwd: appRoot,
117
- signal,
118
138
  }),
119
139
  )
120
140
  }
@@ -158,9 +178,8 @@ export async function reactNativeAutolinkingConfig(
158
178
  : ['config']
159
179
  return autolinkerJson(
160
180
  `react-native ${configArgs.join(' ')}`,
161
- await run('node', [cliPath, ...configArgs], {
181
+ await run(process.execPath, [cliPath, ...configArgs], {
162
182
  cwd: appRoot,
163
- signal,
164
183
  timeout: CLI_TIMEOUT_MS,
165
184
  maxBuffer: 16 * 1024 * 1024,
166
185
  env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: '1', NO_COLOR: '1' },
@@ -221,7 +221,8 @@ export function createSwiftModuleWalker(
221
221
  resources: implicitResources.length > 0,
222
222
  catalogs,
223
223
  iosDeployment: manifest.iosDeployment,
224
- defines: swiftPackageConditions(target, configuration),
224
+ // xcode adds -DXcode to the conditions swiftpm defines
225
+ defines: ['Xcode', ...swiftPackageConditions(target, configuration)],
225
226
  dependsOn: [...new Set(dependsOn)],
226
227
  })
227
228
  done.set(key, moduleName)
@@ -1,10 +1,10 @@
1
1
  {
2
- "id": "4ca2b3c83875439a",
2
+ "id": "e8eb8181d001de00",
3
3
  "release": "swift-6.4.0-RELEASE-custom-fb42d2535739dfd2",
4
- "wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-ad35b0d9",
5
- "wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-ad35b0d9.artifactbundle.tar.gz",
6
- "wasmSdkChecksum": "477c394dd425b54e77260bbc2bab9621642e800e982ada3b99d60158cc3b8eaa",
7
- "source": "9e2afac0cce5cde0da7a24d470e4d6b8a26722c1",
4
+ "wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-3881e5a7",
5
+ "wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-3881e5a7.artifactbundle.tar.gz",
6
+ "wasmSdkChecksum": "b8981ed65e4292d922ece858d386ba4280fc90570302a57a4a789ca257daed29",
7
+ "source": "2c5df43f2bd1d349c712e86d8ea33b331f399b45",
8
8
  "targets": [
9
9
  "ImagePlayground",
10
10
  "QuickLookThumbnailing",
@@ -246,16 +246,16 @@
246
246
  },
247
247
  "hosts": {
248
248
  "darwin-arm64": {
249
- "sha256": "6d7ba1a722732146b06b8d41e5560dec399caf805312936d991b19ddc4521adf",
250
- "size": 107805145
249
+ "sha256": "0fbc9bb9354d34f48f12417cda034ee1a5e57e93a751b98de585f3fa8a955b11",
250
+ "size": 107830848
251
251
  },
252
252
  "linux-x64": {
253
- "sha256": "0373dd6567957507e695c4226b78f1f6cbaf320c3e7629f2057e47d3348e560d",
254
- "size": 110523446
253
+ "sha256": "5d3e78c422d7f4fef1a94b835885d1c11371e37a3cbe78aa154313b6c96e6a82",
254
+ "size": 110550051
255
255
  },
256
256
  "linux-arm64": {
257
- "sha256": "60c28d53dceb00c0b2a3748419c8a4458f75592820c73b0902ac58cb01cc61ae",
258
- "size": 110015845
257
+ "sha256": "19154c89277ebdaa6478c47d5626d2b1333d4921d0782fd3d3ce589644cc93eb",
258
+ "size": 110043572
259
259
  }
260
260
  }
261
261
  }
package/src/swift-host.ts CHANGED
@@ -1117,7 +1117,8 @@ async function buildXcodeLayout(root: string): Promise<XcodeLayout | null> {
1117
1117
  : {}),
1118
1118
  })
1119
1119
  // xcode builds packages in swiftpm's debug configuration for Debug, which
1120
- // defines DEBUG, and in release for any other, as its package compiles show
1120
+ // defines DEBUG, and in release for any other, as its package compiles show;
1121
+ // every package swift unit xcode compiles also gets -DXcode
1121
1122
  const packageConfiguration = app.configuration === 'Debug' ? 'debug' : 'release'
1122
1123
  for (const target of packages.targets) {
1123
1124
  const relative = path.relative(
@@ -1151,6 +1152,7 @@ async function buildXcodeLayout(root: string): Promise<XcodeLayout | null> {
1151
1152
  path: target.remote ? path.posix.join(XCODE_PACKAGES_DIR, posix) : posix,
1152
1153
  exclude: target.exclude ?? [],
1153
1154
  defines: [
1155
+ 'Xcode',
1154
1156
  ...(packageConfiguration === 'debug' ? ['DEBUG'] : []),
1155
1157
  ...target.packageDefines
1156
1158
  .filter(
@@ -453,10 +453,13 @@ export function binaryHeaderSearchPaths(
453
453
  const name = path.basename(framework, '.framework')
454
454
  if (!declaredFrameworks) continue
455
455
  const imports = declaredFrameworks.imports.get(name)
456
- const swift = imports && swiftModuleInterface(declaredFrameworks.moduleRoot, name)
456
+ const swift =
457
+ !REACH_STAGED_FRAMEWORKS.has(name) &&
458
+ imports &&
459
+ swiftModuleInterface(declaredFrameworks.moduleRoot, name)
457
460
  const compiled = declaredFrameworks.compiledImports.get(name)
458
461
  if (swift) declared.set(framework, { ...swift, imports, sdkHeader: null })
459
- else if (compiled && REACH_STAGED_FRAMEWORKS.has(name)) {
462
+ else if ((compiled || imports) && REACH_STAGED_FRAMEWORKS.has(name)) {
460
463
  const sdkHeader = path.join(
461
464
  swiftSharedSdkRoot(
462
465
  declaredFrameworks.moduleRoot,
@@ -468,7 +471,7 @@ export function binaryHeaderSearchPaths(
468
471
  declared.set(framework, {
469
472
  declared: null,
470
473
  header: null,
471
- imports: compiled,
474
+ imports: compiled ?? new Set(),
472
475
  sdkHeader: fs.readFileSync(sdkHeader, 'utf8'),
473
476
  })
474
477
  }
@@ -714,6 +714,35 @@ function parseWasmObjectBytes(
714
714
  }
715
715
  }
716
716
 
717
+ // swift places constant metadata in one explicit .rodata segment, and the
718
+ // assembler folds a relative pointer between two symbols of that segment
719
+ // into a constant with no relocation (a generic requirement's protocol, a
720
+ // nested type's parent). a relocation-free word that lands on another
721
+ // symbol's start, past swift's two low int-pair flag bits, keeps that symbol
722
+ // live as a relocation would; a coincidental match only keeps extra data.
723
+ const relocatedWords = new Map<number, Set<number>>()
724
+ for (const r of dataRelocList) {
725
+ let words = relocatedWords.get(r.segIdx)
726
+ if (!words) relocatedWords.set(r.segIdx, (words = new Set()))
727
+ words.add(r.offInSeg)
728
+ }
729
+ for (const [segIdx, tops] of segTopSyms) {
730
+ const starts = new Map(tops.map((top) => [top.off, top.symIdx]))
731
+ const relocated = relocatedWords.get(segIdx)
732
+ const payload = dataStart + sPayloadStarts[segIdx]!
733
+ const view = new DataView(buf.buffer, buf.byteOffset + payload)
734
+ for (const top of tops) {
735
+ for (let at = top.off; at + 4 <= top.end; at += 4) {
736
+ if (relocated?.has(at)) continue
737
+ const target = starts.get(at + (view.getInt32(at, true) & ~3))
738
+ if (target === undefined || target === top.symIdx) continue
739
+ let list = symDataRelocs.get(top.symIdx)
740
+ if (!list) symDataRelocs.set(top.symIdx, (list = []))
741
+ list.push(target)
742
+ }
743
+ }
744
+ }
745
+
717
746
  const typePrefixesInObj = new Set<string>()
718
747
  for (let i = 0; i < symKind.length; i++) {
719
748
  if (
@@ -8,6 +8,7 @@ import { installedNativeLibraries } from './installed-native-libraries'
8
8
  import {
9
9
  compiledModuleAssets,
10
10
  compiledModuleRequestHandler,
11
+ selectCompiledNitroProviders,
11
12
  type CompiledModuleAsset,
12
13
  } from './nitro-bundle'
13
14
  import { swiftDistributionRoot } from './swift-distribution'
@@ -20,7 +21,9 @@ import type { TurboCompiledModule } from './nitroContract'
20
21
  export const TURBO_ROUTE = '/__peach/turbo'
21
22
 
22
23
  /** the installed C++ TurboModule providers an app compiles: every one Peach
23
- * does not answer itself (a seam resolves before the original module). */
24
+ * does not answer itself (a seam resolves before the original module) and
25
+ * the Nitro compile does not own, since it links a Nitro provider's React
26
+ * support itself. */
24
27
  export async function compiledTurboProviders(
25
28
  appRoot: string,
26
29
  projectRoot?: string,
@@ -32,12 +35,17 @@ export async function compiledTurboProviders(
32
35
  ...Object.keys(config?.nativeViews ?? {}),
33
36
  ])
34
37
  if (!projectRoot && (await turboProviderCandidates(appRoot)).length === 0) return []
35
- return discoverTurboProviders(
36
- appRoot,
37
- projectRoot ?? (await prepareNativeAppRoot(appRoot)),
38
- iosTarget,
39
- answered,
38
+ const nitro = new Set(
39
+ (await selectCompiledNitroProviders(appRoot))?.providers.map(({ name }) => name),
40
40
  )
41
+ return (
42
+ await discoverTurboProviders(
43
+ appRoot,
44
+ projectRoot ?? (await prepareNativeAppRoot(appRoot)),
45
+ iosTarget,
46
+ answered,
47
+ )
48
+ ).filter(({ name }) => !nitro.has(name))
41
49
  }
42
50
 
43
51
  // every installed iOS pod that registers a C++ TurboModule compiles from its
@@ -10,6 +10,7 @@ import fs from 'node:fs'
10
10
  import { createRequire } from 'node:module'
11
11
  import path from 'node:path'
12
12
  import { promisify } from 'node:util'
13
+ import { PEACH_FORKED_SCRIPT_ENV } from './forked-script-contract'
13
14
  import { isRecord } from './is-record'
14
15
  import { iosAutolinkingConfig } from './nitro-source'
15
16
  import {
@@ -250,7 +251,7 @@ export async function runInstalledTurboCodegen(
250
251
  if (!isRecord(manifest) || typeof manifest.version !== 'string')
251
252
  throw new Error(`${manifestPath}: no version`)
252
253
  // RCT_SCRIPT_OUTPUT_DIR would move the output out from under outDir
253
- const env = { ...process.env }
254
+ const env: NodeJS.ProcessEnv = { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: '1' }
254
255
  delete env.RCT_SCRIPT_OUTPUT_DIR
255
256
  const app = fs.realpathSync(appRoot)
256
257
  const out = realTarget(outDir)
@@ -268,7 +269,7 @@ export async function runInstalledTurboCodegen(
268
269
  JSON.stringify(await iosAutolinkingConfig(appRoot, signal)),
269
270
  )
270
271
  await run(
271
- 'node',
272
+ process.execPath,
272
273
  [
273
274
  path.join(path.dirname(manifestPath), 'scripts/generate-codegen-artifacts.js'),
274
275
  '-p',
@@ -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-ad35b0d9",
12
- "checksum": "477c394dd425b54e77260bbc2bab9621642e800e982ada3b99d60158cc3b8eaa"
11
+ "id": "swift-6.4.0-RELEASE_wasm-peach-3881e5a7",
12
+ "checksum": "b8981ed65e4292d922ece858d386ba4280fc90570302a57a4a789ca257daed29"
13
13
  },
14
14
  "framework": {
15
- "distribution": "4ca2b3c83875439a",
15
+ "distribution": "e8eb8181d001de00",
16
16
  "wireAbi": "38eed69f6b7391584112981b7892914e7033d7e0c17c2e8d4a4448030618bd2b"
17
17
  },
18
18
  "archives": [
@@ -20,71 +20,71 @@
20
20
  "headers": {
21
21
  "reactNativeJsi": "0f8c2defbca69a27a848a81ae72363073bf9602fd316e57a75811be1a0528358"
22
22
  },
23
- "sha256": "18f8d215b6d696ddca4cd99a10709c4e97280c3226cf71f96455206e9f64dd92",
24
- "size": 26177
23
+ "sha256": "0e2fef6b40bd6ed971237b2e104464d247218b07384366df3fe10ecee570a610",
24
+ "size": 26171
25
25
  },
26
26
  {
27
27
  "headers": {
28
28
  "reactNativeJsi": "21a624ea24fd17d56bf26832d496fc1177067f89640414c20e6486c7984dfb0a"
29
29
  },
30
- "sha256": "cb16bdcad7a222e8f09da673fc1589c3d9c30fa4e076ae97108db1c0191de94e",
31
- "size": 26910
30
+ "sha256": "3522c8f62dbe28ea63e4bac81b4360aeded16f83ee9e46a25d82eb29af81863f",
31
+ "size": 26912
32
32
  },
33
33
  {
34
34
  "headers": {
35
35
  "reactNativeJsi": "324aefd8591d9ce688bce7589c4c2b516cd33ecb95d35c47239a87a8fcf6a8da"
36
36
  },
37
- "sha256": "8974e47ed58bf40755939bd6f5bf85e1862abf0b7ba54b1a8fb62f3828a16e93",
38
- "size": 26170
37
+ "sha256": "31ab1ef8cfe5f8444bcd5b2b3434f636fddce2c01b70a271e8084c33019fb974",
38
+ "size": 26168
39
39
  },
40
40
  {
41
41
  "headers": {
42
42
  "reactNativeJsi": "33596664ee7d7a6623f0796a6feb429543316c3a41b211150acda6e1d835286c"
43
43
  },
44
- "sha256": "e8933671813fd1ed8143d8246b905054c7c606dc875b7ffe962da73cdc3e5bfe",
45
- "size": 25956
44
+ "sha256": "3be8f65b40607aa8cbf9b8fe512c4c3b9e930b422fa748079014e7aa4363b43a",
45
+ "size": 25952
46
46
  },
47
47
  {
48
48
  "headers": {
49
49
  "reactNativeJsi": "66b2cd5a38511195207f6c8a76aba735f9b9cc66a52a0d00780ffe5d331623f7"
50
50
  },
51
- "sha256": "7e4223f63577ebc4795f7c76fdf796774ea588d2cfb860fba857644361447a9a",
52
- "size": 26175
51
+ "sha256": "4db6cf76d11fd5c02c8e6e723afb80075fc333c83b2f56cd6b6d61b50d80e37b",
52
+ "size": 26168
53
53
  },
54
54
  {
55
55
  "headers": {
56
56
  "reactNativeJsi": "96db4e758dd53e9320cef7cad485e00aa06e7a982cefd920f17007de8a5bd9f9"
57
57
  },
58
- "sha256": "86b44d75adb545dbe7fe05650d4a587d97d33ef83ce650731f6423c33e5aee5e",
59
- "size": 26910
58
+ "sha256": "1dd0095cce736de30c7333a7fef6065c2110215d98dcea6df5ddb23751aa753b",
59
+ "size": 26906
60
60
  },
61
61
  {
62
62
  "headers": {
63
63
  "reactNativeJsi": "aeab590ddd1218df963462242d3954ce467b0fa88f70e91429e4ffc74d230893"
64
64
  },
65
- "sha256": "d7736f6945b3e0098e1aa8f9503af9041e51917b1e1830bf11f04c986f5b7fe0",
65
+ "sha256": "f1650250478f99794359ff80931f2cda30234c4a89022166b660c08c17d21915",
66
66
  "size": 26912
67
67
  },
68
68
  {
69
69
  "headers": {
70
70
  "reactNativeJsi": "b5fb260522384dd7ab07d740cdc534b529922446fcec798341c7817d9eaa49f4"
71
71
  },
72
- "sha256": "deb1724dcb520725faa297f38cb0fe3d0d6f97944cc6ebd034bc174ec808527a",
73
- "size": 26045
72
+ "sha256": "999a455c207fbf35eacaa21ccf87a70eb773c80225c6e2afcefac4f130d2547f",
73
+ "size": 26041
74
74
  },
75
75
  {
76
76
  "headers": {
77
77
  "reactNativeJsi": "c6b391a1e870ccf7cdd534be63582862840f8245b99ebd253317deece1e6ffd5"
78
78
  },
79
- "sha256": "bd83c2c44f265ff8012854c558d0ba80a727dbd8e4810838752ddd6051022ec6",
80
- "size": 26910
79
+ "sha256": "4a76e57d4c5965310aa6db4bc3457ab363502b7f24132d1129e44d1eca706186",
80
+ "size": 26906
81
81
  },
82
82
  {
83
83
  "headers": {
84
84
  "reactNativeJsi": "c8270f1315745ecc204c4209a4f50f58ff6f14b4a385ad6820a69800270b53c6"
85
85
  },
86
- "sha256": "7c09726a6340572398be6a2357330d9ff5d1d360601454cd80e03e0c180c3643",
87
- "size": 25919
86
+ "sha256": "c118b9cab18c4a980ccc96a1f1dacae9b9322e94f1441c4fa52c171d4741fbbd",
87
+ "size": 25916
88
88
  }
89
89
  ]
90
90
  }
@@ -1089,6 +1089,7 @@ export async function collectTurboSources(options: {
1089
1089
  reactNativeRoot: string
1090
1090
  providers: TurboProvider[]
1091
1091
  codegenDir: string
1092
+ configuration?: 'Debug' | 'Release'
1092
1093
  installedPods?: ReadonlyMap<string, TurboInstalledPod>
1093
1094
  /** the prepared workspace whose ios/Pods holds installed binary pods' headers */
1094
1095
  projectRoot: string
@@ -1136,11 +1137,8 @@ export async function collectTurboSources(options: {
1136
1137
  const targetPath = (name: string) => `Sources/${name}`
1137
1138
  const providerTarget = (name: string) => `TurboPackage_${sha256(name).slice(0, 16)}`
1138
1139
  const folly = readFollyConfig(reactNative.root)
1139
- // the compile builds for production, as an app's Release configuration does.
1140
- // Debug also compiles React Native's asserts, which need the glog headers
1141
- // its pod generates at install.
1142
1140
  const defines = [
1143
- 'NDEBUG',
1141
+ options.configuration === 'Debug' ? 'DEBUG=1' : 'NDEBUG',
1144
1142
  'RCT_NEW_ARCH_ENABLED=1',
1145
1143
  'RCT_REMOVE_LEGACY_ARCH=1',
1146
1144
  ...folly.defines,
@@ -2649,7 +2649,7 @@ export function readXcodeAppTarget(
2649
2649
  nativeTargets.add(ref)
2650
2650
  for (const dependency of dependenciesOf(ref)) includeNativeTarget(dependency)
2651
2651
  }
2652
- for (const { ref, module } of builtTargets)
2652
+ for (const { ref, module } of builtTargets.slice(0, -1))
2653
2653
  if (
2654
2654
  options.nativeModules?.some(
2655
2655
  (name) => name === module.moduleName || name === module.name,