peachsim 0.1.2253 → 0.1.2255

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 (119) hide show
  1. package/cli/commands/compat.ts +1 -1
  2. package/cli/commands/control.ts +1 -1
  3. package/cli/commands/package.ts +1 -1
  4. package/cli/commands/runtime.ts +1 -1
  5. package/cli/commands/upgrade.ts +2 -5
  6. package/cli/commands/version.ts +1 -1
  7. package/cli/native-input.ts +1 -1
  8. package/dist-lib/agent-daemon-client.cjs +1 -1
  9. package/dist-lib/agent-events.cjs +1 -1
  10. package/dist-lib/attached-projects.cjs +1 -1
  11. package/dist-lib/auth/shared-session.cjs +1 -1
  12. package/dist-lib/backend-origin.cjs +1 -1
  13. package/dist-lib/beta.cjs +1 -1
  14. package/dist-lib/beta.mjs +1 -1
  15. package/dist-lib/bridge-constants.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.cjs +1 -1
  17. package/dist-lib/bridge-contract-input.mjs +1 -1
  18. package/dist-lib/bridge-contract.cjs +1 -1
  19. package/dist-lib/bridge-contract.mjs +1 -1
  20. package/dist-lib/bundle-channel.cjs +2920 -2214
  21. package/dist-lib/capture-contract.cjs +1 -1
  22. package/dist-lib/capture-contract.mjs +1 -1
  23. package/dist-lib/cloud-contract.cjs +1 -1
  24. package/dist-lib/cloud-contract.mjs +1 -1
  25. package/dist-lib/cloud-test-args.cjs +1 -1
  26. package/dist-lib/cloud-test-args.mjs +1 -1
  27. package/dist-lib/cloud.cjs +1 -1
  28. package/dist-lib/cloud.mjs +1 -1
  29. package/dist-lib/config.cjs +16 -1
  30. package/dist-lib/config.mjs +14 -1
  31. package/dist-lib/detox/index.cjs +2 -2
  32. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  33. package/dist-lib/expo-swift-bundle.cjs +3103 -2398
  34. package/dist-lib/expo-swift-metadata.cjs +1 -1
  35. package/dist-lib/expo-swift-metadata.mjs +1 -1
  36. package/dist-lib/home-paths.cjs +1 -1
  37. package/dist-lib/host/bridge-host.cjs +2977 -2269
  38. package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
  39. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  40. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  41. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  42. package/dist-lib/host/websocket-proxy.cjs +1 -1
  43. package/dist-lib/index.cjs +2777 -2644
  44. package/dist-lib/jump-to-source-babel.cjs +1 -1
  45. package/dist-lib/jump-to-source-native.cjs +1 -1
  46. package/dist-lib/kotlin-host.cjs +3 -2
  47. package/dist-lib/menu.cjs +1 -1
  48. package/dist-lib/menu.mjs +1 -1
  49. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  50. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  51. package/dist-lib/metro-production-bundle.cjs +1 -1
  52. package/dist-lib/metro-production-bundle.mjs +1 -1
  53. package/dist-lib/metro.cjs +115 -40
  54. package/dist-lib/native-app-identity-project.cjs +2 -2
  55. package/dist-lib/native-app-identity-project.mjs +2 -3
  56. package/dist-lib/native-app-identity.cjs +1 -1
  57. package/dist-lib/native-app-identity.mjs +1 -1
  58. package/dist-lib/native-firebase-metadata.cjs +1 -1
  59. package/dist-lib/native-firebase-metadata.mjs +1 -1
  60. package/dist-lib/pdfium-raster.cjs +1 -1
  61. package/dist-lib/pdfium-raster.mjs +1 -1
  62. package/dist-lib/plist.cjs +1 -1
  63. package/dist-lib/plist.mjs +1 -1
  64. package/dist-lib/profiles.cjs +1 -1
  65. package/dist-lib/public-brand.cjs +1 -1
  66. package/dist-lib/public-origins-lib-esm.json +24 -24
  67. package/dist-lib/public-origins-lib.json +126 -114
  68. package/dist-lib/react-native-host-modules.cjs +1 -1
  69. package/dist-lib/react-native-host-modules.mjs +1 -1
  70. package/dist-lib/reap-browser.cjs +1 -1
  71. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  72. package/dist-lib/sdk.cjs +1 -1
  73. package/dist-lib/sdk.mjs +1 -1
  74. package/dist-lib/skills.cjs +3436 -2730
  75. package/dist-lib/swift-compile.cjs +94 -29
  76. package/dist-lib/swift-compile.mjs +97 -29
  77. package/dist-lib/swift-package.cjs +1 -1
  78. package/dist-lib/swift-package.mjs +1 -1
  79. package/dist-lib/swift-submit.cjs +1 -1
  80. package/dist-lib/swift-submit.mjs +1 -1
  81. package/dist-lib/swift-toolchain.cjs +1 -1
  82. package/dist-lib/swift.cjs +1 -1
  83. package/dist-lib/vite-swift.cjs +2197 -1514
  84. package/dist-lib/vite.cjs +4796 -3499
  85. package/dist-lib/worklet-executable.cjs +1 -1
  86. package/dist-lib/worklet-executable.mjs +1 -1
  87. package/dist-types/packages/peach-engine/src/config.d.ts +1 -1
  88. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -0
  89. package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -0
  90. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +33 -1
  91. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  92. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +11 -0
  93. package/kotlin/sdk.tar.gz +0 -0
  94. package/package.json +1 -1
  95. package/runtime-companion.json +1 -1
  96. package/sdk/ios/wasm/include/__typedef_time_t.h +5 -0
  97. package/sdk/ios/wasm/include/ifaddrs.h +75 -0
  98. package/sdk/ios/wasm/include/machine/_types.h +1 -1
  99. package/sdk/ios/wasm/include/pthread.h +4 -0
  100. package/sdk/ios/wasm/include/unistd.h +2 -0
  101. package/{cli → src}/app-config.ts +5 -5
  102. package/src/bundle-channel.mjs +1 -1
  103. package/src/config.ts +29 -0
  104. package/src/core-data-entity-classes.ts +2 -2
  105. package/src/core-data-model.ts +681 -0
  106. package/src/expo-swift-host.ts +1 -1
  107. package/src/kotlin-host.ts +2 -1
  108. package/src/metro-plugin.ts +1 -3
  109. package/src/nitro-adapter.lock.json +236 -236
  110. package/src/nitro-bundle.ts +1 -1
  111. package/src/nitro-superset.lock.json +4 -4
  112. package/src/plist-bytes.ts +113 -0
  113. package/src/swift-compile.ts +2 -0
  114. package/src/swift-distribution.lock.json +11 -11
  115. package/src/swift-guest-image-ledger.ts +2 -1
  116. package/src/swift-host.ts +14 -2
  117. package/src/turbo-bundle.ts +1 -1
  118. package/src/turbo-runtime.lock.json +20 -20
  119. package/src/vite-plugin-one.ts +68 -0
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2253 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2255 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2253 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2255 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/worklet-executable.ts
4
4
  import { parse } from "acorn";
