peachsim 0.1.1814 → 0.1.1817

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 (115) hide show
  1. package/cli/commands/control.ts +5 -2
  2. package/cli/commands/inspect.ts +43 -385
  3. package/cli/commands/package.ts +88 -32
  4. package/cli/commands/runtime.ts +2 -2
  5. package/cli/outbound-endpoints.ts +2 -2
  6. package/cli/packaged-app-launcher.ts +6 -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 +1 -1
  10. package/dist-lib/auth/shared-session.cjs +1 -1
  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 +5186 -5881
  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 +100 -16
  31. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  32. package/dist-lib/expo-swift-bundle.cjs +3949 -4535
  33. package/dist-lib/expo-swift-metadata.cjs +1 -1
  34. package/dist-lib/expo-swift-metadata.mjs +1 -1
  35. package/dist-lib/home-paths.cjs +1 -1
  36. package/dist-lib/host/bridge-host.cjs +3724 -4482
  37. package/dist-lib/host/fetch-proxy-handler.cjs +25 -14
  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 +26 -36
  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 +1 -1
  46. package/dist-lib/menu.cjs +1 -1
  47. package/dist-lib/menu.mjs +1 -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 +26 -36
  53. package/dist-lib/native-app-identity-project.cjs +4 -23
  54. package/dist-lib/native-app-identity-project.mjs +4 -23
  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/pdfium-raster.cjs +1 -1
  60. package/dist-lib/pdfium-raster.mjs +1 -1
  61. package/dist-lib/plist.cjs +1 -1
  62. package/dist-lib/plist.mjs +1 -1
  63. package/dist-lib/profiles.cjs +1 -1
  64. package/dist-lib/public-brand.cjs +1 -1
  65. package/dist-lib/public-origins-lib-esm.json +24 -24
  66. package/dist-lib/public-origins-lib.json +87 -76
  67. package/dist-lib/react-native-host-modules.cjs +1 -1
  68. package/dist-lib/react-native-host-modules.mjs +1 -1
  69. package/dist-lib/reap-browser.cjs +1 -1
  70. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  71. package/dist-lib/sdk.cjs +1 -1
  72. package/dist-lib/sdk.mjs +1 -1
  73. package/dist-lib/skills.cjs +4265 -4982
  74. package/dist-lib/swift-compile.cjs +218 -243
  75. package/dist-lib/swift-compile.mjs +218 -243
  76. package/dist-lib/swift-package.cjs +1 -1
  77. package/dist-lib/swift-package.mjs +1 -1
  78. package/dist-lib/swift-submit.cjs +1 -1
  79. package/dist-lib/swift-submit.mjs +1 -1
  80. package/dist-lib/swift-toolchain.cjs +1 -1
  81. package/dist-lib/swift.cjs +1 -1
  82. package/dist-lib/vite-swift.cjs +274 -251
  83. package/dist-lib/vite.cjs +25 -14
  84. package/dist-lib/worklet-executable.cjs +1 -1
  85. package/dist-lib/worklet-executable.mjs +1 -1
  86. package/dist-types/packages/peach-engine/src/engine/nativeReplayContract.d.ts +2 -0
  87. package/package.json +1 -1
  88. package/runtime-companion.json +1 -1
  89. package/src/answeredNativePackages.ts +41 -0
  90. package/src/cli-runtime.ts +34 -13
  91. package/src/expo-discovery-cache.ts +2 -0
  92. package/src/expo-kotlin-host.ts +11 -9
  93. package/src/expo-swift-host.ts +10 -6
  94. package/src/expo-swift-ready.ts +16 -2
  95. package/src/installed-native-libraries.ts +79 -18
  96. package/src/nitro-adapter.lock.json +240 -240
  97. package/src/nitro-bundle.ts +8 -6
  98. package/src/nitro-compile.ts +6 -3
  99. package/src/nitro-compiler-digest.ts +2 -4
  100. package/src/nitro-dependencies.ts +8 -2
  101. package/src/nitro-source.ts +34 -3
  102. package/src/nitro-superset.lock.json +21 -253
  103. package/src/nitro-superset.ts +59 -63
  104. package/src/nitroContract.ts +26 -3
  105. package/src/react-native-bridge-modules.ts +2 -4
  106. package/src/runtime-delivery.ts +2 -2
  107. package/src/swift-compile.ts +260 -255
  108. package/src/swift-distribution.lock.json +9 -8
  109. package/src/swift-installed-targets.ts +13 -0
  110. package/src/swift-objc-standin.ts +10 -6
  111. package/src/swift-standins.ts +44 -14
  112. package/src/turbo-bundle.ts +20 -1
  113. package/src/turbo-compile.ts +6 -12
  114. package/src/turbo-runtime.lock.json +19 -19
  115. package/src/turbo-source.ts +18 -3
@@ -1,8 +1,8 @@
1
1
  import fs from 'node:fs'
2
2
  import path from 'node:path'
3
- import { PEACH_ANSWERED_NATIVE_PACKAGE_NAMES } from '../../peach-compat/src/generated/supported-native-packages'
4
3
  import { loadRNXAppConfig } from '../cli/app-config'
