peachsim 0.1.2411 → 0.1.2421

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 (146) hide show
  1. package/README.md +1 -1
  2. package/cli/catalog/content.ts +6 -3
  3. package/cli/catalog/meta.ts +63 -17
  4. package/cli/catalog/routes.ts +4 -0
  5. package/cli/cloud-box-artifact.ts +45 -24
  6. package/cli/cloud-client.ts +6 -2
  7. package/cli/command-registry.ts +3 -1
  8. package/cli/commands/control.ts +74 -55
  9. package/cli/commands/desktop.ts +3 -3
  10. package/cli/commands/electron.ts +7 -5
  11. package/cli/commands/kotlin.ts +8 -1
  12. package/cli/commands/platform.ts +5 -7
  13. package/cli/commands/profile.ts +2 -2
  14. package/cli/commands/settings.ts +90 -0
  15. package/cli/commands/shell-url.ts +18 -10
  16. package/cli/commands/swift.ts +3 -1
  17. package/cli/main.ts +6 -0
  18. package/cli/outbound-endpoints.ts +17 -15
  19. package/cli/settings-flags.ts +115 -0
  20. package/dist-lib/agent-daemon-client.cjs +1 -1
  21. package/dist-lib/agent-events.cjs +1 -1
  22. package/dist-lib/attached-projects.cjs +1 -1
  23. package/dist-lib/auth/shared-session.cjs +1 -1
  24. package/dist-lib/backend-origin.cjs +1 -1
  25. package/dist-lib/beta.cjs +1 -1
  26. package/dist-lib/beta.mjs +1 -1
  27. package/dist-lib/bridge-constants.cjs +1 -1
  28. package/dist-lib/bridge-contract-input.cjs +1 -1
  29. package/dist-lib/bridge-contract-input.mjs +1 -1
  30. package/dist-lib/bridge-contract.cjs +1 -1
  31. package/dist-lib/bridge-contract.mjs +1 -1
  32. package/dist-lib/bundle-channel.cjs +3706 -1818
  33. package/dist-lib/capture-contract.cjs +1 -1
  34. package/dist-lib/capture-contract.mjs +1 -1
  35. package/dist-lib/cloud-contract.cjs +1 -1
  36. package/dist-lib/cloud-contract.mjs +1 -1
  37. package/dist-lib/cloud-test-args.cjs +1 -1
  38. package/dist-lib/cloud-test-args.mjs +1 -1
  39. package/dist-lib/cloud.cjs +1 -1
  40. package/dist-lib/cloud.mjs +1 -1
  41. package/dist-lib/config.cjs +3 -7
  42. package/dist-lib/config.mjs +3 -7
  43. package/dist-lib/detox/index.cjs +4 -4
  44. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  45. package/dist-lib/expo-swift-bundle.cjs +17144 -15295
  46. package/dist-lib/expo-swift-metadata.cjs +1 -1
  47. package/dist-lib/expo-swift-metadata.mjs +1 -1
  48. package/dist-lib/home-paths.cjs +1 -1
  49. package/dist-lib/host/bridge-host.cjs +63288 -62269
  50. package/dist-lib/host/fetch-proxy-handler.cjs +1598 -211
  51. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  52. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  53. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  54. package/dist-lib/host/websocket-proxy.cjs +1 -1
  55. package/dist-lib/index.cjs +3007 -1512
  56. package/dist-lib/jump-to-source-babel.cjs +1 -1
  57. package/dist-lib/jump-to-source-native.cjs +1 -1
  58. package/dist-lib/kotlin-host.cjs +972 -246
  59. package/dist-lib/menu.cjs +1 -1
  60. package/dist-lib/menu.mjs +1 -1
  61. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  62. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  63. package/dist-lib/metro-production-bundle.cjs +1 -1
  64. package/dist-lib/metro-production-bundle.mjs +1 -1
  65. package/dist-lib/metro.cjs +1742 -247
  66. package/dist-lib/native-app-identity-project.cjs +40 -204
  67. package/dist-lib/native-app-identity-project.mjs +40 -204
  68. package/dist-lib/native-app-identity.cjs +1 -1
  69. package/dist-lib/native-app-identity.mjs +1 -1
  70. package/dist-lib/native-firebase-metadata.cjs +1 -1
  71. package/dist-lib/native-firebase-metadata.mjs +1 -1
  72. package/dist-lib/pdfium-raster.cjs +1 -1
  73. package/dist-lib/pdfium-raster.mjs +1 -1
  74. package/dist-lib/plist.cjs +1 -1
  75. package/dist-lib/plist.mjs +1 -1
  76. package/dist-lib/profiles.cjs +1 -1
  77. package/dist-lib/public-brand.cjs +1 -1
  78. package/dist-lib/public-origins-lib-esm.json +26 -24
  79. package/dist-lib/public-origins-lib.json +198 -117
  80. package/dist-lib/react-native-host-modules.cjs +1 -1
  81. package/dist-lib/react-native-host-modules.mjs +1 -1
  82. package/dist-lib/reap-browser.cjs +1 -1
  83. package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
  84. package/dist-lib/sdk.cjs +1 -1
  85. package/dist-lib/sdk.mjs +1 -1
  86. package/dist-lib/skills.cjs +21765 -20511
  87. package/dist-lib/swift-compile.cjs +48 -228
  88. package/dist-lib/swift-compile.mjs +48 -228
  89. package/dist-lib/swift-package.cjs +1 -1
  90. package/dist-lib/swift-package.mjs +1 -1
  91. package/dist-lib/swift-submit.cjs +1 -1
  92. package/dist-lib/swift-submit.mjs +1 -1
  93. package/dist-lib/swift-toolchain.cjs +1 -199
  94. package/dist-lib/swift.cjs +1 -1
  95. package/dist-lib/vite-swift.cjs +227 -251
  96. package/dist-lib/vite.cjs +5240 -3788
  97. package/dist-lib/worklet-executable.cjs +1 -1
  98. package/dist-lib/worklet-executable.mjs +1 -1
  99. package/dist-types/packages/peach-engine/src/config.d.ts +1 -4
  100. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +1 -0
  101. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +1 -0
  102. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +4 -0
  103. package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +5 -0
  104. package/kotlin/README.md +4 -3
  105. package/kotlin/sdk.tar.gz +0 -0
  106. package/kotlin/toolchain.json +3 -6
  107. package/package.json +1 -1
  108. package/runtime-companion.json +1 -1
  109. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h +1 -43
  110. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayerContents.h +55 -0
  111. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Modules/module.modulemap +3 -3
  112. package/sdk/ios/usr/include/ObjectiveC.apinotes +0 -24
  113. package/sdk/ios/usr/include/grp.h +93 -0
  114. package/sdk/ios/usr/include/netinet/tcp.h +299 -0
  115. package/sdk/ios/wasm/include/netinet/tcp.h +6 -0
  116. package/sdk/ios/wasm/include/stdlib.h +1 -0
  117. package/sdk/ios/wasm/include/unistd.h +2 -0
  118. package/skills/contrast/SKILL.md +1 -0
  119. package/skills/peach-setup/SKILL.md +11 -1
  120. package/src/android-bridge-dependencies.ts +1 -1
  121. package/src/app-config.ts +7 -0
  122. package/src/binaryen.lock.json +21 -0
  123. package/src/cocoapods-trunk.ts +52 -0
  124. package/src/config.ts +21 -31
  125. package/src/expo-native-workspace.ts +4 -0
  126. package/src/kotlin-host.ts +1 -1
  127. package/src/kotlin-sdk.ts +7 -7
  128. package/src/kotlin-toolchain.ts +28 -24
  129. package/src/kotlinSdkContract.ts +2 -2
  130. package/src/native-bundles.ts +5 -2
  131. package/src/native-static-libraries.ts +38 -5
  132. package/src/podfile-cocoapods.ts +1473 -0
  133. package/src/podspec-cocoapods.ts +331 -106
  134. package/src/podspec-ruby-stdlib.ts +134 -19
  135. package/src/podspec-ruby.ts +199 -46
  136. package/src/settingsContract.ts +74 -0
  137. package/src/swift-compile.ts +1 -1
  138. package/src/swift-compiler-digest.ts +1 -0
  139. package/src/swift-host.ts +107 -15
  140. package/src/swift-objc-compile.ts +5 -0
  141. package/src/swift-packages.ts +75 -0
  142. package/src/swift-shared-sdk.ts +19 -0
  143. package/src/swift-toolchain.ts +2 -201
  144. package/src/turbo-source.ts +7 -37
  145. package/src/wasm-optimize.ts +4 -27
  146. package/src/xcode-project.ts +22 -7
