peachsim 0.1.1692 → 0.1.1700
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.
- package/cli/bridge-flow-runner.ts +61 -39
- package/cli/commands/agent-wrapper.ts +21 -10
- package/cli/commands/control.ts +27 -7
- package/cli/commands/coverage.ts +1 -1
- package/cli/commands/detect.ts +17 -4
- package/cli/commands/maestro-compare.ts +25 -99
- package/cli/help-core.ts +3 -4
- package/cli/maestro-compare.ts +172 -4
- package/cli/outbound-endpoints.ts +2 -10
- package/detox/index.ts +15 -0
- package/detox/launch-permissions.ts +169 -0
- package/dist-lib/agent-daemon-client.cjs +2 -2
- package/dist-lib/agent-events.cjs +2 -2
- package/dist-lib/attached-projects.cjs +2 -2
- package/dist-lib/auth/shared-session.cjs +2 -2
- package/dist-lib/backend-origin.cjs +2 -2
- package/dist-lib/beta.cjs +2 -2
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +2 -2
- package/dist-lib/bridge-contract-input.cjs +2 -2
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +2 -2
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +18273 -15925
- package/dist-lib/capture-contract.cjs +2 -2
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +2 -2
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +2 -2
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +2 -2
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +2 -2
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +104 -3
- package/dist-lib/dev-bundle-resolution.cjs +208 -44
- package/dist-lib/expo-swift-bundle.cjs +2349 -1778
- package/dist-lib/expo-swift-metadata.cjs +2 -2
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +2 -2
- package/dist-lib/host/bridge-host.cjs +7885 -3334
- package/dist-lib/host/fetch-proxy-handler.cjs +331 -39
- package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +2 -2
- package/dist-lib/host/websocket-proxy.cjs +2 -2
- package/dist-lib/index.cjs +297 -77
- package/dist-lib/jump-to-source-babel.cjs +2 -2
- package/dist-lib/jump-to-source-native.cjs +2 -2
- package/dist-lib/kotlin-host.cjs +2 -2
- package/dist-lib/menu.cjs +2 -2
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +2 -2
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +2 -2
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +294 -74
- package/dist-lib/native-app-identity-project.cjs +48 -37
- package/dist-lib/native-app-identity-project.mjs +47 -36
- package/dist-lib/native-app-identity.cjs +2 -2
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +2 -2
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +2 -2
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +2 -2
- package/dist-lib/public-brand.cjs +2 -2
- package/dist-lib/public-origins-lib-esm.json +24 -23
- package/dist-lib/public-origins-lib.json +199 -79
- package/dist-lib/react-native-host-modules.cjs +2 -2
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +2 -2
- package/dist-lib/scripts/dev-server-scanner.cjs +206 -31
- package/dist-lib/sdk.cjs +2 -2
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +19600 -15992
- package/dist-lib/swift-compile.cjs +640 -402
- package/dist-lib/swift-compile.mjs +595 -357
- package/dist-lib/swift-package.cjs +24 -20
- package/dist-lib/swift-package.mjs +23 -19
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +31 -4
- package/dist-lib/swift.cjs +2 -2
- package/dist-lib/vite-swift.cjs +1559 -1208
- package/dist-lib/vite.cjs +251 -42
- package/dist-lib/worklet-executable.cjs +2 -2
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/scroll-pan-contacts.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +7 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +17 -0
- package/dist-types/packages/peach-engine/src/render-worker/worker-input-runtime.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +3 -0
- package/dist-types/packages/peach-globals/src/cameraBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +3 -0
- package/dist-types/packages/peach-kit/src/materials/types.d.ts +1 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +4 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h +2282 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h +10551 -6
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h +4236 -3
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h +827 -8
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h +1369 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h +1243 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h +1747 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h +291 -2
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h +1283 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h +811 -91
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h +1342 -25
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns.h +2738 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h +1685 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h +913 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h +1917 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h +23 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h +209 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h +104 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h +77 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h +554 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h +58 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h +186 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h +86 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h +364 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h +195 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h +44 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/BLAS.h +2330 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/Types.h +123 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Solve.h +8339 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h +520 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h +1893 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h +10 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/blas_new.h +1098 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas.h +859 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas_new.h +1134 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/clapack.h +10555 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/fortran_blas.h +695 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack.h +38526 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_types.h +60 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_version.h +20 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/thread_api.h +50 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h +1218 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBigNum.h +1458 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP.h +10377 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP_translate.h +167 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vForce.h +1243 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h +114 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLibTypes.h +146 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vectorOps.h +1106 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vfp.h +294 -0
- package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h +25 -1
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h +673 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h +232 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h +827 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h +121 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h +387 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h +79 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h +122 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h +674 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h +182 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h +213 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h +82 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h +129 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h +491 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +883 -2
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h +98 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +11 -229
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +2 -1
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +1 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecBase.h +906 -3
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h +613 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecItem.h +1284 -29
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h +441 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecTrust.h +845 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +4 -0
- package/sdk/ios/usr/include/AvailabilityMacros.h +3985 -0
- package/sdk/ios/usr/include/copyfile.h +143 -0
- package/sdk/ios/usr/include/malloc/_malloc.h +143 -0
- package/sdk/ios/usr/include/malloc/_malloc_type.h +153 -0
- package/sdk/ios/usr/include/malloc/_platform.h +80 -0
- package/sdk/ios/usr/include/malloc/_ptrcheck.h +43 -0
- package/sdk/ios/usr/include/malloc/malloc.h +768 -0
- package/sdk/ios/usr/include/os/availability.h +168 -6
- package/sdk/ios/usr/include/os/base.h +351 -0
- package/sdk/ios/usr/include/os/clock.h +18 -0
- package/sdk/ios/usr/include/os/lock.h +232 -10
- package/sdk/ios/usr/include/os/log.h +521 -38
- package/sdk/ios/usr/include/os/object.h +320 -3
- package/sdk/ios/usr/include/os/trace.h +492 -0
- package/sdk/ios/usr/include/os/trace_base.h +167 -0
- package/sdk/ios/usr/include/os/workgroup.h +37 -0
- package/sdk/ios/usr/include/os/workgroup_base.h +91 -0
- package/sdk/ios/usr/include/os/workgroup_interval.h +156 -0
- package/sdk/ios/usr/include/os/workgroup_object.h +359 -0
- package/sdk/ios/usr/include/os/workgroup_parallel.h +76 -0
- package/sdk/ios/usr/include/sys/cdefs.h +38 -0
- package/sdk/ios/wasm/include/unistd.h +3 -0
- package/skills/contrast/SKILL.md +3 -0
- package/src/codex-client.ts +11 -6
- package/src/dev-bundle-resolution.ts +124 -48
- package/src/expo-native-workspace.ts +176 -0
- package/src/expo-swift-host.ts +161 -26
- package/src/expo-swift-ready.ts +14 -28
- package/src/expoSwiftContract.ts +4 -1
- package/src/generated/swift-c-predefines.json +68 -12
- package/src/host/bridge-host.ts +5 -0
- package/src/installed-package-versions.ts +14 -1
- package/src/metro-project-root.ts +44 -33
- package/src/native-app-identity-project.ts +1 -0
- package/src/nitro-adapter.lock.json +916 -10
- package/src/nitro-adapter.ts +33 -24
- package/src/nitro-bundle.ts +108 -22
- package/src/nitro-compile.ts +32 -5
- package/src/nitro-source.ts +13 -3
- package/src/nitroAdapterContract.ts +100 -20
- package/src/node-http-fetch.ts +116 -0
- package/src/packageVersionsContract.ts +46 -0
- package/src/serverDiscoveryContract.ts +1 -0
- package/src/settingsContract.ts +0 -30
- package/src/swift-binary-modules.ts +20 -5
- package/src/swift-compile.ts +168 -48
- package/src/swift-coverage/xcode-assets.ts +4 -3
- package/src/swift-host.ts +14 -3
- package/src/swift-objc-compile.ts +32 -5
- package/src/swift-objc-metadata.ts +2 -2
- package/src/swift-objc-platform.ts +2 -2
- package/src/swift-objc-standin.ts +43 -13
- package/src/swift-package.ts +33 -26
- package/src/swift-source-pods.ts +126 -41
- package/src/swift-standin-digest.ts +77 -0
- package/src/swift-standin-emit.ts +40 -4
- package/src/swift-standins.ts +68 -19
- package/src/swift-toolchain.ts +38 -0
- package/src/swiftContract.ts +8 -0
- package/src/vite-plugin.ts +0 -10
- package/src/xcode-project.ts +62 -42
- package/src/settings-flags.ts +0 -107
|
@@ -60,6 +60,11 @@
|
|
|
60
60
|
#else
|
|
61
61
|
#define __cold
|
|
62
62
|
#endif
|
|
63
|
+
#if __has_attribute(warn_unused_result)
|
|
64
|
+
#define __result_use_check __attribute__((__warn_unused_result__))
|
|
65
|
+
#else
|
|
66
|
+
#define __result_use_check
|
|
67
|
+
#endif
|
|
63
68
|
#if __has_feature(attribute_availability_swift)
|
|
64
69
|
#define __swift_unavailable(_msg) __attribute__((__availability__(swift, unavailable, message=_msg)))
|
|
65
70
|
#else
|
|
@@ -342,4 +347,37 @@
|
|
|
342
347
|
#define __ptrcheck_unavailable_r(REPLACEMENT)
|
|
343
348
|
|
|
344
349
|
#endif /* !__has_include(<ptrcheck.h>) */
|
|
350
|
+
|
|
351
|
+
#ifndef __alloc_align
|
|
352
|
+
#if __has_attribute(alloc_align)
|
|
353
|
+
#define __alloc_align(n) __attribute__((alloc_align(n)))
|
|
354
|
+
#else
|
|
355
|
+
#define __alloc_align(n)
|
|
356
|
+
#endif
|
|
357
|
+
#endif // __alloc_align
|
|
358
|
+
|
|
359
|
+
#ifndef __alloc_size
|
|
360
|
+
#if __has_attribute(alloc_size)
|
|
361
|
+
#define __alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
|
|
362
|
+
#else
|
|
363
|
+
#define __alloc_size(...)
|
|
364
|
+
#endif
|
|
365
|
+
#endif // __alloc_size
|
|
366
|
+
|
|
367
|
+
#if __has_attribute(warn_unused_result)
|
|
368
|
+
#define __result_use_check __attribute__((__warn_unused_result__))
|
|
369
|
+
#else
|
|
370
|
+
#define __result_use_check
|
|
371
|
+
#endif
|
|
372
|
+
|
|
373
|
+
#define __ASSUME_PTR_ABI_SINGLE_BEGIN __ptrcheck_abi_assume_single()
|
|
374
|
+
#define __ASSUME_PTR_ABI_SINGLE_END __ptrcheck_abi_assume_unsafe_indexable()
|
|
375
|
+
|
|
376
|
+
#if __has_ptrcheck
|
|
377
|
+
#define __header_indexable __indexable
|
|
378
|
+
#define __header_bidi_indexable __bidi_indexable
|
|
379
|
+
#else
|
|
380
|
+
#define __header_indexable
|
|
381
|
+
#define __header_bidi_indexable
|
|
382
|
+
#endif
|
|
345
383
|
#endif /* _CDEFS_H_ */
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
// ids; darwin declares it for every process. darwin's cancellation points bind
|
|
4
4
|
// to the darwin provider, which acts on a pending cancel first.
|
|
5
5
|
#include_next <unistd.h>
|
|
6
|
+
// darwin unistd.h includes Availability.h, which defines __API_AVAILABLE for
|
|
7
|
+
// headers such as vImage_Types.h that only include os/availability.h.
|
|
8
|
+
#include <Availability.h>
|
|
6
9
|
#include <sys/cdefs.h>
|
|
7
10
|
__BEGIN_DECLS
|
|
8
11
|
pid_t getppid(void);
|
package/skills/contrast/SKILL.md
CHANGED
|
@@ -30,6 +30,9 @@ automation, inspecting the render tree, and managing sims.
|
|
|
30
30
|
| `peach storage` | manage guest app storage and launch profiles |
|
|
31
31
|
| `peach permissions` | inspect and change simulated operating-system permissions |
|
|
32
32
|
| `peach location` | control the simulator's simulated device location |
|
|
33
|
+
| `peach state` | capture the current app state in one call |
|
|
34
|
+
| `peach reset` | clear the current guest app and relaunch it |
|
|
35
|
+
| `peach camera` | control the simulator camera source |
|
|
33
36
|
| `peach perf` | CPU, React render, shell frame, and scroll-layer profiling |
|
|
34
37
|
| `peach describe` | curated human-readable UI summary (default inspection tool) |
|
|
35
38
|
| `peach find` | locate nodes by text / testID / role / type / predicate |
|
package/src/codex-client.ts
CHANGED
|
@@ -212,18 +212,23 @@ export function spawnCodexClient(options: CodexClientOptions): CodexClient {
|
|
|
212
212
|
try {
|
|
213
213
|
child.stdin.end()
|
|
214
214
|
} catch {}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
215
|
+
// the teardown outlives the child's close while descendants still run,
|
|
216
|
+
// so the caller joins it below; a failure is held until then.
|
|
217
|
+
let stopping: Promise<Error | undefined> | undefined
|
|
218
|
+
const t = setTimeout(() => {
|
|
219
|
+
if (closed) return
|
|
220
|
+
stopping = terminateProcessGroup(child, 'SIGTERM').then(
|
|
221
|
+
() => undefined,
|
|
222
|
+
(error: unknown) => (error instanceof Error ? error : new Error(String(error))),
|
|
223
|
+
)
|
|
221
224
|
}, timeoutMs)
|
|
222
225
|
try {
|
|
223
226
|
await exited
|
|
224
227
|
} finally {
|
|
225
228
|
clearTimeout(t)
|
|
226
229
|
}
|
|
230
|
+
const stopError = await stopping
|
|
231
|
+
if (stopError) throw stopError
|
|
227
232
|
},
|
|
228
233
|
kill(signal = 'SIGTERM') {
|
|
229
234
|
if (closed) return
|
|
@@ -17,6 +17,9 @@ export interface ResolvedDevBundle {
|
|
|
17
17
|
port: number
|
|
18
18
|
framework: string
|
|
19
19
|
projectName?: string
|
|
20
|
+
// the project root the served manifest names, null when the manifest names
|
|
21
|
+
// none. absent when no manifest was read, so nothing was learned.
|
|
22
|
+
manifestProjectRoot?: string | null
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
function buildUnresolvedTargetError(targetLabel: string): Error {
|
|
@@ -121,6 +124,7 @@ async function resolvePortViaServerScan(port: number): Promise<ResolvedDevBundle
|
|
|
121
124
|
framework?: string
|
|
122
125
|
projectName?: string
|
|
123
126
|
bundleUrlProvisional?: boolean
|
|
127
|
+
manifestProjectRoot?: string | null
|
|
124
128
|
} =>
|
|
125
129
|
!!s &&
|
|
126
130
|
typeof s === 'object' &&
|
|
@@ -145,6 +149,11 @@ async function resolvePortViaServerScan(port: number): Promise<ResolvedDevBundle
|
|
|
145
149
|
port,
|
|
146
150
|
framework: typeof match.framework === 'string' ? match.framework : 'unknown',
|
|
147
151
|
projectName: typeof match.projectName === 'string' ? match.projectName : undefined,
|
|
152
|
+
manifestProjectRoot:
|
|
153
|
+
typeof match.manifestProjectRoot === 'string' ||
|
|
154
|
+
match.manifestProjectRoot === null
|
|
155
|
+
? match.manifestProjectRoot
|
|
156
|
+
: undefined,
|
|
148
157
|
}
|
|
149
158
|
} catch {
|
|
150
159
|
return null
|
|
@@ -168,67 +177,117 @@ type ManifestProbe =
|
|
|
168
177
|
|
|
169
178
|
// keep the same request alive through cold config and fingerprint evaluation.
|
|
170
179
|
// discarding it after a short probe and starting another can never resolve a
|
|
171
|
-
// manifest whose response consistently takes longer than that probe.
|
|
180
|
+
// manifest whose response consistently takes longer than that probe. the
|
|
181
|
+
// request is shared and each caller picks how long it will wait for it: the
|
|
182
|
+
// scanner lists a server after the default, an explicit open waits out startup.
|
|
172
183
|
export const MANIFEST_PROBE_TIMEOUT_MS = 30_000
|
|
184
|
+
export interface ManifestWaitOptions {
|
|
185
|
+
// null lets explicit opens follow the server response; discovery stays bounded.
|
|
186
|
+
waitMs?: number | null
|
|
187
|
+
signal?: AbortSignal
|
|
188
|
+
}
|
|
173
189
|
|
|
174
|
-
const manifestRequests = new Map<
|
|
190
|
+
const manifestRequests = new Map<
|
|
191
|
+
string,
|
|
192
|
+
{
|
|
193
|
+
promise: Promise<Response>
|
|
194
|
+
controller: AbortController
|
|
195
|
+
clients: number
|
|
196
|
+
}
|
|
197
|
+
>()
|
|
175
198
|
|
|
176
|
-
|
|
177
|
-
|
|
199
|
+
async function startDevManifestRequest(
|
|
200
|
+
normalizedBaseUrl: string,
|
|
201
|
+
pageOrigin: string | undefined,
|
|
202
|
+
signal: AbortSignal,
|
|
203
|
+
): Promise<Response> {
|
|
204
|
+
const init = { headers: { 'expo-platform': 'ios' }, signal }
|
|
205
|
+
// node and bun callers pass no page origin. node's fetch would end the
|
|
206
|
+
// request at its five minute headers deadline, while a cold Expo Metro
|
|
207
|
+
// legitimately answers later.
|
|
208
|
+
const res = pageOrigin
|
|
209
|
+
? await fetchDevProbe(`${normalizedBaseUrl}/`, pageOrigin, init)
|
|
210
|
+
: await (
|
|
211
|
+
await import('./node-http-fetch')
|
|
212
|
+
).nodeHttpFetch(`${normalizedBaseUrl}/`, init)
|
|
213
|
+
const body = await res.arrayBuffer()
|
|
214
|
+
return new Response(body.byteLength ? body : null, {
|
|
215
|
+
status: res.status,
|
|
216
|
+
headers: res.headers,
|
|
217
|
+
})
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// listing deadlines release a waiter without killing shared manifest work.
|
|
221
|
+
// explicit cancellation aborts the request only when its last waiter leaves.
|
|
178
222
|
export async function fetchDevManifest(
|
|
179
223
|
baseUrl: string,
|
|
180
224
|
pageOrigin?: string,
|
|
181
|
-
|
|
225
|
+
options: ManifestWaitOptions = {},
|
|
226
|
+
): Promise<Response> {
|
|
227
|
+
options.signal?.throwIfAborted()
|
|
182
228
|
const normalizedBaseUrl = baseUrl.replace(/\/+$/, '')
|
|
183
|
-
|
|
184
|
-
if (
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
headers: { 'expo-platform': 'ios' },
|
|
194
|
-
})
|
|
195
|
-
.then(async (res) => {
|
|
196
|
-
const body = await res.arrayBuffer()
|
|
197
|
-
return new Response(body.byteLength ? body : null, {
|
|
198
|
-
status: res.status,
|
|
199
|
-
headers: res.headers,
|
|
200
|
-
})
|
|
229
|
+
let request = manifestRequests.get(normalizedBaseUrl)
|
|
230
|
+
if (!request) {
|
|
231
|
+
const controller = new AbortController()
|
|
232
|
+
const promise = startDevManifestRequest(
|
|
233
|
+
normalizedBaseUrl,
|
|
234
|
+
pageOrigin,
|
|
235
|
+
controller.signal,
|
|
236
|
+
).finally(() => {
|
|
237
|
+
if (manifestRequests.get(normalizedBaseUrl)?.controller === controller)
|
|
238
|
+
manifestRequests.delete(normalizedBaseUrl)
|
|
201
239
|
})
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
240
|
+
request = { promise, controller, clients: 0 }
|
|
241
|
+
manifestRequests.set(normalizedBaseUrl, request)
|
|
242
|
+
}
|
|
243
|
+
const current = request
|
|
244
|
+
current.clients++
|
|
245
|
+
const waitMs = options.waitMs === undefined ? MANIFEST_PROBE_TIMEOUT_MS : options.waitMs
|
|
246
|
+
let deadline: ReturnType<typeof setTimeout> | undefined
|
|
247
|
+
let onAbort: (() => void) | undefined
|
|
248
|
+
try {
|
|
249
|
+
const stopped = new Promise<never>((_, reject) => {
|
|
250
|
+
onAbort = () => {
|
|
251
|
+
const reason: unknown = options.signal?.reason
|
|
252
|
+
reject(
|
|
253
|
+
reason instanceof Error
|
|
254
|
+
? reason
|
|
255
|
+
: new Error('Metro manifest request canceled', { cause: reason }),
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
options.signal?.addEventListener('abort', onAbort, { once: true })
|
|
259
|
+
if (options.signal?.aborted) onAbort()
|
|
260
|
+
if (waitMs !== null)
|
|
261
|
+
deadline = setTimeout(
|
|
262
|
+
() =>
|
|
263
|
+
reject(
|
|
264
|
+
new Error(
|
|
265
|
+
`Metro manifest request timed out after ${waitMs / 1000}s: ${normalizedBaseUrl}/`,
|
|
266
|
+
),
|
|
267
|
+
),
|
|
268
|
+
waitMs,
|
|
214
269
|
)
|
|
215
|
-
return answered
|
|
216
|
-
})
|
|
217
|
-
.finally(() => {
|
|
218
|
-
clearTimeout(probeDeadline)
|
|
219
|
-
manifestRequests.delete(normalizedBaseUrl)
|
|
220
270
|
})
|
|
221
|
-
|
|
222
|
-
|
|
271
|
+
return (await Promise.race([current.promise, stopped])).clone()
|
|
272
|
+
} finally {
|
|
273
|
+
clearTimeout(deadline)
|
|
274
|
+
if (onAbort) options.signal?.removeEventListener('abort', onAbort)
|
|
275
|
+
current.clients--
|
|
276
|
+
if (options.signal?.aborted && current.clients === 0) {
|
|
277
|
+
if (manifestRequests.get(normalizedBaseUrl) === current)
|
|
278
|
+
manifestRequests.delete(normalizedBaseUrl)
|
|
279
|
+
current.controller.abort(options.signal.reason)
|
|
280
|
+
}
|
|
281
|
+
}
|
|
223
282
|
}
|
|
224
283
|
|
|
225
284
|
async function probeExpoManifest(
|
|
226
285
|
normalizedBaseUrl: string,
|
|
227
286
|
port: number,
|
|
228
287
|
pageOrigin: string | undefined,
|
|
288
|
+
options: ManifestWaitOptions,
|
|
229
289
|
): Promise<ManifestProbe> {
|
|
230
|
-
const answered = await fetchDevManifest(normalizedBaseUrl, pageOrigin)
|
|
231
|
-
if (answered === undefined) return { state: 'no-answer' }
|
|
290
|
+
const answered = await fetchDevManifest(normalizedBaseUrl, pageOrigin, options)
|
|
232
291
|
if (answered.status === 404 || answered.status === 405) return { state: 'no-manifest' }
|
|
233
292
|
if (answered.status < 200 || answered.status >= 300)
|
|
234
293
|
throw new Error(
|
|
@@ -268,9 +327,21 @@ async function probeExpoManifest(
|
|
|
268
327
|
'name' in client && typeof client.name === 'string' ? client.name : undefined
|
|
269
328
|
if (!launchUrl && !name) return { state: 'no-manifest' }
|
|
270
329
|
|
|
330
|
+
const internal =
|
|
331
|
+
'_internal' in client && client._internal && typeof client._internal === 'object'
|
|
332
|
+
? client._internal
|
|
333
|
+
: {}
|
|
334
|
+
const manifestProjectRoot =
|
|
335
|
+
'projectRoot' in internal &&
|
|
336
|
+
typeof internal.projectRoot === 'string' &&
|
|
337
|
+
internal.projectRoot.length > 0
|
|
338
|
+
? internal.projectRoot
|
|
339
|
+
: null
|
|
340
|
+
|
|
271
341
|
return {
|
|
272
342
|
state: 'resolved',
|
|
273
343
|
bundle: {
|
|
344
|
+
manifestProjectRoot,
|
|
274
345
|
bundleUrl: normalizeNativeDevBundleUrl(
|
|
275
346
|
launchUrl || `${normalizedBaseUrl}${METRO_BUNDLE_PATH}`,
|
|
276
347
|
),
|
|
@@ -303,10 +374,11 @@ async function probeBaseUrlBundleDirect(
|
|
|
303
374
|
baseUrl: string,
|
|
304
375
|
port: number,
|
|
305
376
|
pageOrigin: string | undefined,
|
|
377
|
+
options: ManifestWaitOptions,
|
|
306
378
|
): Promise<ResolvedDevBundle | null> {
|
|
307
379
|
const normalizedBaseUrl = baseUrl.replace(/\/+$/, '')
|
|
308
380
|
|
|
309
|
-
const manifest = await probeExpoManifest(normalizedBaseUrl, port, pageOrigin)
|
|
381
|
+
const manifest = await probeExpoManifest(normalizedBaseUrl, port, pageOrigin, options)
|
|
310
382
|
if (manifest.state === 'resolved') return manifest.bundle
|
|
311
383
|
// a server that never says what it is gets no guessed entry point.
|
|
312
384
|
if (manifest.state === 'no-answer') return null
|
|
@@ -335,6 +407,7 @@ async function probeBaseUrlBundle(
|
|
|
335
407
|
baseUrl: string,
|
|
336
408
|
port: number,
|
|
337
409
|
pageOrigin: string | undefined,
|
|
410
|
+
options: ManifestWaitOptions,
|
|
338
411
|
): Promise<ResolvedDevBundle | null> {
|
|
339
412
|
// browser/worker loopback targets resolve through the server-side scanner so
|
|
340
413
|
// they match the dev-server list exactly — see resolvePortViaServerScan.
|
|
@@ -344,12 +417,13 @@ async function probeBaseUrlBundle(
|
|
|
344
417
|
if (viaScan) return viaScan
|
|
345
418
|
}
|
|
346
419
|
} catch {}
|
|
347
|
-
return probeBaseUrlBundleDirect(baseUrl, port, pageOrigin)
|
|
420
|
+
return probeBaseUrlBundleDirect(baseUrl, port, pageOrigin, options)
|
|
348
421
|
}
|
|
349
422
|
|
|
350
423
|
export async function probePortBundle(
|
|
351
424
|
port: number,
|
|
352
425
|
pageOrigin?: string,
|
|
426
|
+
options: ManifestWaitOptions = {},
|
|
353
427
|
): Promise<ResolvedDevBundle | null> {
|
|
354
428
|
const viaScan = await resolvePortViaServerScan(port)
|
|
355
429
|
if (viaScan) return viaScan
|
|
@@ -362,6 +436,7 @@ export async function probePortBundle(
|
|
|
362
436
|
buildLoopbackProbeBaseUrl('http:', hostname, port),
|
|
363
437
|
port,
|
|
364
438
|
pageOrigin,
|
|
439
|
+
options,
|
|
365
440
|
)
|
|
366
441
|
if (!bundle) throw unresolved
|
|
367
442
|
return bundle
|
|
@@ -378,12 +453,13 @@ export async function probePortBundle(
|
|
|
378
453
|
export async function resolveConnectionInput(
|
|
379
454
|
input: string,
|
|
380
455
|
pageOrigin?: string,
|
|
456
|
+
options: ManifestWaitOptions = {},
|
|
381
457
|
): Promise<ResolvedDevBundle> {
|
|
382
458
|
const trimmed = input.trim()
|
|
383
459
|
|
|
384
460
|
if (/^\d+$/.test(trimmed)) {
|
|
385
461
|
const port = parseInt(trimmed, 10)
|
|
386
|
-
const resolved = await probePortBundle(port, pageOrigin)
|
|
462
|
+
const resolved = await probePortBundle(port, pageOrigin, options)
|
|
387
463
|
if (resolved) return resolved
|
|
388
464
|
throw buildUnresolvedTargetError(`localhost:${port}`)
|
|
389
465
|
}
|
|
@@ -410,7 +486,7 @@ export async function resolveConnectionInput(
|
|
|
410
486
|
// guessing that the origin itself is the bundle URL. loopback vs. remote
|
|
411
487
|
// only affects how the probe fetch is routed (see shouldProxyLoopbackProbe).
|
|
412
488
|
if (isBaseServerUrl(parsed)) {
|
|
413
|
-
const resolved = await probeBaseUrlBundle(baseUrl, port, pageOrigin)
|
|
489
|
+
const resolved = await probeBaseUrlBundle(baseUrl, port, pageOrigin, options)
|
|
414
490
|
if (resolved) return resolved
|
|
415
491
|
throw buildUnresolvedTargetError(baseUrl)
|
|
416
492
|
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// prepare Expo's own CocoaPods workspace in a private cache on the Mac.
|
|
2
|
+
import { execFileSync } from 'node:child_process'
|
|
3
|
+
import { createHash } from 'node:crypto'
|
|
4
|
+
import fs from 'node:fs'
|
|
5
|
+
import { createRequire } from 'node:module'
|
|
6
|
+
import path from 'node:path'
|
|
7
|
+
import { cacheDir } from './home-paths'
|
|
8
|
+
import { withSwiftRootLock, type SwiftRootLease } from './swift-root-lock'
|
|
9
|
+
|
|
10
|
+
export async function prepareExpoNativeWorkspace(app: string, signal?: AbortSignal) {
|
|
11
|
+
if (process.platform !== 'darwin')
|
|
12
|
+
throw new Error('Expo CocoaPods workspace preparation requires a Mac')
|
|
13
|
+
let root = app
|
|
14
|
+
for (let dir = app; ; dir = path.dirname(dir)) {
|
|
15
|
+
if (
|
|
16
|
+
['pnpm-workspace.yaml', 'package-lock.json', 'yarn.lock', 'bun.lock'].some((name) =>
|
|
17
|
+
fs.existsSync(path.join(dir, name)),
|
|
18
|
+
)
|
|
19
|
+
) {
|
|
20
|
+
root = dir
|
|
21
|
+
break
|
|
22
|
+
}
|
|
23
|
+
if (path.dirname(dir) === dir) break
|
|
24
|
+
}
|
|
25
|
+
const appRelative = path.relative(root, app)
|
|
26
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'))
|
|
27
|
+
const appManifest = JSON.parse(fs.readFileSync(path.join(app, 'package.json'), 'utf8'))
|
|
28
|
+
const excluded = (relative: string) => {
|
|
29
|
+
const parts = relative.split(path.sep)
|
|
30
|
+
return (
|
|
31
|
+
parts.includes('node_modules') ||
|
|
32
|
+
parts.includes('.git') ||
|
|
33
|
+
parts.includes('.expo') ||
|
|
34
|
+
(parts.includes('ios') && (parts.includes('Pods') || parts.includes('build')))
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
const hash = createHash('sha256')
|
|
38
|
+
const walk = (directory: string) => {
|
|
39
|
+
for (const entry of fs
|
|
40
|
+
.readdirSync(directory, { withFileTypes: true })
|
|
41
|
+
.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
42
|
+
signal?.throwIfAborted()
|
|
43
|
+
const file = path.join(directory, entry.name)
|
|
44
|
+
const relative = path.relative(root, file)
|
|
45
|
+
if (excluded(relative)) continue
|
|
46
|
+
hash.update(`${relative}\0`)
|
|
47
|
+
if (entry.isSymbolicLink()) hash.update(`link\0${fs.readlinkSync(file)}\0`)
|
|
48
|
+
else if (entry.isDirectory()) walk(file)
|
|
49
|
+
else if (entry.isFile()) hash.update(fs.readFileSync(file))
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
walk(root)
|
|
53
|
+
let podVersion: string
|
|
54
|
+
try {
|
|
55
|
+
podVersion = execFileSync('pod', ['--version'], { encoding: 'utf8' })
|
|
56
|
+
} catch (cause) {
|
|
57
|
+
throw new Error('CocoaPods is required to install source dependencies', { cause })
|
|
58
|
+
}
|
|
59
|
+
hash.update(
|
|
60
|
+
JSON.stringify({
|
|
61
|
+
appRelative,
|
|
62
|
+
podVersion,
|
|
63
|
+
node: process.version,
|
|
64
|
+
xcode: execFileSync('xcodebuild', ['-version'], { encoding: 'utf8' }),
|
|
65
|
+
packageManager: manifest.packageManager,
|
|
66
|
+
}),
|
|
67
|
+
)
|
|
68
|
+
const work = path.join(cacheDir(), 'expo-native-workspaces', hash.digest('hex'))
|
|
69
|
+
return withSwiftRootLock(
|
|
70
|
+
work,
|
|
71
|
+
async (lease) => {
|
|
72
|
+
const marker = path.join(work, '.peach-complete')
|
|
73
|
+
const preparedApp = path.join(work, appRelative)
|
|
74
|
+
if (!fs.existsSync(marker)) {
|
|
75
|
+
const partial = `${work}.${process.pid}.partial`
|
|
76
|
+
fs.rmSync(partial, { recursive: true, force: true })
|
|
77
|
+
fs.rmSync(work, { recursive: true, force: true })
|
|
78
|
+
fs.mkdirSync(path.dirname(work), { recursive: true })
|
|
79
|
+
fs.cpSync(root, partial, {
|
|
80
|
+
recursive: true,
|
|
81
|
+
filter: (source) => !excluded(path.relative(root, source)),
|
|
82
|
+
})
|
|
83
|
+
fs.renameSync(partial, work)
|
|
84
|
+
const run = (command: string, args: string[], cwd: string) =>
|
|
85
|
+
runAdmitted(lease, command, args, cwd, signal)
|
|
86
|
+
const manager =
|
|
87
|
+
typeof manifest.packageManager === 'string' ? manifest.packageManager : 'npm'
|
|
88
|
+
const nodeVersion =
|
|
89
|
+
typeof manifest.engines?.node === 'string' &&
|
|
90
|
+
/^\d+\.\d+\.\d+$/.test(manifest.engines.node)
|
|
91
|
+
? manifest.engines.node
|
|
92
|
+
: null
|
|
93
|
+
const prefix = nodeVersion ? ['mise', 'exec', `node@${nodeVersion}`, '--'] : []
|
|
94
|
+
const install = manager.startsWith('pnpm@')
|
|
95
|
+
? [
|
|
96
|
+
'npx',
|
|
97
|
+
'--yes',
|
|
98
|
+
manager,
|
|
99
|
+
'install',
|
|
100
|
+
'--frozen-lockfile',
|
|
101
|
+
'--filter',
|
|
102
|
+
`${appManifest.name}...`,
|
|
103
|
+
]
|
|
104
|
+
: manager.startsWith('yarn@')
|
|
105
|
+
? ['corepack', 'yarn', 'install', '--immutable']
|
|
106
|
+
: manager.startsWith('bun@')
|
|
107
|
+
? ['bun', 'install', '--frozen-lockfile']
|
|
108
|
+
: [
|
|
109
|
+
'npm',
|
|
110
|
+
fs.existsSync(path.join(work, 'package-lock.json')) ? 'ci' : 'install',
|
|
111
|
+
]
|
|
112
|
+
const execute = async (args: string[], cwd: string) => {
|
|
113
|
+
const command = [...prefix, ...args]
|
|
114
|
+
await run(command[0]!, command.slice(1), cwd)
|
|
115
|
+
}
|
|
116
|
+
await execute(install, work)
|
|
117
|
+
const expo = createRequire(path.join(preparedApp, 'package.json')).resolve(
|
|
118
|
+
'expo/bin/cli',
|
|
119
|
+
)
|
|
120
|
+
await execute(
|
|
121
|
+
['node', expo, 'prebuild', '--platform', 'ios', '--no-install'],
|
|
122
|
+
preparedApp,
|
|
123
|
+
)
|
|
124
|
+
await run('pod', ['install'], path.join(preparedApp, 'ios'))
|
|
125
|
+
fs.writeFileSync(marker, 'complete\n')
|
|
126
|
+
}
|
|
127
|
+
const ios = path.join(preparedApp, 'ios')
|
|
128
|
+
const workspaces = fs
|
|
129
|
+
.readdirSync(ios)
|
|
130
|
+
.filter((name) => name.endsWith('.xcworkspace'))
|
|
131
|
+
if (workspaces.length !== 1)
|
|
132
|
+
throw new Error(`expected one Expo workspace in ${ios}`)
|
|
133
|
+
return { app: preparedApp, workspace: path.join(ios, workspaces[0]!) }
|
|
134
|
+
},
|
|
135
|
+
signal,
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async function runAdmitted(
|
|
140
|
+
lease: SwiftRootLease,
|
|
141
|
+
command: string,
|
|
142
|
+
args: string[],
|
|
143
|
+
cwd: string,
|
|
144
|
+
signal?: AbortSignal,
|
|
145
|
+
) {
|
|
146
|
+
signal?.throwIfAborted()
|
|
147
|
+
const child = lease.spawn(
|
|
148
|
+
'tm',
|
|
149
|
+
['window', 'run', 'heavy', '--local', '--wait', '--', command, ...args],
|
|
150
|
+
{
|
|
151
|
+
cwd,
|
|
152
|
+
env: {
|
|
153
|
+
...process.env,
|
|
154
|
+
EXPO_NO_TELEMETRY: '1',
|
|
155
|
+
LANG: 'en_US.UTF-8',
|
|
156
|
+
LC_ALL: 'en_US.UTF-8',
|
|
157
|
+
},
|
|
158
|
+
signal,
|
|
159
|
+
},
|
|
160
|
+
)
|
|
161
|
+
const output: Buffer[] = []
|
|
162
|
+
child.stdout.on('data', (bytes: Buffer) => output.push(bytes))
|
|
163
|
+
child.stderr.on('data', (bytes: Buffer) => output.push(bytes))
|
|
164
|
+
await new Promise<void>((resolve, reject) => {
|
|
165
|
+
child.once('error', reject)
|
|
166
|
+
child.once('close', (status) =>
|
|
167
|
+
status === 0
|
|
168
|
+
? resolve()
|
|
169
|
+
: reject(
|
|
170
|
+
new Error(
|
|
171
|
+
`${command} exited ${status}: ${Buffer.concat(output).toString('utf8')}`,
|
|
172
|
+
),
|
|
173
|
+
),
|
|
174
|
+
)
|
|
175
|
+
})
|
|
176
|
+
}
|