@@ -1,5 +1,5 @@
1
1
  import type { PeachConfig as PublicPeachConfig } from '../../../../src/config.ts';
2
2
  import type { SettingsValues } from '../../../../src/settingsContract.ts';
3
- export { PEACH_CONFIG_QUERY_PARAM, applyPeachConfigToUrl, collectConfiguredFileModules, defineConfig, hasPeachConfig, mergePeachConfig, readPeachConfigFromSearchParams, } from '../../../../src/config.ts';
3
+ export { PEACH_CONFIG_QUERY_PARAM, PEACH_WORKSPACE_MODULE_MARKER, applyPeachConfigToUrl, collectConfiguredFileModules, defineConfig, hasPeachConfig, matchConfigModule, mergePeachConfig, readPeachConfigFromSearchParams, } from '../../../../src/config.ts';
4
4
  export type { ModuleResolution, NativeModuleResolution, NativeViewResolution, } from '../../../../src/config.ts';
5
5
  export type PeachConfig = PublicPeachConfig<SettingsValues>;
@@ -83,6 +83,7 @@ export declare const SCENE_PAINT_MATERIAL = 536870912;
83
83
  export declare const SCENE_PAINT_VIEW_MASK = 1073741824;
84
84
  export declare const SCENE_PAINT_SWIFTUI_FRAME = -2147483648;