@@ -4,6 +4,7 @@ import { dirname, join } from 'node:path'
4
4
  import { promisify } from 'node:util'
5
5
  import { installVerifiedTarball } from '@contrast/runtime-delivery'
6
6
  import { windowAdmission } from './admitted-mac-build'
7
+ import binaryenLock from './binaryen.lock.json' with { type: 'json' }
7
8
  import { rnxHomeDir } from './home-paths'
8
9
  import {
9
10
  dropBoundaryExports,
@@ -35,36 +36,13 @@ const FEATURES = [
35
36
  export const KEEP_WASM_NAMES = process.env.PEACH_SWIFT_NAMES === '1'
36
37
 
37
38
  const LOWERING = ['--memory64-lowering', '--table64-lowering']
38
- const BINARYEN_VERSION = '132'
39
+ const BINARYEN_VERSION = binaryenLock.version
39
40
  const runBinaryen = promisify(execFile)
40
41
 
41
42
  /** feeds the artifact hash: a new optimizer or flag set is a new artifact. */
42
43
  export const WASM_LOWER_IDENTITY = `binaryen ${BINARYEN_VERSION} narrow ${LOWERING.join(' ')} ${FEATURES.join(',')} unoptimized-names`
43
44
 
44
- // the sha256 of each supported Binaryen release archive
45
- const BINARYEN_RELEASES = new Map([
46
- [
47
- 'linux-x64',
48
- {
49
- asset: 'x86_64-linux',
50
- sha256: '195ddc94f9bc89f45abdabb0b9eea86023d727ba90eac8b35b80f2544fc30572',
51
- },
52
- ],
53
- [
54
- 'linux-arm64',
55
- {
56
- asset: 'aarch64-linux',
57
- sha256: 'c58562417836c5d0493d89bdefc434933bdc097db641b483df86bcfa557a107f',
58
- },
59
- ],
60
- [
61
- 'darwin-arm64',
62
- {
63
- asset: 'arm64-macos',
64
- sha256: '98aad827847af7ef990ed7098d885725c8e5b5aae75073403635617ae4e259aa',
65
- },
66
- ],
67
- ])
45
+ const BINARYEN_RELEASES = new Map(Object.entries(binaryenLock.platforms))
68
46
 
69
47
  // skipPasses names Binaryen passes to leave out. a guest link with several images
70
48
  // skips duplicate-function-elimination, which would merge identical functions
@@ -142,11 +120,10 @@ async function installWasmOpt(): Promise<string> {
142
120
  const binary = join(destDir, 'bin', 'wasm-opt')
143
121
  if (!existsSync(binary))
144
122
  await installVerifiedTarball({
145
- url: `https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/binaryen-version_${BINARYEN_VERSION}-${release.asset}.tar.gz`,
123
+ url: `https://r2.rnxsim.com/peach/binaryen/${release.sha256}/${platform}.tar.gz`,
146
124
  digest: { algorithm: 'sha256', encoding: 'hex', value: release.sha256 },
147
125
  destDir,
148
126
  installedMarker: 'bin/wasm-opt',
149
- stripComponents: 1,
150
127
  label: `Binaryen ${BINARYEN_VERSION}`,
151
128
  })
152
129
  return binary
@@ -1996,6 +1996,9 @@ 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'
2001
+ frameworkBuildSettings?: Readonly<Record<string, string>>
1999
2002
  /**
2000
2003
  * throw when the project has remote packages and no lock. a read that
2001
2004
  * compiles sets it; one that only reads metadata leaves the graph empty.
@@ -2016,12 +2019,14 @@ export function readXcodeAppTarget(
2016
2019
  )
2017
2020
  const allTargets = projects.flatMap(projectTargets)
2018
2021
  // 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),
2022
+ const appTargets = allTargets.filter((ref) =>
2023
+ options.frameworkMachOType
2024
+ ? ref.target.name === targetName &&
2025
+ FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? '')
2026
+ : isIosAppTarget(ref, options) ||
2027
+ (targetName !== undefined &&
2028
+ ref.target.name === targetName &&
2029
+ ref.target.productType === APP_EXTENSION),
2025
2030
  )
2026
2031
  const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id)
2027
2032
  const container = path.basename(xcodeprojOrWorkspace)
@@ -2029,6 +2034,10 @@ export function readXcodeAppTarget(
2029
2034
  ? appTargets.filter((ref) => ref.target.name === targetName)
2030
2035
  : appTargets
2031
2036
  if (named.length !== 1) {
2037
+ if (options.frameworkMachOType)
2038
+ throw new Error(
2039
+ `${container} must declare one framework target named ${targetName}`,
2040
+ )
2032
2041
  if (appTargets.length === 0)
2033
2042
  throw new Error(
2034
2043
  `${container} has no application targets; open a project or workspace that contains one`,
@@ -2369,7 +2378,13 @@ export function readXcodeAppTarget(
2369
2378
  DEVELOPMENT_LANGUAGE: str(ref.project.project.developmentRegion) ?? 'en',
2370
2379
  },
2371
2380
  options,
2372
- workspaceBuild,
2381
+ ref === app && options.frameworkMachOType
2382
+ ? {
2383
+ ...workspaceBuild,
2384
+ ...options.frameworkBuildSettings,
2385
+ MACH_O_TYPE: options.frameworkMachOType,
2386
+ }
2387
+ : workspaceBuild,
2373
2388
  )
2374
2389
  for (const file of read) xcconfigs.add(file)
2375
2390
  const swiftVersion = Number.parseFloat(settings('SWIFT_VERSION') || '5')