peachsim 0.1.1811 → 0.1.1812

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 (102) hide show
  1. package/cli/cloud-client.ts +53 -23
  2. package/cli/commands/control.ts +9 -0
  3. package/cli/commands/platform.ts +11 -18
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.cjs +1 -1
  6. package/dist-lib/attached-projects.cjs +1 -1
  7. package/dist-lib/auth/shared-session.cjs +1 -1
  8. package/dist-lib/backend-origin.cjs +1 -1
  9. package/dist-lib/beta.cjs +1 -1
  10. package/dist-lib/beta.mjs +1 -1
  11. package/dist-lib/bridge-constants.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.mjs +1 -1
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/bundle-channel.cjs +447 -371
  17. package/dist-lib/capture-contract.cjs +1 -1
  18. package/dist-lib/capture-contract.mjs +1 -1
  19. package/dist-lib/cloud-contract.cjs +1 -1
  20. package/dist-lib/cloud-contract.mjs +1 -1
  21. package/dist-lib/cloud-test-args.cjs +1 -1
  22. package/dist-lib/cloud-test-args.mjs +1 -1
  23. package/dist-lib/cloud.cjs +1 -1
  24. package/dist-lib/cloud.mjs +1 -1
  25. package/dist-lib/config.cjs +1 -1
  26. package/dist-lib/config.mjs +1 -1
  27. package/dist-lib/detox/index.cjs +1 -1
  28. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  29. package/dist-lib/expo-swift-bundle.cjs +122 -46
  30. package/dist-lib/expo-swift-metadata.cjs +1 -1
  31. package/dist-lib/expo-swift-metadata.mjs +1 -1
  32. package/dist-lib/home-paths.cjs +1 -1
  33. package/dist-lib/host/bridge-host.cjs +438 -362
  34. package/dist-lib/host/fetch-proxy-handler.cjs +1 -2
  35. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  36. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  37. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  38. package/dist-lib/host/websocket-proxy.cjs +1 -1
  39. package/dist-lib/index.cjs +35 -12
  40. package/dist-lib/jump-to-source-babel.cjs +1 -1
  41. package/dist-lib/jump-to-source-native.cjs +1 -1
  42. package/dist-lib/kotlin-host.cjs +1 -1
  43. package/dist-lib/menu.cjs +1 -1
  44. package/dist-lib/menu.mjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  47. package/dist-lib/metro-production-bundle.cjs +1 -1
  48. package/dist-lib/metro-production-bundle.mjs +1 -1
  49. package/dist-lib/metro.cjs +35 -12
  50. package/dist-lib/native-app-identity-project.cjs +35 -11
  51. package/dist-lib/native-app-identity-project.mjs +35 -11
  52. package/dist-lib/native-app-identity.cjs +1 -1
  53. package/dist-lib/native-app-identity.mjs +1 -1
  54. package/dist-lib/native-firebase-metadata.cjs +1 -1
  55. package/dist-lib/native-firebase-metadata.mjs +1 -1
  56. package/dist-lib/pdfium-raster.cjs +1 -1
  57. package/dist-lib/pdfium-raster.mjs +1 -1
  58. package/dist-lib/plist.cjs +1 -1
  59. package/dist-lib/plist.mjs +1 -1
  60. package/dist-lib/profiles.cjs +1 -1
  61. package/dist-lib/public-brand.cjs +1 -1
  62. package/dist-lib/public-origins-lib-esm.json +24 -24
  63. package/dist-lib/public-origins-lib.json +53 -53
  64. package/dist-lib/react-native-host-modules.cjs +1 -1
  65. package/dist-lib/react-native-host-modules.mjs +1 -1
  66. package/dist-lib/reap-browser.cjs +1 -1
  67. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  68. package/dist-lib/sdk.cjs +1 -1
  69. package/dist-lib/sdk.mjs +1 -1
  70. package/dist-lib/skills.cjs +492 -389
  71. package/dist-lib/swift-compile.cjs +46 -11
  72. package/dist-lib/swift-compile.mjs +46 -11
  73. package/dist-lib/swift-package.cjs +12 -4
  74. package/dist-lib/swift-package.mjs +9 -3
  75. package/dist-lib/swift-submit.cjs +1 -1
  76. package/dist-lib/swift-submit.mjs +1 -1
  77. package/dist-lib/swift-toolchain.cjs +18 -1
  78. package/dist-lib/swift.cjs +1 -1
  79. package/dist-lib/vite-swift.cjs +75 -30
  80. package/dist-lib/vite.cjs +1 -2
  81. package/dist-lib/worklet-executable.cjs +1 -1
  82. package/dist-lib/worklet-executable.mjs +1 -1
  83. package/package.json +1 -1
  84. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISlider.h +1 -1
  85. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewController.h +12 -50
  86. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewControllerLayoutEnvironment.h +2 -8
  87. package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +62 -0
  88. package/sdk/ios/usr/include/module.modulemap +8 -3
  89. package/src/expo-native-workspace.ts +56 -27
  90. package/src/nitro-adapter.lock.json +265 -265
  91. package/src/nitro-superset.lock.json +14 -14
  92. package/src/nitroContract.ts +1 -0
  93. package/src/swift-compile.ts +20 -6
  94. package/src/swift-distribution.lock.json +9 -9
  95. package/src/swift-link-roots.ts +13 -2
  96. package/src/swift-objc-compile.ts +12 -0
  97. package/src/swift-objc-standin.ts +5 -2
  98. package/src/swift-package.ts +21 -1
  99. package/src/swift-toolchain.ts +17 -0
  100. package/src/turbo-bundle.ts +3 -4
  101. package/src/turbo-runtime.lock.json +20 -20
  102. package/src/xcode-project.ts +29 -12
