peachsim 0.1.2411 → 0.1.2412

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 (89) 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 +119 -22
  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 +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +118 -21
  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 +119 -22
  31. package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
  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 +9 -5
  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 +1 -1
  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 +9 -5
  47. package/dist-lib/native-app-identity-project.cjs +8 -4
  48. package/dist-lib/native-app-identity-project.mjs +8 -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 +53 -53
  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 +119 -22
  68. package/dist-lib/swift-compile.cjs +1 -1
  69. package/dist-lib/swift-compile.mjs +1 -1
  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 +116 -19
  77. package/dist-lib/vite.cjs +3 -3
  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/image-loader.d.ts +1 -0
  81. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +1 -0
  82. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +4 -0
  83. package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +5 -0
  84. package/package.json +1 -1
  85. package/src/expo-native-workspace.ts +4 -0
  86. package/src/swift-host.ts +82 -15
  87. package/src/swift-objc-compile.ts +5 -0
  88. package/src/swift-packages.ts +46 -0
  89. package/src/xcode-project.ts +17 -7
@@ -97,6 +97,14 @@ export interface SwiftPackages {
97
97
  guestTargets: SwiftManifestTarget[]
98
98
  }[]
99
99
  nativeProducts: { name: string; packageDir: string; source: string }[]
100
+ /** source framework producers for binary targets whose release builds are available. */
101
+ sourceFrameworks: {
102
+ packageTarget: string
103
+ project: string
104
+ target: string
105
+ configuration: string
106
+ machOType: 'staticlib' | 'mh_dylib'
107
+ }[]
100
108
  /** linked products peach cannot compile. */
101
109
  unavailable: Map<string, SwiftPackageGap>
102
110
  /** every module a reached package declares that does not compile. */
@@ -167,6 +175,22 @@ export const SWIFT_PLACEHOLDER_PACKAGES: ReadonlyMap<string, string> = new Map<
167
175
  const placeholderPackage = (pkg: LoadedPackage) =>
168
176
  SWIFT_PLACEHOLDER_PACKAGES.get(swiftPackageIdentity(pkg.manifest.dir))
169
177
 
178
+ // sentry's release script builds the static archive with this xcode target.
179
+ const sourceFrameworkRecipes = new Map([
180
+ [
181
+ '438de2c5afb7dde20b640af35dd841961aa2aa4d2719e40c92d48bd2aa5dca56',
182
+ {
183
+ revision: 'a49e7c2148ac9e38bd35ef4f13bc9d6ea3ff0b81',
184
+ project: 'Sentry.xcodeproj',
185
+ target: 'Sentry',
186
+ configuration: 'Release',
187
+ machOType: 'staticlib',
188
+ } satisfies Omit<SwiftPackages['sourceFrameworks'][number], 'packageTarget'> & {
189
+ revision: string
190
+ },
191
+ ],
192
+ ])
193
+
170
194
  /** dependency checkouts belong to peach, isolated by the canonical app root. */
