peachsim 0.1.2438 → 0.1.2440

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 (183) hide show
  1. package/README.md +30 -98
  2. package/cli/app-catalog.ts +4 -73
  3. package/cli/catalog/content.ts +1 -1
  4. package/cli/cloud-box-artifact.ts +26 -39
  5. package/cli/cloud-client.ts +69 -117
  6. package/cli/cloud-session.ts +2 -9
  7. package/cli/commands/box.ts +6 -6
  8. package/cli/commands/control.ts +4 -11
  9. package/cli/commands/flow.ts +5 -9
  10. package/cli/commands/kotlin.ts +2 -1
  11. package/cli/commands/platform.ts +21 -39
  12. package/cli/commands/record-three.ts +1 -1
  13. package/cli/commands/shell-url.ts +29 -23
  14. package/cli/dev-build-freshness.ts +4 -3
  15. package/cli/native-input.ts +2 -2
  16. package/cli/outbound-endpoints.ts +20 -45
  17. package/cli/remote-project-bundle.ts +8 -14
  18. package/cli/remote-simulators.ts +1 -1
  19. package/cli/send-to-box.ts +2 -1
  20. package/detox/jest-preset.cjs +1 -1
  21. package/detox/jest-transform.cjs +40 -2
  22. package/dist-lib/agent-daemon-client.cjs +34 -24
  23. package/dist-lib/agent-events.cjs +1 -1
  24. package/dist-lib/attached-projects.cjs +19 -17
  25. package/dist-lib/auth/shared-session.cjs +18 -16
  26. package/dist-lib/backend-origin.cjs +1 -1
  27. package/dist-lib/beta.cjs +1 -1
  28. package/dist-lib/beta.mjs +2 -1
  29. package/dist-lib/bridge-constants.cjs +1 -1
  30. package/dist-lib/bridge-contract-input.cjs +1 -1
  31. package/dist-lib/bridge-contract-input.mjs +20 -583
  32. package/dist-lib/bridge-contract.cjs +1 -1
  33. package/dist-lib/bridge-contract.mjs +17 -99
  34. package/dist-lib/bundle-channel.cjs +8743 -5562
  35. package/dist-lib/capture-contract.cjs +1 -1
  36. package/dist-lib/capture-contract.mjs +13 -363
  37. package/dist-lib/cloud-contract.cjs +1 -1
  38. package/dist-lib/cloud-contract.mjs +34 -155
  39. package/dist-lib/cloud-test-args.cjs +1 -1
  40. package/dist-lib/cloud-test-args.mjs +2 -1
  41. package/dist-lib/cloud.cjs +1 -1
  42. package/dist-lib/cloud.mjs +26 -155
  43. package/dist-lib/config.cjs +1 -4
  44. package/dist-lib/config.mjs +11 -30
  45. package/dist-lib/detox/index.cjs +2554 -230
  46. package/dist-lib/detox/jest-preset.cjs +1 -1
  47. package/dist-lib/detox/jest-transform.cjs +40 -2
  48. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  49. package/dist-lib/esm-chunks/acorn-B27MTHKJ.mjs +50 -0
  50. package/dist-lib/esm-chunks/chunk-4U7IGWPB.mjs +42 -0
  51. package/dist-lib/esm-chunks/chunk-5CZQZKYU.mjs +10 -0
  52. package/dist-lib/esm-chunks/chunk-6HFWZJ6C.mjs +115 -0
  53. package/dist-lib/esm-chunks/chunk-6JGALQD5.mjs +12 -0
  54. package/dist-lib/esm-chunks/chunk-ADE23YGG.mjs +30 -0
  55. package/dist-lib/esm-chunks/chunk-D4Z36DQQ.mjs +186 -0
  56. package/dist-lib/esm-chunks/chunk-EATI62W3.mjs +188 -0
  57. package/dist-lib/esm-chunks/chunk-H6QIEJRC.mjs +10992 -0
  58. package/dist-lib/esm-chunks/chunk-HIK3VREC.mjs +1353 -0
  59. package/dist-lib/esm-chunks/chunk-HP7DHONL.mjs +598 -0
  60. package/dist-lib/esm-chunks/chunk-PRZI3CFF.mjs +5719 -0
  61. package/dist-lib/esm-chunks/chunk-QECVPSP3.mjs +10 -0
  62. package/dist-lib/esm-chunks/chunk-R5FNLCBO.mjs +17 -0
  63. package/dist-lib/esm-chunks/chunk-RVMUQQWC.mjs +664 -0
  64. package/dist-lib/esm-chunks/chunk-SJFNKW3W.mjs +57 -0
  65. package/dist-lib/esm-chunks/chunk-WQISIGIX.mjs +10 -0
  66. package/dist-lib/esm-chunks/chunk-X6UKJ5AX.mjs +375 -0
  67. package/dist-lib/esm-chunks/chunk-ZXNBC3PZ.mjs +18959 -0
  68. package/dist-lib/esm-chunks/metro-layout-parser-ZOI5PO4E.mjs +58 -0
  69. package/dist-lib/expo-swift-bundle.cjs +7881 -4717
  70. package/dist-lib/expo-swift-metadata.cjs +1 -1
  71. package/dist-lib/expo-swift-metadata.mjs +16 -165
  72. package/dist-lib/home-paths.cjs +1 -1
  73. package/dist-lib/host/bridge-host.cjs +15685 -11414
  74. package/dist-lib/host/fetch-proxy-handler.cjs +3928 -343
  75. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  76. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -1
  77. package/dist-lib/host/replacement-module-handler.cjs +4 -4
  78. package/dist-lib/host/websocket-proxy.cjs +1 -1
  79. package/dist-lib/index.cjs +9145 -32150
  80. package/dist-lib/jump-to-source-babel.cjs +1 -1
  81. package/dist-lib/jump-to-source-native.cjs +2 -2
  82. package/dist-lib/kotlin-host.cjs +260 -253
  83. package/dist-lib/menu.cjs +1 -1
  84. package/dist-lib/menu.mjs +5 -13
  85. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  86. package/dist-lib/metro-fingerprint-registry.mjs +5 -6
  87. package/dist-lib/metro-production-bundle.cjs +22 -3
  88. package/dist-lib/metro-production-bundle.mjs +26 -92
  89. package/dist-lib/native-app-identity-project.cjs +664 -452
  90. package/dist-lib/native-app-identity-project.mjs +509 -2318
  91. package/dist-lib/native-app-identity.cjs +1 -1
  92. package/dist-lib/native-app-identity.mjs +27 -1340
  93. package/dist-lib/native-firebase-metadata.cjs +1 -1
  94. package/dist-lib/native-firebase-metadata.mjs +5 -18
  95. package/dist-lib/pdfium-raster.cjs +1 -1
  96. package/dist-lib/pdfium-raster.mjs +2 -1
  97. package/dist-lib/plist.cjs +2 -2
  98. package/dist-lib/plist.mjs +5 -7
  99. package/dist-lib/profiles.cjs +2 -1
  100. package/dist-lib/public-brand.cjs +1 -1
  101. package/dist-lib/public-origins-lib-esm.json +246 -187
  102. package/dist-lib/public-origins-lib-static.json +1 -1
  103. package/dist-lib/public-origins-lib.json +1059 -1238
  104. package/dist-lib/react-native-host-modules.cjs +1 -1
  105. package/dist-lib/react-native-host-modules.mjs +2 -1
  106. package/dist-lib/reap-browser.cjs +18 -7
  107. package/dist-lib/scripts/dev-server-scanner.cjs +6 -230
  108. package/dist-lib/sdk.cjs +1 -1
  109. package/dist-lib/sdk.mjs +22 -78
  110. package/dist-lib/skills.cjs +21694 -17393
  111. package/dist-lib/swift-compile.cjs +1355 -1322
  112. package/dist-lib/swift-compile.mjs +68 -19013
  113. package/dist-lib/swift-package.cjs +1 -1
  114. package/dist-lib/swift-package.mjs +35 -630
  115. package/dist-lib/swift-submit.cjs +1 -1
  116. package/dist-lib/swift-submit.mjs +9 -24
  117. package/dist-lib/swift-toolchain.cjs +1 -1
  118. package/dist-lib/swift.cjs +1 -1
  119. package/dist-lib/vendor/@peculiar/x509.cjs +18061 -0
  120. package/dist-lib/vendor/acorn.cjs +5699 -0
  121. package/dist-lib/vendor/bplist-parser.cjs +1589 -0
  122. package/dist-lib/vendor/ignore.cjs +455 -0
  123. package/dist-lib/vendor/magic-string.cjs +1693 -0
  124. package/dist-lib/vendor/plist.cjs +10978 -0
  125. package/dist-lib/vendor/smol-toml.cjs +768 -0
  126. package/dist-lib/vendor/stream-json.cjs +1997 -0
  127. package/dist-lib/vendor/sucrase/dist/index.js.cjs +23593 -0
  128. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +15750 -0
  129. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +11316 -0
  130. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +482 -0
  131. package/dist-lib/vendor/sucrase.cjs +23593 -0
  132. package/dist-lib/vendor/terser.cjs +36874 -0
  133. package/dist-lib/vendor/valibot.cjs +6253 -0
  134. package/dist-lib/vendor/zod.cjs +23262 -0
  135. package/dist-lib/worklet-executable.cjs +3 -3
  136. package/dist-lib/worklet-executable.mjs +11 -16
  137. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +4 -0
  138. package/dist-types/packages/peach-engine/src/config.d.ts +1 -1
  139. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
  140. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +9 -0
  141. package/kotlin/fork/NOTICE +3 -0
  142. package/kotlin/sdk.tar.gz +0 -0
  143. package/kotlin/toolchain.json +6 -6
  144. package/package.json +17 -121
  145. package/runtime-companion.json +1 -1
  146. package/scripts/dev-server-scanner.ts +13 -223
  147. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSDateComponentsFormatter.h +1 -1
  148. package/src/android-autolinking.ts +2 -2
  149. package/src/bundle-channel.mjs +3 -15
  150. package/src/cloud-contract.ts +3 -4
  151. package/src/config.ts +0 -5
  152. package/src/host/bridge-host.ts +21 -1
  153. package/src/host/server-scan-handler.ts +1 -9
  154. package/src/index.ts +0 -2
  155. package/src/kotlin-host.ts +1 -2
  156. package/src/kotlinDiscoveryContract.ts +1 -0
  157. package/src/metro-production-bundle.ts +28 -6
  158. package/src/native-seam-manifest.ts +0 -13
  159. package/src/native-slices.ts +1 -1
  160. package/src/one-native-app-catalog.ts +8 -27
  161. package/src/one-native-app-config.ts +95 -0
  162. package/src/one-native-source.ts +250 -0
  163. package/src/one-widget-metadata.ts +45 -126
  164. package/src/oneWidgetContract.ts +80 -117
  165. package/src/serverDiscoveryContract.ts +0 -1
  166. package/src/simulator-route.ts +8 -0
  167. package/src/swift-compile.ts +13 -7
  168. package/src/swift-host.ts +2 -0
  169. package/src/swift-package-manifest.ts +13 -8
  170. package/src/vite-plugin.ts +2 -2
  171. package/src/xcode-project.ts +1 -1
  172. package/dist-lib/metro.cjs +0 -27984
  173. package/dist-lib/vite-swift.cjs +0 -43376
  174. package/dist-lib/vite.cjs +0 -21456
  175. package/src/androidAutolinkingContract.ts +0 -48
  176. package/src/androidRootModuleContract.ts +0 -39
  177. package/src/dev-server-open.ts +0 -92
  178. package/src/metro-plugin.ts +0 -578
  179. package/src/one-widget-discovery.ts +0 -23
  180. package/src/swift-vite-lifetime.ts +0 -42
  181. package/src/vite-plugin-one.ts +0 -746
  182. package/src/vite-plugin-swift.ts +0 -225
  183. package/src/vite.d.ts +0 -10
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2438 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2440 | (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,633 +1,38 @@
1
- /*! peach v0.1.2438 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
-
3
- // src/swift-package.ts
4
- function swiftManifestSettings(target) {
5
- return `swiftSettings: [${[
6
- `.swiftLanguageMode(.v${target.languageMode})`,
7
- ...target.mainActorIsolation ? [".defaultIsolation(MainActor.self)"] : [],
8
- ...target.cxxInterop ? [".interoperabilityMode(.Cxx)"] : [],
9
- ...(target.defines ?? []).map((name) => `.define(${JSON.stringify(name)})`),
10
- ...(target.experimentalFeatures ?? []).map(
11
- (name) => `.enableExperimentalFeature(${JSON.stringify(name)})`
12
- ),
13
- ...(target.upcomingFeatures ?? []).map(
14
- (name) => `.enableUpcomingFeature(${JSON.stringify(name)})`
15
- ),
16
- ...target.swiftFlags?.length ? [
17
- `.unsafeFlags([${target.swiftFlags.map((flag) => JSON.stringify(flag)).join(", ")}])`
18
- ] : []
19
- ].join(", ")}]`;
20
- }
21
- function isSwiftManifestFile(file) {
22
- const segments = file.split("/");
23
- return segments[segments.length - 1] === "Package.swift";
24
- }
25
- function swiftImplicitResourcePaths(paths) {
26
- return paths.filter(
27
- (file) => !file.endsWith(".swift") && (/\.(xcassets|xcstrings|nib|xib|storyboard|xcdatamodeld|xcdatamodel|xcmappingmodel|metal|xcprivacy)(?:\/|$)/.test(
28
- file
29
- ) || /(?:^|\/)[^/]+\.lproj\/[^/]+$/.test(file))
30
- ).sort();
31
- }
32
- var MANIFEST_DECLARATIONS = [
33
- "executableTarget",
34
- "testTarget",
35
- "binaryTarget",
36
- "systemLibrary",
37
- "macro",
38
- "plugin",
39
- "target",
40
- "library",
41
- "executable",
42
- "package"
43
- ];
44
- function manifestCalls(manifest, kinds) {
45
- const code = manifest.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|[^:"])\/\/[^\n]*/g, "$1");
46
- const calls = [];
47
- const pattern = new RegExp(
48
- `(?:\\.(${MANIFEST_DECLARATIONS.join("|")})|\\b(Package))\\s*\\(`,
49
- "g"
50
- );
51
- let match;
52
- while ((match = pattern.exec(code)) !== null) {
53
- let depth = 1;
54
- const start = pattern.lastIndex;
55
- let i = start;
56
- let inString = false;
57
- let escaped = false;
58
- let flat = "";
59
- while (i < code.length && depth > 0) {
60
- const ch = code[i];
61
- if (inString) {
62
- if (escaped) escaped = false;
63
- else if (ch === "\\") escaped = true;
64
- else if (ch === '"') inString = false;
65
- if (depth === 1) flat += ch;
66
- } else if (ch === '"') {
67
- inString = true;
68
- if (depth === 1) flat += ch;
69
- } else if (ch === "(") {
70
- depth++;
71
- if (depth === 1) flat += ch;
72
- } else if (ch === ")") {
73
- depth--;
74
- if (depth >= 1) flat += ch;
75
- } else if (depth === 1) {
76
- flat += ch;
77
- }
78
- i++;
79
- }
80
- const kind = match[1] ?? match[2];
81
- if (kinds.includes(kind)) calls.push({ kind, flat, call: code.slice(start, i) });
82
- else if (kind === "Package") {
83
- calls.push(...manifestCalls(code.slice(start, i - 1), kinds));
84
- }
85
- pattern.lastIndex = i;
86
- }
87
- return calls;
88
- }
89
- function splitManifestArguments(source) {
90
- const arguments_ = [];
91
- let start = 0;
92
- let parentheses = 0;
93
- let brackets = 0;
94
- let braces = 0;
95
- let inString = false;
96
- let escaped = false;
97
- for (let index = 0; index < source.length; index++) {
98
- const character = source[index];
99
- if (inString) {
100
- if (escaped) escaped = false;
101
- else if (character === "\\") escaped = true;
102
- else if (character === '"') inString = false;
103
- } else if (character === '"') inString = true;
104
- else if (character === "(") parentheses++;
105
- else if (character === ")") parentheses--;
106
- else if (character === "[") brackets++;
107
- else if (character === "]") brackets--;
108
- else if (character === "{") braces++;
109
- else if (character === "}") braces--;
110
- else if (character === "," && parentheses === 0 && brackets === 0 && braces === 0) {
111
- arguments_.push(source.slice(start, index).trim());
112
- start = index + 1;
113
- }
114
- }
115
- const final = source.slice(start).trim();
116
- if (final) arguments_.push(final);
117
- return arguments_;
118
- }
119
- function swiftManifestPackages(manifest) {
120
- return new Map(
121
- manifestCalls(manifest, ["package"]).flatMap(({ flat }) => {
122
- const directory = /\bpath\s*:\s*"([^"]+)"/.exec(flat)?.[1];
123
- if (!directory) return [];
124
- const name = /\bname\s*:\s*"([^"]+)"/.exec(flat)?.[1] ?? directory.split("/").pop();
125
- return [[name.toLowerCase(), directory]];
126
- })
127
- );
128
- }
129
- var SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS = [
130
- ".c",
131
- ".cc",
132
- ".cpp",
133
- ".cxx",
134
- ".m",
135
- ".mm"
136
- ];
137
- function isSwiftNativeTranslationUnit(file) {
138
- return SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS.some(
139
- (extension) => file.endsWith(extension)
140
- );
141
- }
142
- var SWIFT_STANDINS_DIR = "__standins__";
143
- var SWIFT_NATIVE_SOURCE_EXTENSIONS = [
144
- ...SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS,
145
- ".s",
146
- ".S",
147
- ".h",
148
- ".hh",
149
- ".hpp",
150
- ".hxx",
151
- ".pch",
152
- ".inc",
153
- ".inl",
154
- ".ipp",
155
- ".def",
156
- ".modulemap"
157
- ];
158
- function swiftNativeSupportFiles(files, targets) {
159
- return Object.fromEntries(
160
- Object.entries(files).filter(
161
- ([file]) => SWIFT_NATIVE_SOURCE_EXTENSIONS.some((extension) => file.endsWith(extension)) && (!isSwiftNativeTranslationUnit(file) || !targets.some(
162
- (target) => target.path === "." || file.startsWith(`${target.path}/`)
163
- ))
164
- )
165
- );
166
- }
167
- function clangImportNames(text, isLocalHeader) {
168
- return [
169
- ...text.matchAll(
170
- /^\s*(?:#\s*(?:import|include)\s*<((\w+)\/[^>]+)>|@import\s+(\w+))/gm
171
- )
172
- ].flatMap(
173
- (match) => match[1] && isLocalHeader?.(match[1]) ? [] : [match[2] ?? match[3]]
174
- );
175
- }
176
- function moduleMapTokens(text) {
177
- return (text.match(/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"[^"]*"|[\w.*]+|[{}\[\]]/g) ?? []).filter((token) => !token.startsWith("/"));
178
- }
179
- function moduleMapName(text) {
180
- const tokens = moduleMapTokens(text);
181
- const index = tokens.findIndex(
182
- (token, i) => token === "module" && tokens[i - 1] !== "extern"
183
- );
184
- return index < 0 ? void 0 : tokens[index + 1];
185
- }
186
- function moduleMapModules(text) {
187
- const modules = [];
188
- const token = /\/\*[\s\S]*?\*\/|\/\/[^\n]*|"[^"]*"|\{|\}|\bmodule\s+([\w.]+)/g;
189
- let depth = 0;
190
- let start = -1;
191
- let name = "";
192
- for (const match of text.matchAll(token)) {
193
- if (match[0] === "{") depth++;
194
- else if (match[0] === "}") {
195
- depth--;
196
- if (depth === 0 && start >= 0) {
197
- modules.push({ name, text: text.slice(start, match.index + 1) });
198
- start = -1;
199
- }
200
- } else if (match[1] !== void 0 && depth === 0) {
201
- const before = text.slice(0, match.index).trimEnd();
202
- if (/\bextern$/.test(before)) continue;
203
- start = match.index;
204
- name = match[1];
205
- }
206
- }
207
- return modules;
208
- }
209
- function swiftTargetModuleName(name) {
210
- return name.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
211
- }
212
- function swiftPackageClangModuleMap(moduleName, umbrella) {
213
- const escaped = umbrella.path.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
214
- const declaration = umbrella.kind === "header" ? `umbrella header "${escaped}"` : `umbrella "${escaped}"`;
215
- return `module ${moduleName} {
216
- ${declaration}
217
- export *
218
- }`;
219
- }
220
- function swiftPackageIdentity(url) {
221
- const path = url.endsWith("/") ? url.slice(0, -1) : url;
222
- return (path.split("/").pop() ?? path).replace(/\.git$/, "").toLowerCase();
223
- }
224
- var withoutGlogModuleMap = (flags) => flags.filter(
225
- (flag) => !(flag.startsWith("-fmodule-map-file=") && flag.endsWith("/glog.modulemap"))
226
- );
227
- function clangSettingEntries(settings, tool) {
228
- return (settings ?? []).flatMap(
229
- (setting) => setting.tool !== tool ? [] : "headerSearchPath" in setting ? [`.headerSearchPath(${JSON.stringify(setting.headerSearchPath)})`] : [`.unsafeFlags(${JSON.stringify(withoutGlogModuleMap(setting.flags))})`]
230
- );
231
- }
232
- function clangMacroSetting(macro) {
233
- const [name, ...value] = macro.split("=");
234
- return value.length === 0 ? `.define(${JSON.stringify(name)})` : `.define(${JSON.stringify(name)}, to: ${JSON.stringify(value.join("="))})`;
235
- }
236
- var swiftEscapes = {
237
- "\\": "\\",
238
- '"': '"',
239
- "'": "'",
240
- n: "\n",
241
- r: "\r",
242
- t: " "
243
- };
244
- function swiftStringValue(raw, context) {
245
- return raw.replace(/\\(.)/g, (_, escape) => {
246
- const value = swiftEscapes[escape];
247
- if (value === void 0)
248
- throw new Error(
249
- `Unsupported ${escape === "(" ? "interpolation" : `escape \\${escape}`} in ${context}`
250
- );
251
- return value;
252
- });
253
- }
254
- function bracketBody(text, openIndex) {
255
- let depth = 1;
256
- let index = openIndex;
257
- for (; index < text.length && depth > 0; index++) {
258
- const char = text[index];
259
- if (char === '"') {
260
- for (index++; index < text.length && text[index] !== '"'; index++)
261
- if (text[index] === "\\") index++;
262
- } else if (char === "[") depth++;
263
- else if (char === "]") depth--;
264
- }
265
- return text.slice(openIndex, index - 1);
266
- }
267
- function settingsBlocks(call, tool) {
268
- const bodies = [];
269
- for (const open of call.matchAll(new RegExp(`\\b${tool}Settings\\s*:\\s*\\[`, "g")))
270
- bodies.push(bracketBody(call, open.index + open[0].length));
271
- return bodies;
272
- }
273
- function unsafeFlagsAt(body, start, encoded, target, readArguments) {
274
- if (!encoded)
275
- return [...bracketBody(body, start).matchAll(/"((?:[^"\\]|\\.)*)"/g)].map(
276
- (match) => swiftStringValue(match[1], `unsafeFlags of target ${target} (${match[0]})`)
277
- );
278
- const literal = /^((?:[^"\\]|\\.)*)"/.exec(body.slice(start));
279
- if (!literal) throw new Error(`Unterminated peachCompilerArguments of target ${target}`);
280
- if (!readArguments)
281
- throw new Error(`Missing compiler argument reader for target ${target}`);
282
- const decoded = JSON.parse(
283
- readArguments(
284
- swiftStringValue(literal[1], `peachCompilerArguments of target ${target}`)
285
- )
286
- );
287
- const flags = Array.isArray(decoded) ? decoded.filter((flag) => typeof flag === "string") : [];
288
- if (!Array.isArray(decoded) || flags.length !== decoded.length)
289
- throw new Error(`peachCompilerArguments of target ${target} is not a string array`);
290
- return flags;
291
- }
292
- var unsafeFlagsOpen = /\.unsafeFlags\(\s*(?:(\[)|peachCompilerArguments\(\s*")/g;
293
- function settingFeatures(call, setting, target, readArguments) {
294
- const found = [];
295
- for (const body of settingsBlocks(call, "swift")) {
296
- if (setting === ".unsafeFlags") {
297
- for (const open of body.matchAll(unsafeFlagsOpen))
298
- found.push(
299
- ...unsafeFlagsAt(
300
- body,
301
- open.index + open[0].length,
302
- open[1] === void 0,
303
- target,
304
- readArguments
305
- )
306
- );
307
- } else {
308
- const name = "([A-Za-z_][A-Za-z0-9_]*(?:=[A-Za-z_][A-Za-z0-9_.-]*)?)";
309
- const pattern = setting === ".enableExperimentalFeature" ? new RegExp(`\\.enableExperimentalFeature\\(\\s*"${name}"\\s*\\)`, "g") : new RegExp(`\\.enableUpcomingFeature\\(\\s*"${name}"\\s*\\)`, "g");
310
- for (const match of body.matchAll(pattern)) found.push(match[1]);
311
- }
312
- }
313
- return found;
314
- }
315
- function settingClang(call, target, readArguments) {
316
- const found = [];
317
- for (const tool of ["c", "cxx"])
318
- for (const body of settingsBlocks(call, tool))
319
- for (const match of body.matchAll(
320
- /\.headerSearchPath\(\s*"((?:[^"\\]|\\.)*)"\s*\)|\.unsafeFlags\(\s*(?:(\[)|peachCompilerArguments\(\s*")/g
321
- )) {
322
- if (match[1] !== void 0) {
323
- found.push({
324
- tool,
325
- headerSearchPath: swiftStringValue(
326
- match[1],
327
- `headerSearchPath of target ${target} (${match[0]})`
328
- )
329
- });
330
- continue;
331
- }
332
- const open = match.index + match[0].length;
333
- if (match[2] === void 0) {
334
- found.push({
335
- tool,
336
- flags: unsafeFlagsAt(body, open, true, target, readArguments)
337
- });
338
- continue;
339
- }
340
- const list = bracketBody(body, open);
341
- if (!/^\s*\)/.test(body.slice(open + list.length + 1))) continue;
342
- found.push({ tool, flags: unsafeFlagsAt(body, open, false, target) });
343
- }
344
- return found;
345
- }
346
- function settingDefines(call, tool) {
347
- const defines = [];
348
- for (const body of settingsBlocks(call, tool)) {
349
- for (const match of body.matchAll(
350
- /\.define\(\s*"([A-Za-z_][A-Za-z0-9_]*)"\s*(?:,\s*to:\s*"((?:[^"\\]|\\.)*)"\s*)?\)/g
351
- )) {
352
- const name = match[1];
353
- defines.push(
354
- match[2] === void 0 ? name : `${name}=${swiftStringValue(match[2], `the value of macro ${name}`)}`
355
- );
356
- }
357
- }
358
- return defines;
359
- }
360
- function swiftManifestDeclarations(manifest, resourcePaths = []) {
361
- const implicitResources = swiftImplicitResourcePaths(resourcePaths);
362
- const targets = [];
363
- for (const declaration of manifestCalls(manifest, [
364
- "executableTarget",
365
- "target",
366
- "systemLibrary"
367
- ])) {
368
- const { kind, flat } = declaration;
369
- const name = /\bname\s*:\s*"([^"]+)"/.exec(flat)?.[1];
370
- if (!name) continue;
371
- const rawPath = /\bpath\s*:\s*"([^"]*)"/.exec(flat)?.[1];
372
- const targetPath = rawPath == null || rawPath === "" ? `Sources/${name}` : rawPath.replace(/^\.\//, "").replace(/\/+$/, "");
373
- const exclude = /\bexclude\s*:\s*\[/.exec(flat);
374
- const excluded = [
375
- ...(exclude ? bracketBody(flat, exclude.index + exclude[0].length) : "").matchAll(
376
- /"([^"]+)"/g
377
- )
378
- ].map((match) => match[1].replace(/^\.\//, "").replace(/\/+$/, ""));
379
- const prefix = targetPath === "." ? "" : `${targetPath}/`;
380
- const resources = /\bresources\s*:/.test(flat) || implicitResources.some((file) => {
381
- if (!file.startsWith(prefix)) return false;
382
- const relative = file.slice(prefix.length);
383
- if (excluded.some(
384
- (exclude2) => relative === exclude2 || relative.startsWith(`${exclude2}/`)
385
- ))
386
- return false;
387
- return true;
388
- });
389
- targets.push({
390
- ...declaration,
391
- name,
392
- path: targetPath,
393
- executable: kind === "executableTarget",
394
- resources,
395
- exclude: excluded
396
- });
397
- }
398
- return targets;
399
- }
400
- function swiftManifestTargets(manifest, resourcePaths = [], readArguments) {
401
- const targets = [];
402
- const packageCall = manifestCalls(manifest, ["Package"])[0];
403
- const platformArgument = packageCall ? splitManifestArguments(packageCall.call.slice(0, -1)).find(
404
- (argument) => /^platforms\s*:/.test(argument)
405
- ) : void 0;
406
- const platformList = /^platforms\s*:\s*\[([\s\S]*)\]$/.exec(platformArgument ?? "")?.[1];
407
- const iosPlatforms = [
408
- ...(platformList ?? "").matchAll(
409
- /\.iOS\(\s*(?:"(\d+(?:\.\d+){0,2})"|\.v(\d+(?:_\d+){0,2}))\s*\)/g
410
- )
411
- ];
412
- const iosDeploymentTarget = iosPlatforms.length === 1 ? iosPlatforms[0][1] ?? iosPlatforms[0][2].replaceAll("_", ".") : void 0;
413
- const declarations = swiftManifestDeclarations(manifest, resourcePaths);
414
- const targetNames = new Set(declarations.map(({ name }) => name));
415
- for (const {
416
- kind,
417
- flat,
418
- call,
419
- name,
420
- path: targetPath,
421
- executable,
422
- resources,
423
- exclude: excluded
424
- } of declarations) {
425
- const publicHeadersPath = /\bpublicHeadersPath\s*:\s*"([^"]*)"/.exec(flat)?.[1];
426
- const languageMode = Number(
427
- /\.swiftLanguageMode\(\s*\.v(\d+)\s*\)/.exec(call)?.[1] ?? "5"
428
- );
429
- const mainActorIsolation = /\.defaultIsolation\(\s*MainActor\.self\s*\)/.test(call);
430
- const cxxInterop = /\.interoperabilityMode\(\s*\.Cxx\s*\)/.test(
431
- call.replace(/"(?:\\.|[^"\\])*"/g, "")
432
- );
433
- const defines = settingDefines(call, "swift").map((define) => define.split("=")[0]);
434
- const experimentalFeatures = settingFeatures(call, ".enableExperimentalFeature", name);
435
- const upcomingFeatures = settingFeatures(call, ".enableUpcomingFeature", name);
436
- const swiftFlags = settingFeatures(call, ".unsafeFlags", name, readArguments);
437
- const cDefines = settingDefines(call, "c");
438
- const cxxDefines = settingDefines(call, "cxx");
439
- const clangSettings = settingClang(call, name, readArguments);
440
- const linkedLibraries = [...call.matchAll(/\.linkedLibrary\(\s*"([^"]+)"\s*\)/g)].map(
441
- (match) => match[1]
442
- );
443
- const targetArguments = splitManifestArguments(call.slice(0, -1));
444
- const sourceArgument = targetArguments.find(
445
- (argument) => /^sources\s*:/.test(argument)
446
- );
447
- const sourceList = sourceArgument?.replace(/^sources\s*:\s*/, "").trim();
448
- if (sourceList && sourceList !== "nil" && !(sourceList.startsWith("[") && sourceList.endsWith("]")))
449
- throw new Error(`Unsupported sources expression in target ${name}: ${sourceList}`);
450
- const sources = sourceList?.startsWith("[") && sourceList.endsWith("]") ? splitManifestArguments(sourceList.slice(1, -1)).map((source) => {
451
- const literal = /^"((?:[^"\\]|\\.)*)"$/.exec(source);
452
- if (!literal)
453
- throw new Error(
454
- `Unsupported source expression in target ${name}: ${source}`
455
- );
456
- return swiftStringValue(literal[1], `a source of target ${name}`).replace(/^\.\//, "").replace(/\/+$/, "");
457
- }) : void 0;
458
- const dependencyArgument = targetArguments.find(
459
- (argument) => /^dependencies\s*:/.test(argument)
460
- );
461
- const dependencyList = dependencyArgument?.replace(/^dependencies\s*:\s*/, "").trim();
462
- const dependencies = [];
463
- if (dependencyList?.startsWith("[") && dependencyList.endsWith("]")) {
464
- for (const dependency of splitManifestArguments(dependencyList.slice(1, -1))) {
465
- const product = /^\.product\s*\(\s*name\s*:\s*"([^"]+)"\s*,\s*package\s*:\s*"([^"]+)"\s*\)$/.exec(
466
- dependency
467
- );
468
- if (product) {
469
- dependencies.push({ kind: "product", name: product[1], package: product[2] });
470
- continue;
471
- }
472
- const dependencyName = /^"([^"]+)"$/.exec(dependency)?.[1] ?? /^\.(?:target|byName)\s*\(\s*name\s*:\s*"([^"]+)"/.exec(dependency)?.[1];
473
- if (dependencyName && targetNames.has(dependencyName))
474
- dependencies.push({ kind: "target", name: dependencyName });
475
- }
476
- }
477
- targets.push({
478
- name,
479
- path: targetPath,
480
- executable,
481
- ...kind === "systemLibrary" ? { systemLibrary: true } : {},
482
- ...publicHeadersPath === void 0 ? {} : { publicHeadersPath },
483
- languageMode,
484
- ...iosDeploymentTarget ? { iosDeploymentTarget } : {},
485
- mainActorIsolation,
486
- ...cxxInterop ? { cxxInterop: true } : {},
487
- ...defines.length === 0 ? {} : { defines },
488
- ...experimentalFeatures.length === 0 ? {} : { experimentalFeatures },
489
- ...upcomingFeatures.length === 0 ? {} : { upcomingFeatures },
490
- ...swiftFlags.length === 0 ? {} : { swiftFlags },
491
- ...cDefines.length === 0 ? {} : { cDefines },
492
- ...cxxDefines.length === 0 ? {} : { cxxDefines },
493
- ...clangSettings.length === 0 ? {} : { clangSettings },
494
- ...linkedLibraries.length === 0 ? {} : { linkedLibraries },
495
- resources,
496
- ...dependencyList?.startsWith("[") && dependencyList.endsWith("]") ? { dependencies } : {},
497
- ...sources === void 0 ? {} : { sources },
498
- ...excluded.length === 0 ? {} : { exclude: excluded }
499
- });
500
- }
501
- return targets;
502
- }
503
- function swiftManifestCxxLanguageStandard(manifest) {
504
- const declaration = manifestCalls(manifest, ["Package"])[0];
505
- if (!declaration) return void 0;
506
- const code = declaration.flat.replace(/"(?:\\.|[^"\\])*"/g, "");
507
- return /\bcxxLanguageStandard\s*:\s*\.(\w+)/.exec(code)?.[1];
508
- }
509
- function swiftResourceBundles(files, resourcePaths = []) {
510
- const manifest = files["Package.swift"] ?? "";
511
- const targets = swiftManifestDeclarations(manifest, resourcePaths).filter(
512
- (target) => target.resources
513
- );
514
- if (targets.length === 0) return [];
515
- const declaration = manifestCalls(manifest, ["Package"])[0];
516
- const packageName = declaration && /\bname\s*:\s*"([^"/\\]+)"/.exec(declaration.flat)?.[1];
517
- if (!packageName)
518
- throw new Error("swift resource bundles require the original package name");
519
- return targets.map((target) => ({
520
- target: target.name,
521
- sourcePath: target.path,
522
- path: `${packageName}_${target.name}.bundle`
523
- }));
524
- }
525
- var OBJC_RESOURCE_ACCESSOR_HEADER = "resource_bundle_accessor.h";
526
- var OBJC_RESOURCE_ACCESSOR_BODY = "resource_bundle_accessor.m";
527
- function swiftObjCResourceBundleName(args) {
528
- const { target, resources, usesBundleMacro } = args;
529
- if (!resources) {
530
- if (usesBundleMacro)
531
- throw new Error(
532
- `objective-c target ${target} uses SWIFTPM_MODULE_BUNDLE but declares no resources`
533
- );
534
- return void 0;
535
- }
536
- const bundle = args.bundles?.find((candidate) => candidate.target === target);
537
- if (!bundle || bundle.sourcePath !== args.path || !bundle.path.endsWith(`_${target}.bundle`))
538
- throw new Error(`swift resource target ${target} has no matching bundle assignment`);
539
- return bundle.path.slice(0, -".bundle".length);
540
- }
541
- function swiftObjCResourceAccessor(bundleName) {
542
- const accessorName = swiftTargetModuleName(bundleName.replace(/[^\x00-\x7f]/gu, "_"));
543
- const symbol = `${accessorName}_SWIFTPM_MODULE_BUNDLE`;
544
- const finder = `${accessorName}_SWIFTPM_MODULE_BUNDLER_FINDER`;
545
- return {
546
- header: [
547
- "#ifdef __OBJC__",
548
- "#import <Foundation/Foundation.h>",
549
- "",
550
- "__BEGIN_DECLS",
551
- "",
552
- `NSBundle* ${symbol}(void);`,
553
- "",
554
- `#define SWIFTPM_MODULE_BUNDLE ${symbol}()`,
555
- "",
556
- "__END_DECLS",
557
- "#endif"
558
- ].join("\n"),
559
- body: [
560
- "#import <Foundation/Foundation.h>",
561
- "",
562
- "NS_ASSUME_NONNULL_BEGIN",
563
- "",
564
- `@interface ${finder} : NSObject`,
565
- "@end",
566
- "",
567
- `@implementation ${finder}`,
568
- "@end",
569
- "",
570
- `NSBundle* ${symbol}() {`,
571
- ` NSString *bundleName = @"${accessorName}";`,
572
- "",
573
- " NSArray<NSURL*> *candidates = @[",
574
- " NSBundle.mainBundle.resourceURL,",
575
- ` [NSBundle bundleForClass:[${finder} class]].resourceURL,`,
576
- " NSBundle.mainBundle.bundleURL",
577
- " ];",
578
- "",
579
- " for (NSURL* candidate in candidates) {",
580
- ' NSURL *bundlePath = [candidate URLByAppendingPathComponent:[NSString stringWithFormat:@"%@.bundle", bundleName]];',
581
- "",
582
- " NSBundle *bundle = [NSBundle bundleWithURL:bundlePath];",
583
- " if (bundle != nil) {",
584
- " return bundle;",
585
- " }",
586
- " }",
587
- "",
588
- ' @throw [[NSException alloc] initWithName:@"SwiftPMResourcesAccessor" reason:[NSString stringWithFormat:@"unable to find bundle named %@", bundleName] userInfo:nil];',
589
- "}",
590
- "",
591
- "NS_ASSUME_NONNULL_END"
592
- ].join("\n")
593
- };
594
- }
595
- function swiftResourceBundleForFile(bundles, file) {
596
- let owner;
597
- for (const bundle of bundles) {
598
- const prefix = bundle.sourcePath === "." ? "" : `${bundle.sourcePath}/`;
599
- if (file.startsWith(prefix) && (!owner || bundle.sourcePath.length > owner.sourcePath.length))
600
- owner = bundle;
601
- }
602
- return owner;
603
- }
604
- function swiftResourceBundleInfoPlist(bundle) {
605
- const name = bundle.path.split("/").pop().replace(/\.(bundle|framework)$/, "");
606
- const escaped = name.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
607
- return `<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>CFBundleName</key><string>${escaped}</string><key>CFBundlePackageType</key><string>${bundle.path.endsWith(".framework") ? "FMWK" : "BNDL"}</string></dict></plist>`;
608
- }
609
- function swiftMetalSourceFiles(files) {
610
- const sources = Object.entries(files).filter(([file]) => file.endsWith(".metal"));
611
- if (sources.length === 0) return {};
612
- const targets = swiftManifestTargets(files["Package.swift"] ?? "");
613
- return Object.fromEntries(
614
- sources.filter(([file]) => {
615
- if (targets.length === 0) return true;
616
- return targets.some((target) => {
617
- const prefix = target.path === "." ? "" : `${target.path}/`;
618
- if (!file.startsWith(prefix)) return false;
619
- const relative = file.slice(prefix.length);
620
- return !(target.exclude ?? []).some(
621
- (excluded) => relative === excluded || relative.startsWith(`${excluded}/`)
622
- );
623
- });
624
- })
625
- );
626
- }
627
- function swiftPackagePartition(manifest, resourcePaths = []) {
628
- const targets = swiftManifestTargets(manifest, resourcePaths);
629
- return targets.length === 1 && targets[0].executable && targets[0].path === "." && targets[0].languageMode === 5 && !targets[0].iosDeploymentTarget && !targets[0].mainActorIsolation && !targets[0].defines?.length && !targets[0].experimentalFeatures?.length && !targets[0].upcomingFeatures?.length && !targets[0].swiftFlags?.length && !targets[0].linkedLibraries?.length && !targets[0].cxxInterop && !swiftManifestCxxLanguageStandard(manifest) ? [] : targets;
630
- }
1
+ /*! peach v0.1.2440 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
+ import {
3
+ OBJC_RESOURCE_ACCESSOR_BODY,
4
+ OBJC_RESOURCE_ACCESSOR_HEADER,
5
+ SWIFT_NATIVE_SOURCE_EXTENSIONS,
6
+ SWIFT_STANDINS_DIR,
7
+ clangImportNames,
8
+ clangMacroSetting,
9
+ clangSettingEntries,
10
+ isSwiftManifestFile,
11
+ isSwiftNativeTranslationUnit,
12
+ manifestCalls,
13
+ moduleMapModules,
14
+ moduleMapName,
15
+ moduleMapTokens,
16
+ swiftImplicitResourcePaths,
17
+ swiftManifestCxxLanguageStandard,
18
+ swiftManifestDeclarations,
19
+ swiftManifestPackages,
20
+ swiftManifestSettings,
21
+ swiftManifestTargets,
22
+ swiftMetalSourceFiles,
23
+ swiftNativeSupportFiles,
24
+ swiftObjCResourceAccessor,
25
+ swiftObjCResourceBundleName,
26
+ swiftPackageClangModuleMap,
27
+ swiftPackageIdentity,
28
+ swiftPackagePartition,
29
+ swiftResourceBundleForFile,
30
+ swiftResourceBundleInfoPlist,
31
+ swiftResourceBundles,
32
+ swiftTargetModuleName,
33
+ withoutGlogModuleMap
34
+ } from "./esm-chunks/chunk-RVMUQQWC.mjs";
35
+ import "./esm-chunks/chunk-4U7IGWPB.mjs";
631
36
  export {
632
37
  OBJC_RESOURCE_ACCESSOR_BODY,
633
38
  OBJC_RESOURCE_ACCESSOR_HEADER,
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2438 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2440 | (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;