@@ -1,9 +1,10 @@
1
1
  // prepare Expo's own CocoaPods workspace in a private cache on the Mac.
2
- import { execFileSync, spawnSync } from 'node:child_process'
2
+ import { execFile, execFileSync, spawnSync } from 'node:child_process'
3
3
  import { createHash } from 'node:crypto'
4
4
  import fs from 'node:fs'
5
5
  import { createRequire } from 'node:module'
6
6
  import path from 'node:path'
7
+ import { promisify } from 'node:util'
7
8
  import { detectPackageManager } from '../cli/commands/detect'
8
9
  import { teamMachineInstalled } from './admitted-mac-build'
9
10
  import { workspaceExclusion } from './expo-workspace-exclusion'
@@ -71,9 +72,9 @@ const NATIVE_CONFIG_FILE =
71
72
  const NATIVE_SOURCE_FILE = /\.(swift|mm?|hpp?|c|cc|cpp|kt|java)$/
72
73
 
73
74
  // every file the native prepare can read, plus the toolchain that reads it.
74
- // node_modules stays out: the js install rebuilds it from the hashed lockfiles,
75
- // and the discovery cache keys the live native inventory separately. the walk
76
- // yields so the bridge that runs it keeps answering its other requests.
75
+ // node_modules stays out: the js install reconciles it with the hashed
76
+ // lockfiles, and the discovery cache keys the live native inventory separately.
77
+ // the walk yields so the bridge that runs it keeps answering its other requests.
77
78
  export async function hashExpoWorkspace(app: string, signal?: AbortSignal) {
78
79
  if (process.platform !== 'darwin') {
79
80
  const source = await hashExpoSourceWorkspace(app, signal)
@@ -458,6 +459,53 @@ function prepare(app: string, stage: 'project' | 'workspace', signal?: AbortSign
458
459
  })
459
460
  }
460
461
 