171
195
  export function remoteSwiftCheckouts(root: string): string {
172
196
  const prepared = preparedSwiftCheckouts(root)
@@ -510,6 +534,7 @@ interface LoadedPackage {
510
534
  /** the url, or the local directory. */
511
535
  source: string
512
536
  remote: boolean
537
+ revision?: string
513
538
  manifest: SwiftPackageManifest
514
539
  }
515
540
 
@@ -583,6 +608,7 @@ export function resolveSwiftPackages(options: {
583
608
  targets: [],
584
609
  nativePackages: [],
585
610
  nativeProducts: [],
611
+ sourceFrameworks: [],
586
612
  unavailable: new Map(),
587
613
  modules: new Map(),
588
614
  binaries: [],
@@ -592,6 +618,7 @@ export function resolveSwiftPackages(options: {
592
618
  const checkouts = remoteSwiftCheckouts(rootDir)
593
619
 
594
620
  const packages = new Map<string, LoadedPackage | string>()
621
+ const sourceFrameworks = new Map<string, SwiftPackages['sourceFrameworks'][number]>()
595
622
  // swiftpm identifies a remote package by its identity (the url's last path
596
623
  // component, case-insensitive and without `.git`) and a local package by its
597
624
  // directory. two spellings of one repository are one package, with one
@@ -624,6 +651,7 @@ export function resolveSwiftPackages(options: {
624
651
  loaded = {
625
652
  source: source.url,
626
653
  remote: true,
654
+ revision: pin.revision,
627
655
  manifest: swiftPackageManifest(
628
656
  fetchedCheckout(checkouts, identity, pin),
629
657
  undefined,
@@ -696,6 +724,7 @@ export function resolveSwiftPackages(options: {
696
724
  const targetOutcomes = new Map<string, string[]>()
697
725
  const resolveTarget = (pkg: LoadedPackage, name: string): string[] => {
698
726
  const key = `${pkg.manifest.dir}\0${name}`
727
+ if (sourceFrameworks.has(key)) return []
699
728
  if (targetOutcomes.has(key)) return targetOutcomes.get(key)!
700
729
  // a dependency cycle resolves as compiling; swiftpm rejects real cycles
701
730
  targetOutcomes.set(key, [])
@@ -838,6 +867,20 @@ export function resolveSwiftPackages(options: {
838
867
  if (!binaryOnly && claimed.has(key)) return true
839
868
  const target = pkg.manifest.targets.get(name)
840
869
  if (target?.type === 'binary') {
870
+ const recipe = target.checksum
871
+ ? sourceFrameworkRecipes.get(target.checksum)
872
+ : undefined
873
+ if (recipe && pkg.revision === recipe.revision && name === recipe.target) {
874
+ sourceFrameworks.set(key, {
875
+ packageTarget: path.join(pkg.manifest.dir, '#target', name),
876
+ project: path.join(pkg.manifest.dir, recipe.project),
877
+ target: name,
878
+ configuration: recipe.configuration,
879
+ machOType: recipe.machOType,
880
+ })
881
+ providedTargets.delete(name)
882
+ return true
883
+ }
841
884
  const changed =
842
885
  !options.standinTargets?.has(name) && shippedBinaryDiffers(name, target.checksum)
843
886
  if (changed) providedTargets.delete(name)
@@ -907,6 +950,7 @@ export function resolveSwiftPackages(options: {
907
950
  for (const pkg of packages.values()) {
908
951
  if (typeof pkg === 'string') continue
909
952
  for (const [name, target] of pkg.manifest.targets) {
953
+ if (sourceFrameworks.has(`${pkg.manifest.dir}\0${name}`)) continue
910
954
  if (target.type === 'test' || target.type === 'plugin' || target.type === 'macro')
911
955
  continue
912
956
  if (target.type === 'executable') continue
@@ -1169,6 +1213,8 @@ export function resolveSwiftPackages(options: {
1169
1213
  const id = targetId(pkg, name)
1170
1214
  if (emitted.has(id)) return id
1171
1215
  emitted.add(id)
1216
+ const framework = sourceFrameworks.get(`${pkg.manifest.dir}\0${name}`)
1217
+ if (framework) result.sourceFrameworks.push(framework)
1172
1218
  const target = pkg.manifest.targets.get(name)
1173
1219
  if (!target) throw new Error(`missing resolved package target ${name}`)
1174
1220
  const dependencies =
@@ -1996,6 +1996,8 @@ export function readXcodeAppTarget(
1996
1996
  installedPods?: boolean
1997
1997
  /** snapshot only these native modules, without the application's resources. */
1998
1998
  nativeModules?: readonly string[]
1999
+ /** select the original framework target that builds a package's archive. */
2000
+ frameworkMachOType?: 'staticlib' | 'mh_dylib'
1999
2001
  /**
2000
2002
  * throw when the project has remote packages and no lock. a read that
2001
2003
  * compiles sets it; one that only reads metadata leaves the graph empty.
@@ -2016,12 +2018,14 @@ export function readXcodeAppTarget(
2016
2018
  )
2017
2019
  const allTargets = projects.flatMap(projectTargets)
2018
2020
  // an extension runs as its own process: named, it builds as the compiled unit
2019
- const appTargets = allTargets.filter(
2020
- (ref) =>
2021
- isIosAppTarget(ref, options) ||
2022
- (targetName !== undefined &&
2023
- ref.target.name === targetName &&
2024
- ref.target.productType === APP_EXTENSION),
2021
+ const appTargets = allTargets.filter((ref) =>
2022
+ options.frameworkMachOType
2023
+ ? ref.target.name === targetName &&
2024
+ FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? '')
2025
+ : isIosAppTarget(ref, options) ||
2026
+ (targetName !== undefined &&
2027
+ ref.target.name === targetName &&
2028
+ ref.target.productType === APP_EXTENSION),
2025
2029
  )
2026
2030
  const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id)
2027
2031
  const container = path.basename(xcodeprojOrWorkspace)
@@ -2029,6 +2033,10 @@ export function readXcodeAppTarget(
2029
2033
  ? appTargets.filter((ref) => ref.target.name === targetName)
2030
2034
  : appTargets
2031
2035
  if (named.length !== 1) {
2036
+ if (options.frameworkMachOType)
2037
+ throw new Error(
2038
+ `${container} must declare one framework target named ${targetName}`,
2039
+ )
2032
2040
  if (appTargets.length === 0)
2033
2041
  throw new Error(
2034
2042
  `${container} has no application targets; open a project or workspace that contains one`,
@@ -2369,7 +2377,9 @@ export function readXcodeAppTarget(
2369
2377
  DEVELOPMENT_LANGUAGE: str(ref.project.project.developmentRegion) ?? 'en',
2370
2378
  },
2371
2379
  options,
2372
- workspaceBuild,
2380
+ ref === app && options.frameworkMachOType
2381
+ ? { ...workspaceBuild, MACH_O_TYPE: options.frameworkMachOType }
2382
+ : workspaceBuild,
2373
2383
  )
2374
2384
  for (const file of read) xcconfigs.add(file)
2375
2385
  const swiftVersion = Number.parseFloat(settings('SWIFT_VERSION') || '5')