5
4
  import { resolveAppProject } from '../cli/app-project'
5
+ import { peachAnsweredNativePackages } from './answeredNativePackages'
6
6
  import { isLoopbackHost } from './backend-origin'
7
7
  import { prepareNativeAppRoot } from './expo-native-workspace'
8
8
  import { readIosAppTarget } from './native-app-identity-project'
@@ -28,18 +28,19 @@ export interface NitroBundle {
28
28
  assets: CompiledModuleAsset[]
29
29
  }
30
30
 
31
- const answeredPackages: ReadonlySet<string> = new Set(PEACH_ANSWERED_NATIVE_PACKAGE_NAMES)
32
-
33
31
  // the installed iOS Nitro providers an app compiles and the HybridObject names
34
32
  // its config answers, or null when none has an original constructor left. a
35
33
  // provider Peach answers itself (a seam resolves before the original
36
34
  // registration) is not compiled. a HybridObject the app's config answers, a
37
35
  // view or an unsupported or file-answered name, registers no original
38
36
  // constructor; a provider left with none is not compiled.
39
- export async function selectCompiledNitroProviders(appRoot: string) {
37
+ export async function selectCompiledNitroProviders(
38
+ appRoot: string,
39
+ answered = peachAnsweredNativePackages(),
40
+ ) {
40
41
  const config = await loadRNXAppConfig(resolveAppProject(appRoot))
41
42
  const providers = selectNitroProviders(await discoverNitroProviders(appRoot)).filter(
42
- ({ provider }) => !answeredPackages.has(provider.name),
43
+ ({ provider }) => !answered.has(provider.name),
43
44
  )
44
45
  const registered = new Set(
45
46
  providers.flatMap(({ config }) => config.classes.map(({ name }) => name)),
@@ -73,9 +74,10 @@ export async function compileNitroApp(
73
74
  moduleRoot?: string,
74
75
  shared = true,
75
76
  iosTarget?: string,
77
+ answered?: ReadonlySet<string>,
76
78
  ): Promise<{ metadata: NitroCompiledModule; artifact: SwiftArtifact | null } | null> {
77
79
  appRoot = fs.realpathSync(appRoot)
78
- const selection = await selectCompiledNitroProviders(appRoot)
80
+ const selection = await selectCompiledNitroProviders(appRoot, answered)
79
81
  if (!selection) return null
80
82
  const { packageRoots, answers } = selection
81
83
  let projectRoot = readIosAppTarget(appRoot, iosTarget)
@@ -295,7 +295,7 @@ export async function compileNitroModule(
295
295
  )
296
296
  let nativeSourceKeys: ReadonlySet<string>
297
297
  if (workspace) {
298
- await prepareXcodeSwiftPackages(workspace)
298
+ await prepareXcodeSwiftPackages(workspace, options.iosTarget)
299
299
  const nativeApp = readXcodeAppTarget(workspace, options.iosTarget, 'Debug', {
300
300
  installedPods: true,
301
301
  requireSources: false,
@@ -330,7 +330,7 @@ export async function compileNitroModule(
330
330
  fs.realpathSync(options.appRoot ?? options.projectRoot),
331
331
  )
332
332
  const providerNames = new Set(collection.providers.map(({ name }) => name))
333
- const nativeLibraries = workspace
333
+ const installedLibraries = workspace
334
334
  ? installedNativeLibraries(
335
335
  providersNamed(providerNames),
336
336
  options.projectRoot,
@@ -338,7 +338,10 @@ export async function compileNitroModule(
338
338
  options.iosTarget,
339
339
  'provider',
340
340
  )
341
- : new Map<string, TurboInstalledPod>()
341
+ : null
342
+ const [unavailable] = installedLibraries?.unavailable.values() ?? []
343
+ if (unavailable !== undefined) throw new Error(unavailable)
344
+ const nativeLibraries = installedLibraries?.pods ?? new Map<string, TurboInstalledPod>()
342
345
  const swiftModules = selectNitroProviders(
343
346
  options.packageRoots,
344
347
  options.answers,
@@ -4,10 +4,8 @@ import path from 'node:path'
4
4
  import { swiftCompilerSourceDigest } from './swift-compiler-digest'
5
5
 
6
6
  // the sources that turn providers into the executable. a change to any of them
7
- // moves the key, so the lock is regenerated and republished with it
8
- // (scripts/check/nitro-superset-lock.ts rejects a stale lock before main).
9
- // this module imports only digest code, so the lander can run a candidate
10
- // tree's own copy to address that tree's lock (scripts/lib/land-nitro-lock.ts).
7
+ // moves the shared executable's key (nitro-superset.ts), which main's
8
+ // nitro-superset workflow then publishes.
11
9
  export const COMPILER_SOURCES = [
12
10
  'nitro-source.ts',
13
11
  'nitro-compile.ts',
@@ -247,8 +247,14 @@ export async function prepareNitroDependencies(
247
247
  }
248
248
  for (const sourceRoot of dependency.sourceDirectories ?? [dependency.headers.from])
249
249
  walk(sourceRoot)
250
- fs.rmSync(path.join(root, 'tree'), { recursive: true, force: true })
251
- fs.renameSync(tree, path.join(root, 'tree'))
250
+ // the tree is the verified archive's whole prefix, renamed into place
251
+ // whole, so one another process installed first is identical to ours.
252
+ if (!fs.existsSync(path.join(root, 'tree')))
253
+ try {
254
+ fs.renameSync(tree, path.join(root, 'tree'))
255
+ } catch (error) {
256
+ if (!fs.existsSync(path.join(root, 'tree'))) throw error
257
+ }
252
258
  fs.rmSync(staging, { recursive: true, force: true })
253
259
  const partial = path.join(root, `manifest.json.${process.pid}.partial`)
254
260
  fs.writeFileSync(
@@ -708,6 +708,8 @@ export function collectNitroSources(
708
708
  result.aliases[file] = original
709
709
  }
710
710
  const originals = new Map<string, string>()
711
+ // podspec header search roots whose headers resolve by their path under the root
712
+ const searchRootDirs = new Set<string>()
711
713
  const collect = (
712
714
  root: string,
713
715
  directory: string,
@@ -715,7 +717,7 @@ export function collectNitroSources(
715
717
  includeNamespace: string | null,
716
718
  skip: ReadonlySet<string> = new Set(),
717
719
  select: (file: string) => boolean = () => true,
718
- extensions: RegExp = /\.(?:c|cc|cpp|cxx|h|hpp|hxx|inl)$/,
720
+ extensions: RegExp = /\.(?:c|cc|cpp|cxx|h|hpp|hxx|inl|inc)$/,
719
721
  ) => {
720
722
  const headers = new Map<string, string>()
721
723
  const walk = (relative: string) => {
@@ -765,18 +767,21 @@ export function collectNitroSources(
765
767
  }
766
768
  const requested = `${targetPath(name)}/upstream/${sourceRelative}`
767
769
  if (requested !== original) {
768
- if (!/\.(?:h|hpp|hxx|inl)$/.test(entry.name))
770
+ if (!/\.(?:h|hpp|hxx|inl|inc)$/.test(entry.name))
769
771
  throw new Error(
770
772
  `aliased Nitro translation unit is unsupported: ${sourceRelative}`,
771
773
  )
772
774
  alias(requested, original)
773
775
  }
774
- if (!/\.(?:h|hpp|hxx|inl)$/.test(entry.name)) continue
776
+ if (!/\.(?:h|hpp|hxx|inl|inc)$/.test(entry.name)) continue
775
777
  const prior = headers.get(entry.name)
776
778
  if (prior && prior !== original)
777
779
  throw new Error(`ambiguous Nitro header ${entry.name} in ${root}`)
778
780
  headers.set(entry.name, original)
779
781
  alias(`${targetPath(name)}/include/${entry.name}`, original)
782
+ const fromRoot = path.posix.relative(directory, sourceRelative)
783
+ if (searchRootDirs.has(directory) && fromRoot !== entry.name)
784
+ alias(`${targetPath(name)}/include/${fromRoot}`, original)
780
785
  if (includeNamespace)
781
786
  alias(`${targetPath(name)}/include/${includeNamespace}/${entry.name}`, original)
782
787
  }
@@ -931,6 +936,32 @@ export function collectNitroSources(
931
936
  const implementationHeaders = fs.existsSync(path.join(module.root, 'cpp'))
932
937
  ? collect(module.root, 'cpp', targetName, null)
933
938
  : new Map<string, string>()
939
+ // the podspec's other HEADER_SEARCH_PATHS roots under the pod directory
940
+ // (vendored C sources and headers) are part of the same translation set.
941
+ const podspecFile = fs.readdirSync(module.root).find((f) => f.endsWith('.podspec'))
942
+ const searchRoots = podspecFile
943
+ ? [
944
+ ...fs
945
+ .readFileSync(path.join(module.root, podspecFile), 'utf8')
946
+ .split('\n')
947
+ .filter((line) => /HEADER_SEARCH_PATHS/.test(line))
948
+ .join('\n')
949
+ .matchAll(/\$[({]PODS_TARGET_SRCROOT[)}]\/([^\s"'\\)}$]+)/g),
950
+ ]
951
+ .map((match) => match[1]!.replace(/\/+$/, ''))
952
+ .filter(
953
+ (dir) =>
954
+ dir !== 'cpp' &&
955
+ dir !== 'ios' &&
956
+ fs.existsSync(path.join(module.root, dir)),
957
+ )
958
+ : []
959
+ for (const dir of searchRoots.filter(
960
+ (dir) => !searchRoots.some((other) => other !== dir && dir.startsWith(`${other}/`)),
961
+ )) {
962
+ searchRootDirs.add(dir)
963
+ collect(module.root, dir, targetName, null)
964
+ }
934
965
  // views/ holds nitrogen's Fabric component descriptor and props parser,
935
966
  // which only React Native's Fabric renderer reads.
936
967
  collect(