462
+ // a workspace starts from the app's own installed dependencies, which the js
463
+ // install then reconciles with the lockfile: an installed tree that matches
464
+ // takes it under a second, where a fresh install fetches, links and runs every
465
+ // lifecycle script again. cp clones the trees eight packages at a time; a
466
+ // per-file copy from node takes several times as long, one cp per tree twice.
467
+ async function copyInstalledWorkspace(
468
+ root: string,
469
+ destination: string,
470
+ excluded: (relative: string) => boolean,
471
+ ) {
472
+ const installed: string[] = []
473
+ await fs.promises.cp(root, destination, {
474
+ recursive: true,
475
+ mode: fs.constants.COPYFILE_FICLONE,
476
+ preserveTimestamps: true,
477
+ verbatimSymlinks: true,
478
+ filter: (source) => {
479
+ const relative = path.relative(root, source)
480
+ if (path.basename(source) === 'node_modules') installed.push(relative)
481
+ return !excluded(relative)
482
+ },
483
+ })
484
+ const entries = installed.flatMap((relative) => {
485
+ const source = path.join(root, relative)
486
+ if (fs.lstatSync(source).isSymbolicLink()) {
487
+ fs.symlinkSync(fs.readlinkSync(source), path.join(destination, relative))
488
+ return []
489
+ }
490
+ fs.mkdirSync(path.join(destination, relative))
491
+ return fs.readdirSync(source).map((name) => path.join(relative, name))
492
+ })
493
+ const clone = async (): Promise<void> => {
494
+ const relative = entries.pop()
495
+ if (relative === undefined) return
496
+ await promisify(execFile)('cp', [
497
+ // -c clones on a Mac, as gnu cp already does where the filesystem can
498
+ ...(process.platform === 'darwin' ? ['-c'] : []),
499
+ '-R',
500
+ '-p',
501
+ path.join(root, relative),
502
+ path.join(destination, relative),
503
+ ])
504
+ return clone()
505
+ }
506
+ await Promise.all(Array.from({ length: 8 }, clone))
507
+ }
508
+
461
509
  // release producers prepare the already installed app. this preserves the
462
510
  // exact dependency tree selected by a replay, including a staged package.
463
511
  export async function prepareInstalledExpoWorkspace(app: string, work: string) {
@@ -470,18 +518,7 @@ export async function prepareInstalledExpoWorkspace(app: string, work: string) {
470
518
  throw new Error(`prepared Expo workspace already exists: ${work}`)
471
519
  fs.mkdirSync(path.dirname(work), { recursive: true })
472
520
  return withSwiftRootLock(work, async (lease) => {
473
- fs.cpSync(root, work, {
474
- recursive: true,
475
- mode: fs.constants.COPYFILE_FICLONE,
476
- preserveTimestamps: true,
477
- verbatimSymlinks: true,
478
- filter: (source) => {
479
- const relative = path.relative(root, source)
480
- const parts = relative.split(path.sep)
481
- if (parts.includes('.git')) return false
482
- return parts.includes('node_modules') || !excluded(relative)
483
- },
484
- })
521
+ await copyInstalledWorkspace(root, work, excluded)
485
522
  initializeWorkspaceGit(work)
486
523
  const preparedApp = path.join(work, appRelative)
487
524
  const manifest = JSON.parse(
@@ -573,13 +610,7 @@ async function prepareWorkspace(
573
610
  await fs.promises.rm(partial, { recursive: true, force: true })
574
611
  await fs.promises.rm(work, { recursive: true, force: true })
575
612
  fs.mkdirSync(path.dirname(work), { recursive: true })
576
- await fs.promises.cp(root, partial, {
577
- recursive: true,
578
- mode: fs.constants.COPYFILE_FICLONE,
579
- preserveTimestamps: true,
580
- verbatimSymlinks: true,
581
- filter: (source) => !excluded(path.relative(root, source)),
582
- })
613
+ await copyInstalledWorkspace(root, partial, excluded)
583
614
  fs.renameSync(partial, work)
584
615
  // a lifecycle script that installs git hooks needs a repository, and the copy gets its own.
585
616
  // an app config may read HEAD, so the repository carries one empty commit
@@ -654,10 +685,8 @@ async function prepareWorkspace(
654
685
  'install',
655
686
  '--frozen-lockfile',
656
687
  ]
657
- : [
658
- 'npm',
659
- fs.existsSync(path.join(work, 'package-lock.json')) ? 'ci' : 'install',
660
- ]
688
+ : // npm ci would delete the cloned tree before installing it again
689
+ ['npm', 'install', '--no-audit', '--no-fund']
661
690
  // dependencies such as react-native-skia fetch their native binaries in a lifecycle
662
691
  // script, so a host-wide ignore-scripts must not reach the workspace install
663
692
  const installEnv = { npm_config_ignore_scripts: 'false', YARN_ENABLE_SCRIPTS: 'true' }