85
85
  export declare const STYLE_RECORD_LENGTH: number;
86
+ export declare const STYLE_RECORD_LAYOUT: string;
86
87
  export declare const SCENE_D_SELF_GEN = 38;
87
88
  export declare const SCENE_D_SUB_GEN = 39;
88
89
  export declare const SCENE_D_KIND_STAMP = 53;
@@ -747,6 +747,7 @@ export interface RenderContext extends RenderContextBase {
747
747
  flatDeps?: [boolean];
748
748
  damage?: FrameDamage | null;
749
749
  damageClip?: DamageRect | null;
750
+ rasterHeld?: boolean;
750
751
  excludedNodeIds?: ReadonlySet<number>;
751
752
  prewarm?: PrewarmPass;
752
753
  recordingFailed?: boolean;
@@ -39,7 +39,7 @@ import type { SurfaceTreePaintAckState } from './tree-sync-port.d.ts';
39
39
  import type { WebGpuFrameTransactionCounters } from './webgpu-frame-transaction.d.ts';
40
40
  import type { WebGpuReadbackCounters } from './webgpu-readback-scheduler.d.ts';
41
41
  import type { WorkerStorageSyncMessage } from './worker-storage.d.ts';
42
- import type { SootSimCaptureOptions, SootsimBootMark } from '../../../peach-globals/src/index.d.ts';
42
+ import type { CompositorStepPhases, SootSimCaptureOptions, SootsimBootMark } from '../../../peach-globals/src/index.d.ts';
43
43
  export type NativeInterfaceRotation = InterfaceRotation & {
44
44
  platform: RuntimePlatform;
45
45
  };
@@ -152,8 +152,37 @@ export interface CompositorSurfaceCaptureFailure {
152
152
  surfaceId: CompositorSurfaceId;
153
153
  message: string;
154
154
  }
155
+ export interface CompositorCaptureComposite {
156
+ width: number;
157
+ height: number;
158
+ layers: Array<{
159
+ surfaceId: CompositorSurfaceId;
160
+ x: number;
161
+ y: number;
162
+ width: number;
163
+ height: number;
164
+ opacity: number;
165
+ radii: number[] | null;
166
+ }>;
167
+ crop?: {
168
+ x: number;
169
+ y: number;
170
+ width: number;
171
+ height: number;
172
+ };
173
+ type: 'image/png' | 'image/webp';
174
+ quality: number;
175
+ rejectFlat: boolean;
176
+ }
177
+ export type CompositorCaptureEncoded = {
178
+ bytes: ArrayBuffer;
179
+ type: string;
180
+ } | {
181
+ flat: true;
182
+ };
155
183
  export interface CompositorSurfaceCaptureResult {
156
184
  surfaces: CompositorCapturedSurface[];
185
+ encoded?: CompositorCaptureEncoded;
157
186
  pixelSurfaces?: CompositorCapturedPixelSurface[];
158
187
  hashedSurfaces?: CompositorCapturedFrameHash[];
159
188
  unavailableSurfaceIds: CompositorSurfaceId[];
@@ -1351,6 +1380,7 @@ export type CompositorHostToWorker = {
1351
1380
  suppressText?: SootSimCaptureOptions['suppressText'];
1352
1381
  captureFilter?: SootSimCaptureOptions['captureFilter'];
1353
1382
  reads?: CompositorPixelReads;
1383
+ composite?: CompositorCaptureComposite;
1354
1384
  } | ({
1355
1385
  type: 'dump';
1356
1386
  requestId: number;
@@ -1933,6 +1963,7 @@ export type CompositorWorkerToHost = {
1933
1963
  type: 'captureSurfacesResult';
1934
1964
  requestId: number;
1935
1965
  surfaces: CompositorCapturedSurface[];
1966
+ encoded?: CompositorCaptureEncoded;
1936
1967
  pixelSurfaces?: CompositorCapturedPixelSurface[];
1937
1968
  hashedSurfaces?: CompositorCapturedFrameHash[];
1938
1969
  unavailableSurfaceIds: CompositorSurfaceId[];
@@ -1941,6 +1972,7 @@ export type CompositorWorkerToHost = {
1941
1972
  type: 'stepFrameDone';
1942
1973
  requestId: number;
1943
1974
  frameToken: number;
1975
+ phases: CompositorStepPhases;
1944
1976
  } | {
1945
1977
  type: 'imageGetSizeResult';
1946
1978
  requestId: number;
@@ -35,7 +35,7 @@ export type { SootSimElectronBridge } from './electronBridgeContract.d.ts';
35
35
  export { isBoxViewingMessage } from './shellBridgeContract.d.ts';
36
36
  export type { PeachHomeApp, PeachHomeStorageValue, PeachHomeStorageBinding, PeachHomeScreenConfig, SootSimConsoleBuffer, SootSimShellCommands, SootSimMainShellBridge, SootSimDemoShareLeaseOptions, SootSimDemoShareBridge, BoxViewingMode, BoxViewingMessage, } from './shellBridgeContract.d.ts';
37
37
  export type { SootSimRenderActivityState, SootSimShellSceneFanoutStats, SootSimAuxCompositorStats, SootSimLiveCompositeBridge, SootSimVideoStreamBridge, SootSimLiveCompositeFreshStage, SootSimLiveCompositePublicationStatus, } from './compositorBridgeContract.d.ts';
38
- export type { PeachAnimatedExecution, PeachLockstepTenantFrame, SootSimLockstepFrameReceipt, LockstepInputReceipt, LockstepScheduledInput, SootSimLockstepCaptureController, SootSimLockstepCaptureBridge, } from './lockstepCaptureBridgeContract.d.ts';
38
+ export type { PeachAnimatedExecution, CompositorStepPhases, PeachLockstepTenantFrame, SootSimLockstepFrameReceipt, LockstepInputReceipt, LockstepScheduledInput, SootSimLockstepCaptureController, SootSimLockstepCaptureBridge, } from './lockstepCaptureBridgeContract.d.ts';
39
39
  export type { LockstepFramePosition, PointerDeliveryTarget, PointerDeliveryPendingDrop, PointerDeliveryStats, SootSimShellHostBridge, } from './shellHostBridgeContract.d.ts';
40
40
  export type { SootSimLaunchArguments, SootSimExternalAppLifecycleOptions, SootSimStorageResetStrategy, SootSimExternalAppResetOptions, SootSimExternalAppResetResult, SootSimExternalAppStorageClearOptions, SootSimWebStorageName, SootSimHotRemountBridge, } from './appLifecycleBridgeContract.d.ts';
41
41
  export type { SootSimSettingsBridge } from './settingsBridgeContract.d.ts';
@@ -25,6 +25,16 @@ export interface PeachLockstepTenantFrame {
25
25
  animatedRenderTriggers: number;
26
26
  rendered: boolean;
27
27
  }
28
+ export interface CompositorStepPhases {
29
+ advanceMs: number;
30
+ produceMs: number;
31
+ admissionWaitMs: number;
32
+ imageWaitMs: number;
33
+ pageShownMs: number;
34
+ producedFrames: number;
35
+ transitionPaint: boolean;
36
+ totalMs?: number;
37
+ }
28
38
  export interface SootSimLockstepFrameReceipt {
29
39
  frameIndex: number;
30
40
  virtualTimestampMs: number;
@@ -34,6 +44,7 @@ export interface SootSimLockstepFrameReceipt {
34
44
  shell: number;
35
45
  publication: number;
36
46
  compositor: number;
47
+ compositorPhases: CompositorStepPhases | null;
37
48
  } | null;
38
49
  }
39
50
  export type LockstepInputReceipt = {
package/kotlin/sdk.tar.gz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.2253",
3
+ "version": "0.1.2255",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1 +1 @@
1
- {"abi":1,"sha256":"3f866674ef9cb3c9dd8d40d8b28a4b9c1131b5c5f7fa6504651570ed7ce753a3","file":"node/cli-3f866674ef9cb3c9dd8d40d8b28a4b9c1131b5c5f7fa6504651570ed7ce753a3.cjs"}
1
+ {"abi":1,"sha256":"04d02b55743de5e2ad5423d864a6f1757158967c1a77df55455bb98d4d2435af","file":"node/cli-04d02b55743de5e2ad5423d864a6f1757158967c1a77df55455bb98d4d2435af.cjs"}
@@ -0,0 +1,5 @@
1
+ #pragma once
2
+ #define __wasilibc___typedef_time_t_h
3
+ // darwin's time_t is long, which swift imports as Int; the installed libc's long
4
+ // long imports as Int64. both are 64 bits wide in the guest.
5
+ typedef long time_t;
@@ -0,0 +1,75 @@
1
+ #pragma once
2
+ // darwin's ifaddrs record, as the ios sdk declares it: the installed libc's keeps the
3
+ // destination in a union and defines ifa_dstaddr as a macro, which swift cannot import.
4
+ #include <sys/types.h>
5
+ #include <sys/socket.h>
6
+ /*
7
+ * Copyright (c) 2018 Apple Inc. All rights reserved.
8
+ */
9
+ /* $FreeBSD: src/include/ifaddrs.h,v 1.3.32.1.4.1 2010/06/14 02:09:06 kensmith Exp $ */
10
+
11
+ /*
12
+ * Copyright (c) 1995, 1999
13
+ * Berkeley Software Design, Inc. All rights reserved.
14
+ *
15
+ * Redistribution and use in source and binary forms, with or without
16
+ * modification, are permitted provided that the following conditions
17
+ * are met:
18
+ * 1. Redistributions of source code must retain the above copyright
19
+ * notice, this list of conditions and the following disclaimer.
20
+ *
21
+ * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
22
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24
+ * ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
25
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31
+ * SUCH DAMAGE.
32
+ *
33
+ * BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp
34
+ */
35
+
36
+ #ifndef _IFADDRS_H_
37
+ #define _IFADDRS_H_
38
+
39
+ #include <os/availability.h>
40
+
41
+ struct ifaddrs {
42
+ struct ifaddrs *ifa_next;
43
+ char *ifa_name;
44
+ unsigned int ifa_flags;
45
+ struct sockaddr *ifa_addr;
46
+ struct sockaddr *ifa_netmask;
47
+ struct sockaddr *ifa_dstaddr;
48
+ void *ifa_data;
49
+ };
50
+
51
+ /*
52
+ * This may have been defined in <net/if.h>. Note that if <net/if.h> is
53
+ * to be included it must be included before this header file.
54
+ */
55
+ #ifndef ifa_broadaddr
56
+ #define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
57
+ #endif
58
+
59
+ struct ifmaddrs {
60
+ struct ifmaddrs *ifma_next;
61
+ struct sockaddr *ifma_name;
62
+ struct sockaddr *ifma_addr;
63
+ struct sockaddr *ifma_lladdr;
64
+ };
65
+
66
+ #include <sys/cdefs.h>
67
+
68
+ __BEGIN_DECLS
69
+ extern int getifaddrs(struct ifaddrs **);
70
+ extern void freeifaddrs(struct ifaddrs *);
71
+ extern int getifmaddrs(struct ifmaddrs **) API_AVAILABLE(macos(10.7), ios(4.3), watchos(4.0), tvos(11.0));
72
+ extern void freeifmaddrs(struct ifmaddrs *) API_AVAILABLE(macos(10.7), ios(4.3), watchos(4.0), tvos(11.0));
73
+ __END_DECLS
74
+
75
+ #endif
@@ -143,7 +143,7 @@ typedef __darwin_ct_rune_t __darwin_wint_t; /* wint_t */
143
143
  typedef long long __darwin_clock_t; /* clock() */
144
144
  typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
145
145
  typedef long __darwin_ssize_t; /* byte count or error */
146
- typedef long long __darwin_time_t; /* time() */
146
+ typedef long __darwin_time_t; /* time() */
147
147
 
148
148
  #undef USE_CLANG_TYPES
149
149
  #else
@@ -57,7 +57,11 @@ int pthread_cond_timedwait(pthread_cond_t *__restrict, pthread_mutex_t *__restri
57
57
  int pthread_cond_timedwait_relative_np(pthread_cond_t *, pthread_mutex_t *, const struct timespec *)
58
58
  __asm__("__peach_darwin_pthread_cond_timedwait_relative_np");
59
59
  // darwin hands out 512 thread-specific keys from 256; these bind to its table.
60
+ #pragma clang assume_nonnull begin
60
61
  int pthread_key_create(pthread_key_t *, void (* _Nullable)(void *)) __asm__("__peach_darwin_pthread_key_create");
62
+ // darwin's swift-importer shape: the start routine and its argument import non-optional.
63
+ int pthread_create(pthread_t _Nullable * _Nonnull __restrict, const pthread_attr_t * _Nullable __restrict, void * _Nullable (* _Nonnull)(void *), void * _Nullable __restrict);
64
+ #pragma clang assume_nonnull end
61
65
  int pthread_key_delete(pthread_key_t) __asm__("__peach_darwin_pthread_key_delete");
62
66
  void * _Nullable pthread_getspecific(pthread_key_t) __asm__("__peach_darwin_pthread_getspecific");
63
67
  int pthread_setspecific(pthread_key_t, const void * _Nullable) __asm__("__peach_darwin_pthread_setspecific");
@@ -8,6 +8,7 @@
8
8
  // darwin's cancellation points bind to the darwin provider, which acts on a
9
9
  // pending cancel first, and getcwd binds to the provider that refuses an
10
10
  // empty buffer as darwin does.
11
+ #include <sys/_types/_mode_t.h>
11
12
  #include_next <unistd.h>
12
13
  // darwin unistd.h includes Availability.h, which defines __API_AVAILABLE for
13
14
  // headers such as vImage_Types.h that only include os/availability.h.
@@ -30,6 +31,7 @@ int pthread_getugid_np(uid_t *, gid_t *);
30
31
  int dup(int) __asm__("__peach_darwin_dup");
31
32
  int dup2(int, int) __asm__("__peach_darwin_dup2");
32
33
  int pipe(int [2]);
34
+ int mkpath_np(const char *, mode_t);
33
35
  #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
34
36
  long syscall(long, ...);
35
37
  #endif
@@ -1,11 +1,11 @@
1
1
  import { readFileSync } from 'node:fs'
2
2
  import path from 'node:path'
3
3
  import { createJiti } from 'jiti'
4
- import * as peachConfigModule from '../src/config'
5
- import { isPeachConfig, type PeachConfig } from '../src/config'
6
- import { rnxPublicBrand } from '../src/public-brand'
7
- import { resolveAppProject, type ResolvedAppProject } from './app-project'
8
- import { resolveAppStubs, wireSlotMigration, type AppStubs } from './app-stubs'
4
+ import { resolveAppProject, type ResolvedAppProject } from '../cli/app-project'
5
+ import { resolveAppStubs, wireSlotMigration, type AppStubs } from '../cli/app-stubs'
6
+ import * as peachConfigModule from './config'
7
+ import { isPeachConfig, type PeachConfig } from './config'
8
+ import { rnxPublicBrand } from './public-brand'
9
9
 
10
10
  // `{ file }` entries are relative to the config file; the engine loads them by
11
11
  // absolute path from the runtime's replacement-module endpoint.
@@ -391,7 +391,7 @@ async function packagePlatformBundle(
391
391
  }
392
392
 
393
393
  async function readPackagingInputs(projectRoot) {
394
- const { resolveRNXAppConfig } = await import('../cli/app-config')
394
+ const { resolveRNXAppConfig } = await import('./app-config')
395
395
  const { config } = await resolveRNXAppConfig(projectRoot)
396
396
  return { config, versions: await readInstalledNativePackageVersionsAsync(projectRoot) }
397
397
  }
package/src/config.ts CHANGED
@@ -28,6 +28,35 @@ export type ModuleResolution =
28
28
  | { file: string } // resolve to a file relative to the config
29
29
  | { inline: Record<string, any> } // inline stub object
30
30
 
31
+ // a production bundle has no module paths, so the build tags each workspace
32
+ // module a config `modules` entry names with an assignment of this global to the
33
+ // entry's key; the engine finds the tagged factory and substitutes it
34
+ export const PEACH_WORKSPACE_MODULE_MARKER = '__peach_workspace_module'
35
+
36
+ // match a metro module name against config.modules patterns.
37
+ // config keys match as path prefixes: key "modules/bottom-sheet" matches
38
+ // any module whose name contains "/modules/bottom-sheet/"
39
+ export function matchConfigModule(
40
+ name: string,
41
+ modules: Record<string, ModuleResolution>,
42
+ ): { pattern: string; resolution: ModuleResolution } | undefined {
43
+ // sort by specificity (longest key first)
44
+ const entries = Object.entries(modules).sort((a, b) => b[0].length - a[0].length)
45
+ const modulePath = name.startsWith('/') ? name : `/${name}`
46
+ for (const [pattern, resolution] of entries) {
47
+ if (
48
+ modulePath.includes(`/${pattern}/`) ||
49
+ modulePath.endsWith(`/${pattern}`) ||
50
+ modulePath.endsWith(`/${pattern}.js`) ||
51
+ modulePath.endsWith(`/${pattern}.ts`) ||
52
+ modulePath.endsWith(`/${pattern}.tsx`)
53
+ ) {
54
+ return { pattern, resolution }
55
+ }
56
+ }
57
+ return undefined
58
+ }
59
+
31
60
  export type NativeModuleResolution = ModuleResolution | Record<string, any> // direct native module object for non-url configs
32
61
 
33
62
  // an app's own native view, keyed by its `requireNativeComponent` name or, for
@@ -7,7 +7,7 @@ import { parsePlistSource } from './plist'
7
7
  // rule here was read from momc 27.1 --action generate (swift 5, iOS 17); a model
8
8
  // feature whose output was not observed is refused, never guessed.
9
9
 
10
- type Tag = { name: string; attrs: Record<string, string>; children: Tag[] }
10
+ export type Tag = { name: string; attrs: Record<string, string>; children: Tag[] }
11
11
 
12
12
  const unescapeXml = (value: string) =>
13
13
  value
@@ -18,7 +18,7 @@ const unescapeXml = (value: string) =>
18
18
  .replace(/&amp;/g, '&')
19
19
 
20
20
  // the model format is plain tags and attributes with no text content.
21
- function parseModel(xml: string): Tag {
21
+ export function parseModel(xml: string): Tag {
22
22
  const root: Tag = { name: '#root', attrs: {}, children: [] }
23
23
  const stack = [root]
24
24
  for (const match of xml.matchAll(