peachsim 0.1.2438 → 0.1.2439

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 (175) 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 +8718 -5552
  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-FGE4PYDJ.mjs +50 -0
  50. package/dist-lib/esm-chunks/chunk-2EUHEBIJ.mjs +664 -0
  51. package/dist-lib/esm-chunks/chunk-2NPABFPN.mjs +5719 -0
  52. package/dist-lib/esm-chunks/chunk-4ZFNH7TU.mjs +10 -0
  53. package/dist-lib/esm-chunks/chunk-5T4XBUJP.mjs +1353 -0
  54. package/dist-lib/esm-chunks/chunk-6VY6HTJC.mjs +18951 -0
  55. package/dist-lib/esm-chunks/chunk-7HANEMO4.mjs +188 -0
  56. package/dist-lib/esm-chunks/chunk-C3WBGYP6.mjs +186 -0
  57. package/dist-lib/esm-chunks/chunk-CVGDRROP.mjs +57 -0
  58. package/dist-lib/esm-chunks/chunk-DADGQELM.mjs +375 -0
  59. package/dist-lib/esm-chunks/chunk-DEGYKHN7.mjs +12 -0
  60. package/dist-lib/esm-chunks/chunk-HIDNO3RP.mjs +10992 -0
  61. package/dist-lib/esm-chunks/chunk-HSADZOVN.mjs +30 -0
  62. package/dist-lib/esm-chunks/chunk-IWJUYJQO.mjs +42 -0
  63. package/dist-lib/esm-chunks/chunk-JCKI3VZ6.mjs +10 -0
  64. package/dist-lib/esm-chunks/chunk-KSQ5KM5Y.mjs +17 -0
  65. package/dist-lib/esm-chunks/chunk-KVTIDLBK.mjs +598 -0
  66. package/dist-lib/esm-chunks/chunk-MIQSRBVU.mjs +10 -0
  67. package/dist-lib/esm-chunks/chunk-YB27R6JG.mjs +115 -0
  68. package/dist-lib/esm-chunks/metro-layout-parser-MVUAXRUJ.mjs +58 -0
  69. package/dist-lib/expo-swift-bundle.cjs +7856 -4707
  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 +15658 -11404
  74. package/dist-lib/host/fetch-proxy-handler.cjs +3927 -342
  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 +663 -451
  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 +21657 -17374
  111. package/dist-lib/swift-compile.cjs +1343 -1318
  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-engine/src/config.d.ts +1 -1
  138. package/kotlin/fork/NOTICE +3 -0
  139. package/kotlin/sdk.tar.gz +0 -0
  140. package/kotlin/toolchain.json +6 -6
  141. package/package.json +17 -121
  142. package/runtime-companion.json +1 -1
  143. package/scripts/dev-server-scanner.ts +13 -223
  144. package/src/android-autolinking.ts +2 -2
  145. package/src/bundle-channel.mjs +3 -15
  146. package/src/cloud-contract.ts +3 -4
  147. package/src/config.ts +0 -5
  148. package/src/host/bridge-host.ts +19 -1
  149. package/src/host/server-scan-handler.ts +1 -9
  150. package/src/index.ts +0 -2
  151. package/src/kotlin-host.ts +1 -2
  152. package/src/kotlinDiscoveryContract.ts +1 -0
  153. package/src/metro-production-bundle.ts +28 -6
  154. package/src/native-seam-manifest.ts +0 -13
  155. package/src/one-native-app-catalog.ts +8 -27
  156. package/src/one-native-app-config.ts +95 -0
  157. package/src/one-native-source.ts +250 -0
  158. package/src/one-widget-metadata.ts +45 -126
  159. package/src/oneWidgetContract.ts +80 -117
  160. package/src/serverDiscoveryContract.ts +0 -1
  161. package/src/simulator-route.ts +8 -0
  162. package/src/vite-plugin.ts +2 -2
  163. package/src/xcode-project.ts +1 -1
  164. package/dist-lib/metro.cjs +0 -27984
  165. package/dist-lib/vite-swift.cjs +0 -43376
  166. package/dist-lib/vite.cjs +0 -21456
  167. package/src/androidAutolinkingContract.ts +0 -48
  168. package/src/androidRootModuleContract.ts +0 -39
  169. package/src/dev-server-open.ts +0 -92
  170. package/src/metro-plugin.ts +0 -578
  171. package/src/one-widget-discovery.ts +0 -23
  172. package/src/swift-vite-lifetime.ts +0 -42
  173. package/src/vite-plugin-one.ts +0 -746
  174. package/src/vite-plugin-swift.ts +0 -225
  175. package/src/vite.d.ts +0 -10
@@ -1,31 +1,49 @@
1
- /*! peach v0.1.2438 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __commonJS = (cb, mod) => function __require() {
10
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
1
+ /*! peach v0.1.2439 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
+ import {
3
+ LAUNCH_METADATA_KEYS,
4
+ LAUNCH_METADATA_KEYS_PATH
5
+ } from "./esm-chunks/chunk-HSADZOVN.mjs";
6
+ import {
7
+ NATIVE_GRAPH_SDK_VERSION,
8
+ cacheDir
9
+ } from "./esm-chunks/chunk-6VY6HTJC.mjs";
10
+ import {
11
+ isSwiftNativeTranslationUnit,
12
+ moduleMapName
13
+ } from "./esm-chunks/chunk-2EUHEBIJ.mjs";
14
+ import "./esm-chunks/chunk-C3WBGYP6.mjs";
15
+ import {
16
+ androidMergedResourceValuesDirectory,
17
+ extractNativeAppIdentityFromFiles,
18
+ isDict,
19
+ list,
20
+ parseOpenStepPlist,
21
+ readGoogleSignInConfiguration,
22
+ readKeychainAccessGroups,
23
+ readRootModuleName,
24
+ resolveNativeAppIconArtwork,
25
+ resolveNativeBundleIcons,
26
+ selectNativeAppIdentityReader,
27
+ str,
28
+ xcodeBuildFileBuildsForIos,
29
+ xcodePathResolver,
30
+ xcodeTargetMemberVisitor
31
+ } from "./esm-chunks/chunk-5T4XBUJP.mjs";
32
+ import "./esm-chunks/chunk-DEGYKHN7.mjs";
33
+ import {
34
+ parsePlistSource,
35
+ require_plist
36
+ } from "./esm-chunks/chunk-HIDNO3RP.mjs";
37
+ import "./esm-chunks/chunk-4ZFNH7TU.mjs";
38
+ import "./esm-chunks/chunk-CVGDRROP.mjs";
39
+ import {
40
+ isRecord
41
+ } from "./esm-chunks/chunk-JCKI3VZ6.mjs";
42
+ import {
43
+ __commonJS,
44
+ __publicField,
45
+ __toESM
46
+ } from "./esm-chunks/chunk-IWJUYJQO.mjs";
29
47
 
30
48
  // ../../node_modules/json5/lib/unicode.js
31
49
  var require_unicode = __commonJS({
@@ -73,7 +91,7 @@ var require_parse = __commonJS({
73
91
  var token;
74
92
  var key;
75
93
  var root;
76
- module.exports = function parse5(text2, reviver) {
94
+ module.exports = function parse(text2, reviver) {
77
95
  source = String(text2);
78
96
  parseState = "start";
79
97
  stack = [];
@@ -256,15 +274,15 @@ var require_parse = __commonJS({
256
274
  return newToken("punctuator", read());
257
275
  case "n":
258
276
  read();
259
- literal2("ull");
277
+ literal("ull");
260
278
  return newToken("null", null);
261
279
  case "t":
262
280
  read();
263
- literal2("rue");
281
+ literal("rue");
264
282
  return newToken("boolean", true);
265
283
  case "f":
266
284
  read();
267
- literal2("alse");
285
+ literal("alse");
268
286
  return newToken("boolean", false);
269
287
  case "-":
270
288
  case "+":
@@ -295,11 +313,11 @@ var require_parse = __commonJS({
295
313
  return;
296
314
  case "I":
297
315
  read();
298
- literal2("nfinity");
316
+ literal("nfinity");
299
317
  return newToken("numeric", Infinity);
300
318
  case "N":
301
319
  read();
302
- literal2("aN");
320
+ literal("aN");
303
321
  return newToken("numeric", NaN);
304
322
  case '"':
305
323
  case "'":
@@ -393,11 +411,11 @@ var require_parse = __commonJS({
393
411
  return;
394
412
  case "I":
395
413
  read();
396
- literal2("nfinity");
414
+ literal("nfinity");
397
415
  return newToken("numeric", sign * Infinity);
398
416
  case "N":
399
417
  read();
400
- literal2("aN");
418
+ literal("aN");
401
419
  return newToken("numeric", NaN);
402
420
  }
403
421
  throw invalidChar(read());
@@ -630,7 +648,7 @@ var require_parse = __commonJS({
630
648
  column
631
649
  };
632
650
  }
633
- function literal2(s) {
651
+ function literal(s) {
634
652
  for (const c2 of s) {
635
653
  const p = peek();
636
654
  if (p !== c2) {
@@ -927,12 +945,12 @@ var require_stringify = __commonJS({
927
945
  replacerFunc = replacer;
928
946
  } else if (Array.isArray(replacer)) {
929
947
  propertyList = [];
930
- for (const v6 of replacer) {
948
+ for (const v of replacer) {
931
949
  let item;
932
- if (typeof v6 === "string") {
933
- item = v6;
934
- } else if (typeof v6 === "number" || v6 instanceof String || v6 instanceof Number) {
935
- item = String(v6);
950
+ if (typeof v === "string") {
951
+ item = v;
952
+ } else if (typeof v === "number" || v instanceof String || v instanceof Number) {
953
+ item = String(v);
936
954
  }
937
955
  if (item !== void 0 && propertyList.indexOf(item) < 0) {
938
956
  propertyList.push(item);
@@ -1129,10 +1147,10 @@ var require_stringify = __commonJS({
1129
1147
  // ../../node_modules/json5/lib/index.js
1130
1148
  var require_lib = __commonJS({
1131
1149
  "../../node_modules/json5/lib/index.js"(exports, module) {
1132
- var parse5 = require_parse();
1150
+ var parse = require_parse();
1133
1151
  var stringify = require_stringify();
1134
1152
  var JSON52 = {
1135
- parse: parse5,
1153
+ parse,
1136
1154
  stringify
1137
1155
  };
1138
1156
  module.exports = JSON52;
@@ -1140,1243 +1158,24 @@ var require_lib = __commonJS({
1140
1158
  });
1141
1159
 
1142
1160
  // src/native-app-identity-project.ts
1143
- import fs19 from "node:fs";
1161
+ import fs8 from "node:fs";
1144
1162
  import { createRequire } from "node:module";
1145
- import path40 from "node:path";
1146
-
1147
- // src/android-string-value.ts
1148
- function compileAndroidStringValue(text2, where) {
1149
- if (/^\s*[@?]/.test(text2))
1150
- throw new Error(`${where} is a resource reference, not resolved by Peach yet`);
1151
- const out = [];
1152
- let quoted = false;
1153
- for (let index = 0; index < text2.length; index++) {
1154
- const char = text2[index] ?? "";
1155
- if (char === "\\") {
1156
- const next = text2[index + 1];
1157
- if (next === void 0) break;
1158
- index++;
1159
- if (next === "n") out.push({ char: "\n", soft: false });
1160
- else if (next === "t") out.push({ char: " ", soft: false });
1161
- else if (next === "u") {
1162
- const hex = text2.slice(index + 1, index + 5);
1163
- if (!/^[0-9a-fA-F]{4}$/.test(hex))
1164
- throw new Error(`${where} has an invalid unicode escape \\u${hex}`);
1165
- out.push({ char: String.fromCharCode(Number.parseInt(hex, 16)), soft: false });
1166
- index += 4;
1167
- } else out.push({ char: next, soft: false });
1168
- } else if (char === '"') quoted = !quoted;
1169
- else if (char === "'" && !quoted)
1170
- throw new Error(`${where} has an unescaped apostrophe`);
1171
- else if (!quoted && /\s/.test(char)) {
1172
- if (out.at(-1)?.soft !== true) out.push({ char: " ", soft: true });
1173
- } else out.push({ char, soft: false });
1174
- }
1175
- while (out[0]?.soft) out.shift();
1176
- while (out.at(-1)?.soft) out.pop();
1177
- return out.map((part) => part.char).join("");
1178
- }
1179
-
1180
- // src/android-xml.ts
1181
- var ENTITIES = {
1182
- quot: '"',
1183
- apos: "'",
1184
- amp: "&",
1185
- lt: "<",
1186
- gt: ">"
1187
- };
1188
- var TAG = /<(\/?)([\w:.-]+)((?:\s+[\w:.-]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>/y;
1189
- var ATTRIBUTE = /([\w:.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
1190
- function decodeXmlText(value, file) {
1191
- return value.replace(/&(#x[0-9a-fA-F]+|#\d+|\w+);/g, (_match, entity) => {
1192
- if (entity.startsWith("#x"))
1193
- return String.fromCodePoint(Number.parseInt(entity.slice(2), 16));
1194
- if (entity.startsWith("#"))
1195
- return String.fromCodePoint(Number.parseInt(entity.slice(1), 10));
1196
- const character = ENTITIES[entity];
1197
- if (character === void 0) throw new Error(`${file}: unknown entity &${entity};`);
1198
- return character;
1199
- });
1200
- }
1201
- function parseXml(text2, file) {
1202
- const root = { name: "#document", attributes: {}, children: [], text: "" };
1203
- const stack = [root];
1204
- const body = text2.replace(/<!--[\s\S]*?-->/g, "").replace(/<\?[\s\S]*?\?>/g, "");
1205
- let index = 0;
1206
- while (index < body.length) {
1207
- const open = body.indexOf("<", index);
1208
- const content = body.slice(index, open === -1 ? body.length : open);
1209
- const parent = stack.at(-1);
1210
- if (parent && content.trim()) parent.text += decodeXmlText(content, file);
1211
- if (open === -1) break;
1212
- TAG.lastIndex = open;
1213
- const match = TAG.exec(body);
1214
- if (!match)
1215
- throw new Error(`${file}: unreadable markup at ${body.slice(open, open + 40)}`);
1216
- index = TAG.lastIndex;
1217
- const [, closing, name, rawAttributes, selfClosing] = match;
1218
- if (!name) continue;
1219
- if (closing) {
1220
- const element2 = stack.pop();
1221
- if (element2?.name !== name)
1222
- throw new Error(`${file}: </${name}> closes <${element2?.name}>`);
1223
- continue;
1224
- }
1225
- const attributes = {};
1226
- for (const [, key, double, single] of (rawAttributes ?? "").matchAll(ATTRIBUTE))
1227
- if (key) attributes[key] = decodeXmlText(double ?? single ?? "", file);
1228
- const element = { name, attributes, children: [], text: "" };
1229
- stack.at(-1)?.children.push(element);
1230
- if (!selfClosing) stack.push(element);
1231
- }
1232
- if (stack.length !== 1)
1233
- throw new Error(`${file}: <${stack.at(-1)?.name}> is never closed`);
1234
- return root;
1235
- }
1236
-
1237
- // src/android-app-identity.ts
1238
- function nativeAppIdentityFromAndroidManifest(source, file, files = {}) {
1239
- const document = parseXml(source, file);
1240
- if (document.children.length !== 1) return null;
1241
- const manifest = document.children[0];
1242
- if (manifest.name !== "manifest") return null;
1243
- const androidPrefix = Object.entries(manifest.attributes).find(
1244
- ([name, value]) => name.startsWith("xmlns:") && value === "http://schemas.android.com/apk/res/android"
1245
- )?.[0].slice("xmlns:".length);
1246
- if (!androidPrefix) return null;
1247
- const attribute = `${androidPrefix}:`;
1248
- const bundleIdentifier = manifest.attributes.package;
1249
- const appVersion = manifest.attributes[`${attribute}versionName`];
1250
- const buildVersion = manifest.attributes[`${attribute}versionCode`];
1251
- const application = manifest.children.find((child) => child.name === "application");
1252
- if (!application || !bundleIdentifier || !appVersion || !buildVersion || !/^[1-9][0-9]*$/.test(buildVersion) || [bundleIdentifier, appVersion].some((value) => /\$\{|^[@?]/.test(value)))
1253
- return null;
1254
- const toolsPrefixes = Object.entries(manifest.attributes).filter(
1255
- ([name, value]) => name.startsWith("xmlns:") && value === "http://schemas.android.com/tools"
1256
- ).map(([name]) => `${name.slice("xmlns:".length)}:`);
1257
- const androidManifestPermissions = [];
1258
- for (const element of manifest.children) {
1259
- if (!["uses-permission", "uses-permission-sdk-23", "uses-permission-sdk-m"].includes(
1260
- element.name
1261
- ))
1262
- continue;
1263
- if (Object.keys(element.attributes).some(
1264
- (key) => toolsPrefixes.some((prefix) => key.startsWith(prefix))
1265
- ))
1266
- return null;
1267
- const name = element.attributes[`${attribute}name`];
1268
- const max = element.attributes[`${attribute}maxSdkVersion`];
1269
- if (!name || /\$\{|^[@?]/.test(name) || element.attributes[`${attribute}requiredFeature`] !== void 0 || element.attributes[`${attribute}requiredNotFeature`] !== void 0 || max !== void 0 && !/^\d+$/.test(max))
1270
- return null;
1271
- androidManifestPermissions.push({
1272
- name,
1273
- minSdkVersion: element.name === "uses-permission" ? 1 : 23,
1274
- ...max === void 0 ? {} : { maxSdkVersion: Number(max) }
1275
- });
1276
- }
1277
- let androidPhotoLibraryAddOnly;
1278
- for (const element of application.children) {
1279
- if (element.name !== "meta-data" || element.attributes[`${attribute}name`] !== "one.photoLibrary.addOnly")
1280
- continue;
1281
- if (/^(?:true|True|TRUE)$/.test(element.attributes[`${attribute}value`]?.trim() ?? ""))
1282
- androidPhotoLibraryAddOnly = true;
1283
- }
1284
- let label = application.attributes[`${attribute}label`];
1285
- let applicationName = null;
1286
- if (label && !/\$\{|^[@?]/.test(label)) applicationName = label;
1287
- else if (label?.startsWith("@string/")) {
1288
- const resourceDirectory = androidMergedResourceValuesDirectory(file);
1289
- const resourceFile = resourceDirectory ? `${resourceDirectory}/values/values.xml` : null;
1290
- const resources = resourceFile ? files[resourceFile] : void 0;
1291
- if (resources !== void 0 && resourceFile) {
1292
- const document2 = parseXml(resources, resourceFile);
1293
- const root = document2.children[0];
1294
- if (document2.children.length === 1 && root?.name === "resources") {
1295
- const qualified = Object.entries(files).filter(
1296
- ([name]) => name.startsWith(`${resourceDirectory}/values-`) && name.endsWith(".xml")
1297
- ).flatMap(([name, source2]) => parseXml(source2, name).children).flatMap((root2) => root2.children);
1298
- const visited = /* @__PURE__ */ new Set();
1299
- while (label?.startsWith("@string/") && !visited.has(label)) {
1300
- visited.add(label);
1301
- const name = label.slice("@string/".length);
1302
- if (qualified.some((element) => element.attributes.name === name)) break;
1303
- const matches = root.children.filter(
1304
- (element) => (element.name === "string" || element.name === "item" && element.attributes.type === "string") && element.attributes.name === name
1305
- );
1306
- const value = matches.length === 1 ? matches[0] : void 0;
1307
- if (!value || value.children.length) break;
1308
- label = value.text.trim();
1309
- if (/^[@?]/.test(label)) continue;
1310
- applicationName = compileAndroidStringValue(value.text, resourceFile) || null;
1311
- break;
1312
- }
1313
- }
1314
- }
1315
- }
1316
- return {
1317
- applicationName,
1318
- appVersion,
1319
- buildVersion,
1320
- bundleIdentifier,
1321
- platform: "android",
1322
- androidManifestPermissions,
1323
- ...androidPhotoLibraryAddOnly === void 0 ? {} : { androidPhotoLibraryAddOnly }
1324
- };
1325
- }
1326
- function androidMergedResourceValuesDirectory(manifestFile) {
1327
- const match = /^(.*\/build\/intermediates\/)merged_manifests\/([^/]+)\/[^/]+\/AndroidManifest\.xml$/.exec(
1328
- manifestFile
1329
- );
1330
- if (!match) return null;
1331
- const [, intermediates, variant2] = match;
1332
- if (!variant2) return null;
1333
- const taskVariant = variant2[0].toUpperCase() + variant2.slice(1);
1334
- return `${intermediates}incremental/${variant2}/merge${taskVariant}Resources/merged.dir`;
1335
- }
1336
-
1337
- // src/is-record.ts
1338
- function isRecord(value) {
1339
- return typeof value === "object" && value !== null && !Array.isArray(value);
1340
- }
1341
-
1342
- // src/nativeAppIconContract.ts
1343
- function resolveNativeBundleIcons(icons, catalogNames, resolveReference) {
1344
- if (!isRecord(icons) && catalogNames.length === 0) return void 0;
1345
- const resolve = (value) => {
1346
- if (typeof value === "string") return resolveReference(value);
1347
- if (Array.isArray(value)) return value.map(resolve);
1348
- if (isRecord(value))
1349
- return Object.fromEntries(
1350
- Object.entries(value).map(([key, entry]) => [
1351
- resolveReference(key),
1352
- resolve(entry)
1353
- ])
1354
- );
1355
- return value;
1356
- };
1357
- const dictionary = isRecord(icons) ? Object.fromEntries(
1358
- Object.entries(icons).map(([key, value]) => [key, resolve(value)])
1359
- ) : {};
1360
- if (catalogNames.length === 0) return dictionary;
1361
- return {
1362
- ...dictionary,
1363
- CFBundleAlternateIcons: {
1364
- ...Object.fromEntries(
1365
- catalogNames.map((name) => [name, { CFBundleIconName: name }])
1366
- ),
1367
- ...isRecord(dictionary.CFBundleAlternateIcons) ? dictionary.CFBundleAlternateIcons : {}
1368
- }
1369
- };
1370
- }
1371
- function resolveNativeAppIconArtwork(resources, readText, resourceUri, icons, primaryName, alternateNames, resolveReference) {
1372
- const members = new Set(resources);
1373
- const dictionary = isRecord(icons) ? icons : {};
1374
- const alternates = Object.fromEntries(
1375
- Object.entries(
1376
- isRecord(dictionary.CFBundleAlternateIcons) ? dictionary.CFBundleAlternateIcons : {}
1377
- ).map(([name, declaration]) => [resolveReference(name), declaration])
1378
- );
1379
- const resolve = (declaration, defaultName) => {
1380
- const entry = isRecord(declaration) ? declaration : {};
1381
- const name = typeof entry.CFBundleIconName === "string" ? resolveReference(entry.CFBundleIconName) : resolveReference(defaultName);
1382
- const catalogs = resources.filter(
1383
- (file) => file.endsWith(`/${name}.appiconset/Contents.json`)
1384
- );
1385
- const populatedCatalogs = [];
1386
- for (const catalog of catalogs) {
1387
- const catalogCandidates = [];
1388
- const text2 = readText(catalog);
1389
- const contents = text2 === null ? null : JSON.parse(text2);
1390
- if (isRecord(contents) && Array.isArray(contents.images)) {
1391
- for (const image of contents.images) {
1392
- if (!isRecord(image) || typeof image.filename !== "string" || /[/\\]/.test(image.filename) || !/\.(png|jpe?g|webp)$/i.test(image.filename) || image.appearances !== void 0 || !["iphone", "universal", "ios-marketing"].includes(String(image.idiom)))
1393
- continue;
1394
- const file = catalog.slice(0, -"Contents.json".length) + image.filename;
1395
- const scale = image.scale === "2x" ? 2 : image.scale === "3x" ? 3 : 1;
1396
- const size = typeof image.size === "string" ? parseFloat(image.size) : 1024;
1397
- if (members.has(file) && Number.isFinite(size) && size > 0)
1398
- catalogCandidates.push({ file, scale, size });
1399
- }
1400
- }
1401
- if (catalogCandidates.length > 0) populatedCatalogs.push(catalogCandidates);
1402
- }
1403
- if (populatedCatalogs.length > 1)
1404
- throw new Error(`native app icon catalog ${name} is ambiguous`);
1405
- const candidates = [];
1406
- if (populatedCatalogs.length === 1) {
1407
- candidates.push(...populatedCatalogs[0]);
1408
- const home = candidates.filter((image) => image.size === 60);
1409
- const chosen = home.length ? home : candidates.sort((a, b) => b.size * b.scale - a.size * a.scale).slice(0, 1);
1410
- return chosen.flatMap(({ file, scale }) => {
1411
- const uri = resourceUri(file);
1412
- return uri ? [{ uri, scale }] : [];
1413
- }).sort((a, b) => a.scale - b.scale);
1414
- }
1415
- const files = Array.isArray(entry.CFBundleIconFiles) ? entry.CFBundleIconFiles : [];
1416
- for (const iconFile of files) {
1417
- if (typeof iconFile !== "string" || /[/\\]/.test(iconFile)) continue;
1418
- const base = resolveReference(iconFile).replace(/\.(png|jpe?g|webp)$/i, "");
1419
- for (const file of resources) {
1420
- const match = /(?:^|\/)([^/]+?)(?:@([23])x)?\.(png|jpe?g|webp)$/i.exec(file);
1421
- if (!match || match[1] !== base) continue;
1422
- candidates.push({ file, scale: Number(match[2] ?? 1), size: 60 });
1423
- }
1424
- }
1425
- return candidates.flatMap(({ file, scale }) => {
1426
- const uri = resourceUri(file);
1427
- return uri ? [{ uri, scale }] : [];
1428
- }).sort((a, b) => a.scale - b.scale);
1429
- };
1430
- const primary = resolve(dictionary.CFBundlePrimaryIcon, primaryName);
1431
- return {
1432
- ...primary.length ? { primary } : {},
1433
- alternates: Object.fromEntries(
1434
- alternateNames.flatMap((name) => {
1435
- const images = resolve(alternates[name], name);
1436
- return images.length ? [[name, images]] : [];
1437
- })
1438
- )
1439
- };
1440
- }
1441
-
1442
- // src/openstep-plist.ts
1443
- var isDict = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1444
- var str = (value) => typeof value === "string" ? value : void 0;
1445
- var list = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
1446
- function parseOpenStepPlist(text2) {
1447
- let i = 0;
1448
- const fail = (message) => {
1449
- const line = text2.slice(0, i).split("\n").length;
1450
- throw new Error(`project.pbxproj line ${line}: ${message}`);
1451
- };
1452
- const skip = () => {
1453
- for (; ; ) {
1454
- const ch = text2[i];
1455
- if (ch === " " || ch === " " || ch === "\n" || ch === "\r") i++;
1456
- else if (ch === "/" && text2[i + 1] === "*") {
1457
- const end = text2.indexOf("*/", i + 2);
1458
- if (end < 0) fail("unterminated comment");
1459
- i = end + 2;
1460
- } else if (ch === "/" && text2[i + 1] === "/") {
1461
- const end = text2.indexOf("\n", i);
1462
- i = end < 0 ? text2.length : end + 1;
1463
- } else return;
1464
- }
1465
- };
1466
- const quoted = () => {
1467
- i++;
1468
- let out = "";
1469
- for (; ; ) {
1470
- const ch = text2[i++];
1471
- if (ch === void 0) fail("unterminated string");
1472
- if (ch === '"') return out;
1473
- if (ch !== "\\") {
1474
- out += ch;
1475
- continue;
1476
- }
1477
- const next = text2[i++];
1478
- if (next === "n") out += "\n";
1479
- else if (next === "t") out += " ";
1480
- else if (next === "r") out += "\r";
1481
- else if (next === "U") {
1482
- out += String.fromCharCode(parseInt(text2.slice(i, i + 4), 16));
1483
- i += 4;
1484
- } else out += next;
1485
- }
1486
- };
1487
- const value = () => {
1488
- skip();
1489
- const ch = text2[i];
1490
- if (ch === "{") {
1491
- i++;
1492
- const dict = {};
1493
- for (; ; ) {
1494
- skip();
1495
- if (text2[i] === "}") {
1496
- i++;
1497
- return dict;
1498
- }
1499
- const key = value();
1500
- if (typeof key !== "string") fail("dictionary key is not a string");
1501
- skip();
1502
- if (text2[i++] !== "=") fail("expected =");
1503
- if (Object.hasOwn(dict, key)) fail(`duplicate key ${key}`);
1504
- dict[key] = value();
1505
- skip();
1506
- if (text2[i++] !== ";") fail("expected ;");
1507
- }
1508
- }
1509
- if (ch === "(") {
1510
- i++;
1511
- const list2 = [];
1512
- for (; ; ) {
1513
- skip();
1514
- if (text2[i] === ")") {
1515
- i++;
1516
- return list2;
1517
- }
1518
- list2.push(value());
1519
- skip();
1520
- if (text2[i] === ",") i++;
1521
- else if (text2[i] !== ")") fail("expected , or )");
1522
- }
1523
- }
1524
- if (ch === '"') return quoted();
1525
- const start = i;
1526
- while (i < text2.length && /[A-Za-z0-9_$+/:.\-<>]/.test(text2[i])) i++;
1527
- if (i === start) fail(`unexpected ${JSON.stringify(ch ?? "end of file")}`);
1528
- return text2.slice(start, i);
1529
- };
1530
- if (text2.startsWith("// !$*UTF8*$!")) i = text2.indexOf("\n") + 1;
1531
- const root = value();
1532
- skip();
1533
- if (i !== text2.length) fail("trailing content");
1534
- return root;
1535
- }
1536
-
1537
- // src/xcode-target-members.ts
1538
- var NEVER_MEMBER = /(?:^|\/)(?:Info\.plist|[^/]+\.entitlements|[^/]+\.xcconfig|\.DS_Store)$/;
1539
- var FOLDER_REFERENCE = /^(?:folder|wrapper\.scnassets)$/;
1540
- var BUNDLE_DIR = /\.(xcassets|bundle|lproj|xcdatamodeld|scnassets|spriteatlas|rcproject|storyboardc|icon)$/;
1541
- var groupParents = /* @__PURE__ */ new WeakMap();
1542
- function groupParentsOf(objects) {
1543
- let parents = groupParents.get(objects);
1544
- if (parents) return parents;
1545
- parents = /* @__PURE__ */ new Map();
1546
- for (const [id, entry] of Object.entries(objects)) {
1547
- if (!isDict(entry)) continue;
1548
- if (entry.isa === "PBXGroup" || entry.isa === "PBXVariantGroup") {
1549
- for (const child of list(entry.children)) parents.set(child, id);
1550
- }
1551
- }
1552
- groupParents.set(objects, parents);
1553
- return parents;
1554
- }
1555
- function xcodePathResolver(objects, projectDir, join8, sourceTreeRoot) {
1556
- const parents = groupParentsOf(objects);
1557
- const paths = /* @__PURE__ */ new Map();
1558
- const resolve = (id) => {
1559
- if (paths.has(id)) return paths.get(id);
1560
- paths.set(id, null);
1561
- const entry = objects[id];
1562
- let result = null;
1563
- if (isDict(entry)) {
1564
- const own = str(entry.path) ?? "";
1565
- const tree = str(entry.sourceTree) ?? "<group>";
1566
- if (tree === "<absolute>") result = own;
1567
- else if (tree === "SOURCE_ROOT") result = join8(projectDir, own);
1568
- else if (tree === "<group>") {
1569
- const parent = parents.get(id);
1570
- const base = parent ? resolve(parent) : projectDir;
1571
- if (base !== null) result = join8(base, own);
1572
- } else {
1573
- const base = sourceTreeRoot?.(tree);
1574
- if (base) result = join8(base, own);
1575
- }
1576
- }
1577
- paths.set(id, result);
1578
- return result;
1579
- };
1580
- return resolve;
1581
- }
1582
- function xcodeBuildFileBuildsForIos(buildFile) {
1583
- const filters = [
1584
- ...list(buildFile.platformFilters),
1585
- str(buildFile.platformFilter)
1586
- ].filter((filter) => !!filter);
1587
- return !filters.length || filters.includes("ios");
1588
- }
1589
- function xcodeTargetMemberVisitor(objects) {
1590
- const synchronizedGroups = [];
1591
- for (const id of Object.keys(objects)) {
1592
- const group = objects[id];
1593
- if (isDict(group) && group.isa === "PBXFileSystemSynchronizedRootGroup")
1594
- synchronizedGroups.push({ id, group });
1595
- }
1596
- return (targetId, resolvePath, filesUnder, join8, visit) => {
1597
- const target = objects[targetId];
1598
- if (!isDict(target)) return;
1599
- for (const phaseId of list(target.buildPhases)) {
1600
- const phase = objects[phaseId];
1601
- if (!isDict(phase)) continue;
1602
- if (phase.isa !== "PBXSourcesBuildPhase" && phase.isa !== "PBXResourcesBuildPhase")
1603
- continue;
1604
- for (const buildFileId of list(phase.files)) {
1605
- const buildFile = objects[buildFileId];
1606
- if (!isDict(buildFile) || !xcodeBuildFileBuildsForIos(buildFile)) continue;
1607
- const refId = str(buildFile.fileRef);
1608
- if (!refId) continue;
1609
- const entry = objects[refId];
1610
- const refs = isDict(entry) && entry.isa === "PBXVariantGroup" ? list(entry.children) : [refId];
1611
- for (const id of refs) {
1612
- const file = resolvePath(id);
1613
- if (file === null) continue;
1614
- if (phase.isa === "PBXSourcesBuildPhase") {
1615
- visit(file, "source");
1616
- continue;
1617
- }
1618
- const ref = objects[id];
1619
- const type = isDict(ref) ? str(ref.lastKnownFileType) ?? str(ref.explicitFileType) ?? "" : "";
1620
- const root = file.replace(/[\\/]+$/, "");
1621
- const folder = FOLDER_REFERENCE.test(type) ? root.split(/[\\/]/).pop() : void 0;
1622
- for (const inner of filesUnder(file))
1623
- visit(
1624
- inner,
1625
- "resource",
1626
- folder && `${folder}/${inner.slice(root.length + 1).replaceAll("\\", "/")}`
1627
- );
1628
- }
1629
- }
1630
- }
1631
- const owned = new Set(list(target.fileSystemSynchronizedGroups));
1632
- for (const { id: groupId, group } of synchronizedGroups) {
1633
- const folder = resolvePath(groupId);
1634
- if (folder === null) continue;
1635
- const prefix = folder === "" ? "" : `${folder.replace(/\/$/, "")}/`;
1636
- const exceptions = /* @__PURE__ */ new Set();
1637
- for (const exceptionId of list(group.exceptions)) {
1638
- const exception = objects[exceptionId];
1639
- if (!isDict(exception) || exception.target !== targetId) continue;
1640
- for (const relative2 of list(exception.membershipExceptions))
1641
- exceptions.add(relative2);
1642
- }
1643
- const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative2) => filesUnder(join8(folder, relative2)));
1644
- for (const file of members) {
1645
- const relative2 = file.slice(prefix.length);
1646
- const excepted = [...exceptions].some(
1647
- (exception) => relative2 === exception || relative2.startsWith(`${exception}/`)
1648
- );
1649
- if (owned.has(groupId) === excepted || NEVER_MEMBER.test(relative2)) continue;
1650
- if (file.endsWith(".swift")) {
1651
- if (!relative2.split("/").some((segment) => BUNDLE_DIR.test(segment)))
1652
- visit(file, "source");
1653
- } else if (/\.(h|hh|hpp|hxx|pch)$/.test(file)) {
1654
- visit(
1655
- file,
1656
- relative2.split("/").some((segment) => BUNDLE_DIR.test(segment)) ? "resource" : "header"
1657
- );
1658
- } else if (/\.(m|mm|c|cc|cpp|cxx|metal)$/.test(file)) {
1659
- visit(file, "source");
1660
- } else visit(file, "resource");
1661
- }
1662
- }
1663
- };
1664
- }
1665
-
1666
- // src/native-app-identity.ts
1667
- function readKeychainAccessGroups(dictionary, resolve) {
1668
- if (!isRecord(dictionary))
1669
- throw new Error("native app entitlements are not a dictionary");
1670
- const groups = dictionary["keychain-access-groups"];
1671
- if (groups === void 0) return void 0;
1672
- if (!Array.isArray(groups)) throw new Error("keychain-access-groups is not an array");
1673
- return groups.map((group) => {
1674
- if (typeof group !== "string")
1675
- throw new Error("keychain access group is not a string");
1676
- const value = resolve(group);
1677
- if (!value || /\$[({]/.test(value))
1678
- throw new Error("keychain access group has unresolved signing settings");
1679
- return value;
1680
- });
1681
- }
1682
- function nonEmptyString(value) {
1683
- return typeof value === "string" && value.length > 0 ? value : null;
1684
- }
1685
- function readGoogleSignInConfiguration(plist4, resources) {
1686
- const clientIds = {};
1687
- for (const [file, value] of Object.entries(resources)) {
1688
- if (isRecord(value) && typeof value.CLIENT_ID === "string")
1689
- clientIds[file.split("/").pop()?.replace(/\.plist$/, "") ?? file] = value.CLIENT_ID;
1690
- }
1691
- const urlSchemes = [];
1692
- for (const entry of Array.isArray(plist4.CFBundleURLTypes) ? plist4.CFBundleURLTypes : []) {
1693
- if (!isRecord(entry) || !Array.isArray(entry.CFBundleURLSchemes)) continue;
1694
- for (const scheme of entry.CFBundleURLSchemes)
1695
- if (typeof scheme === "string") urlSchemes.push(scheme);
1696
- }
1697
- return {
1698
- clientId: plist4.GIDClientID,
1699
- serverClientId: plist4.GIDServerClientID,
1700
- hostedDomain: plist4.GIDHostedDomain,
1701
- openIDRealm: plist4.GIDOpenIDRealm,
1702
- urlSchemes,
1703
- clientIds
1704
- };
1705
- }
1706
- function plistString(plist4, key) {
1707
- const match = plist4.match(new RegExp(`<key>${key}</key>\\s*<string>([^<]*)</string>`));
1708
- return match ? match[1].trim() : null;
1709
- }
1710
- function resolvePlistStrings(value, settings) {
1711
- const resolve = (item) => typeof item === "string" ? resolveBuildSetting(item, settings) ?? item : Array.isArray(item) ? item.map(resolve) : isRecord(item) ? resolvePlistStrings(item, settings) : item;
1712
- return Object.fromEntries(
1713
- Object.entries(value).map(([key, item]) => [key, resolve(item)])
1714
- );
1715
- }
1716
- function resolveBuildSetting(value, settings, depth = 0) {
1717
- if (depth > 8) return null;
1718
- let unresolved = false;
1719
- const resolved = value.replace(/\$\(([^()]+)\)/g, (_match, reference) => {
1720
- const separator = reference.indexOf(":");
1721
- if (separator >= 0) {
1722
- unresolved = true;
1723
- return "";
1724
- }
1725
- const replacement = settings[reference];
1726
- if (replacement === void 0) {
1727
- unresolved = true;
1728
- return "";
1729
- }
1730
- return replacement;
1731
- });
1732
- if (unresolved) return null;
1733
- if (resolved.includes("$(")) return resolveBuildSetting(resolved, settings, depth + 1);
1734
- return resolved;
1735
- }
1736
- function resolvedIdentityField(value) {
1737
- const trimmed = value?.trim() ?? "";
1738
- if (!trimmed || trimmed.includes("$(")) return null;
1739
- return trimmed;
1740
- }
1741
- function identityFieldFrom(settings, raw, fallbackSetting) {
1742
- if (raw !== null) return resolvedIdentityField(resolveBuildSetting(raw, settings));
1743
- return resolvedIdentityField(nonEmptyString(fallbackSetting ?? null));
1744
- }
1745
- function readBuildSettingsBlock(source, start) {
1746
- let depth = 0;
1747
- for (let index = start; index < source.length; index++) {
1748
- const character = source[index];
1749
- if (character === "{") depth++;
1750
- else if (character === "}") {
1751
- depth--;
1752
- if (depth === 0) return source.slice(start, index + 1);
1753
- }
1754
- }
1755
- return source.slice(start);
1756
- }
1757
- function parseBuildSettings(block) {
1758
- const settings = {};
1759
- const matchPattern = /([A-Za-z0-9_]+) = ("(?:[^"\\]|\\.)*"|[^;{}]*);/g;
1760
- let match;
1761
- while ((match = matchPattern.exec(block)) !== null) {
1762
- const raw = match[2].trim();
1763
- settings[match[1]] = raw.startsWith('"') ? raw.slice(1, -1) : raw.trim();
1764
- }
1765
- return settings;
1766
- }
1767
- function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
1768
- const configurationPattern = /\/\* (Release|Debug) \*\/ = \{/g;
1769
- const candidates = [];
1770
- let match;
1771
- while ((match = configurationPattern.exec(pbxproj)) !== null) {
1772
- const blockStart = pbxproj.indexOf("{", match.index);
1773
- if (blockStart < 0) continue;
1774
- const block = readBuildSettingsBlock(pbxproj, blockStart);
1775
- const buildSettingsStart = block.indexOf("buildSettings = {");
1776
- if (buildSettingsStart < 0) continue;
1777
- const settings = parseBuildSettings(
1778
- readBuildSettingsBlock(block, block.indexOf("{", buildSettingsStart))
1779
- );
1780
- candidates.push({ name: match[1], settings });
1781
- }
1782
- const plistMatch = (settings) => {
1783
- const plist4 = settings.INFOPLIST_FILE;
1784
- if (!plist4) return false;
1785
- const normalized = plist4.replace(/^"|"$/g, "");
1786
- return normalized === infoPlistRelativePath || infoPlistRelativePath.endsWith(`/${normalized}`) || normalized.endsWith(`/${infoPlistRelativePath}`);
1787
- };
1788
- const named = (settings) => resolveBuildSetting(settings.PRODUCT_NAME ?? "", settings) === targetName;
1789
- return candidates.find(
1790
- (candidate) => candidate.name === "Release" && plistMatch(candidate.settings)
1791
- )?.settings ?? candidates.find(
1792
- (candidate) => candidate.name === "Release" && named(candidate.settings)
1793
- )?.settings ?? null;
1794
- }
1795
- var APP_DELEGATE_PATH_RE = /(?:^|\/)(?:ios\/)?([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
1796
- function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
1797
- const pbxprojPath = Object.keys(files).find(
1798
- (path41) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path41)
1799
- ) ?? Object.keys(files).find(
1800
- (path41) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path41)
1801
- ) ?? Object.keys(files).find((path41) => /(?:^|\/)project\.pbxproj$/.test(path41));
1802
- if (!pbxprojPath) return null;
1803
- const pbxproj = files[pbxprojPath];
1804
- let objects = {};
1805
- try {
1806
- const parsed = parseOpenStepPlist(pbxproj);
1807
- if (isRecord(parsed)) {
1808
- objects = isRecord(parsed.objects) ? parsed.objects : parsed;
1809
- }
1810
- } catch {
1811
- }
1812
- const targets = [];
1813
- for (const [id, obj] of Object.entries(objects)) {
1814
- if (isRecord(obj) && obj.isa === "PBXNativeTarget" && typeof obj.name === "string") {
1815
- targets.push({
1816
- id,
1817
- name: obj.name,
1818
- productType: typeof obj.productType === "string" ? obj.productType : void 0,
1819
- buildConfigurationList: typeof obj.buildConfigurationList === "string" ? obj.buildConfigurationList : void 0
1820
- });
1821
- }
1822
- }
1823
- const applicationTargetNames = new Set(
1824
- targets.filter((t) => t.productType === "com.apple.product-type.application").map((t) => t.name)
1825
- );
1826
- if (applicationTargetNames.size === 0) {
1827
- for (const match of pbxproj.matchAll(
1828
- /isa = PBXNativeTarget;[^}]*?name = "?([^";]+)"?;[^}]*?productType = "com\.apple\.product-type\.application";/g
1829
- )) {
1830
- applicationTargetNames.add(match[1]);
1831
- }
1832
- }
1833
- let targetName = null;
1834
- if (iosTarget) {
1835
- if (applicationTargetNames.has(iosTarget)) {
1836
- targetName = iosTarget;
1837
- } else {
1838
- return null;
1839
- }
1840
- } else if (applicationTargetNames.size === 1) {
1841
- targetName = [...applicationTargetNames][0];
1842
- } else if (applicationTargetNames.size > 1) {
1843
- const delegateTargets = Object.keys(files).filter((path41) => !path41.includes("/Pods/")).map((path41) => path41.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
1844
- (name) => typeof name === "string" && applicationTargetNames.has(name)
1845
- );
1846
- if (delegateTargets.length === 1) {
1847
- targetName = delegateTargets[0];
1848
- } else {
1849
- return null;
1850
- }
1851
- } else {
1852
- return null;
1853
- }
1854
- const selectedTarget = targets.find((t) => t.name === targetName);
1855
- const settings = {
1856
- TARGET_NAME: targetName,
1857
- PRODUCT_NAME: targetName
1858
- };
1859
- for (const obj of Object.values(objects)) {
1860
- if (isRecord(obj) && obj.isa === "PBXProject" && typeof obj.buildConfigurationList === "string") {
1861
- const listObj = objects[obj.buildConfigurationList];
1862
- if (isRecord(listObj) && Array.isArray(listObj.buildConfigurations)) {
1863
- for (const configId of listObj.buildConfigurations) {
1864
- if (typeof configId === "string") {
1865
- const configObj = objects[configId];
1866
- if (isRecord(configObj) && configObj.name === "Release" && isRecord(configObj.buildSettings)) {
1867
- for (const [k, v6] of Object.entries(configObj.buildSettings)) {
1868
- if (typeof v6 === "string") settings[k] = v6;
1869
- }
1870
- }
1871
- }
1872
- }
1873
- }
1874
- }
1875
- }
1876
- if (selectedTarget?.buildConfigurationList) {
1877
- const listObj = objects[selectedTarget.buildConfigurationList];
1878
- if (isRecord(listObj) && Array.isArray(listObj.buildConfigurations)) {
1879
- for (const configId of listObj.buildConfigurations) {
1880
- if (typeof configId === "string") {
1881
- const configObj = objects[configId];
1882
- if (isRecord(configObj) && configObj.name === "Release" && isRecord(configObj.buildSettings)) {
1883
- for (const [k, v6] of Object.entries(configObj.buildSettings)) {
1884
- if (typeof v6 === "string") settings[k] = v6;
1885
- }
1886
- }
1887
- }
1888
- }
1889
- }
1890
- } else {
1891
- const legacy = appTargetReleaseSettings(
1892
- pbxproj,
1893
- targetName,
1894
- `${targetName}/Info.plist`
1895
- );
1896
- if (legacy) Object.assign(settings, legacy);
1897
- }
1898
- let plist4;
1899
- const infoPlistPath = settings.INFOPLIST_FILE;
1900
- if (infoPlistPath) {
1901
- const normalized = infoPlistPath.replace(/^"|"$/g, "");
1902
- plist4 = files[`ios/${normalized}`] ?? files[normalized] ?? Object.entries(files).find(([k]) => k.endsWith(`/${normalized}`))?.[1];
1903
- }
1904
- if (!plist4) {
1905
- plist4 = files[`ios/${targetName}/Info.plist`] ?? files[`${targetName}/Info.plist`] ?? Object.entries(files).find(([k]) => k.endsWith(`/${targetName}/Info.plist`))?.[1];
1906
- }
1907
- if (!plist4) return null;
1908
- const bundleIdentifier = identityFieldFrom(
1909
- settings,
1910
- plistString(plist4, "CFBundleIdentifier"),
1911
- settings.PRODUCT_BUNDLE_IDENTIFIER
1912
- );
1913
- if (!bundleIdentifier) return null;
1914
- const appVersion = identityFieldFrom(
1915
- settings,
1916
- plistString(plist4, "CFBundleShortVersionString"),
1917
- settings.MARKETING_VERSION
1918
- );
1919
- const buildVersion = identityFieldFrom(
1920
- settings,
1921
- plistString(plist4, "CFBundleVersion"),
1922
- settings.CURRENT_PROJECT_VERSION
1923
- );
1924
- if (!appVersion || !buildVersion) return null;
1925
- const bundleName = identityFieldFrom(
1926
- settings,
1927
- plistString(plist4, "CFBundleName"),
1928
- settings.PRODUCT_NAME
1929
- ) ?? resolvedIdentityField(resolveBuildSetting(settings.PRODUCT_NAME ?? "", settings)) ?? resolvedIdentityField(targetName);
1930
- if (!bundleName) return null;
1931
- const applicationName = identityFieldFrom(settings, plistString(plist4, "CFBundleDisplayName"), void 0) ?? bundleName;
1932
- const dictionary = parseInfoPlist(plist4);
1933
- if (!isRecord(dictionary)) throw new Error("native app Info.plist is not a dictionary");
1934
- let keychainAccessGroups;
1935
- if (settings.CODE_SIGN_ENTITLEMENTS) {
1936
- const entitlementPath = resolveBuildSetting(settings.CODE_SIGN_ENTITLEMENTS, settings);
1937
- if (!entitlementPath)
1938
- throw new Error("CODE_SIGN_ENTITLEMENTS has unresolved build settings");
1939
- const source = files[`ios/${entitlementPath}`] ?? files[entitlementPath];
1940
- if (source === void 0)
1941
- throw new Error(`missing selected entitlement input ${entitlementPath}`);
1942
- keychainAccessGroups = readKeychainAccessGroups(
1943
- parseInfoPlist(source),
1944
- (value) => resolveBuildSetting(value, settings)
1945
- );
1946
- }
1947
- const declaredDisplayName = dictionary.CFBundleDisplayName;
1948
- const applicationDisplayName = typeof declaredDisplayName === "string" ? resolveBuildSetting(declaredDisplayName, settings) : void 0;
1949
- if (applicationDisplayName === null)
1950
- throw new Error("native app Info.plist CFBundleDisplayName is unresolved");
1951
- const declaredBackgroundColor = dictionary.RCTRootViewBackgroundColor;
1952
- const rootViewBackgroundColor = typeof declaredBackgroundColor === "number" && Number.isInteger(declaredBackgroundColor) ? declaredBackgroundColor : void 0;
1953
- const designRequiresCompatibility = dictionary.UIDesignRequiresCompatibility === true;
1954
- const declaredPlatformVersion = dictionary.DTPlatformVersion;
1955
- const dtPlatformVersion = typeof declaredPlatformVersion === "string" ? resolveBuildSetting(declaredPlatformVersion, settings) : void 0;
1956
- if (dtPlatformVersion === null)
1957
- throw new Error("native app Info.plist DTPlatformVersion is unresolved");
1958
- const icons = dictionary.CFBundleIcons;
1959
- const alternates = isRecord(icons) ? icons.CFBundleAlternateIcons : void 0;
1960
- const alternateIconNames = /* @__PURE__ */ new Set();
1961
- for (const name of isRecord(alternates) ? Object.keys(alternates) : []) {
1962
- const resolved = resolveBuildSetting(name, settings);
1963
- if (resolved === null) throw new Error("native alternate icon name is unresolved");
1964
- alternateIconNames.add(resolved);
1965
- }
1966
- const alternateSetting = resolveBuildSetting(
1967
- settings.ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES ?? "",
1968
- settings
1969
- );
1970
- if (alternateSetting === null)
1971
- throw new Error("native alternate icon setting is unresolved");
1972
- const catalogAlternateNames = [];
1973
- for (const match of alternateSetting.replace(/\\"/g, '"').matchAll(/"([^"]*)"|([^\s(),]+)/g)) {
1974
- const name = match[1] ?? match[2];
1975
- alternateIconNames.add(name);
1976
- catalogAlternateNames.push(name);
1977
- }
1978
- const intentIds = dictionary.OneAppIntentIdentifiers;
1979
- const appIntentIdentifiers = Array.isArray(intentIds) && intentIds.every((value) => typeof value === "string") ? intentIds.map((value) => resolveBuildSetting(value, settings)) : [];
1980
- const backgroundIds = dictionary.BGTaskSchedulerPermittedIdentifiers;
1981
- const backgroundTaskIdentifiers = Array.isArray(backgroundIds) && backgroundIds.every((value) => typeof value === "string") ? backgroundIds.map((value) => resolveBuildSetting(value, settings)) : [];
1982
- const declaredModes = dictionary.UIBackgroundModes;
1983
- const backgroundModes = Array.isArray(declaredModes) && declaredModes.every((value) => typeof value === "string") ? declaredModes.map((value) => resolveBuildSetting(value, settings)) : [];
1984
- const screenOrientationLists = [
1985
- "UISupportedInterfaceOrientations",
1986
- "UISupportedInterfaceOrientations~ipad"
1987
- ].map((key) => {
1988
- const list2 = dictionary[key];
1989
- if (!Array.isArray(list2) || !list2.every((value) => typeof value === "string"))
1990
- return [];
1991
- return list2.map((value) => {
1992
- const resolved = resolveBuildSetting(value, settings);
1993
- if (resolved === null) throw new Error(`native app Info.plist ${key} is unresolved`);
1994
- return resolved;
1995
- });
1996
- });
1997
- const [supportedInterfaceOrientations, ipadSupportedInterfaceOrientations] = screenOrientationLists;
1998
- const declaredDefaultOrientationMask = dictionary.EXDefaultScreenOrientationMask;
1999
- const defaultScreenOrientationMask = typeof declaredDefaultOrientationMask === "string" ? resolveBuildSetting(declaredDefaultOrientationMask, settings) : void 0;
2000
- if (defaultScreenOrientationMask === null)
2001
- throw new Error("native app Info.plist EXDefaultScreenOrientationMask is unresolved");
2002
- const declaredShareGroup = dictionary.ExpoShareIntoAppGroupId;
2003
- const shareIntoAppGroupId = typeof declaredShareGroup === "string" ? resolveBuildSetting(declaredShareGroup, settings) : void 0;
2004
- if (shareIntoAppGroupId === null)
2005
- throw new Error("native app Info.plist ExpoShareIntoAppGroupId is unresolved");
2006
- const declaredRtcGroup = dictionary.RTCAppGroupIdentifier;
2007
- const rtcAppGroupIdentifier = typeof declaredRtcGroup === "string" ? resolveBuildSetting(declaredRtcGroup, settings) : void 0;
2008
- if (rtcAppGroupIdentifier === null)
2009
- throw new Error("native app Info.plist RTCAppGroupIdentifier is unresolved");
2010
- const declaredScreenShareExtension = dictionary.ScreenShareExtensionBundleId;
2011
- const screenShareExtensionBundleId = typeof declaredScreenShareExtension === "string" ? resolveBuildSetting(declaredScreenShareExtension, settings) : void 0;
2012
- if (screenShareExtensionBundleId === null)
2013
- throw new Error("native app Info.plist ScreenShareExtensionBundleId is unresolved");
2014
- const querySchemes = dictionary.LSApplicationQueriesSchemes;
2015
- if (querySchemes !== void 0 && !Array.isArray(querySchemes)) {
2016
- throw new Error("native app Info.plist LSApplicationQueriesSchemes is not an array");
2017
- }
2018
- const urlQuerySchemes = (querySchemes ?? []).map((value) => {
2019
- if (typeof value !== "string") return value;
2020
- const resolved = resolveBuildSetting(value, settings);
2021
- if (resolved === null)
2022
- throw new Error("native app Info.plist LSApplicationQueriesSchemes is unresolved");
2023
- return resolved;
2024
- });
2025
- const permissionUsageDescriptions = {};
2026
- for (const [key, value] of Object.entries(dictionary)) {
2027
- if (!/^NS.*UsageDescription$/.test(key) && key !== "NSLocationTemporaryUsageDescriptionDictionary")
2028
- continue;
2029
- if (typeof value !== "string") {
2030
- permissionUsageDescriptions[key] = value;
2031
- continue;
2032
- }
2033
- const resolved = resolveBuildSetting(value, settings);
2034
- if (resolved === null) throw new Error(`native app Info.plist ${key} is unresolved`);
2035
- permissionUsageDescriptions[key] = resolved;
2036
- }
2037
- const infoPlistStrings = {};
2038
- const infoPlistBooleans = {};
2039
- for (const [key, value] of Object.entries(dictionary)) {
2040
- if (typeof value === "boolean") infoPlistBooleans[key] = value;
2041
- if (typeof value !== "string") continue;
2042
- const resolved = resolveBuildSetting(value, settings);
2043
- if (resolved !== null) infoPlistStrings[key] = resolved;
2044
- }
2045
- if (settings.GENERATE_INFOPLIST_FILE === "YES") {
2046
- for (const [setting, value] of Object.entries(settings)) {
2047
- if (!/^INFOPLIST_KEY_NS.*UsageDescription$/.test(setting)) continue;
2048
- const key = setting.slice("INFOPLIST_KEY_".length);
2049
- const resolved = resolveBuildSetting(value, settings);
2050
- if (resolved === null)
2051
- throw new Error(`native app build setting ${setting} is unresolved`);
2052
- permissionUsageDescriptions[key] = resolved;
2053
- }
2054
- }
2055
- const resources = /* @__PURE__ */ new Set();
2056
- if (resourceUri) {
2057
- if (!selectedTarget)
2058
- throw new Error("native app icon target membership is unresolved");
2059
- const join8 = (base, own) => {
2060
- const segments = [];
2061
- for (const segment of `${base}/${own}`.split("/")) {
2062
- if (segment === "" || segment === ".") continue;
2063
- if (segment === ".." && segments.length > 0 && segments.at(-1) !== "..")
2064
- segments.pop();
2065
- else segments.push(segment);
2066
- }
2067
- return `${base.startsWith("/") ? "/" : ""}${segments.join("/")}`;
2068
- };
2069
- const project = Object.values(objects).find(
2070
- (object3) => isRecord(object3) && object3.isa === "PBXProject"
2071
- );
2072
- const projectDir = join8(
2073
- pbxprojPath.replace(/(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/, ""),
2074
- isRecord(project) && typeof project.projectDirPath === "string" ? project.projectDirPath : ""
2075
- );
2076
- const paths = Object.keys(files);
2077
- xcodeTargetMemberVisitor(objects)(
2078
- selectedTarget.id,
2079
- xcodePathResolver(objects, projectDir, join8),
2080
- (file) => {
2081
- if (Object.hasOwn(files, file)) return [file];
2082
- const prefix = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
2083
- return paths.filter(
2084
- (path41) => path41.startsWith(prefix) && !/(?:^|\/)\./.test(path41.slice(prefix.length))
2085
- );
2086
- },
2087
- join8,
2088
- (file, kind) => {
2089
- if (kind === "resource") resources.add(file);
2090
- }
2091
- );
2092
- }
2093
- const rootModuleName = readRootModuleName(
2094
- Object.entries(files).filter(
2095
- ([path41]) => !path41.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path41) || path41.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
2096
- ).map(([, source]) => source)
2097
- );
2098
- return {
2099
- applicationName,
2100
- ...applicationDisplayName === void 0 ? {} : { applicationDisplayName },
2101
- ...rootModuleName === void 0 ? {} : { rootModuleName },
2102
- ...rootViewBackgroundColor === void 0 ? {} : { rootViewBackgroundColor },
2103
- ...designRequiresCompatibility ? { designRequiresCompatibility } : {},
2104
- ...typeof dictionary.UIStatusBarHidden === "boolean" ? { statusBarHidden: dictionary.UIStatusBarHidden } : {},
2105
- ...typeof dictionary.UIViewControllerBasedStatusBarAppearance === "boolean" ? {
2106
- viewControllerBasedStatusBarAppearance: dictionary.UIViewControllerBasedStatusBarAppearance
2107
- } : {},
2108
- sceneManifest: isRecord(dictionary.UIApplicationSceneManifest) ? resolvePlistStrings(dictionary.UIApplicationSceneManifest, settings) : null,
2109
- ...dtPlatformVersion === void 0 ? {} : { dtPlatformVersion },
2110
- bundleName,
2111
- appVersion,
2112
- buildVersion,
2113
- bundleIdentifier,
2114
- platform: "ios",
2115
- googleSignIn: readGoogleSignInConfiguration(
2116
- dictionary,
2117
- Object.fromEntries(
2118
- [...resources].filter((file) => file.endsWith(".plist") && files[file]).map((file) => [file, parseInfoPlist(files[file])])
2119
- )
2120
- ),
2121
- supportedInterfaceOrientations,
2122
- ipadSupportedInterfaceOrientations,
2123
- ...defaultScreenOrientationMask === void 0 ? {} : { defaultScreenOrientationMask },
2124
- alternateIconNames: [...alternateIconNames],
2125
- bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => {
2126
- const resolved = resolveBuildSetting(value, settings);
2127
- if (resolved === null) throw new Error("native bundle icon reference is unresolved");
2128
- return resolved;
2129
- }),
2130
- ...resourceUri ? {
2131
- appIconArtwork: resolveNativeAppIconArtwork(
2132
- [...resources],
2133
- (file) => files[file] ?? null,
2134
- resourceUri,
2135
- icons,
2136
- settings.ASSETCATALOG_COMPILER_APPICON_NAME ?? "",
2137
- [...alternateIconNames],
2138
- (value) => {
2139
- const resolved = resolveBuildSetting(value, settings);
2140
- if (resolved === null)
2141
- throw new Error("native app icon reference is unresolved");
2142
- return resolved;
2143
- }
2144
- )
2145
- } : {},
2146
- permissionUsageDescriptions,
2147
- infoPlistStrings,
2148
- infoPlistBooleans,
2149
- urlQuerySchemes,
2150
- ...keychainAccessGroups === void 0 ? {} : { keychainAccessGroups },
2151
- ...shareIntoAppGroupId === void 0 ? {} : { shareIntoAppGroupId },
2152
- ...rtcAppGroupIdentifier === void 0 ? {} : { rtcAppGroupIdentifier },
2153
- ...screenShareExtensionBundleId === void 0 ? {} : { screenShareExtensionBundleId },
2154
- backgroundTaskIdentifiers: backgroundTaskIdentifiers.every((value) => value !== null) ? backgroundTaskIdentifiers : [],
2155
- backgroundModes: backgroundModes.every((value) => value !== null) ? backgroundModes : [],
2156
- appIntentIdentifiers: appIntentIdentifiers.every((value) => value !== null) ? appIntentIdentifiers : []
2157
- };
2158
- }
2159
- var ROOT_MODULE_NAME_RE = /(?:\bm|M)oduleName\s*[:=]\s*@?"([^"\\]+)"/g;
2160
- function readRootModuleName(sources) {
2161
- const names = /* @__PURE__ */ new Set();
2162
- for (const source of sources) {
2163
- for (const match of source.matchAll(ROOT_MODULE_NAME_RE)) names.add(match[1]);
2164
- }
2165
- return names.size === 1 ? [...names][0] : void 0;
2166
- }
2167
- function canExtractNativeAppIdentity(platform) {
2168
- return platform === "ios" || platform === "android";
2169
- }
2170
- function selectNativeAppIdentityReader(platform, readers) {
2171
- return canExtractNativeAppIdentity(platform) ? readers[platform] : null;
2172
- }
2173
- function extractNativeAppIdentityFromFiles(files, platform, parseInfoPlist, iosTarget, resourceUri, androidMergedManifest) {
2174
- if (platform === "android") {
2175
- const candidates = androidMergedManifest ? [androidMergedManifest] : Object.keys(files).filter(
2176
- (file) => /^android\/[^/]+\/build\/intermediates\/merged_manifests\/.+\/AndroidManifest\.xml$/.test(
2177
- file
2178
- )
2179
- );
2180
- if (candidates.length !== 1) return null;
2181
- const source = files[candidates[0]];
2182
- return source === void 0 ? null : nativeAppIdentityFromAndroidManifest(source, candidates[0], files);
2183
- }
2184
- return platform === "ios" ? nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) : null;
2185
- }
2186
-
2187
- // src/plist.ts
2188
- import plist from "plist";
2189
- function parsePlistSource(source) {
2190
- return plist.parse(source);
2191
- }
1163
+ import path10 from "node:path";
2192
1164
 
2193
- // src/swift-objc-standin.ts
2194
- import { execFileSync as execFileSync2, spawnSync as spawnSync2 } from "node:child_process";
2195
- import { createHash as createHash3 } from "node:crypto";
2196
- import fs3 from "node:fs";
2197
- import path7 from "node:path";
1165
+ // src/xcode-project.ts
1166
+ var import_plist2 = __toESM(require_plist(), 1);
1167
+ import { execFileSync as execFileSync3 } from "node:child_process";
1168
+ import { createHash as createHash8 } from "node:crypto";
1169
+ import fs7 from "node:fs";
1170
+ import path9 from "node:path";
2198
1171
 
2199
- // src/case-insensitive-header-overlay.ts
1172
+ // src/bazel-project.ts
1173
+ var import_plist = __toESM(require_plist(), 1);
1174
+ import { execFileSync } from "node:child_process";
2200
1175
  import { createHash } from "node:crypto";
2201
1176
  import fs from "node:fs";
2202
- import path2 from "node:path";
2203
-
2204
- // src/write-build-file.ts
2205
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2206
- import path from "node:path";
2207
-
2208
- // src/swift-objc-platform.ts
2209
- import { spawnSync } from "node:child_process";
2210
- import path4 from "node:path";
2211
-
2212
- // src/swift-toolchain.ts
2213
- import { execFile, execFileSync, spawn } from "node:child_process";
2214
- import { createHash as createHash2 } from "node:crypto";
2215
- import fs2 from "node:fs";
2216
1177
  import os from "node:os";
2217
- import path3 from "node:path";
2218
- import { pipeline } from "node:stream/promises";
2219
- import { fileURLToPath } from "node:url";
2220
- import { promisify } from "node:util";
2221
- import zlib from "node:zlib";
2222
- var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-81b2c791c27276bf";
2223
- var SWIFT_HOST_COMPILER_ID = "81b2c791c27276bf";
2224
- var compilerArchives = {
2225
- "swift-6.4.0-RELEASE-custom-cbd9cef4b408cc96": {
2226
- identity: "cbd9cef4b408cc96",
2227
- archive: "tar.zst",
2228
- hosts: {
2229
- "darwin-arm64": {
2230
- checksum: "97ed2a6b10ae85e73422656fe7b44fdbd5e2343d7082ef2cb39476847988e615",
2231
- manifest: "49c8002809ba90b16e2619653994bc776b5bc7ef26b98796233d8b425515b734"
2232
- },
2233
- "linux-x64": {
2234
- checksum: "b404cffaa55b783098056cce0ef568d864bc92910dafa89dd0650d0e9d019918",
2235
- manifest: "19c333d87f2ffc5c716e0561b3bcb0c2a6c6015ccd4a404a739099c6aa3b898f"
2236
- },
2237
- "linux-arm64": {
2238
- checksum: "47d8572b0438f100494edaeb4c7b24fbf5c627d7d02a09fcd68a95c6d2d780f5",
2239
- manifest: "b27a2bccb5a8a0988414951b3b4a4cd9d3acc315694f59ae4c166c2f41282171"
2240
- }
2241
- }
2242
- },
2243
- "swift-6.4.0-RELEASE-custom-fb42d2535739dfd2": {
2244
- identity: "fb42d2535739dfd2",
2245
- archive: "tar.zst",
2246
- hosts: {
2247
- "darwin-arm64": {
2248
- checksum: "5e417d415ca74a435755e298a1d2d19ec47637fd03479de7a7d958eb382941f1",
2249
- manifest: "eb5a0356aebabe89c7b2780f8809e13d6e2ad6f342fed87cf99f9a5834344363"
2250
- },
2251
- "linux-arm64": {
2252
- checksum: "8ac7ad97f3d68bf485423001d1ce3cd92a8d4625313c47c8071867a9aeed3af9",
2253
- manifest: "6126266dd65b43c43d719e4dc4d33c4ea6a3267f99f34e3638637439a995af2e"
2254
- },
2255
- "linux-x64": {
2256
- checksum: "7d76463079619ba822123d250601bd35f6744ed5f8054a657ce472ce4dac76c8",
2257
- manifest: "f1a6c0c61d15eddb2ecfa4c3a72a5154621881ac2f0c413162ff1d0f4343bd0e"
2258
- }
2259
- }
2260
- },
2261
- "swift-6.4.0-RELEASE-custom-11345d60dca47496": {
2262
- identity: "11345d60dca47496",
2263
- archive: "tar.zst",
2264
- hosts: {
2265
- "darwin-arm64": {
2266
- checksum: "3df74a95c6f3ffa45aaa412027b390c99f9af81f6f6a41bf6d58a1a3079b5b02",
2267
- manifest: "8e5ed4be6adc967e4c7d955eff004c96d5dc050a589d50e1b3e694b70f9afd63"
2268
- },
2269
- "linux-x64": {
2270
- checksum: "a80e46add069932114bacc18640dc2e6a1a8f2a3ea7306a8ea8614d5cdf6e0e7",
2271
- manifest: "662d8869534f3cce827b1205973db1f9a1e1d92027005a5bdb6893f9c2a0b39d"
2272
- },
2273
- "linux-arm64": {
2274
- checksum: "4ca69bbc284fc7d54be57c80b744b88cce997d470ff23048795db54e7a6fbcba",
2275
- manifest: "85df84da2f814b6a71c264b37b83a81965ac33b5d2b465443d60c08cc7bc5dc3"
2276
- }
2277
- }
2278
- },
2279
- [SWIFT_HOST_COMPILER_RELEASE]: {
2280
- identity: SWIFT_HOST_COMPILER_ID,
2281
- archive: "tar.gz",
2282
- hosts: {
2283
- "darwin-arm64": {
2284
- checksum: "bc51b83d9e2e01c9873875326544734486d3ff3a868d650379c304045e8838d3",
2285
- manifest: "a26eb9cb4fbd1dbd7faac20cced1ec5e67745bd358aa1180cc4abc1a0d21d6e6"
2286
- },
2287
- "linux-x64": {
2288
- checksum: "ea63bbdecae14ff8e9e3f535b521fedc65d51b31521c5d10cc332cb91882d058",
2289
- manifest: "b22b321ce3eb3fe044fa2122484a15c061f262c45d88a05b3fbace0a5bf038b6"
2290
- },
2291
- "linux-arm64": {
2292
- checksum: "3eef4ed57830908515d8def2882e312f7cabeea57ccda5b2a7585401ef98cc48",
2293
- manifest: "cfab342b8090fa83a697a391a7563cba14b771c24f07e1f8e19977f913ac88be"
2294
- }
2295
- }
2296
- }
2297
- };
2298
-
2299
- // src/swift-objc-sdk.ts
2300
- import path6 from "node:path";
2301
-
2302
- // src/swift-objc-sdk-tree.ts
2303
- import { readdirSync, readFileSync as readFileSync2 } from "node:fs";
2304
- import path5 from "node:path";
2305
-
2306
- // src/swift-objc-sdk.ts
2307
- var IOS_SDK_TARGET = "arm64-apple-ios16.0-simulator";
2308
-
2309
- // src/swift-package.ts
2310
- var SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS = [
2311
- ".c",
2312
- ".cc",
2313
- ".cpp",
2314
- ".cxx",
2315
- ".m",
2316
- ".mm"
2317
- ];
2318
- function isSwiftNativeTranslationUnit(file) {
2319
- return SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS.some(
2320
- (extension) => file.endsWith(extension)
2321
- );
2322
- }
2323
- var SWIFT_NATIVE_SOURCE_EXTENSIONS = [
2324
- ...SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS,
2325
- ".s",
2326
- ".S",
2327
- ".h",
2328
- ".hh",
2329
- ".hpp",
2330
- ".hxx",
2331
- ".pch",
2332
- ".inc",
2333
- ".inl",
2334
- ".ipp",
2335
- ".def",
2336
- ".modulemap"
2337
- ];
2338
- function moduleMapTokens(text2) {
2339
- return (text2.match(/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"[^"]*"|[\w.*]+|[{}\[\]]/g) ?? []).filter((token) => !token.startsWith("/"));
2340
- }
2341
- function moduleMapName(text2) {
2342
- const tokens = moduleMapTokens(text2);
2343
- const index = tokens.findIndex(
2344
- (token, i) => token === "module" && tokens[i - 1] !== "extern"
2345
- );
2346
- return index < 0 ? void 0 : tokens[index + 1];
2347
- }
2348
-
2349
- // src/swift-objc-standin.ts
2350
- var NATIVE_GRAPH_SDK_VERSION = "27.1";
2351
- var WASI_EMULATION = [
2352
- "_WASI_EMULATED_SIGNAL",
2353
- "_WASI_EMULATED_MMAN",
2354
- "_WASI_EMULATED_PROCESS_CLOCKS"
2355
- ];
2356
- var WASI_EMULATION_FLAGS = WASI_EMULATION.map((name) => `-D${name}`);
2357
- var NATIVE_GRAPH_INPUTS = {
2358
- sdk: NATIVE_GRAPH_SDK_VERSION,
2359
- settings: "e68503e5e534e9194af5efe8c636ca8b824e2d8237c5f38ec84aa4d155bc8418",
2360
- build: "ff785237ba22f1d8f347a5c4f4c68400a387c6d935ef3a443545a72faef57e70",
2361
- compiler: "Apple Swift version 6.4 (swiftlang-6.4.0.34.1 clang-2100.3.34.1)",
2362
- target: IOS_SDK_TARGET
2363
- };
2364
- var NATIVE_GRAPH_ID = createHash3("sha256").update(JSON.stringify(NATIVE_GRAPH_INPUTS)).digest("hex");
2365
-
2366
- // src/xcode-project.ts
2367
- import { execFileSync as execFileSync15 } from "node:child_process";
2368
- import { createHash as createHash23 } from "node:crypto";
2369
- import fs18 from "node:fs";
2370
- import path39 from "node:path";
2371
- import plist3 from "plist";
2372
-
2373
- // src/bazel-project.ts
2374
- import { execFileSync as execFileSync3 } from "node:child_process";
2375
- import { createHash as createHash4 } from "node:crypto";
2376
- import fs4 from "node:fs";
2377
- import os2 from "node:os";
2378
- import path8 from "node:path";
2379
- import plist2 from "plist";
1178
+ import path from "node:path";
2380
1179
  var LIBRARY_RULES = /* @__PURE__ */ new Set(["swift_library", "objc_library", "cc_library"]);
2381
1180
  var QUERIED_RULES = [
2382
1181
  "swift_library",
@@ -2393,43 +1192,43 @@ var QUERIED_RULES = [
2393
1192
  ];
2394
1193
  var NATIVE_SOURCE = /\.(?:m|mm|c|cc|cpp|cxx|S)$/;
2395
1194
  var HEADER = /\.(?:h|hh|hpp|hxx|inc|inl|ipp)$/;
2396
- var PRODUCTS = path8.join(".build", "peach-bazel", "Products");
1195
+ var PRODUCTS = path.join(".build", "peach-bazel", "Products");
2397
1196
  function isBazelPackage(input) {
2398
- return /^BUILD(?:\.bazel)?$/.test(path8.basename(input)) && fs4.statSync(input).isFile();
1197
+ return /^BUILD(?:\.bazel)?$/.test(path.basename(input)) && fs.statSync(input).isFile();
2399
1198
  }
2400
1199
  function workspaceRoot(buildFile) {
2401
- for (let dir = path8.dirname(buildFile); ; dir = path8.dirname(dir)) {
1200
+ for (let dir = path.dirname(buildFile); ; dir = path.dirname(dir)) {
2402
1201
  if (["MODULE.bazel", "WORKSPACE", "WORKSPACE.bazel"].some(
2403
- (name) => fs4.existsSync(path8.join(dir, name))
1202
+ (name) => fs.existsSync(path.join(dir, name))
2404
1203
  ))
2405
1204
  return dir;
2406
- if (path8.dirname(dir) === dir)
1205
+ if (path.dirname(dir) === dir)
2407
1206
  throw new Error(`${buildFile} is not inside a bazel workspace`);
2408
1207
  }
2409
1208
  }
2410
1209
  function bazelBinary(root) {
2411
- const pinned = path8.join(root, ".bazelversion");
2412
- if (!fs4.existsSync(pinned)) return "bazel";
2413
- const version = fs4.readFileSync(pinned, "utf8").trim();
2414
- const platform = os2.platform() === "darwin" ? "darwin" : "linux";
2415
- const arch = os2.arch() === "arm64" ? "arm64" : "x86_64";
1210
+ const pinned = path.join(root, ".bazelversion");
1211
+ if (!fs.existsSync(pinned)) return "bazel";
1212
+ const version = fs.readFileSync(pinned, "utf8").trim();
1213
+ const platform = os.platform() === "darwin" ? "darwin" : "linux";
1214
+ const arch = os.arch() === "arm64" ? "arm64" : "x86_64";
2416
1215
  const name = `bazel-${version}-${platform}-${arch}`;
2417
- const binary = path8.join(os2.homedir(), ".peach", "cache", "bazel", name);
2418
- if (fs4.existsSync(binary)) return binary;
1216
+ const binary = path.join(os.homedir(), ".peach", "cache", "bazel", name);
1217
+ if (fs.existsSync(binary)) return binary;
2419
1218
  const url = `https://github.com/bazelbuild/bazel/releases/download/${version}/${name}`;
2420
- fs4.mkdirSync(path8.dirname(binary), { recursive: true });
1219
+ fs.mkdirSync(path.dirname(binary), { recursive: true });
2421
1220
  const partial = `${binary}.${process.pid}.partial`;
2422
- execFileSync3("curl", ["-fsSL", "-o", partial, url]);
2423
- const expected = execFileSync3("curl", ["-fsSL", `${url}.sha256`], {
1221
+ execFileSync("curl", ["-fsSL", "-o", partial, url]);
1222
+ const expected = execFileSync("curl", ["-fsSL", `${url}.sha256`], {
2424
1223
  encoding: "utf8"
2425
1224
  }).split(/\s/)[0];
2426
- const actual = createHash4("sha256").update(fs4.readFileSync(partial)).digest("hex");
1225
+ const actual = createHash("sha256").update(fs.readFileSync(partial)).digest("hex");
2427
1226
  if (actual !== expected) {
2428
- fs4.rmSync(partial, { force: true });
1227
+ fs.rmSync(partial, { force: true });
2429
1228
  throw new Error(`${url} digest ${actual} differs from its release ${expected}`);
2430
1229
  }
2431
- fs4.chmodSync(partial, 493);
2432
- fs4.renameSync(partial, binary);
1230
+ fs.chmodSync(partial, 493);
1231
+ fs.renameSync(partial, binary);
2433
1232
  return binary;
2434
1233
  }
2435
1234
  function parseRule(raw) {
@@ -2453,22 +1252,22 @@ function parseRule(raw) {
2453
1252
  };
2454
1253
  }
2455
1254
  function graphInputsDigest(root) {
2456
- const hash = createHash4("sha256");
1255
+ const hash = createHash("sha256");
2457
1256
  const visit = (dir) => {
2458
- for (const entry of fs4.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
1257
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
2459
1258
  if (entry.name.startsWith(".") || entry.name.startsWith("bazel-")) continue;
2460
- const full = path8.join(dir, entry.name);
1259
+ const full = path.join(dir, entry.name);
2461
1260
  if (entry.isDirectory()) visit(full);
2462
1261
  else if (/^(?:BUILD(?:\.bazel)?|MODULE\.bazel(?:\.lock)?|WORKSPACE(?:\.bazel)?|\.bazelrc|\.bazelversion)$/.test(
2463
1262
  entry.name
2464
1263
  ) || entry.name.endsWith(".bzl"))
2465
- hash.update(path8.relative(root, full)).update("\0").update(fs4.readFileSync(full));
1264
+ hash.update(path.relative(root, full)).update("\0").update(fs.readFileSync(full));
2466
1265
  }
2467
1266
  };
2468
1267
  visit(root);
2469
1268
  for (const file of [".bazelrc", ".bazelversion"])
2470
- if (fs4.existsSync(path8.join(root, file)))
2471
- hash.update(file).update(fs4.readFileSync(path8.join(root, file)));
1269
+ if (fs.existsSync(path.join(root, file)))
1270
+ hash.update(file).update(fs.readFileSync(path.join(root, file)));
2472
1271
  return hash.digest("hex");
2473
1272
  }
2474
1273
  var graphs = /* @__PURE__ */ new Map();
@@ -2488,17 +1287,17 @@ function bazelGraph(root, label, configuration) {
2488
1287
  const cached = graphs.get(key);
2489
1288
  if (cached) return cached;
2490
1289
  const flags = configurationFlags(configuration);
2491
- const digest = createHash4("sha256").update(JSON.stringify([GRAPH_FORMAT, label, flags, QUERIED_RULES])).update(graphInputsDigest(root)).digest("hex").slice(0, 24);
2492
- const file = path8.join(root, ".build", "peach-bazel", `graph-${digest}.json`);
1290
+ const digest = createHash("sha256").update(JSON.stringify([GRAPH_FORMAT, label, flags, QUERIED_RULES])).update(graphInputsDigest(root)).digest("hex").slice(0, 24);
1291
+ const file = path.join(root, ".build", "peach-bazel", `graph-${digest}.json`);
2493
1292
  const bazel = bazelBinary(root);
2494
- const run2 = (args) => execFileSync3(bazel, args, {
1293
+ const run = (args) => execFileSync(bazel, args, {
2495
1294
  cwd: root,
2496
1295
  encoding: "utf8",
2497
1296
  maxBuffer: 1 << 30,
2498
1297
  stdio: ["ignore", "pipe", "pipe"]
2499
1298
  });
2500
- if (!fs4.existsSync(file)) {
2501
- const application = run2(["query", label, "--output=streamed_jsonproto"]);
1299
+ if (!fs.existsSync(file)) {
1300
+ const application = run(["query", label, "--output=streamed_jsonproto"]);
2502
1301
  const app2 = parseRule({ target: JSON.parse(application.trim().split("\n")[0]) });
2503
1302
  if (!app2?.ruleClass.endsWith("_application"))
2504
1303
  throw new Error(
@@ -2510,19 +1309,19 @@ function bazelGraph(root, label, configuration) {
2510
1309
  const infoplists = app2.attrs.get("infoplists")?.list ?? [];
2511
1310
  const roots = [...deps, ...strings];
2512
1311
  const query = `kind("${QUERIED_RULES.join("|")}", deps(set(${roots.join(" ")})))${infoplists.length > 0 ? ` + set(${infoplists.join(" ")})` : ""}`;
2513
- const output2 = run2(["cquery", query, ...flags, "--output=jsonproto"]);
2514
- const defaults = run2([
1312
+ const output2 = run(["cquery", query, ...flags, "--output=jsonproto"]);
1313
+ const defaults = run([
2515
1314
  "cquery",
2516
1315
  query,
2517
1316
  ...flags,
2518
1317
  "--output=starlark",
2519
1318
  '--starlark:expr=str(target.label) + "\\t" + " ".join([f.short_path for f in target.files.to_list() if not f.is_source])'
2520
1319
  ]);
2521
- const info2 = run2(["info", "output_base", "execution_root"]);
2522
- const bin = run2(["cquery", deps[0], ...flags, "--output=files"]).split("\n").find((line) => line.includes("/bin/"));
1320
+ const info2 = run(["info", "output_base", "execution_root"]);
1321
+ const bin = run(["cquery", deps[0], ...flags, "--output=files"]).split("\n").find((line) => line.includes("/bin/"));
2523
1322
  if (!bin) throw new Error(`bazel cquery names no output for ${deps[0]}`);
2524
- fs4.mkdirSync(path8.dirname(file), { recursive: true });
2525
- fs4.writeFileSync(
1323
+ fs.mkdirSync(path.dirname(file), { recursive: true });
1324
+ fs.writeFileSync(
2526
1325
  `${file}.partial`,
2527
1326
  JSON.stringify({
2528
1327
  application,
@@ -2532,9 +1331,9 @@ function bazelGraph(root, label, configuration) {
2532
1331
  bin: bin.slice(0, bin.indexOf("/bin/") + 4)
2533
1332
  })
2534
1333
  );
2535
- fs4.renameSync(`${file}.partial`, file);
1334
+ fs.renameSync(`${file}.partial`, file);
2536
1335
  }
2537
- const stored = JSON.parse(fs4.readFileSync(file, "utf8"));
1336
+ const stored = JSON.parse(fs.readFileSync(file, "utf8"));
2538
1337
  if (!isRecord(stored) || typeof stored.application !== "string" || typeof stored.cquery !== "string" || typeof stored.defaults !== "string" || typeof stored.info !== "string" || typeof stored.bin !== "string")
2539
1338
  throw new Error(`${file} is not a bazel graph`);
2540
1339
  const app = parseRule({
@@ -2575,8 +1374,8 @@ function bazelGraph(root, label, configuration) {
2575
1374
  app,
2576
1375
  appDeps,
2577
1376
  outputBase: info.output_base ?? "",
2578
- outputs: path8.join(info.execution_root ?? "", stored.bin),
2579
- bin: path8.join(root, ".build", "peach-bazel", "bin"),
1377
+ outputs: path.join(info.execution_root ?? "", stored.bin),
1378
+ bin: path.join(root, ".build", "peach-bazel", "bin"),
2580
1379
  minimumOS: app.attrs.get("minimum_os_version")?.value || null
2581
1380
  };
2582
1381
  graphs.set(key, graph);
@@ -2604,25 +1403,25 @@ var BazelFiles = class {
2604
1403
  }
2605
1404
  repoDir(repo) {
2606
1405
  if (repo === "") return this.root;
2607
- const external = path8.join(this.graph.outputBase, "external");
1406
+ const external = path.join(this.graph.outputBase, "external");
2608
1407
  for (const name of [repo, `${repo}+`])
2609
- if (fs4.existsSync(path8.join(external, name))) return path8.join(external, name);
1408
+ if (fs.existsSync(path.join(external, name))) return path.join(external, name);
2610
1409
  throw new Error(`bazel external repository ${repo} is not fetched`);
2611
1410
  }
2612
1411
  /** the package directory in the source tree, or under bazel-bin for outputs. */
2613
1412
  packageDirs(label) {
2614
1413
  const { repo, pkg } = splitLabel(label);
2615
- const source = path8.join(this.repoDir(repo), pkg);
2616
- const bin = repo ? path8.join(this.graph.bin, "external", path8.basename(this.repoDir(repo)), pkg) : path8.join(this.graph.bin, pkg);
1414
+ const source = path.join(this.repoDir(repo), pkg);
1415
+ const bin = repo ? path.join(this.graph.bin, "external", path.basename(this.repoDir(repo)), pkg) : path.join(this.graph.bin, pkg);
2617
1416
  return [source, bin];
2618
1417
  }
2619
1418
  path(label) {
2620
1419
  const { repo, pkg, name } = splitLabel(label);
2621
1420
  if (this.generated.has(label)) {
2622
1421
  const [, bin] = this.packageDirs(label);
2623
- return path8.join(bin, name);
1422
+ return path.join(bin, name);
2624
1423
  }
2625
- return path8.join(this.repoDir(repo), pkg, name);
1424
+ return path.join(this.repoDir(repo), pkg, name);
2626
1425
  }
2627
1426
  /** files a label list names: filegroups, aliases and rule outputs expanded. */
2628
1427
  expand(labels, from) {
@@ -2652,9 +1451,9 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options =
2652
1451
  throw new Error(
2653
1452
  `${buildFile}: pass --target with the ios_application the bazel package builds`
2654
1453
  );
2655
- const root = fs4.realpathSync.native(workspaceRoot(fs4.realpathSync.native(buildFile)));
2656
- const pkg = path8.relative(root, path8.dirname(fs4.realpathSync.native(buildFile)));
2657
- const label = `//${pkg.split(path8.sep).join("/")}:${targetName}`;
1454
+ const root = fs.realpathSync.native(workspaceRoot(fs.realpathSync.native(buildFile)));
1455
+ const pkg = path.relative(root, path.dirname(fs.realpathSync.native(buildFile)));
1456
+ const label = `//${pkg.split(path.sep).join("/")}:${targetName}`;
2658
1457
  const configuration = configurationName ?? "Debug";
2659
1458
  const graph = bazelGraph(root, label, configuration);
2660
1459
  const files = new BazelFiles(graph, root);
@@ -2686,7 +1485,7 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options =
2686
1485
  if (known) return known;
2687
1486
  const own = {
2688
1487
  includes: (rule.attrs.get("includes")?.list ?? []).flatMap(
2689
- (include) => files.packageDirs(rule.label).map((dir) => path8.normalize(path8.join(dir, include)))
1488
+ (include) => files.packageDirs(rule.label).map((dir) => path.normalize(path.join(dir, include)))
2690
1489
  ),
2691
1490
  defines: rule.attrs.get("defines")?.list ?? [],
2692
1491
  moduleMaps: ["objc_library", "cc_library"].includes(rule.ruleClass) ? [moduleMapOf(rule)] : []
@@ -2711,11 +1510,11 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options =
2711
1510
  return result;
2712
1511
  };
2713
1512
  const debug = configuration !== "Release";
2714
- const products = path8.join(root, PRODUCTS);
1513
+ const products = path.join(root, PRODUCTS);
2715
1514
  const resources = [];
2716
1515
  const resourceNames = {};
2717
1516
  const moduleNameOf = (rule) => rule.attrs.get("module_name")?.value || splitLabel(rule.label).pkg.concat("_", splitLabel(rule.label).name).replace(/[^A-Za-z0-9_]/g, "_");
2718
- const moduleMapOf = (rule) => path8.join(products, "modulemaps", moduleNameOf(rule), "module.modulemap");
1517
+ const moduleMapOf = (rule) => path.join(products, "modulemaps", moduleNameOf(rule), "module.modulemap");
2719
1518
  const idOf = (rule) => `${root}/BUILD#${rule.label}`;
2720
1519
  const collectData = (rule) => {
2721
1520
  for (const raw of rule.attrs.get("data")?.list ?? []) {
@@ -2727,7 +1526,7 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options =
2727
1526
  target.label
2728
1527
  )) {
2729
1528
  resources.push(file);
2730
- resourceNames[file] = path8.posix.join(bundle, path8.basename(file));
1529
+ resourceNames[file] = path.posix.join(bundle, path.basename(file));
2731
1530
  }
2732
1531
  continue;
2733
1532
  }
@@ -2829,14 +1628,14 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options =
2829
1628
  );
2830
1629
  const text2 = `module ${moduleName} {
2831
1630
  ${published.map(
2832
- (file) => ` ${textual.has(file) ? "textual header" : "header"} "${path8.relative(path8.dirname(moduleMap), file)}"
1631
+ (file) => ` ${textual.has(file) ? "textual header" : "header"} "${path.relative(path.dirname(moduleMap), file)}"
2833
1632
  `
2834
1633
  ).join("")} export *
2835
1634
  }
2836
1635
  `;
2837
- fs4.mkdirSync(path8.dirname(moduleMap), { recursive: true });
2838
- if (!fs4.existsSync(moduleMap) || fs4.readFileSync(moduleMap, "utf8") !== text2)
2839
- fs4.writeFileSync(moduleMap, text2);
1636
+ fs.mkdirSync(path.dirname(moduleMap), { recursive: true });
1637
+ if (!fs.existsSync(moduleMap) || fs.readFileSync(moduleMap, "utf8") !== text2)
1638
+ fs.writeFileSync(moduleMap, text2);
2840
1639
  const clangDefines = [...debug ? ["DEBUG=1"] : [], ...defines].map(
2841
1640
  (define) => `-D${define}`
2842
1641
  );
@@ -2907,7 +1706,7 @@ ${published.map(
2907
1706
  const bundle = files.expand(dep.attrs.get("xcframework_imports")?.list ?? [], dep.label).map(
2908
1707
  (file) => file.slice(0, file.indexOf(".xcframework/") + ".xcframework".length)
2909
1708
  ).find((file) => file.endsWith(".xcframework"));
2910
- return bundle ? [[path8.basename(bundle, ".xcframework"), bundle]] : [];
1709
+ return bundle ? [[path.basename(bundle, ".xcframework"), bundle]] : [];
2911
1710
  })
2912
1711
  )
2913
1712
  ].map(([name, file]) => ({
@@ -2919,11 +1718,11 @@ ${published.map(
2919
1718
  [rule.attrs.get("crate_root")?.value ?? ""],
2920
1719
  rule.label
2921
1720
  )[0];
2922
- let dir = crateRoot ? path8.dirname(crateRoot) : root;
2923
- while (!fs4.existsSync(path8.join(dir, "Cargo.toml")) && dir.startsWith(`${root}${path8.sep}`))
2924
- dir = path8.dirname(dir);
2925
- const manifest = path8.join(dir, "Cargo.toml");
2926
- if (!fs4.existsSync(manifest))
1721
+ let dir = crateRoot ? path.dirname(crateRoot) : root;
1722
+ while (!fs.existsSync(path.join(dir, "Cargo.toml")) && dir.startsWith(`${root}${path.sep}`))
1723
+ dir = path.dirname(dir);
1724
+ const manifest = path.join(dir, "Cargo.toml");
1725
+ if (!fs.existsSync(manifest))
2927
1726
  throw new Error(`${rule.label} has no Cargo.toml around its crate root`);
2928
1727
  return { manifest, features: rule.attrs.get("crate_features")?.list ?? [] };
2929
1728
  };
@@ -2951,20 +1750,20 @@ ${published.map(
2951
1750
  ...module.allSources,
2952
1751
  ...module.objc?.headers ?? []
2953
1752
  ])
2954
- ].filter((file) => !fs4.existsSync(file));
1753
+ ].filter((file) => !fs.existsSync(file));
2955
1754
  const mirror = () => {
2956
1755
  for (const rule of graph.rules.values())
2957
1756
  for (const output2 of rule.outputs) {
2958
1757
  const target = files.path(output2);
2959
1758
  if (target.endsWith(".a")) continue;
2960
- const source = path8.join(graph.outputs, path8.relative(graph.bin, target));
2961
- if (!fs4.existsSync(source)) continue;
2962
- const from = fs4.statSync(source);
2963
- const to = fs4.existsSync(target) ? fs4.statSync(target) : null;
1759
+ const source = path.join(graph.outputs, path.relative(graph.bin, target));
1760
+ if (!fs.existsSync(source)) continue;
1761
+ const from = fs.statSync(source);
1762
+ const to = fs.existsSync(target) ? fs.statSync(target) : null;
2964
1763
  if (to && to.mtimeMs === from.mtimeMs && to.size === from.size) continue;
2965
- fs4.rmSync(target, { recursive: true, force: true });
2966
- fs4.mkdirSync(path8.dirname(target), { recursive: true });
2967
- fs4.cpSync(source, target, {
1764
+ fs.rmSync(target, { recursive: true, force: true });
1765
+ fs.mkdirSync(path.dirname(target), { recursive: true });
1766
+ fs.cpSync(source, target, {
2968
1767
  recursive: true,
2969
1768
  dereference: true,
2970
1769
  preserveTimestamps: true
@@ -2980,7 +1779,7 @@ ${published.map(
2980
1779
  ...new Set(absent().flatMap((file) => owners.get(file) ?? []))
2981
1780
  ].sort();
2982
1781
  if (generators.length > 0)
2983
- execFileSync3(
1782
+ execFileSync(
2984
1783
  bazelBinary(root),
2985
1784
  ["build", ...configurationFlags(configuration), ...generators],
2986
1785
  { cwd: root, stdio: ["ignore", "pipe", "pipe"], maxBuffer: 1 << 28 }
@@ -2990,7 +1789,7 @@ ${published.map(
2990
1789
  const missing = options.requireSources === false ? [] : absent();
2991
1790
  if (missing.length > 0)
2992
1791
  throw new Error(
2993
- `bazel application has ${missing.length} unbuilt inputs: ${missing.slice(0, 5).map((file) => path8.relative(root, file)).join(", ")}`
1792
+ `bazel application has ${missing.length} unbuilt inputs: ${missing.slice(0, 5).map((file) => path.relative(root, file)).join(", ")}`
2994
1793
  );
2995
1794
  const archives = /* @__PURE__ */ new Map();
2996
1795
  for (const rule of order) {
@@ -3014,7 +1813,7 @@ ${published.map(
3014
1813
  );
3015
1814
  const key = owner?.label ?? label2;
3016
1815
  const entry = archives.get(key) ?? {
3017
- library: path8.basename(archive),
1816
+ library: path.basename(archive),
3018
1817
  holders: []
3019
1818
  };
3020
1819
  if (!entry.holders.includes(rule)) entry.holders.push(rule);
@@ -3027,9 +1826,9 @@ ${published.map(
3027
1826
  (module) => [
3028
1827
  ...module.allSources.filter((file) => !file.endsWith(".swift")),
3029
1828
  ...module.objc?.headers ?? []
3030
- ].filter((file) => fs4.existsSync(file)).flatMap(
1829
+ ].filter((file) => fs.existsSync(file)).flatMap(
3031
1830
  (file) => [
3032
- ...fs4.readFileSync(file, "utf8").matchAll(/^\s*#\s*(?:include|import)\s*[<"]([^>"\n]+)[>"]/gm)
1831
+ ...fs.readFileSync(file, "utf8").matchAll(/^\s*#\s*(?:include|import)\s*[<"]([^>"\n]+)[>"]/gm)
3033
1832
  ].map((match) => match[1])
3034
1833
  )
3035
1834
  )
@@ -3047,10 +1846,10 @@ ${published.map(
3047
1846
  ],
3048
1847
  rule.label
3049
1848
  ).filter((file) => /\.(?:h|hh|hpp|hxx|inc)$/.test(file)).map((file) => {
3050
- const include = includes.find((dir) => file.startsWith(`${dir}${path8.sep}`));
1849
+ const include = includes.find((dir) => file.startsWith(`${dir}${path.sep}`));
3051
1850
  return {
3052
1851
  file,
3053
- name: include ? path8.relative(include, file) : path8.basename(file)
1852
+ name: include ? path.relative(include, file) : path.basename(file)
3054
1853
  };
3055
1854
  });
3056
1855
  });
@@ -3063,12 +1862,12 @@ ${published.map(
3063
1862
  (include) => header.name === include || header.name.endsWith(`/${include}`)
3064
1863
  )
3065
1864
  );
3066
- const bundle = path8.join(products, "archives", `${name}.xcframework`);
3067
- const slice = path8.join(bundle, "ios-arm64-simulator");
1865
+ const bundle = path.join(products, "archives", `${name}.xcframework`);
1866
+ const slice = path.join(bundle, "ios-arm64-simulator");
3068
1867
  const contents = new Map([
3069
1868
  [
3070
1869
  "Info.plist",
3071
- plist2.build({
1870
+ import_plist.default.build({
3072
1871
  AvailableLibraries: [
3073
1872
  {
3074
1873
  LibraryIdentifier: "ios-arm64-simulator",
@@ -3085,7 +1884,7 @@ ${published.map(
3085
1884
  ],
3086
1885
  // c library headers may lean on the standard ones their callers include first
3087
1886
  [
3088
- path8.join("ios-arm64-simulator", "Headers", `${name}.h`),
1887
+ path.join("ios-arm64-simulator", "Headers", `${name}.h`),
3089
1888
  [
3090
1889
  "#include <stddef.h>",
3091
1890
  "#include <stdio.h>",
@@ -3093,7 +1892,7 @@ ${published.map(
3093
1892
  ].join("\n") + "\n"
3094
1893
  ],
3095
1894
  [
3096
- path8.join("ios-arm64-simulator", "Headers", "module.modulemap"),
1895
+ path.join("ios-arm64-simulator", "Headers", "module.modulemap"),
3097
1896
  `module ${name} {
3098
1897
  header "${name}.h"
3099
1898
  export *
@@ -3102,28 +1901,28 @@ ${published.map(
3102
1901
  ],
3103
1902
  ...headers.map(
3104
1903
  (header) => [
3105
- path8.join("ios-arm64-simulator", "Headers", header.name),
3106
- fs4.readFileSync(header.file)
1904
+ path.join("ios-arm64-simulator", "Headers", header.name),
1905
+ fs.readFileSync(header.file)
3107
1906
  ]
3108
1907
  )
3109
1908
  ]);
3110
- const digest = createHash4("sha256").update(
1909
+ const digest = createHash("sha256").update(
3111
1910
  JSON.stringify(
3112
1911
  [...contents].map(([file, bytes]) => [
3113
1912
  file,
3114
- createHash4("sha256").update(bytes).digest("hex")
1913
+ createHash("sha256").update(bytes).digest("hex")
3115
1914
  ])
3116
1915
  )
3117
1916
  ).digest("hex");
3118
- const stamp = path8.join(bundle, ".peach-digest");
3119
- if (!fs4.existsSync(stamp) || fs4.readFileSync(stamp, "utf8") !== digest) {
3120
- fs4.rmSync(bundle, { recursive: true, force: true });
1917
+ const stamp = path.join(bundle, ".peach-digest");
1918
+ if (!fs.existsSync(stamp) || fs.readFileSync(stamp, "utf8") !== digest) {
1919
+ fs.rmSync(bundle, { recursive: true, force: true });
3121
1920
  for (const [file, bytes] of contents) {
3122
- fs4.mkdirSync(path8.dirname(path8.join(bundle, file)), { recursive: true });
3123
- fs4.writeFileSync(path8.join(bundle, file), bytes);
1921
+ fs.mkdirSync(path.dirname(path.join(bundle, file)), { recursive: true });
1922
+ fs.writeFileSync(path.join(bundle, file), bytes);
3124
1923
  }
3125
- fs4.writeFileSync(path8.join(slice, library), "");
3126
- fs4.writeFileSync(stamp, digest);
1924
+ fs.writeFileSync(path.join(slice, library), "");
1925
+ fs.writeFileSync(stamp, digest);
3127
1926
  }
3128
1927
  binaryFrameworks.push({ name, path: bundle, rustCrate });
3129
1928
  }
@@ -3145,10 +1944,10 @@ ${published.map(
3145
1944
  ) : Array.isArray(value) ? value.map(substitute) : value && typeof value === "object" && !(value instanceof Date) && !Buffer.isBuffer(value) ? Object.fromEntries(
3146
1945
  Object.entries(value).map(([key, item]) => [key, substitute(item)])
3147
1946
  ) : value;
3148
- const infoPlistReady = infoPlistFiles.every((file) => fs4.existsSync(file));
1947
+ const infoPlistReady = infoPlistFiles.every((file) => fs.existsSync(file));
3149
1948
  const info = {};
3150
1949
  for (const file of infoPlistReady ? infoPlistFiles : []) {
3151
- const fragment = plist2.parse(fs4.readFileSync(file, "utf8"));
1950
+ const fragment = import_plist.default.parse(fs.readFileSync(file, "utf8"));
3152
1951
  if (!fragment || typeof fragment !== "object" || Array.isArray(fragment) || fragment instanceof Date || Buffer.isBuffer(fragment))
3153
1952
  throw new Error(`${file} is not a plist dictionary`);
3154
1953
  for (const [key, value] of Object.entries(fragment)) {
@@ -3172,9 +1971,9 @@ ${published.map(
3172
1971
  });
3173
1972
  const buildFiles = [
3174
1973
  ...new Set(
3175
- order.map((rule) => path8.join(files.packageDirs(rule.label)[0], "BUILD"))
1974
+ order.map((rule) => path.join(files.packageDirs(rule.label)[0], "BUILD"))
3176
1975
  )
3177
- ].map((file) => fs4.existsSync(file) ? file : `${file}.bazel`).filter((file) => fs4.existsSync(file));
1976
+ ].map((file) => fs.existsSync(file) ? file : `${file}.bazel`).filter((file) => fs.existsSync(file));
3178
1977
  return {
3179
1978
  ...appModule,
3180
1979
  resources: [...new Set(resources)],
@@ -3217,7 +2016,7 @@ ${published.map(
3217
2016
  rootDir: root,
3218
2017
  projectFiles: buildFiles.sort(),
3219
2018
  projectDirs: [root],
3220
- infoPlist: infoPlistReady ? plist2.build(info) : null,
2019
+ infoPlist: infoPlistReady ? import_plist.default.build(info) : null,
3221
2020
  infoPlistFile: null,
3222
2021
  postBundleScripts: [],
3223
2022
  appIconName: "",
@@ -3563,26 +2362,26 @@ var ios_sdk_frameworks_default = {
3563
2362
  };
3564
2363
 
3565
2364
  // src/prepared-xcode-phases.ts
3566
- import { createHash as createHash5 } from "node:crypto";
3567
- import fs5 from "node:fs";
3568
- import path9 from "node:path";
2365
+ import { createHash as createHash2 } from "node:crypto";
2366
+ import fs2 from "node:fs";
2367
+ import path2 from "node:path";
3569
2368
  var workspaces = /* @__PURE__ */ new Map();
3570
2369
  var recording;
3571
2370
  function relativeFile(root, file) {
3572
- const relative2 = path9.relative(root, file);
3573
- if (!relative2 || relative2 === ".." || relative2.startsWith(`..${path9.sep}`) || path9.isAbsolute(relative2))
2371
+ const relative2 = path2.relative(root, file);
2372
+ if (!relative2 || relative2 === ".." || relative2.startsWith(`..${path2.sep}`) || path2.isAbsolute(relative2))
3574
2373
  throw new Error(`prepared Xcode output is outside its workspace: ${file}`);
3575
- return relative2.split(path9.sep).join("/");
2374
+ return relative2.split(path2.sep).join("/");
3576
2375
  }
3577
2376
  function output(root, file) {
3578
2377
  const relative2 = relativeFile(root, file);
3579
- const stat = fs5.statSync(file, { throwIfNoEntry: false });
2378
+ const stat = fs2.statSync(file, { throwIfNoEntry: false });
3580
2379
  if (!stat) return { path: relative2, sha256: null };
3581
2380
  if (!stat.isFile()) throw new Error(`prepared Xcode output is not a file: ${file}`);
3582
- relativeFile(root, fs5.realpathSync(file));
3583
- const bytes = fs5.readFileSync(file);
2381
+ relativeFile(root, fs2.realpathSync(file));
2382
+ const bytes = fs2.readFileSync(file);
3584
2383
  const prefix = Buffer.from(root);
3585
- const hash = createHash5("sha256");
2384
+ const hash = createHash2("sha256");
3586
2385
  let offset = 0;
3587
2386
  for (let index = bytes.indexOf(prefix); index !== -1; index = bytes.indexOf(prefix, offset)) {
3588
2387
  hash.update(bytes.subarray(offset, index)).update("\0workspace\0");
@@ -3596,8 +2395,8 @@ function output(root, file) {
3596
2395
  }
3597
2396
  function preparedXcodePhase(project, target, phase, configuration, outputs, recorded) {
3598
2397
  const root = recording?.root ?? [...workspaces.keys()].find((root2) => {
3599
- const relative2 = path9.relative(root2, project);
3600
- return relative2 !== ".." && !relative2.startsWith(`..${path9.sep}`) && !path9.isAbsolute(relative2);
2398
+ const relative2 = path2.relative(root2, project);
2399
+ return relative2 !== ".." && !relative2.startsWith(`..${path2.sep}`) && !path2.isAbsolute(relative2);
3601
2400
  });
3602
2401
  if (!root) return false;
3603
2402
  const entry = {
@@ -3632,30 +2431,10 @@ function preparedXcodePhase(project, target, phase, configuration, outputs, reco
3632
2431
  }
3633
2432
 
3634
2433
  // src/swift-binary-modules.ts
3635
- import { createHash as createHash6 } from "node:crypto";
3636
- import fs7 from "node:fs";
3637
- import path11 from "node:path";
3638
-
3639
- // src/home-paths.ts
3640
- import { randomUUID } from "node:crypto";
3641
- import fs6 from "node:fs";
3642
- import { homedir } from "node:os";
3643
- import path10 from "node:path";
3644
- var PEACH_HOME_ENV = "PEACH_HOME";
3645
- function ambientHomeDir() {
3646
- return path10.join(homedir(), ".peach");
3647
- }
3648
- function rnxHomeDir() {
3649
- const override = process.env[PEACH_HOME_ENV];
3650
- return override && override.length > 0 ? path10.resolve(override) : ambientHomeDir();
3651
- }
3652
- function cacheDir() {
3653
- return path10.join(rnxHomeDir(), "cache");
3654
- }
3655
- var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
3656
-
3657
- // src/swift-binary-modules.ts
3658
- var cacheDir2 = path11.join(cacheDir(), "swift-binary-modules");
2434
+ import { createHash as createHash3 } from "node:crypto";
2435
+ import fs3 from "node:fs";
2436
+ import path3 from "node:path";
2437
+ var cacheDir2 = path3.join(cacheDir(), "swift-binary-modules");
3659
2438
  function frameworkModules(paths) {
3660
2439
  const modules = /* @__PURE__ */ new Set();
3661
2440
  for (const file of paths) {
@@ -3665,21 +2444,21 @@ function frameworkModules(paths) {
3665
2444
  return [...modules].sort();
3666
2445
  }
3667
2446
  function localSwiftBinaryModules(dir) {
3668
- if (!fs7.existsSync(dir)) return [];
3669
- const slices = fs7.readdirSync(dir, { withFileTypes: true }).filter((slice) => slice.isDirectory());
2447
+ if (!fs3.existsSync(dir)) return [];
2448
+ const slices = fs3.readdirSync(dir, { withFileTypes: true }).filter((slice) => slice.isDirectory());
3670
2449
  const frameworks = frameworkModules(
3671
2450
  slices.flatMap(
3672
- (slice) => fs7.readdirSync(path11.join(dir, slice.name)).map((entry) => `${slice.name}/${entry}`)
2451
+ (slice) => fs3.readdirSync(path3.join(dir, slice.name)).map((entry) => `${slice.name}/${entry}`)
3673
2452
  )
3674
2453
  );
3675
2454
  if (frameworks.length > 0) return frameworks;
3676
2455
  const modules = /* @__PURE__ */ new Set();
3677
2456
  for (const slice of slices) {
3678
- const headers = path11.join(dir, slice.name, "Headers");
3679
- if (!fs7.existsSync(headers)) continue;
3680
- for (const file of fs7.readdirSync(headers, { recursive: true, encoding: "utf8" })) {
3681
- if (path11.basename(file) !== "module.modulemap") continue;
3682
- const module = moduleMapName(fs7.readFileSync(path11.join(headers, file), "utf8"));
2457
+ const headers = path3.join(dir, slice.name, "Headers");
2458
+ if (!fs3.existsSync(headers)) continue;
2459
+ for (const file of fs3.readdirSync(headers, { recursive: true, encoding: "utf8" })) {
2460
+ if (path3.basename(file) !== "module.modulemap") continue;
2461
+ const module = moduleMapName(fs3.readFileSync(path3.join(headers, file), "utf8"));
3683
2462
  if (module) modules.add(module);
3684
2463
  }
3685
2464
  }
@@ -3687,18 +2466,18 @@ function localSwiftBinaryModules(dir) {
3687
2466
  }
3688
2467
 
3689
2468
  // src/swift-coverage/xcode-assets.ts
3690
- import { createHash as createHash8 } from "node:crypto";
3691
- import { readFileSync as readFileSync5, readdirSync as readdirSync3, statSync, writeFileSync as writeFileSync2 } from "node:fs";
2469
+ import { createHash as createHash5 } from "node:crypto";
2470
+ import { readFileSync as readFileSync3, readdirSync as readdirSync2, statSync, writeFileSync } from "node:fs";
3692
2471
  import { join as join3, relative, sep } from "node:path";
3693
2472
 
3694
2473
  // src/swift-coverage/provenance.ts
3695
- import { createHash as createHash7 } from "node:crypto";
3696
- import { readFileSync as readFileSync3 } from "node:fs";
2474
+ import { createHash as createHash4 } from "node:crypto";
2475
+ import { readFileSync } from "node:fs";
3697
2476
  import { join } from "node:path";
3698
- var swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"a19fe4c5e2efe18bbc3ece544ff2c8be660170d63274cccb0ab58e53083050e4","swift-package.ts":"851417572ca9aff699ad368bdc3ff05309b0256e483d40812b9c0beb869d0a5b","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"a0ef7c20a2bc2b7dbd98b9006a8b000b9b4f9708f1bcf0adad8aaf79ef253022","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"4a775ba92c7b23ce71dd6bb08c188c4bccd6e1ed500cc9fc7850030b945fc8d4","xcode-project.ts":"fea47e1e076b2cca23c8ac9037eced1d094e69d206df09c393979a5bd1d07a8a","xcode-target-members.ts":"2f25aaf5a3aa34395983c75935491c06bd68554c47ff1cb06b49c79499c03db0","xcode-json-project.ts":"41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6","openstep-plist.ts":"74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3"}') : swiftCoverageSourceDigests(join(import.meta.dirname, ".."));
2477
+ var swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"a19fe4c5e2efe18bbc3ece544ff2c8be660170d63274cccb0ab58e53083050e4","swift-package.ts":"851417572ca9aff699ad368bdc3ff05309b0256e483d40812b9c0beb869d0a5b","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"a0ef7c20a2bc2b7dbd98b9006a8b000b9b4f9708f1bcf0adad8aaf79ef253022","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"4a775ba92c7b23ce71dd6bb08c188c4bccd6e1ed500cc9fc7850030b945fc8d4","xcode-project.ts":"1eea444b8005e33de0a9987f184b183ba3fd49ab8af347a893383ec2e464cf4d","xcode-target-members.ts":"2f25aaf5a3aa34395983c75935491c06bd68554c47ff1cb06b49c79499c03db0","xcode-json-project.ts":"41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6","openstep-plist.ts":"74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3"}') : swiftCoverageSourceDigests(join(import.meta.dirname, ".."));
3699
2478
 
3700
2479
  // src/swift-coverage/xcode-asset-symbols.ts
3701
- import { existsSync as existsSync2, readdirSync as readdirSync2, readFileSync as readFileSync4 } from "node:fs";
2480
+ import { existsSync, readdirSync, readFileSync as readFileSync2 } from "node:fs";
3702
2481
  import { extname, join as join2 } from "node:path";
3703
2482
  var silentTypes = /* @__PURE__ */ new Set([
3704
2483
  "appiconset",
@@ -3882,14 +2661,14 @@ var assetSymbolSettingKeys = [
3882
2661
 
3883
2662
  // src/swift-package-manifest.ts
3884
2663
  import {
3885
- execFile as execFile4,
3886
- execFileSync as execFileSync14
2664
+ execFile,
2665
+ execFileSync as execFileSync2
3887
2666
  } from "node:child_process";
3888
- import { createHash as createHash22 } from "node:crypto";
3889
- import fs17 from "node:fs";
3890
- import os8 from "node:os";
3891
- import path37 from "node:path";
3892
- import { promisify as promisify4 } from "node:util";
2667
+ import { createHash as createHash7 } from "node:crypto";
2668
+ import fs6 from "node:fs";
2669
+ import os3 from "node:os";
2670
+ import path7 from "node:path";
2671
+ import { promisify } from "node:util";
3893
2672
 
3894
2673
  // src/git-repo-env.ts
3895
2674
  var UNATTENDED_GIT_ENV = {
@@ -3898,612 +2677,24 @@ var UNATTENDED_GIT_ENV = {
3898
2677
  };
3899
2678
 
3900
2679
  // src/swift-distribution.ts
3901
- import fs16 from "node:fs";
3902
- import os7 from "node:os";
3903
- import path36 from "node:path";
3904
-
3905
- // ../contrast-runtime-delivery/src/index.ts
3906
- import { spawn as spawn3 } from "node:child_process";
3907
- import crypto from "node:crypto";
3908
- import fs9 from "node:fs";
3909
- import os3 from "node:os";
3910
- import path13 from "node:path";
3911
- import { pipeline as pipeline2 } from "node:stream/promises";
3912
- import zlib2 from "node:zlib";
3913
-
3914
- // src/process-group.ts
3915
- import { spawn as spawn2, spawnSync as spawnSync4 } from "node:child_process";
3916
- import {
3917
- appendFileSync,
3918
- mkdtempSync,
3919
- readdirSync as readdirSync5,
3920
- readFileSync as readFileSync7,
3921
- rmSync,
3922
- writeFileSync as writeFileSync3
3923
- } from "node:fs";
3924
- import { tmpdir } from "node:os";
3925
- import { join as join4 } from "node:path";
3926
- import { Duplex } from "node:stream";
3927
- import { setTimeout as sleep } from "node:timers/promises";
3928
-
3929
- // src/process-table.ts
3930
- import { spawnSync as spawnSync3 } from "node:child_process";
3931
- import { readFileSync as readFileSync6, readdirSync as readdirSync4 } from "node:fs";
3932
- import { endianness } from "node:os";
3933
-
3934
- // ../contrast-runtime-delivery/src/product.ts
3935
- import fs8 from "node:fs";
3936
- import path12 from "node:path";
2680
+ import fs5 from "node:fs";
2681
+ import os2 from "node:os";
2682
+ import path6 from "node:path";
3937
2683
 
3938
2684
  // cli/drivers/linux-browser-libs.ts
3939
- import { spawnSync as spawnSync5 } from "node:child_process";
3940
- import { existsSync as existsSync3 } from "node:fs";
3941
- import { join as join5 } from "node:path";
3942
-
3943
- // src/swift-compile.ts
3944
- import {
3945
- spawn as spawn5,
3946
- execFileSync as execFileSync13
3947
- } from "node:child_process";
3948
- import { createHash as createHash20, randomUUID as randomUUID5 } from "node:crypto";
3949
- import {
3950
- chmodSync as chmodSync3,
3951
- copyFileSync,
3952
- cpSync,
3953
- existsSync as existsSync9,
3954
- lstatSync,
3955
- mkdirSync as mkdirSync8,
3956
- mkdtempSync as mkdtempSync4,
3957
- readFileSync as readFileSync21,
3958
- readdirSync as readdirSync10,
3959
- readlinkSync,
3960
- realpathSync as realpathSync6,
3961
- renameSync as renameSync3,
3962
- rmSync as rmSync8,
3963
- statSync as statSync4,
3964
- symlinkSync as symlinkSync2,
3965
- utimesSync,
3966
- writeFileSync as writeFileSync10
3967
- } from "node:fs";
3968
- import os6 from "node:os";
3969
- import path33 from "node:path";
3970
- import * as v5 from "valibot";
3971
-
3972
- // src/admitted-mac-build.ts
3973
- import { spawnSync as spawnSync6 } from "node:child_process";
3974
-
3975
- // src/retired-cache-directory.ts
3976
- import { randomUUID as randomUUID2 } from "node:crypto";
3977
- import { renameSync } from "node:fs";
3978
- import { rm } from "node:fs/promises";
3979
- import path14 from "node:path";
3980
-
3981
- // src/process-liveness.ts
3982
- import { readFileSync as readFileSync8 } from "node:fs";
3983
-
3984
- // src/swift-compiler-digest.ts
3985
- import { createHash as createHash9 } from "node:crypto";
3986
- import { readFileSync as readFileSync9 } from "node:fs";
3987
- import path15 from "node:path";
3988
-
3989
- // src/swift-darwin-records.ts
3990
- import { execFileSync as execFileSync5 } from "node:child_process";
3991
- import { mkdtempSync as mkdtempSync2, readdirSync as readdirSync7, rmSync as rmSync2, symlinkSync } from "node:fs";
3992
- import { tmpdir as tmpdir2 } from "node:os";
3993
- import path17 from "node:path";
3994
-
3995
- // src/swift-shared-sdk.ts
3996
- import { execFileSync as execFileSync4 } from "node:child_process";
3997
- import { createHash as createHash10 } from "node:crypto";
3998
- import fs10, { readdirSync as readdirSync6, readFileSync as readFileSync10 } from "node:fs";
3999
- import path16 from "node:path";
4000
-
4001
- // src/swift-guest-compile.ts
4002
- import { execFileSync as execFileSync10 } from "node:child_process";
4003
- import { mkdirSync as mkdirSync4, readFileSync as readFileSync16, writeFileSync as writeFileSync7 } from "node:fs";
4004
- import path24 from "node:path";
4005
-
4006
- // src/swift-guest-archive.ts
4007
- import { execFileSync as execFileSync7 } from "node:child_process";
4008
- import { createHash as createHash12 } from "node:crypto";
4009
- import { mkdirSync as mkdirSync2, readFileSync as readFileSync11, rmSync as rmSync3, writeFileSync as writeFileSync4 } from "node:fs";
4010
- import path19 from "node:path";
4011
-
4012
- // src/swift-wasm-prune.ts
4013
- import { execFileSync as execFileSync6 } from "node:child_process";
4014
- import { createHash as createHash11 } from "node:crypto";
4015
- import fs11 from "node:fs";
4016
- import path18 from "node:path";
4017
- import * as v2 from "valibot";
4018
-
4019
- // src/swiftRuntimeProductContract.ts
4020
- import * as v from "valibot";
4021
- var swiftFrameworkProductSchema = v.object({
4022
- version: v.literal(1),
4023
- packageName: v.string(),
4024
- manifestSha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
4025
- product: v.object({
4026
- name: v.string(),
4027
- linkage: v.picklist(["static", "dynamic", "automatic"]),
4028
- targets: v.array(v.string())
4029
- }),
4030
- // framework names are distinct from SDK library linkNames. they identify
4031
- // the packaged owner, not an observed native image dependency.
4032
- frameworkAliases: v.array(
4033
- v.object({
4034
- kind: v.literal("framework"),
4035
- name: v.string(),
4036
- targets: v.array(v.string()),
4037
- moduleMap: v.string(),
4038
- moduleMapSha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
4039
- wasmSdkId: v.string(),
4040
- wasmSdkChecksum: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/))
4041
- })
4042
- ),
4043
- targets: v.array(
4044
- v.object({
4045
- name: v.string(),
4046
- path: v.string(),
4047
- kind: v.picklist(["regular", "system"]),
4048
- dependencies: v.array(v.string())
4049
- })
4050
- ),
4051
- objects: v.array(v.object({ path: v.string(), target: v.string() })),
4052
- autolink: v.array(v.string())
4053
- });
4054
- var swiftSdkProductSchema = v.pipe(
4055
- v.object({
4056
- id: v.string(),
4057
- installName: v.string(),
4058
- target: v.literal("wasm64-unknown-wasip1"),
4059
- linkNames: v.array(v.string()),
4060
- // absent records declare no framework namespace, even when a library name matches.
4061
- frameworkAliases: v.optional(
4062
- v.array(
4063
- v.object({
4064
- name: v.string(),
4065
- moduleMap: v.string(),
4066
- moduleMapSha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/))
4067
- })
4068
- ),
4069
- []
4070
- ),
4071
- buildDependencies: v.array(v.string()),
4072
- linkOwnership: v.picklist(["image", "containing-image"]),
4073
- linkDependencies: v.nullable(v.array(v.string())),
4074
- autolink: v.array(v.string()),
4075
- sources: v.array(
4076
- v.object({
4077
- path: v.string(),
4078
- sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/))
4079
- })
4080
- ),
4081
- artifacts: v.array(
4082
- v.variant("kind", [
4083
- v.object({
4084
- kind: v.literal("archive"),
4085
- path: v.string(),
4086
- sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
4087
- members: v.array(
4088
- v.object({
4089
- name: v.string(),
4090
- ordinal: v.pipe(v.number(), v.integer(), v.minValue(1)),
4091
- sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
4092
- sources: v.array(v.string())
4093
- })
4094
- )
4095
- }),
4096
- v.object({
4097
- kind: v.literal("object"),
4098
- path: v.string(),
4099
- sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)),
4100
- sources: v.array(v.string()),
4101
- input: v.optional(
4102
- v.object({
4103
- product: v.string(),
4104
- artifact: v.object({
4105
- path: v.string(),
4106
- sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/))
4107
- }),
4108
- member: v.optional(
4109
- v.object({
4110
- name: v.string(),
4111
- ordinal: v.pipe(v.number(), v.integer(), v.minValue(1)),
4112
- sha256: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/))
4113
- })
4114
- )
4115
- })
4116
- )
4117
- })
4118
- ])
4119
- )
4120
- }),
4121
- v.check(
4122
- (product) => product.linkOwnership === "image" || product.linkDependencies === null,
4123
- "containing-image products cannot declare an image scope"
4124
- )
4125
- );
4126
- var swiftSdkProductsSchema = v.object({
4127
- version: v.literal(1),
4128
- products: v.array(swiftSdkProductSchema)
4129
- });
4130
-
4131
- // src/swift-wasm-prune.ts
4132
- var PRUNED_SDK_ARCHIVES = /* @__PURE__ */ new Set([
4133
- "libFoundation",
4134
- "lib_FoundationCollections",
4135
- "libswift_StringProcessing",
4136
- "libswift_RegexParser",
4137
- "libswiftObservation",
4138
- "libswiftSynchronization",
4139
- "libswiftCxx",
4140
- "libswiftCxxStdlib",
4141
- "libswiftWASILibc",
4142
- "libswift_Builtin_float",
4143
- "libObjectiveC"
4144
- ]);
4145
- var OMIT_SDK_LIB_FLAGS = /* @__PURE__ */ new Set([
4146
- ...[...PRUNED_SDK_ARCHIVES].map((a) => `-l${a.slice(3)}`),
4147
- "-lswiftCore",
4148
- "-lswift_Concurrency"
4149
- ]);
4150
- var SWIFTUI_WRAPPER_HOST_PROTOCOLS = new Set(
4151
- [
4152
- "View",
4153
- "ViewModifier",
4154
- "App",
4155
- "Scene",
4156
- "Gesture",
4157
- "ToolbarContent",
4158
- "Commands",
4159
- "DynamicProperty"
4160
- ].map((name) => `$s7SwiftUI${name.length}${name}Mp`)
4161
- );
4162
-
4163
- // src/swift-guest-link.ts
4164
- import { execFileSync as execFileSync8 } from "node:child_process";
4165
- import fs12 from "node:fs";
4166
- import path22 from "node:path";
4167
- import { StringDecoder } from "node:string_decoder";
4168
-
4169
- // src/swift-guest-manifest.ts
4170
- import { createHash as createHash13 } from "node:crypto";
4171
- import { readFileSync as readFileSync12 } from "node:fs";
4172
-
4173
- // src/swift-guest-projection-storage.ts
4174
- var maxProjectionRegions = 1 << 20;
4175
-
4176
- // src/swift-guest-runtime-plan.ts
4177
- import { createHash as createHash15 } from "node:crypto";
4178
- import { readFileSync as readFileSync13, realpathSync } from "node:fs";
4179
- import path21 from "node:path";
4180
- import * as v4 from "valibot";
4181
-
4182
- // src/swift-guest-source-plan.ts
4183
- import path20 from "node:path";
4184
-
4185
- // src/swift-runtime-products.ts
4186
- import { createHash as createHash14 } from "node:crypto";
4187
- import * as v3 from "valibot";
4188
- var packageSchema = v3.object({
4189
- name: v3.string(),
4190
- products: v3.array(
4191
- v3.object({
4192
- name: v3.string(),
4193
- targets: v3.array(v3.string()),
4194
- type: v3.unknown()
4195
- })
4196
- ),
4197
- targets: v3.array(
4198
- v3.object({
4199
- name: v3.string(),
4200
- type: v3.string(),
4201
- path: v3.optional(v3.string()),
4202
- dependencies: v3.array(v3.unknown())
4203
- })
4204
- )
4205
- });
4206
-
4207
- // src/swift-guest-source-inputs.ts
4208
- import { execFileSync as execFileSync9 } from "node:child_process";
4209
- import { createHash as createHash16 } from "node:crypto";
4210
- import { mkdirSync as mkdirSync3, readFileSync as readFileSync14, realpathSync as realpathSync2, writeFileSync as writeFileSync5 } from "node:fs";
4211
- import path23 from "node:path";
4212
-
4213
- // src/wasm-optimize.ts
4214
- import { execFile as execFile2 } from "node:child_process";
4215
- import { existsSync as existsSync4, readFileSync as readFileSync15, rmSync as rmSync4, writeFileSync as writeFileSync6 } from "node:fs";
4216
- import { dirname, join as join6 } from "node:path";
4217
- import { promisify as promisify2 } from "node:util";
4218
-
4219
- // src/binaryen.lock.json
4220
- var binaryen_lock_default = {
4221
- version: "132",
4222
- licenseSha256: "64c0d02491e16eced74826440ecd2bcf7722d37fa586faf457b2494293afbffe",
4223
- platforms: {
4224
- "linux-x64": {
4225
- asset: "x86_64-linux",
4226
- upstreamSha256: "195ddc94f9bc89f45abdabb0b9eea86023d727ba90eac8b35b80f2544fc30572",
4227
- sha256: "0396b1a540e9f97f30eb6a378d829305c218c821a0bd88c74e83d3d6923dad0b"
4228
- },
4229
- "linux-arm64": {
4230
- asset: "aarch64-linux",
4231
- upstreamSha256: "c58562417836c5d0493d89bdefc434933bdc097db641b483df86bcfa557a107f",
4232
- sha256: "25e3747f19614b0281a28b9a909ddc602b546ccdfacebc8cae2f7165665328fa"
4233
- },
4234
- "darwin-arm64": {
4235
- asset: "arm64-macos",
4236
- upstreamSha256: "98aad827847af7ef990ed7098d885725c8e5b5aae75073403635617ae4e259aa",
4237
- sha256: "34281566fe32df71337aaf0b60aa265dc853587d92bda0b5b1fac8aed8c2f8ab"
4238
- }
4239
- }
4240
- };
4241
-
4242
- // src/wasm-optimize.ts
4243
- var FEATURES = [
4244
- "memory64",
4245
- "threads",
4246
- "bulk-memory",
4247
- "bulk-memory-opt",
4248
- "call-indirect-overlong",
4249
- "exception-handling",
4250
- "multivalue",
4251
- "mutable-globals",
4252
- "nontrapping-float-to-int",
4253
- "reference-types",
4254
- "sign-ext"
4255
- ];
4256
- var KEEP_WASM_NAMES = process.env.PEACH_SWIFT_NAMES === "1";
4257
- var LOWERING = ["--memory64-lowering", "--table64-lowering"];
4258
- var BINARYEN_VERSION = binaryen_lock_default.version;
4259
- var runBinaryen = promisify2(execFile2);
4260
- var WASM_LOWER_IDENTITY = `binaryen ${BINARYEN_VERSION} narrow ${LOWERING.join(" ")} ${FEATURES.join(",")} unoptimized-names`;
4261
- var BINARYEN_RELEASES = new Map(Object.entries(binaryen_lock_default.platforms));
4262
-
4263
- // src/swift-header-compiler.ts
4264
- import { createHash as createHash17 } from "node:crypto";
4265
- import {
4266
- chmodSync,
4267
- existsSync as existsSync5,
4268
- mkdirSync as mkdirSync5,
4269
- mkdtempSync as mkdtempSync3,
4270
- readFileSync as readFileSync17,
4271
- renameSync as renameSync2,
4272
- rmSync as rmSync5,
4273
- statSync as statSync2,
4274
- writeFileSync as writeFileSync8
4275
- } from "node:fs";
4276
- import { createServer } from "node:http";
4277
- import path25 from "node:path";
4278
-
4279
- // src/swift-header-dependencies.ts
4280
- import path26 from "node:path";
4281
-
4282
- // src/swift-icu.ts
4283
- import { execFile as execFile3 } from "node:child_process";
4284
- import { createHash as createHash18, randomUUID as randomUUID3 } from "node:crypto";
4285
- import { existsSync as existsSync6, readFileSync as readFileSync18 } from "node:fs";
4286
- import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
4287
- import os4 from "node:os";
4288
- import path27 from "node:path";
4289
- import { promisify as promisify3 } from "node:util";
4290
- import {
4291
- brotliCompress,
4292
- constants as zlibConstants,
4293
- deflateRawSync,
4294
- gunzip,
4295
- gzip
4296
- } from "node:zlib";
4297
-
4298
- // ../sootsim-swift/src/icuData.ts
4299
- var PACK_BYTES = 64 * 1024;
4300
- var VERSION = 1;
4301
- var SWIFT_ICU_PACKED = `picu${VERSION}`;
4302
-
4303
- // src/swift-icu.ts
4304
- var run = promisify3(execFile3);
4305
- var deflate = promisify3(gzip);
4306
- var compressBrotli = promisify3(brotliCompress);
4307
- var inflateGzip = promisify3(gunzip);
4308
-
4309
- // src/swift-link-roots.ts
4310
- import fs13 from "node:fs";
4311
- import path28 from "node:path";
4312
-
4313
- // src/swift-project-user.ts
4314
- import { execFileSync as execFileSync11 } from "node:child_process";
4315
- import {
4316
- chmodSync as chmodSync2,
4317
- existsSync as existsSync7,
4318
- mkdirSync as mkdirSync6,
4319
- readdirSync as readdirSync8,
4320
- readFileSync as readFileSync19,
4321
- realpathSync as realpathSync3,
4322
- rmSync as rmSync6,
4323
- statSync as statSync3
4324
- } from "node:fs";
4325
- import path29 from "node:path";
4326
-
4327
- // src/swift-reproducible.ts
4328
- import { realpathSync as realpathSync4 } from "node:fs";
4329
- import os5 from "node:os";
4330
-
4331
- // src/swift-root-lock.ts
4332
- import {
4333
- spawn as spawn4
4334
- } from "node:child_process";
4335
- import { createHash as createHash19, randomUUID as randomUUID4 } from "node:crypto";
4336
- import {
4337
- existsSync as existsSync8,
4338
- linkSync,
4339
- mkdirSync as mkdirSync7,
4340
- readdirSync as readdirSync9,
4341
- readFileSync as readFileSync20,
4342
- realpathSync as realpathSync5,
4343
- rmSync as rmSync7,
4344
- writeFileSync as writeFileSync9
4345
- } from "node:fs";
4346
- import { homedir as homedir2 } from "node:os";
4347
- import path30 from "node:path";
4348
-
4349
- // src/swift-uniform-type-constants.ts
4350
- import { execFileSync as execFileSync12 } from "node:child_process";
4351
- import path31 from "node:path";
4352
-
4353
- // src/xcode-header-search.ts
4354
- import fs14 from "node:fs";
4355
- import path32 from "node:path";
4356
-
4357
- // src/swift-compile.ts
4358
- var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
4359
- PDFKit: [],
4360
- CFNetwork: ["PeachCFNetwork"],
4361
- PeachCFNetwork: [],
4362
- JavaScriptCore: ["PeachJavaScriptCore"],
4363
- PeachJavaScriptCore: [],
4364
- // GameplayKit names SpriteKit and SceneKit nodes, as on iOS
4365
- GameplayKit: ["SpriteKit", "SceneKit", "PeachBox2D", "simd", "GLKit"],
4366
- simd: [],
4367
- ModelIO: ["simd"],
4368
- GLKit: ["ModelIO"],
4369
- Accelerate: [],
4370
- CryptoTokenKit: [],
4371
- CommonCrypto: [],
4372
- ImagePlayground: [],
4373
- QuickLook: ["QuickLookThumbnailing"],
4374
- QuickLookThumbnailing: [],
4375
- libxml2: [],
4376
- Compression: [],
4377
- zlib: [],
4378
- TikTokBusinessSDK: [],
4379
- nSure: [],
4380
- Statsig: [],
4381
- TOCropViewController: [],
4382
- RiveRuntime: ["MetalKit"],
4383
- MetalKit: ["ModelIO"],
4384
- DatadogInternal: [],
4385
- // Kronos resolves hosts with CFHost, which iOS Foundation re-exports without an import
4386
- DatadogCore: ["DatadogInternal", "CFNetwork"],
4387
- DatadogLogs: ["DatadogCore"],
4388
- DatadogRUM: ["DatadogCore"],
4389
- DatadogTrace: ["DatadogCore"],
4390
- DatadogCrashReporting: ["DatadogCore"],
4391
- Amplitude: [],
4392
- AppLovinSDK: [],
4393
- AppsFlyerLib: [],
4394
- FBSDKCoreKit: ["FBAEMKit", "FBSDKCoreKit_Basics"],
4395
- FBAEMKit: ["FBSDKCoreKit_Basics"],
4396
- FBSDKCoreKit_Basics: [],
4397
- Intercom: [],
4398
- FirebaseCore: [],
4399
- FirebaseSharedSwift: ["FirebaseCore"],
4400
- FirebaseRemoteConfig: ["FirebaseCore", "FirebaseSharedSwift"],
4401
- FirebaseFirestoreInternal: ["FirebaseCore"],
4402
- FirebaseAnalytics: ["FirebaseCore"],
4403
- FirebaseAppCheck: ["FirebaseCore"],
4404
- FirebaseAuth: ["FirebaseCore"],
4405
- FirebaseCrashlytics: ["FirebaseCore"],
4406
- FirebaseFirestore: ["FirebaseCore", "FirebaseSharedSwift", "FirebaseFirestoreInternal"],
4407
- FirebaseStorage: ["FirebaseCore"],
4408
- Firebase: [
4409
- "FirebaseCore",
4410
- "FirebaseAnalytics",
4411
- "FirebaseAppCheck",
4412
- "FirebaseAuth",
4413
- "FirebaseCrashlytics",
4414
- "FirebaseFirestore",
4415
- "FirebaseRemoteConfig",
4416
- "FirebaseStorage"
4417
- ],
4418
- GoogleMobileAds: [],
4419
- FBAudienceNetwork: [],
4420
- ExpoModulesCore: []
4421
- };
4422
- var OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES));
4423
- var FOUNDATION_IMPLICIT_MODULES = [
4424
- "PeachObjC",
4425
- "Dispatch",
4426
- "FoundationNetworking",
4427
- "PeachFoundationCombine",
4428
- "Darwin"
4429
- ];
4430
- var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
4431
- (module) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module}"`
4432
- ).join("");
4433
- var compilerSourceDigest = true ? "4a6e02699924195639b15c5cdfd8852b5f17fb2ffacb8f9f964ef3daeee8b9dc" : swiftCompilerSourceDigest(import.meta.dirname);
4434
- var C_WORDS = new Set(
4435
- "auto bool break case char const continue default do double else enum extern false float for goto if inline int long register restrict return short signed sizeof static struct switch true typedef union unsigned void volatile while YES NO NULL nil Nil id self super instancetype".split(
4436
- " "
4437
- )
4438
- );
4439
- var CORE_FOUNDATION_HANDLE_IMPORTS = [
4440
- "CFAllocator",
4441
- "CFArray",
4442
- "CFAttributedString",
4443
- "CFBoolean",
4444
- "CFData",
4445
- "CFDate",
4446
- "CFDictionary",
4447
- "CFError",
4448
- "CFMutableData",
4449
- "CFNumber",
4450
- "CFSet",
4451
- "CFString",
4452
- "CFURL"
4453
- ].map((name) => `import class CoreFoundation.${name}`).concat([
4454
- "import typealias CoreFoundation.CFPropertyList",
4455
- "import typealias CoreFoundation.CFTypeRef",
4456
- "import CoreGraphics"
4457
- ]).join("; ");
4458
- var emptyMacroEnvironment = {
4459
- defines: /* @__PURE__ */ new Map(),
4460
- predefines: /* @__PURE__ */ new Map(),
4461
- targetDefined: /* @__PURE__ */ new Set()
4462
- };
4463
- var wasmMacroEnvironment = {
4464
- ...emptyMacroEnvironment,
4465
- defines: /* @__PURE__ */ new Map([
4466
- ["__wasm__", "1"],
4467
- ["__wasm64__", "1"],
4468
- ["__wasi__", "1"]
4469
- ])
4470
- };
4471
- var ROOT_LOCKS = Symbol.for("peachsim.swiftCompile.rootLocks");
4472
- var host = globalThis;
4473
- var rootLocks = host[ROOT_LOCKS] ?? (host[ROOT_LOCKS] = /* @__PURE__ */ new Map());
4474
- var SHARED_ARTIFACT_BUDGET_BYTES = 4 * 1024 ** 3;
2685
+ import { spawnSync } from "node:child_process";
2686
+ import { existsSync as existsSync2 } from "node:fs";
2687
+ import { join as join4 } from "node:path";
4475
2688
 
4476
2689
  // src/answeredNativePackages.ts
4477
2690
  import { AsyncLocalStorage } from "node:async_hooks";
4478
- import { readFileSync as readFileSync22 } from "node:fs";
4479
- import { join as join7 } from "node:path";
4480
-
4481
- // src/launchMetadataContract.ts
4482
- var LAUNCH_METADATA_KEYS_PATH = "node/launch-metadata-keys.json";
4483
- var LAUNCH_METADATA_KEYS = [
4484
- "appFonts",
4485
- "appSplash",
4486
- "appCatalog",
4487
- "appBundleResources",
4488
- "nativeAppIdentity",
4489
- "nativeFirebase",
4490
- "expoSwift",
4491
- "expoWidgets",
4492
- "expoKotlin",
4493
- "nitro",
4494
- "turbo",
4495
- "widgetExtension",
4496
- "appManifest",
4497
- "packageVersions",
4498
- "dotEnv",
4499
- "env"
4500
- ];
4501
- var LAUNCH_METADATA_KEYS_BEFORE_RUNTIME_STATED_THEM = LAUNCH_METADATA_KEYS.filter((key) => key !== "widgetExtension");
2691
+ import { readFileSync as readFileSync4 } from "node:fs";
2692
+ import { join as join5 } from "node:path";
4502
2693
 
4503
2694
  // src/runtime-assets.ts
4504
- import fs15 from "fs";
4505
- import path34 from "path";
4506
- import { fileURLToPath as fileURLToPath2 } from "url";
2695
+ import fs4 from "fs";
2696
+ import path4 from "path";
2697
+ import { fileURLToPath } from "url";
4507
2698
 
4508
2699
  // src/answeredNativePackages.ts
4509
2700
  var runtimeLaunchMetadataKeysFile = {
@@ -4515,17 +2706,17 @@ var unansweredStore = new AsyncLocalStorage();
4515
2706
  var answeredStore = new AsyncLocalStorage();
4516
2707
 
4517
2708
  // src/nitroAdapterContract.ts
4518
- import { createHash as createHash21 } from "node:crypto";
4519
- import { readdirSync as readdirSync11, readFileSync as readFileSync23 } from "node:fs";
4520
- import path35 from "node:path";
2709
+ import { createHash as createHash6 } from "node:crypto";
2710
+ import { readdirSync as readdirSync3, readFileSync as readFileSync5 } from "node:fs";
2711
+ import path5 from "node:path";
4521
2712
 
4522
2713
  // src/swift-package-manifest.ts
4523
- var cacheDir3 = path37.join(cacheDir(), "swift-manifests");
4524
- var execFileAsync = promisify4(execFile4);
2714
+ var cacheDir3 = path7.join(cacheDir(), "swift-manifests");
2715
+ var execFileAsync = promisify(execFile);
4525
2716
 
4526
2717
  // src/xcode-json-project.ts
4527
2718
  var import_json5 = __toESM(require_lib(), 1);
4528
- import path38 from "node:path";
2719
+ import path8 from "node:path";
4529
2720
  var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4530
2721
  var text = (value) => typeof value === "string" ? value : void 0;
4531
2722
  var items = (value) => Array.isArray(value) ? value : [];
@@ -4582,7 +2773,7 @@ var PHASE_ISA = {
4582
2773
  function readXcodeJsonProject(xcodeproj, source) {
4583
2774
  const json = import_json5.default.parse(source);
4584
2775
  if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
4585
- const projectDir = path38.dirname(xcodeproj);
2776
+ const projectDir = path8.dirname(xcodeproj);
4586
2777
  const objects = {};
4587
2778
  let next = 0;
4588
2779
  const add = (entry, id) => {
@@ -4595,7 +2786,7 @@ function readXcodeJsonProject(xcodeproj, source) {
4595
2786
  const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
4596
2787
  if (base) {
4597
2788
  if (base[1] === "PROJECT")
4598
- return { sourceTree: "<absolute>", path: path38.join(projectDir, base[2]) };
2789
+ return { sourceTree: "<absolute>", path: path8.join(projectDir, base[2]) };
4599
2790
  if (base[1] === "PRODUCTS")
4600
2791
  return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
4601
2792
  return null;
@@ -4603,7 +2794,7 @@ function readXcodeJsonProject(xcodeproj, source) {
4603
2794
  const unescaped = raw.replaceAll("\\<", "<");
4604
2795
  if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
4605
2796
  if (unescaped.startsWith("~")) return null;
4606
- return groupDir === null ? null : { sourceTree: "<absolute>", path: path38.join(groupDir, unescaped) };
2797
+ return groupDir === null ? null : { sourceTree: "<absolute>", path: path8.join(groupDir, unescaped) };
4607
2798
  };
4608
2799
  const memberships = [];
4609
2800
  const folders = [];
@@ -4614,7 +2805,7 @@ function readXcodeJsonProject(xcodeproj, source) {
4614
2805
  const kind = text(entry.kind) ?? "file-reference";
4615
2806
  const raw = text(entry.path) ?? "";
4616
2807
  const located = raw === "" ? null : locate(raw, parent.dir);
4617
- const name = text(entry.name) ?? path38.basename(raw);
2808
+ const name = text(entry.name) ?? path8.basename(raw);
4618
2809
  const node = { id: "", name, dir: null, parent, children: [] };
4619
2810
  if (kind === "group" || kind === "variant-group" || kind === "version-group") {
4620
2811
  node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
@@ -4735,7 +2926,7 @@ function readXcodeJsonProject(xcodeproj, source) {
4735
2926
  if (!isObject(entry)) continue;
4736
2927
  const repository = text(entry.repository);
4737
2928
  const local = text(entry.path);
4738
- const name = local !== void 0 ? path38.basename(path38.resolve(path38.dirname(xcodeproj), local)) : path38.basename(repository ?? "").replace(/\.git$/, "");
2929
+ const name = local !== void 0 ? path8.basename(path8.resolve(path8.dirname(xcodeproj), local)) : path8.basename(repository ?? "").replace(/\.git$/, "");
4739
2930
  const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
4740
2931
  isa: "XCRemoteSwiftPackageReference",
4741
2932
  repositoryURL: repository ?? "",
@@ -4956,28 +3147,28 @@ var CONDITIONS = {
4956
3147
  variant: "normal"
4957
3148
  };
4958
3149
  function walkFiles(dir) {
4959
- if (!fs18.existsSync(dir)) return [];
3150
+ if (!fs7.existsSync(dir)) return [];
4960
3151
  const out = [];
4961
- for (const entry of fs18.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
3152
+ for (const entry of fs7.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
4962
3153
  if (entry.name.startsWith(".")) continue;
4963
- const full = path39.join(dir, entry.name);
3154
+ const full = path9.join(dir, entry.name);
4964
3155
  if (entry.isDirectory()) out.push(...walkFiles(full));
4965
3156
  else if (entry.isFile()) out.push(full);
4966
3157
  }
4967
3158
  return out;
4968
3159
  }
4969
- var isDirectory = (dir) => fs18.existsSync(dir) && fs18.statSync(dir).isDirectory();
3160
+ var isDirectory = (dir) => fs7.existsSync(dir) && fs7.statSync(dir).isDirectory();
4970
3161
  function readXcconfig(file, read) {
4971
- if (read.includes(file) || !fs18.existsSync(file)) return {};
3162
+ if (read.includes(file) || !fs7.existsSync(file)) return {};
4972
3163
  read.push(file);
4973
3164
  const settings = {};
4974
- for (const raw of fs18.readFileSync(file, "utf8").split("\n")) {
3165
+ for (const raw of fs7.readFileSync(file, "utf8").split("\n")) {
4975
3166
  const line = raw.replace(/\/\/.*$/, "").trim();
4976
3167
  const include = /^#include\??\s+"([^"]+)"/.exec(line);
4977
3168
  if (include) {
4978
3169
  Object.assign(
4979
3170
  settings,
4980
- readXcconfig(path39.resolve(path39.dirname(file), include[1]), read)
3171
+ readXcconfig(path9.resolve(path9.dirname(file), include[1]), read)
4981
3172
  );
4982
3173
  continue;
4983
3174
  }
@@ -5022,8 +3213,8 @@ function applyOperator(value, operator) {
5022
3213
  return value.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
5023
3214
  case "standardizepath":
5024
3215
  if (value === ".") return value;
5025
- if (path39.posix.isAbsolute(value))
5026
- return path39.posix.normalize(value).replace(/(?<=.)\/$/, "");
3216
+ if (path9.posix.isAbsolute(value))
3217
+ return path9.posix.normalize(value).replace(/(?<=.)\/$/, "");
5027
3218
  return value.split("/").filter((component) => component !== "" && component !== ".").join("/");
5028
3219
  }
5029
3220
  throw new Error(`unsupported build setting operator :${operator}`);
@@ -5032,22 +3223,22 @@ function decodeXml(text2) {
5032
3223
  return text2.replaceAll("&quot;", '"').replaceAll("&apos;", "'").replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&");
5033
3224
  }
5034
3225
  function workspaceReferences(workspace) {
5035
- const data = path39.join(workspace, "contents.xcworkspacedata");
5036
- if (!fs18.existsSync(data))
3226
+ const data = path9.join(workspace, "contents.xcworkspacedata");
3227
+ if (!fs7.existsSync(data))
5037
3228
  throw new Error(`${workspace} has no contents.xcworkspacedata`);
5038
- const container = path39.dirname(workspace);
3229
+ const container = path9.dirname(workspace);
5039
3230
  const locate = (location, base) => {
5040
3231
  const colon = location.indexOf(":");
5041
3232
  const kind = location.slice(0, colon);
5042
3233
  const rest = location.slice(colon + 1);
5043
- if (kind === "group") return path39.resolve(base, rest);
5044
- if (kind === "container" || kind === "self") return path39.resolve(container, rest);
5045
- if (kind === "absolute") return path39.resolve(rest);
5046
- throw new Error(`${path39.basename(workspace)} has an unsupported location ${location}`);
3234
+ if (kind === "group") return path9.resolve(base, rest);
3235
+ if (kind === "container" || kind === "self") return path9.resolve(container, rest);
3236
+ if (kind === "absolute") return path9.resolve(rest);
3237
+ throw new Error(`${path9.basename(workspace)} has an unsupported location ${location}`);
5047
3238
  };
5048
3239
  const groups = [container];
5049
3240
  const references = [];
5050
- for (const [, closing, tag, attributes, selfClosing] of fs18.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
3241
+ for (const [, closing, tag, attributes, selfClosing] of fs7.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
5051
3242
  if (closing) {
5052
3243
  if (tag === "Group") groups.pop();
5053
3244
  continue;
@@ -5098,8 +3289,8 @@ function remotePackageRequirements(projects) {
5098
3289
  var loaded = /* @__PURE__ */ new Map();
5099
3290
  function xcodeProjectFile(xcodeproj) {
5100
3291
  for (const name of ["project.pbxproj", "project.xcproj"]) {
5101
- const file = path39.join(xcodeproj, name);
5102
- if (fs18.existsSync(file)) return file;
3292
+ const file = path9.join(xcodeproj, name);
3293
+ if (fs7.existsSync(file)) return file;
5103
3294
  }
5104
3295
  return null;
5105
3296
  }
@@ -5107,8 +3298,8 @@ function loadProject(xcodeproj) {
5107
3298
  const projectFile = xcodeProjectFile(xcodeproj);
5108
3299
  if (!projectFile)
5109
3300
  throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
5110
- const source = fs18.readFileSync(projectFile, "utf8");
5111
- const digest = createHash23("sha256").update(source).digest("hex");
3301
+ const source = fs7.readFileSync(projectFile, "utf8");
3302
+ const digest = createHash8("sha256").update(source).digest("hex");
5112
3303
  const cached = loaded.get(projectFile);
5113
3304
  if (cached?.digest === digest) return cached.project;
5114
3305
  const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
@@ -5116,25 +3307,25 @@ function loadProject(xcodeproj) {
5116
3307
  throw new Error(`${projectFile} has no objects table`);
5117
3308
  }
5118
3309
  const objects = root.objects;
5119
- const object3 = (id) => {
3310
+ const object = (id) => {
5120
3311
  const found = id === void 0 ? void 0 : objects[id];
5121
3312
  return isDict(found) ? found : void 0;
5122
3313
  };
5123
- const project = object3(str(root.rootObject));
3314
+ const project = object(str(root.rootObject));
5124
3315
  if (!project || project.isa !== "PBXProject") {
5125
3316
  throw new Error(`${projectFile} has no PBXProject root`);
5126
3317
  }
5127
- const projectDir = fs18.realpathSync.native(
5128
- path39.resolve(path39.dirname(xcodeproj), str(project.projectDirPath) ?? "")
3318
+ const projectDir = fs7.realpathSync.native(
3319
+ path9.resolve(path9.dirname(xcodeproj), str(project.projectDirPath) ?? "")
5129
3320
  );
5130
- const resolvePath = xcodePathResolver(objects, projectDir, path39.join);
3321
+ const resolvePath = xcodePathResolver(objects, projectDir, path9.join);
5131
3322
  const result = {
5132
3323
  xcodeproj,
5133
3324
  projectFile,
5134
3325
  objects,
5135
3326
  project,
5136
3327
  projectDir,
5137
- object: object3,
3328
+ object,
5138
3329
  resolvePath,
5139
3330
  visitMembers: xcodeTargetMemberVisitor(objects)
5140
3331
  };
@@ -5145,7 +3336,7 @@ var developerDir;
5145
3336
  function selectedDeveloperDir() {
5146
3337
  developerDir ?? (developerDir = process.platform === "darwin" ? (
5147
3338
  // runner-toolchain-platform: darwin
5148
- execFileSync15("xcode-select", ["-p"], {
3339
+ execFileSync3("xcode-select", ["-p"], {
5149
3340
  encoding: "utf8",
5150
3341
  stdio: ["ignore", "pipe", "pipe"]
5151
3342
  }).trim()
@@ -5175,8 +3366,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
5175
3366
  const relative2 = str(config.baseConfigurationReferenceRelativePath);
5176
3367
  const own = isDict(config.buildSettings) ? config.buildSettings : {};
5177
3368
  const directory = anchor ? project.resolvePath(anchor) : null;
5178
- const baseFile = base ? project.resolvePath(base) : directory && relative2 ? path39.resolve(directory, relative2) : null;
5179
- if (options.requireSources !== false && (base || anchor || relative2) && (!baseFile || !fs18.existsSync(baseFile)))
3369
+ const baseFile = base ? project.resolvePath(base) : directory && relative2 ? path9.resolve(directory, relative2) : null;
3370
+ if (options.requireSources !== false && (base || anchor || relative2) && (!baseFile || !fs7.existsSync(baseFile)))
5180
3371
  throw new Error(
5181
3372
  `Unable to open base configuration reference file '${baseFile ?? base ?? relative2 ?? anchor}'`
5182
3373
  );
@@ -5267,26 +3458,26 @@ function scriptCommand(shell, script) {
5267
3458
  return [executable, ...args, "-c", script];
5268
3459
  }
5269
3460
  function expandSearchPath(directory, rules2) {
5270
- if (path39.basename(directory) !== "**") return [directory];
3461
+ if (path9.basename(directory) !== "**") return [directory];
5271
3462
  const expanded = [];
5272
3463
  const seen = /* @__PURE__ */ new Set();
5273
- const queue = [path39.dirname(directory)];
3464
+ const queue = [path9.dirname(directory)];
5274
3465
  for (let at = 0; at < queue.length; at++) {
5275
3466
  const current = queue[at];
5276
3467
  let real;
5277
3468
  try {
5278
- real = fs18.realpathSync.native(current);
3469
+ real = fs7.realpathSync.native(current);
5279
3470
  } catch {
5280
3471
  continue;
5281
3472
  }
5282
- if (!fs18.statSync(real).isDirectory() || seen.has(real)) continue;
3473
+ if (!fs7.statSync(real).isDirectory() || seen.has(real)) continue;
5283
3474
  seen.add(real);
5284
3475
  expanded.push(current);
5285
- for (const entry of fs18.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
3476
+ for (const entry of fs7.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
5286
3477
  if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
5287
3478
  if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
5288
3479
  continue;
5289
- queue.push(path39.join(current, entry.name));
3480
+ queue.push(path9.join(current, entry.name));
5290
3481
  }
5291
3482
  }
5292
3483
  return expanded;
@@ -5377,7 +3568,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
5377
3568
  for (const token of tokens) {
5378
3569
  if (token.startsWith("-")) break;
5379
3570
  const file = resolve(token);
5380
- if (file?.endsWith(".xcassets")) catalogs.push(path39.resolve(projectDir, file));
3571
+ if (file?.endsWith(".xcassets")) catalogs.push(path9.resolve(projectDir, file));
5381
3572
  }
5382
3573
  }
5383
3574
  return catalogs;
@@ -5422,14 +3613,14 @@ function shellCopies(script, settings, projectDir) {
5422
3613
  if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
5423
3614
  return [];
5424
3615
  copies.push({
5425
- from: path39.resolve(projectDir, operands[0]),
5426
- to: path39.resolve(projectDir, operands[1])
3616
+ from: path9.resolve(projectDir, operands[0]),
3617
+ to: path9.resolve(projectDir, operands[1])
5427
3618
  });
5428
3619
  }
5429
3620
  return copies;
5430
3621
  }
5431
3622
  function fileListEntries(file, absolute) {
5432
- return fs18.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
3623
+ return fs7.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
5433
3624
  }
5434
3625
  function targetMembers(ref, settings, options, settingKeys, projectInputs) {
5435
3626
  const { project, target, id: targetId } = ref;
@@ -5443,7 +3634,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
5443
3634
  const copiedFiles = [];
5444
3635
  let generatedInfoPlist = false;
5445
3636
  const declaredInfoPlist = settings("INFOPLIST_FILE");
5446
- const infoPlistOutput = declaredInfoPlist ? path39.resolve(project.projectDir, declaredInfoPlist) : null;
3637
+ const infoPlistOutput = declaredInfoPlist ? path9.resolve(project.projectDir, declaredInfoPlist) : null;
5447
3638
  const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
5448
3639
  for (const phaseId of list(target.buildPhases)) {
5449
3640
  const phase = project.object(phaseId);
@@ -5458,7 +3649,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
5458
3649
  copiedFiles.push(
5459
3650
  ...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
5460
3651
  );
5461
- const absolute = (raw) => path39.resolve(project.projectDir, expand(raw, settings));
3652
+ const absolute = (raw) => path9.resolve(project.projectDir, expand(raw, settings));
5462
3653
  const inputs = list(phase.inputPaths).map(absolute);
5463
3654
  const outputs = list(phase.outputPaths).map(absolute);
5464
3655
  const fileLists = /* @__PURE__ */ new Map();
@@ -5467,7 +3658,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
5467
3658
  kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
5468
3659
  ).map((raw) => {
5469
3660
  const file = absolute(raw);
5470
- if (!fs18.existsSync(file)) {
3661
+ if (!fs7.existsSync(file)) {
5471
3662
  return { file, entries: [] };
5472
3663
  }
5473
3664
  return { file, entries: fileListEntries(file, absolute) };
@@ -5488,7 +3679,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
5488
3679
  ...fileLists.get("OUTPUT").map((item) => item.file)
5489
3680
  ];
5490
3681
  if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
5491
- for (const file of inputFiles) if (fs18.existsSync(file)) projectInputs.add(file);
3682
+ for (const file of inputFiles) if (fs7.existsSync(file)) projectInputs.add(file);
5492
3683
  }
5493
3684
  if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
5494
3685
  const configuration = settings("CONFIGURATION");
@@ -5501,10 +3692,10 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
5501
3692
  false
5502
3693
  ))
5503
3694
  continue;
5504
- const phaseDir = path39.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
3695
+ const phaseDir = path9.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
5505
3696
  for (const lists of fileLists.values())
5506
3697
  for (const { file } of lists)
5507
- if (!fs18.existsSync(file))
3698
+ if (!fs7.existsSync(file))
5508
3699
  throw new Error(
5509
3700
  `${targetName}: Run Script "${script}" missing file list ${file}`
5510
3701
  );
@@ -5523,25 +3714,25 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
5523
3714
  const lists = fileLists.get(kind);
5524
3715
  env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
5525
3716
  lists.forEach((_item, index) => {
5526
- env[`SCRIPT_${kind}_FILE_LIST_${index}`] = path39.join(
3717
+ env[`SCRIPT_${kind}_FILE_LIST_${index}`] = path9.join(
5527
3718
  phaseDir,
5528
3719
  `${kind}-${index}.xcfilelist`
5529
3720
  );
5530
3721
  });
5531
3722
  }
5532
- const signature = createHash23("sha256").update(
3723
+ const signature = createHash8("sha256").update(
5533
3724
  JSON.stringify([phase, [...settingKeys].map((key2) => [key2, settings(key2)])])
5534
3725
  );
5535
3726
  for (const file of inputFiles) {
5536
3727
  signature.update(file);
5537
- if (fs18.existsSync(file)) {
5538
- const stat = fs18.statSync(file);
3728
+ if (fs7.existsSync(file)) {
3729
+ const stat = fs7.statSync(file);
5539
3730
  signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
5540
3731
  } else signature.update("missing");
5541
3732
  }
5542
3733
  const stamp = signature.digest("hex");
5543
3734
  const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
5544
- if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => fs18.existsSync(file))) {
3735
+ if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => fs7.existsSync(file))) {
5545
3736
  preparedXcodePhase(
5546
3737
  project.projectFile,
5547
3738
  targetId,
@@ -5552,14 +3743,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
5552
3743
  );
5553
3744
  continue;
5554
3745
  }
5555
- fs18.mkdirSync(phaseDir, { recursive: true });
5556
- fs18.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
5557
- fs18.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
3746
+ fs7.mkdirSync(phaseDir, { recursive: true });
3747
+ fs7.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
3748
+ fs7.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
5558
3749
  for (const output2 of allOutputs)
5559
- fs18.mkdirSync(path39.dirname(output2), { recursive: true });
3750
+ fs7.mkdirSync(path9.dirname(output2), { recursive: true });
5560
3751
  for (const [kind, lists] of fileLists)
5561
3752
  lists.forEach((item, index) => {
5562
- fs18.writeFileSync(
3753
+ fs7.writeFileSync(
5563
3754
  env[`SCRIPT_${kind}_FILE_LIST_${index}`],
5564
3755
  `${item.entries.join("\n")}
5565
3756
  `
@@ -5567,9 +3758,9 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
5567
3758
  });
5568
3759
  const rawScript = str(phase.shellScript) ?? "";
5569
3760
  if (rawScript.includes("generate-modules-provider")) {
5570
- const preloadPath = path39.join(phaseDir, "expo-scan-timeout.cjs");
5571
- fs18.mkdirSync(phaseDir, { recursive: true });
5572
- fs18.writeFileSync(
3761
+ const preloadPath = path9.join(phaseDir, "expo-scan-timeout.cjs");
3762
+ fs7.mkdirSync(phaseDir, { recursive: true });
3763
+ fs7.writeFileSync(
5573
3764
  preloadPath,
5574
3765
  [
5575
3766
  "const cp = require('node:child_process');",
@@ -5591,7 +3782,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
5591
3782
  str(phase.shellPath) ?? "/bin/sh",
5592
3783
  rawScript
5593
3784
  );
5594
- execFileSync15(shell, args, {
3785
+ execFileSync3(shell, args, {
5595
3786
  cwd: project.projectDir,
5596
3787
  env,
5597
3788
  stdio: ["ignore", "pipe", "pipe"],
@@ -5607,7 +3798,7 @@ ${output2}`
5607
3798
  );
5608
3799
  }
5609
3800
  const missing = allOutputs.filter(
5610
- (file) => file === infoPlistOutput && !fs18.existsSync(file)
3801
+ (file) => file === infoPlistOutput && !fs7.existsSync(file)
5611
3802
  );
5612
3803
  if (missing.length > 0)
5613
3804
  throw new Error(
@@ -5626,9 +3817,9 @@ ${output2}`
5626
3817
  }
5627
3818
  project.visitMembers(
5628
3819
  targetId,
5629
- xcodePathResolver(project.objects, project.projectDir, path39.join, settings),
5630
- (file) => isDirectory(file) ? walkFiles(file) : fs18.existsSync(file) ? [file] : [],
5631
- path39.join,
3820
+ xcodePathResolver(project.objects, project.projectDir, path9.join, settings),
3821
+ (file) => isDirectory(file) ? walkFiles(file) : fs7.existsSync(file) ? [file] : [],
3822
+ path9.join,
5632
3823
  (file, kind, bundleName) => {
5633
3824
  if (kind === "header") {
5634
3825
  headers.add(file);
@@ -5639,9 +3830,9 @@ ${output2}`
5639
3830
  if (bundleName) resourceNames[file] = bundleName;
5640
3831
  return;
5641
3832
  }
5642
- if (!fs18.existsSync(file)) {
3833
+ if (!fs7.existsSync(file)) {
5643
3834
  if (options.requireSources === false) return;
5644
- const script = scriptForOutput.get(path39.normalize(file));
3835
+ const script = scriptForOutput.get(path9.normalize(file));
5645
3836
  throw new Error(
5646
3837
  script ? `${targetName}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)` : `${targetName}: missing source ${file}`
5647
3838
  );
@@ -5652,17 +3843,17 @@ ${output2}`
5652
3843
  );
5653
3844
  if (options.prepareGeneratedSources && options.requireSources !== false) {
5654
3845
  const interfaceFiles = [...resources].filter(
5655
- (file) => /\.(storyboard|xib)$/.test(file) && !file.split(path39.sep).some((part) => part.endsWith(".bundle"))
3846
+ (file) => /\.(storyboard|xib)$/.test(file) && !file.split(path9.sep).some((part) => part.endsWith(".bundle"))
5656
3847
  );
5657
3848
  if (process.platform !== "darwin") {
5658
3849
  let launchName = settings("INFOPLIST_KEY_UILaunchStoryboardName");
5659
- if (!launchName && infoPlistOutput && fs18.existsSync(infoPlistOutput)) {
5660
- const info = plist3.parse(fs18.readFileSync(infoPlistOutput, "utf8"));
3850
+ if (!launchName && infoPlistOutput && fs7.existsSync(infoPlistOutput)) {
3851
+ const info = import_plist2.default.parse(fs7.readFileSync(infoPlistOutput, "utf8"));
5661
3852
  const declared = isRecord(info) ? info.UILaunchStoryboardName : void 0;
5662
3853
  if (typeof declared === "string") launchName = expand(declared, settings);
5663
3854
  }
5664
3855
  const runtimeInterfaceFiles = interfaceFiles.filter(
5665
- (file) => path39.basename(file, path39.extname(file)) !== launchName
3856
+ (file) => path9.basename(file, path9.extname(file)) !== launchName
5666
3857
  );
5667
3858
  if (runtimeInterfaceFiles.length > 0)
5668
3859
  throw new Error(
@@ -5673,13 +3864,13 @@ ${output2}`
5673
3864
  }
5674
3865
  const interfaceOutputs = /* @__PURE__ */ new Set();
5675
3866
  for (const file of interfaceFiles) {
5676
- const localization = file.split(path39.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
3867
+ const localization = file.split(path9.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
5677
3868
  const extension = file.endsWith(".storyboard") ? ".storyboardc" : ".nib";
5678
- const output2 = path39.join(
3869
+ const output2 = path9.join(
5679
3870
  settings("DERIVED_FILE_DIR"),
5680
3871
  "InterfaceBuilder",
5681
3872
  localization,
5682
- path39.basename(file, path39.extname(file)) + extension
3873
+ path9.basename(file, path9.extname(file)) + extension
5683
3874
  );
5684
3875
  if (interfaceOutputs.has(output2))
5685
3876
  throw new Error(`${targetName}: duplicate Interface Builder output ${output2}`);
@@ -5701,18 +3892,18 @@ ${output2}`
5701
3892
  const inputs = JSON.stringify({
5702
3893
  args,
5703
3894
  developer: settings("DEVELOPER_DIR"),
5704
- source: createHash23("sha256").update(fs18.readFileSync(file)).digest("hex")
3895
+ source: createHash8("sha256").update(fs7.readFileSync(file)).digest("hex")
5705
3896
  });
5706
- if (!fs18.existsSync(output2) || !fs18.existsSync(stamp) || fs18.readFileSync(stamp, "utf8") !== inputs) {
5707
- fs18.rmSync(output2, { recursive: true, force: true });
5708
- fs18.rmSync(stamp, { force: true });
5709
- fs18.mkdirSync(path39.dirname(output2), { recursive: true });
5710
- execFileSync15("xcrun", args, {
3897
+ if (!fs7.existsSync(output2) || !fs7.existsSync(stamp) || fs7.readFileSync(stamp, "utf8") !== inputs) {
3898
+ fs7.rmSync(output2, { recursive: true, force: true });
3899
+ fs7.rmSync(stamp, { force: true });
3900
+ fs7.mkdirSync(path9.dirname(output2), { recursive: true });
3901
+ execFileSync3("xcrun", args, {
5711
3902
  cwd: project.projectDir,
5712
3903
  stdio: ["ignore", "pipe", "pipe"],
5713
3904
  timeout: runScriptTimeoutMs
5714
3905
  });
5715
- fs18.writeFileSync(stamp, inputs);
3906
+ fs7.writeFileSync(stamp, inputs);
5716
3907
  }
5717
3908
  projectInputs.add(file);
5718
3909
  resources.delete(file);
@@ -5729,13 +3920,13 @@ ${output2}`
5729
3920
  for (const definition of definitions) {
5730
3921
  const configuredLanguage = settings("INTENTS_CODEGEN_LANGUAGE");
5731
3922
  const language = !configuredLanguage || configuredLanguage === "Automatic" ? sources.size > 0 ? "Swift" : "Objective-C" : configuredLanguage;
5732
- const output2 = path39.join(
3923
+ const output2 = path9.join(
5733
3924
  settings("DERIVED_FILE_DIR"),
5734
3925
  "IntentDefinitionGenerated",
5735
- path39.basename(definition, ".intentdefinition")
3926
+ path9.basename(definition, ".intentdefinition")
5736
3927
  );
5737
- fs18.rmSync(output2, { recursive: true, force: true });
5738
- fs18.mkdirSync(output2, { recursive: true });
3928
+ fs7.rmSync(output2, { recursive: true, force: true });
3929
+ fs7.mkdirSync(output2, { recursive: true });
5739
3930
  const args = [
5740
3931
  "intentbuilderc",
5741
3932
  "generate",
@@ -5754,20 +3945,20 @@ ${output2}`
5754
3945
  args.push("-swiftVersion", settings("SWIFT_VERSION") || "5.0");
5755
3946
  if (settings("DEFINES_MODULE") === "YES")
5756
3947
  args.push("-moduleName", settings("PRODUCT_MODULE_NAME"));
5757
- execFileSync15("xcrun", args, {
3948
+ execFileSync3("xcrun", args, {
5758
3949
  cwd: project.projectDir,
5759
3950
  stdio: ["ignore", "pipe", "pipe"],
5760
3951
  timeout: runScriptTimeoutMs
5761
3952
  });
5762
- const compiled = path39.join(
3953
+ const compiled = path9.join(
5763
3954
  settings("DERIVED_FILE_DIR"),
5764
3955
  "IntentDefinitionCompiled",
5765
- definition.split(path39.sep).findLast((part) => part.endsWith(".lproj")) ?? ""
3956
+ definition.split(path9.sep).findLast((part) => part.endsWith(".lproj")) ?? ""
5766
3957
  );
5767
- const compiledDefinition = path39.join(compiled, path39.basename(definition));
5768
- fs18.rmSync(compiledDefinition, { force: true });
5769
- fs18.mkdirSync(compiled, { recursive: true });
5770
- execFileSync15(
3958
+ const compiledDefinition = path9.join(compiled, path9.basename(definition));
3959
+ fs7.rmSync(compiledDefinition, { force: true });
3960
+ fs7.mkdirSync(compiled, { recursive: true });
3961
+ execFileSync3(
5771
3962
  "xcrun",
5772
3963
  [
5773
3964
  "intentbuilderc",
@@ -5807,37 +3998,37 @@ ${output2}`
5807
3998
  function commonAncestor(dirs) {
5808
3999
  let common = dirs[0];
5809
4000
  for (const dir of dirs) {
5810
- while (common !== path39.dirname(common) && path39.relative(common, dir).startsWith(".."))
5811
- common = path39.dirname(common);
4001
+ while (common !== path9.dirname(common) && path9.relative(common, dir).startsWith(".."))
4002
+ common = path9.dirname(common);
5812
4003
  }
5813
4004
  return common;
5814
4005
  }
5815
- var isPodsProject = (xcodeproj) => path39.basename(xcodeproj) === "Pods.xcodeproj" && path39.basename(path39.dirname(xcodeproj)) === "Pods";
4006
+ var isPodsProject = (xcodeproj) => path9.basename(xcodeproj) === "Pods.xcodeproj" && path9.basename(path9.dirname(xcodeproj)) === "Pods";
5816
4007
  function installedPodsSandbox(pods) {
5817
- const podfileLock = path39.join(path39.dirname(pods), "Podfile.lock");
5818
- const manifestLock = path39.join(pods, "Manifest.lock");
5819
- if (!fs18.existsSync(podfileLock))
4008
+ const podfileLock = path9.join(path9.dirname(pods), "Podfile.lock");
4009
+ const manifestLock = path9.join(pods, "Manifest.lock");
4010
+ if (!fs7.existsSync(podfileLock))
5820
4011
  throw new Error(
5821
- `${pods} has no ${podfileLock}: run \`pod install\` in ${path39.dirname(pods)}`
4012
+ `${pods} has no ${podfileLock}: run \`pod install\` in ${path9.dirname(pods)}`
5822
4013
  );
5823
- if (!fs18.existsSync(manifestLock) || !fs18.readFileSync(manifestLock).equals(fs18.readFileSync(podfileLock)))
4014
+ if (!fs7.existsSync(manifestLock) || !fs7.readFileSync(manifestLock).equals(fs7.readFileSync(podfileLock)))
5824
4015
  throw new Error(
5825
- `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${path39.dirname(pods)}`
4016
+ `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${path9.dirname(pods)}`
5826
4017
  );
5827
4018
  const specChecksums = {};
5828
- const lines = fs18.readFileSync(manifestLock, "utf8").split("\n");
4019
+ const lines = fs7.readFileSync(manifestLock, "utf8").split("\n");
5829
4020
  const start = lines.indexOf("SPEC CHECKSUMS:");
5830
4021
  for (const line of start === -1 ? [] : lines.slice(start + 1)) {
5831
4022
  const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
5832
4023
  if (!entry) break;
5833
4024
  specChecksums[entry[1]] = entry[2];
5834
4025
  }
5835
- const specs = path39.join(pods, "Local Podspecs");
4026
+ const specs = path9.join(pods, "Local Podspecs");
5836
4027
  return {
5837
4028
  podfileLock,
5838
4029
  manifestLock,
5839
4030
  specChecksums,
5840
- localPodspecs: isDirectory(specs) ? fs18.readdirSync(specs).filter((name) => name.endsWith(".podspec.json")).sort().map((name) => path39.join(specs, name)) : []
4031
+ localPodspecs: isDirectory(specs) ? fs7.readdirSync(specs).filter((name) => name.endsWith(".podspec.json")).sort().map((name) => path9.join(specs, name)) : []
5841
4032
  };
5842
4033
  }
5843
4034
  function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
@@ -5849,14 +4040,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
5849
4040
  if (!xcodeProjectFile(xcodeproj)) {
5850
4041
  if (installedPods && isPodsProject(xcodeproj))
5851
4042
  throw new Error(
5852
- `${path39.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${path39.dirname(path39.dirname(xcodeproj))}`
4043
+ `${path9.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${path9.dirname(path9.dirname(xcodeproj))}`
5853
4044
  );
5854
4045
  return;
5855
4046
  }
5856
- const key = fs18.realpathSync.native(xcodeproj);
5857
- if (projectAt.has(key) || !installedPods && key.split(path39.sep).includes("Pods"))
4047
+ const key = fs7.realpathSync.native(xcodeproj);
4048
+ if (projectAt.has(key) || !installedPods && key.split(path9.sep).includes("Pods"))
5858
4049
  return;
5859
- if (isPodsProject(key)) cocoapods = installedPodsSandbox(path39.dirname(key));
4050
+ if (isPodsProject(key)) cocoapods = installedPodsSandbox(path9.dirname(key));
5860
4051
  const project = loadProject(key);
5861
4052
  projectAt.set(key, project);
5862
4053
  projects.push(project);
@@ -5872,12 +4063,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
5872
4063
  for (const reference of listed)
5873
4064
  if (reference.endsWith(".xcodeproj")) addProject(reference);
5874
4065
  if (projects.length === 0) {
5875
- throw new Error(`${path39.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
4066
+ throw new Error(`${path9.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
5876
4067
  }
5877
- const podfile = path39.join(path39.dirname(xcodeprojOrWorkspace), "Podfile");
5878
- if (installedPods && !cocoapods && fs18.existsSync(podfile))
4068
+ const podfile = path9.join(path9.dirname(xcodeprojOrWorkspace), "Podfile");
4069
+ if (installedPods && !cocoapods && fs7.existsSync(podfile))
5879
4070
  throw new Error(
5880
- `${podfile} is not installed into ${path39.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${path39.dirname(podfile)} and open the workspace it writes`
4071
+ `${podfile} is not installed into ${path9.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${path9.dirname(podfile)} and open the workspace it writes`
5881
4072
  );
5882
4073
  return { listed, projects, projectAt, cocoapods };
5883
4074
  }
@@ -5915,7 +4106,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
5915
4106
  return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
5916
4107
  }
5917
4108
  function defaultXcodeAppTarget(xcodeproj) {
5918
- const project = loadProject(fs18.realpathSync.native(xcodeproj));
4109
+ const project = loadProject(fs7.realpathSync.native(xcodeproj));
5919
4110
  for (const [id, target] of Object.entries(project.objects)) {
5920
4111
  if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
5921
4112
  if (isIosAppTarget({ project, id, target }, { requireSources: false }))
@@ -5923,30 +4114,30 @@ function defaultXcodeAppTarget(xcodeproj) {
5923
4114
  }
5924
4115
  }
5925
4116
  function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
5926
- const container = fs18.realpathSync.native(xcodeprojOrWorkspace);
4117
+ const container = fs7.realpathSync.native(xcodeprojOrWorkspace);
5927
4118
  const { projects } = workspaceProjects(container);
5928
4119
  const containers = [
5929
4120
  .../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
5930
4121
  ];
5931
4122
  const found = containers.flatMap(
5932
4123
  (dir) => [
5933
- path39.join(dir, "xcshareddata"),
5934
- ...isDirectory(path39.join(dir, "xcuserdata")) ? fs18.readdirSync(path39.join(dir, "xcuserdata")).sort().map((user) => path39.join(dir, "xcuserdata", user)) : []
4124
+ path9.join(dir, "xcshareddata"),
4125
+ ...isDirectory(path9.join(dir, "xcuserdata")) ? fs7.readdirSync(path9.join(dir, "xcuserdata")).sort().map((user) => path9.join(dir, "xcuserdata", user)) : []
5935
4126
  ].map((data) => ({
5936
4127
  dir,
5937
- file: path39.join(data, "xcschemes", `${scheme}.xcscheme`)
4128
+ file: path9.join(data, "xcschemes", `${scheme}.xcscheme`)
5938
4129
  }))
5939
- ).find((candidate) => fs18.existsSync(candidate.file));
4130
+ ).find((candidate) => fs7.existsSync(candidate.file));
5940
4131
  if (!found) {
5941
4132
  const known = containers.flatMap(
5942
- (dir) => fs18.existsSync(path39.join(dir, "xcshareddata", "xcschemes")) ? fs18.readdirSync(path39.join(dir, "xcshareddata", "xcschemes")).filter((name2) => name2.endsWith(".xcscheme")).map((name2) => name2.slice(0, -".xcscheme".length)).sort() : []
4133
+ (dir) => fs7.existsSync(path9.join(dir, "xcshareddata", "xcschemes")) ? fs7.readdirSync(path9.join(dir, "xcshareddata", "xcschemes")).filter((name2) => name2.endsWith(".xcscheme")).map((name2) => name2.slice(0, -".xcscheme".length)).sort() : []
5943
4134
  );
5944
4135
  throw new Error(
5945
- `${path39.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
4136
+ `${path9.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
5946
4137
  );
5947
4138
  }
5948
4139
  const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
5949
- fs18.readFileSync(found.file, "utf8")
4140
+ fs7.readFileSync(found.file, "utf8")
5950
4141
  );
5951
4142
  const attribute = (text2, name2) => {
5952
4143
  const value = new RegExp(`\\b${name2}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
@@ -5959,12 +4150,12 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
5959
4150
  if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
5960
4151
  throw new Error(`scheme ${scheme} runs no application target`);
5961
4152
  }
5962
- const projectPath = path39.resolve(
5963
- path39.dirname(found.dir),
4153
+ const projectPath = path9.resolve(
4154
+ path9.dirname(found.dir),
5964
4155
  referenced.slice("container:".length)
5965
4156
  );
5966
4157
  const project = projects.find(
5967
- (candidate) => fs18.existsSync(projectPath) && candidate.xcodeproj === fs18.realpathSync.native(projectPath)
4158
+ (candidate) => fs7.existsSync(projectPath) && candidate.xcodeproj === fs7.realpathSync.native(projectPath)
5968
4159
  );
5969
4160
  const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
5970
4161
  const name = target && str(target.target.name);
@@ -5984,31 +4175,31 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
5984
4175
  var NativeAppTargetSelectionError = class extends Error {
5985
4176
  };
5986
4177
  function selectIosAppTarget(projectRoot, iosTarget) {
5987
- const nested = path39.join(projectRoot, "ios");
5988
- const iosRoot = fs18.existsSync(nested) ? nested : projectRoot;
5989
- const entries = fs18.readdirSync(iosRoot, { withFileTypes: true });
4178
+ const nested = path9.join(projectRoot, "ios");
4179
+ const iosRoot = fs7.existsSync(nested) ? nested : projectRoot;
4180
+ const entries = fs7.readdirSync(iosRoot, { withFileTypes: true });
5990
4181
  const projects = (entries.some((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")) ? entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).map((entry) => ({
5991
- xcodeproj: path39.join(iosRoot, entry.name),
4182
+ xcodeproj: path9.join(iosRoot, entry.name),
5992
4183
  workspace: null
5993
4184
  })) : entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcworkspace")).flatMap((entry) => {
5994
- const workspace = path39.join(iosRoot, entry.name);
4185
+ const workspace = path9.join(iosRoot, entry.name);
5995
4186
  return workspaceReferences(workspace).map((xcodeproj2) => ({
5996
4187
  xcodeproj: xcodeproj2,
5997
4188
  workspace
5998
4189
  }));
5999
4190
  }).filter(
6000
- ({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(path39.sep).includes("Pods") && fs18.existsSync(xcodeproj2)
4191
+ ({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(path9.sep).includes("Pods") && fs7.existsSync(xcodeproj2)
6001
4192
  ).filter(
6002
4193
  ({ xcodeproj: xcodeproj2 }) => listXcodeAppTargets(xcodeproj2, { requireSources: false }).length > 0
6003
4194
  )).map(({ xcodeproj: xcodeproj2, workspace }) => ({
6004
4195
  xcodeproj: xcodeproj2,
6005
4196
  workspace,
6006
- name: path39.basename(xcodeproj2)
4197
+ name: path9.basename(xcodeproj2)
6007
4198
  }));
6008
4199
  if (projects.length === 0) return null;
6009
4200
  if (projects.length > 1 && !iosTarget) {
6010
4201
  throw new NativeAppTargetSelectionError(
6011
- `native app identity requires a selected Xcode project; set withPeach's iosTarget to an app target in one of: ${projects.map((entry) => entry.name).join(", ")}`
4202
+ `native app identity requires a selected Xcode project; pass --ios-target with an app target in one of: ${projects.map((entry) => entry.name).join(", ")}`
6012
4203
  );
6013
4204
  }
6014
4205
  let project = projects[0];
@@ -6042,13 +4233,13 @@ function selectIosAppTarget(projectRoot, iosTarget) {
6042
4233
  if (!target) throw new Error("native app identity has no iOS application target");
6043
4234
  if (!iosTarget) {
6044
4235
  const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
6045
- const container = fs18.existsSync(workspace) ? workspace : xcodeproj;
4236
+ const container = fs7.existsSync(workspace) ? workspace : xcodeproj;
6046
4237
  const hasScheme = [container, xcodeproj].some((dir) => {
6047
- if (fs18.existsSync(path39.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
4238
+ if (fs7.existsSync(path9.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
6048
4239
  return true;
6049
- const users = path39.join(dir, "xcuserdata");
6050
- return fs18.existsSync(users) && fs18.readdirSync(users).some(
6051
- (user) => fs18.existsSync(path39.join(users, user, "xcschemes", `${target}.xcscheme`))
4240
+ const users = path9.join(dir, "xcuserdata");
4241
+ return fs7.existsSync(users) && fs7.readdirSync(users).some(
4242
+ (user) => fs7.existsSync(path9.join(users, user, "xcschemes", `${target}.xcscheme`))
6052
4243
  );
6053
4244
  });
6054
4245
  if (hasScheme) target = readXcodeScheme(container, target).target;
@@ -6059,8 +4250,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
6059
4250
  );
6060
4251
  return { xcodeproj, target, workspace: project.workspace };
6061
4252
  }
6062
- var workspaceResolvedFile = (xcodeprojOrWorkspace) => path39.join(
6063
- xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : path39.join(xcodeprojOrWorkspace, "project.xcworkspace"),
4253
+ var workspaceResolvedFile = (xcodeprojOrWorkspace) => path9.join(
4254
+ xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : path9.join(xcodeprojOrWorkspace, "project.xcworkspace"),
6064
4255
  "xcshareddata",
6065
4256
  "swiftpm",
6066
4257
  "Package.resolved"
@@ -6077,7 +4268,7 @@ var SwiftPackageResolutionRequired = class extends Error {
6077
4268
  function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
6078
4269
  if (isBazelPackage(input))
6079
4270
  return readBazelAppTarget(input, targetName, configurationName, options);
6080
- const xcodeprojOrWorkspace = fs18.realpathSync.native(input);
4271
+ const xcodeprojOrWorkspace = fs7.realpathSync.native(input);
6081
4272
  const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
6082
4273
  const { listed, projects, projectAt, cocoapods } = workspaceProjects(
6083
4274
  xcodeprojOrWorkspace,
@@ -6088,7 +4279,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6088
4279
  (ref) => options.frameworkMachOType ? ref.target.name === targetName && FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "") : isIosAppTarget(ref, options) || targetName !== void 0 && ref.target.name === targetName && ref.target.productType === APP_EXTENSION
6089
4280
  );
6090
4281
  const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
6091
- const container = path39.basename(xcodeprojOrWorkspace);
4282
+ const container = path9.basename(xcodeprojOrWorkspace);
6092
4283
  const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
6093
4284
  if (named.length !== 1) {
6094
4285
  if (options.frameworkMachOType)
@@ -6113,15 +4304,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6113
4304
  for (const ref of allTargets) {
6114
4305
  const product = ref.project.object(str(ref.target.productReference));
6115
4306
  const file = str(product?.path);
6116
- if (file && !byProduct.has(path39.basename(file)))
6117
- byProduct.set(path39.basename(file), ref);
4307
+ if (file && !byProduct.has(path9.basename(file)))
4308
+ byProduct.set(path9.basename(file), ref);
6118
4309
  }
6119
4310
  const proxied = (project, proxyId) => {
6120
4311
  const proxy = project.object(proxyId);
6121
4312
  if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
6122
4313
  const portal = str(proxy.containerPortal);
6123
4314
  const portalPath = project.resolvePath(portal ?? "");
6124
- const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && fs18.existsSync(portalPath) ? projectAt.get(fs18.realpathSync.native(portalPath)) : void 0;
4315
+ const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && fs7.existsSync(portalPath) ? projectAt.get(fs7.realpathSync.native(portalPath)) : void 0;
6125
4316
  const remote = str(proxy.remoteGlobalIDString);
6126
4317
  if (!owner || !remote) return void 0;
6127
4318
  return projectTargets(owner).find(
@@ -6138,7 +4329,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6138
4329
  const buildFile = project.object(buildFileId);
6139
4330
  if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
6140
4331
  const file = project.object(str(buildFile.fileRef));
6141
- const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(path39.basename(str(file.path) ?? "")) : void 0;
4332
+ const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(path9.basename(str(file.path) ?? "")) : void 0;
6142
4333
  if (resolved)
6143
4334
  found.push({
6144
4335
  target: resolved,
@@ -6219,7 +4410,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6219
4410
  const otherProduct = productName(other);
6220
4411
  for (const { file, visibility } of headerPhase(other)) {
6221
4412
  if (visibility === "Project") continue;
6222
- const key = `${otherProduct}/${path39.basename(file)}`;
4413
+ const key = `${otherProduct}/${path9.basename(file)}`;
6223
4414
  if (!headers.has(key)) headers.set(key, file);
6224
4415
  }
6225
4416
  }
@@ -6249,8 +4440,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6249
4440
  ref.project.visitMembers(
6250
4441
  ref.id,
6251
4442
  ref.project.resolvePath,
6252
- (file) => isDirectory(file) ? walkFiles(file) : fs18.existsSync(file) ? [file] : [],
6253
- path39.join,
4443
+ (file) => isDirectory(file) ? walkFiles(file) : fs7.existsSync(file) ? [file] : [],
4444
+ path9.join,
6254
4445
  (file, kind) => {
6255
4446
  if (kind === "header") found.push(file);
6256
4447
  }
@@ -6266,12 +4457,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6266
4457
  for (const ref of projectTargets(project)) {
6267
4458
  const product = productName(ref);
6268
4459
  for (const { file, visibility } of headerPhase(ref)) {
6269
- const name = path39.basename(file);
4460
+ const name = path9.basename(file);
6270
4461
  if (!entries.has(name))
6271
4462
  entries.set(name, visibility !== "Project" ? `${product}/${name}` : file);
6272
4463
  }
6273
4464
  for (const file of synchronizedHeaders(ref)) {
6274
- const name = path39.basename(file);
4465
+ const name = path9.basename(file);
6275
4466
  if (!entries.has(name)) entries.set(name, file);
6276
4467
  }
6277
4468
  }
@@ -6281,7 +4472,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6281
4472
  if (folder === null) continue;
6282
4473
  for (const file of walkFiles(folder)) {
6283
4474
  if (!HEADER_FILE.test(file)) continue;
6284
- const name = path39.basename(file);
4475
+ const name = path9.basename(file);
6285
4476
  if (!entries.has(name)) entries.set(name, file);
6286
4477
  }
6287
4478
  }
@@ -6289,18 +4480,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6289
4480
  for (const id of Object.keys(project.objects)) {
6290
4481
  if (project.object(id)?.isa !== "PBXFileReference") continue;
6291
4482
  const file = project.resolvePath(id);
6292
- if (file && HEADER_FILE.test(file) && !entries.has(path39.basename(file)))
6293
- entries.set(path39.basename(file), file);
4483
+ if (file && HEADER_FILE.test(file) && !entries.has(path9.basename(file)))
4484
+ entries.set(path9.basename(file), file);
6294
4485
  }
6295
4486
  const map = [...entries];
6296
4487
  projectHeaderMaps.set(project, map);
6297
4488
  return map;
6298
4489
  };
6299
4490
  const xcconfigs = /* @__PURE__ */ new Set();
6300
- const buildDir = (project) => path39.join(project.projectDir, ".build/peach-xcode/Build");
4491
+ const buildDir = (project) => path9.join(project.projectDir, ".build/peach-xcode/Build");
6301
4492
  const workspaceBuild = {
6302
- SYMROOT: path39.join(buildDir(app.project), "Products"),
6303
- OBJROOT: path39.join(buildDir(app.project), "Intermediates.noindex")
4493
+ SYMROOT: path9.join(buildDir(app.project), "Products"),
4494
+ OBJROOT: path9.join(buildDir(app.project), "Intermediates.noindex")
6304
4495
  };
6305
4496
  const moduleTarget = (ref) => {
6306
4497
  const name = str(ref.target.name) ?? ref.id;
@@ -6315,16 +4506,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6315
4506
  TARGET_NAME: name,
6316
4507
  TARGETNAME: "$(TARGET_NAME)",
6317
4508
  PROJECT: "$(PROJECT_NAME)",
6318
- PROJECT_NAME: path39.basename(ref.project.xcodeproj, ".xcodeproj"),
4509
+ PROJECT_NAME: path9.basename(ref.project.xcodeproj, ".xcodeproj"),
6319
4510
  PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
6320
4511
  PROJECT_FILE_PATH: ref.project.xcodeproj,
6321
4512
  SRCROOT: ref.project.projectDir,
6322
4513
  SOURCE_ROOT: ref.project.projectDir,
6323
4514
  PROJECT_DIR: ref.project.projectDir,
6324
- SYMROOT: path39.join(buildDir(ref.project), "Products"),
4515
+ SYMROOT: path9.join(buildDir(ref.project), "Products"),
6325
4516
  BUILD_DIR: "$(SYMROOT)",
6326
4517
  BUILD_ROOT: "$(SYMROOT)",
6327
- OBJROOT: path39.join(buildDir(ref.project), "Intermediates.noindex"),
4518
+ OBJROOT: path9.join(buildDir(ref.project), "Intermediates.noindex"),
6328
4519
  CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
6329
4520
  BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
6330
4521
  TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
@@ -6373,7 +4564,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6373
4564
  xcconfigs
6374
4565
  );
6375
4566
  const searchRules = recursiveSearchRules(settings2);
6376
- const absolute = (file) => path39.resolve(ref.project.projectDir, file);
4567
+ const absolute = (file) => path9.resolve(ref.project.projectDir, file);
6377
4568
  const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
6378
4569
  const product = settings2("PRODUCT_NAME");
6379
4570
  const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
@@ -6404,7 +4595,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6404
4595
  `${name}: Swift compatibility header phase has no Swift producer sources`
6405
4596
  );
6406
4597
  const building = options.prepareGeneratedSources && options.requireSources !== false;
6407
- const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? path39.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
4598
+ const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? path9.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
6408
4599
  if (versioning) {
6409
4600
  const version = settings2("CURRENT_PROJECT_VERSION");
6410
4601
  const custom = [
@@ -6417,22 +4608,22 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6417
4608
  ].filter((key) => settings2(key));
6418
4609
  if (custom.length)
6419
4610
  throw new Error(
6420
- `${name}: Xcode generates ${path39.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
4611
+ `${name}: Xcode generates ${path9.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
6421
4612
  );
6422
4613
  const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
6423
4614
  const [major, minor] = version.split(".");
6424
- const number2 = `${major === "" ? "0" : major}.${minor !== void 0 && /^\d+$/.test(minor) ? minor.replace(/^0+(?=\d)/, "") : ""}`;
4615
+ const number = `${major === "" ? "0" : major}.${minor !== void 0 && /^\d+$/.test(minor) ? minor.replace(/^0+(?=\d)/, "") : ""}`;
6425
4616
  const unit = [
6426
4617
  ` extern const unsigned char ${symbol}VersionString[];`,
6427
4618
  ` extern const double ${symbol}VersionNumber;`,
6428
4619
  "",
6429
4620
  ` const unsigned char ${symbol}VersionString[] __attribute__ ((used)) = "@(#)PROGRAM:${product} PROJECT:${settings2("PROJECT_NAME")}-${version}" "\\n";`,
6430
- ` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number2};`,
4621
+ ` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number};`,
6431
4622
  ""
6432
4623
  ].join("\n");
6433
- if (!fs18.existsSync(versioning) || fs18.readFileSync(versioning, "utf8") !== unit) {
6434
- fs18.mkdirSync(path39.dirname(versioning), { recursive: true });
6435
- fs18.writeFileSync(versioning, unit);
4624
+ if (!fs7.existsSync(versioning) || fs7.readFileSync(versioning, "utf8") !== unit) {
4625
+ fs7.mkdirSync(path9.dirname(versioning), { recursive: true });
4626
+ fs7.writeFileSync(versioning, unit);
6436
4627
  }
6437
4628
  allSources.push(versioning);
6438
4629
  }
@@ -6451,7 +4642,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6451
4642
  const headerFiles = headerPhase(ref);
6452
4643
  const ownHeaders = /* @__PURE__ */ new Map();
6453
4644
  for (const { file, visibility } of headerFiles) {
6454
- const name2 = path39.basename(file);
4645
+ const name2 = path9.basename(file);
6455
4646
  const published = visibility !== "Project";
6456
4647
  if (!ownHeaders.has(name2))
6457
4648
  ownHeaders.set(name2, published ? `${product}/${name2}` : file);
@@ -6459,27 +4650,27 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6459
4650
  ownHeaders.set(`${product}/${name2}`, file);
6460
4651
  }
6461
4652
  for (const file of synchronizedHeaders(ref)) {
6462
- const name2 = path39.basename(file);
4653
+ const name2 = path9.basename(file);
6463
4654
  if (ownHeaders.has(name2)) continue;
6464
4655
  ownHeaders.set(name2, file);
6465
4656
  const qualified = `${product}/${name2}`;
6466
4657
  if (!ownHeaders.has(qualified)) ownHeaders.set(qualified, file);
6467
4658
  }
6468
4659
  const nonFrameworkHeaders = nonFrameworkHeadersOf(ref.project);
6469
- const wrapper = path39.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
4660
+ const wrapper = path9.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
6470
4661
  const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
6471
- const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? path39.join(path39.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
6472
- const frameworkCompatibility = frameworkUmbrella && moduleMap && fs18.existsSync(moduleMap) && fs18.existsSync(frameworkUmbrella) ? {
4662
+ const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? path9.join(path9.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
4663
+ const frameworkCompatibility = frameworkUmbrella && moduleMap && fs7.existsSync(moduleMap) && fs7.existsSync(frameworkUmbrella) ? {
6473
4664
  framework: true,
6474
4665
  moduleMap,
6475
4666
  umbrella: frameworkUmbrella,
6476
- outputModuleMap: path39.join(wrapper, "Modules", "module.modulemap"),
6477
- outputUmbrella: path39.join(
4667
+ outputModuleMap: path9.join(wrapper, "Modules", "module.modulemap"),
4668
+ outputUmbrella: path9.join(
6478
4669
  wrapper,
6479
4670
  "Headers",
6480
- path39.basename(frameworkUmbrella)
4671
+ path9.basename(frameworkUmbrella)
6481
4672
  ),
6482
- outputHeader: path39.join(
4673
+ outputHeader: path9.join(
6483
4674
  wrapper,
6484
4675
  "Headers",
6485
4676
  settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
@@ -6493,10 +4684,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6493
4684
  outputUmbrella: compatibility.outputUmbrella,
6494
4685
  outputHeader: compatibility.outputHeader
6495
4686
  } : frameworkCompatibility;
6496
- const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && path39.relative(path39.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(path39.sep)[0] !== ".." && fs18.existsSync(moduleMap) ? fs18.readdirSync(path39.dirname(moduleMap)).flatMap((entry) => {
4687
+ const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && path9.relative(path9.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(path9.sep)[0] !== ".." && fs7.existsSync(moduleMap) ? fs7.readdirSync(path9.dirname(moduleMap)).flatMap((entry) => {
6497
4688
  if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
6498
- const file = path39.join(path39.dirname(moduleMap), entry);
6499
- return fs18.existsSync(file) ? [file] : [];
4689
+ const file = path9.join(path9.dirname(moduleMap), entry);
4690
+ return fs7.existsSync(file) ? [file] : [];
6500
4691
  }) : [];
6501
4692
  const fileFlags = {};
6502
4693
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -6577,15 +4768,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6577
4768
  // xcode searches its products' include directory before
6578
4769
  // HEADER_SEARCH_PATHS and the target's derived sources after.
6579
4770
  headerSearchPaths: [
6580
- path39.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
4771
+ path9.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
6581
4772
  ...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
6582
4773
  (raw) => expandSearchPath(absolute(raw), searchRules)
6583
4774
  ),
6584
- path39.join(
4775
+ path9.join(
6585
4776
  `${settings2("DERIVED_FILE_DIR")}-normal`,
6586
4777
  settings2("CURRENT_ARCH")
6587
4778
  ),
6588
- path39.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
4779
+ path9.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
6589
4780
  settings2("DERIVED_FILE_DIR")
6590
4781
  ],
6591
4782
  userHeaderSearchPaths: settingList(
@@ -6635,10 +4826,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6635
4826
  ...headerFiles.flatMap(
6636
4827
  ({ file, visibility }) => visibility === "Project" ? [] : [
6637
4828
  [
6638
- path39.join(
4829
+ path9.join(
6639
4830
  wrapper,
6640
4831
  visibility === "Public" ? "Headers" : "PrivateHeaders",
6641
- path39.basename(file)
4832
+ path9.basename(file)
6642
4833
  ),
6643
4834
  file
6644
4835
  ]
@@ -6652,7 +4843,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6652
4843
  return [];
6653
4844
  const destination = expand(
6654
4845
  str(phase.dstPath) ?? "",
6655
- (name2) => name2 === "PUBLIC_HEADERS_FOLDER_PATH" ? path39.join(wrapper, "Headers") : name2 === "PRIVATE_HEADERS_FOLDER_PATH" ? path39.join(wrapper, "PrivateHeaders") : settings2(name2)
4846
+ (name2) => name2 === "PUBLIC_HEADERS_FOLDER_PATH" ? path9.join(wrapper, "Headers") : name2 === "PRIVATE_HEADERS_FOLDER_PATH" ? path9.join(wrapper, "PrivateHeaders") : settings2(name2)
6656
4847
  );
6657
4848
  return list(phase.files).flatMap((id) => {
6658
4849
  const file = ref.project.resolvePath(
@@ -6660,17 +4851,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6660
4851
  );
6661
4852
  return file && HEADER_FILE.test(file) ? [
6662
4853
  [
6663
- path39.resolve(
4854
+ path9.resolve(
6664
4855
  settings2("BUILT_PRODUCTS_DIR"),
6665
4856
  destination,
6666
- path39.basename(file)
4857
+ path9.basename(file)
6667
4858
  ),
6668
4859
  file
6669
4860
  ]
6670
4861
  ] : [];
6671
4862
  });
6672
4863
  }),
6673
- ...moduleMap ? [[path39.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
4864
+ ...moduleMap ? [[path9.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
6674
4865
  ]) : Object.fromEntries([
6675
4866
  ...podHeaders.map((file) => [file, file]),
6676
4867
  ...moduleMap ? [[moduleMap, moduleMap]] : []
@@ -6707,7 +4898,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6707
4898
  const frameworkTargets = selectedTargets.filter((target) => target !== builtTargets.at(-1)).filter(({ ref }) => MODULE_PRODUCTS.has(str(ref.target.productType) ?? "")).map(({ ref, module: module2 }) => ({ ref, framework: module2 }));
6708
4899
  const frameworks = frameworkTargets.map(({ framework }) => framework);
6709
4900
  const podSourceDirs = builtTargets.slice(0, -1).flatMap(
6710
- ({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) => path39.dirname(file)).filter((dir) => fs18.existsSync(dir)) : []
4901
+ ({ ref, module: module2 }) => isPodsProject(ref.project.xcodeproj) ? [...module2.allSources, ...module2.objc?.headers ?? []].map((file) => path9.dirname(file)).filter((dir) => fs7.existsSync(dir)) : []
6711
4902
  );
6712
4903
  const expandValue = (value, settings2) => {
6713
4904
  if (typeof value === "string") return expand(value, settings2);
@@ -6728,7 +4919,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6728
4919
  const phase = owner.ref.project.object(phaseId);
6729
4920
  if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
6730
4921
  continue;
6731
- const absolute = (raw) => path39.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
4922
+ const absolute = (raw) => path9.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
6732
4923
  const entries = (paths) => paths.flatMap((raw) => {
6733
4924
  const file = absolute(raw);
6734
4925
  xcconfigs.add(file);
@@ -6744,7 +4935,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6744
4935
  ].filter((file) => file.endsWith(".bundle"));
6745
4936
  if (inputs.length !== outputs.length)
6746
4937
  throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
6747
- const destinationRoot = path39.join(
4938
+ const destinationRoot = path9.join(
6748
4939
  owner.settings("TARGET_BUILD_DIR"),
6749
4940
  owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
6750
4941
  );
@@ -6753,24 +4944,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6753
4944
  const file = str(
6754
4945
  target.ref.project.object(str(target.ref.target.productReference))?.path
6755
4946
  );
6756
- return file && path39.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
4947
+ return file && path9.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
6757
4948
  });
6758
4949
  if (!product && !isDirectory(input2))
6759
4950
  throw new Error(
6760
4951
  `${owner.module.name}: resource bundle input has no selected producer: ${input2}`
6761
4952
  );
6762
- const destination = path39.relative(destinationRoot, outputs[index]);
6763
- if (destination === ".." || destination.startsWith(`..${path39.sep}`) || path39.isAbsolute(destination) || path39.basename(input2) !== path39.basename(destination))
4953
+ const destination = path9.relative(destinationRoot, outputs[index]);
4954
+ if (destination === ".." || destination.startsWith(`..${path9.sep}`) || path9.isAbsolute(destination) || path9.basename(input2) !== path9.basename(destination))
6764
4955
  throw new Error(
6765
4956
  `${owner.module.name}: invalid resource bundle copy destination`
6766
4957
  );
6767
- const infoFile = product ? path39.resolve(
4958
+ const infoFile = product ? path9.resolve(
6768
4959
  product.ref.project.projectDir,
6769
4960
  product.settings("INFOPLIST_FILE")
6770
4961
  ) : null;
6771
4962
  if (infoFile) xcconfigs.add(infoFile);
6772
4963
  const prefix = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
6773
- const bundlePath = prefix + destination.split(path39.sep).join("/");
4964
+ const bundlePath = prefix + destination.split(path9.sep).join("/");
6774
4965
  if (resourceProducts.some((resource) => resource.path === bundlePath))
6775
4966
  throw new Error(
6776
4967
  `${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
@@ -6779,24 +4970,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6779
4970
  path: bundlePath,
6780
4971
  ...product ? {
6781
4972
  resources: product.module.resources,
6782
- infoPlist: plist3.build(
4973
+ infoPlist: import_plist2.default.build(
6783
4974
  expandValue(
6784
- plist3.parse(fs18.readFileSync(infoFile, "utf8")),
4975
+ import_plist2.default.parse(fs7.readFileSync(infoFile, "utf8")),
6785
4976
  product.settings
6786
4977
  )
6787
4978
  )
6788
4979
  } : {
6789
- resources: fs18.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => path39.join(entry.parentPath, entry.name)).sort(),
4980
+ resources: fs7.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => path9.join(entry.parentPath, entry.name)).sort(),
6790
4981
  sourceRoot: input2
6791
4982
  }
6792
4983
  });
6793
4984
  }
6794
4985
  }
6795
4986
  }
6796
- const infoPlistFile = settings("INFOPLIST_FILE") ? path39.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
6797
- const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? path39.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
4987
+ const infoPlistFile = settings("INFOPLIST_FILE") ? path9.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
4988
+ const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? path9.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
6798
4989
  const infoPlistPending = module.generatedInfoPlist && !options.prepareGeneratedSources;
6799
- const sourceInfo = infoPlistFile && !infoPlistPending ? plist3.parse(fs18.readFileSync(infoPlistFile, "utf8")) : {};
4990
+ const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist2.default.parse(fs7.readFileSync(infoPlistFile, "utf8")) : {};
6800
4991
  if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
6801
4992
  throw new Error(`${module.name} Info.plist must contain a dictionary`);
6802
4993
  }
@@ -6821,7 +5012,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6821
5012
  }
6822
5013
  const bundleIdentifier = settings("PRODUCT_BUNDLE_IDENTIFIER") || (typeof info.CFBundleIdentifier === "string" ? info.CFBundleIdentifier : "");
6823
5014
  const keychainAccessGroups = entitlementsFile ? readKeychainAccessGroups(
6824
- plist3.parse(fs18.readFileSync(entitlementsFile, "utf8")),
5015
+ import_plist2.default.parse(fs7.readFileSync(entitlementsFile, "utf8")),
6825
5016
  (value) => expand(value, (key) => {
6826
5017
  if (key === "AppIdentifierPrefix") return "FAKETEAMID.";
6827
5018
  if (key === "TeamIdentifierPrefix") return "";
@@ -6859,7 +5050,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6859
5050
  };
6860
5051
  }
6861
5052
  const localPackageDirs = [
6862
- ...listed.filter((reference) => fs18.existsSync(path39.join(reference, "Package.swift"))),
5053
+ ...listed.filter((reference) => fs7.existsSync(path9.join(reference, "Package.swift"))),
6863
5054
  ...projects.flatMap(
6864
5055
  (project) => Object.entries(project.objects).flatMap(([id, entry]) => {
6865
5056
  if (!isDict(entry)) return [];
@@ -6869,19 +5060,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6869
5060
  const packages = [];
6870
5061
  while (pending.length > 0) {
6871
5062
  const dir = pending.pop();
6872
- if (fs18.existsSync(path39.join(dir, "Package.swift"))) {
5063
+ if (fs7.existsSync(path9.join(dir, "Package.swift"))) {
6873
5064
  packages.push(dir);
6874
5065
  continue;
6875
5066
  }
6876
5067
  if (!isDirectory(dir)) continue;
6877
- for (const child of fs18.readdirSync(dir, { withFileTypes: true }))
5068
+ for (const child of fs7.readdirSync(dir, { withFileTypes: true }))
6878
5069
  if (child.isDirectory() && !child.name.startsWith("."))
6879
- pending.push(path39.join(dir, child.name));
5070
+ pending.push(path9.join(dir, child.name));
6880
5071
  }
6881
5072
  return packages;
6882
5073
  }
6883
- const candidate = entry.isa === "XCLocalSwiftPackageReference" ? path39.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
6884
- return candidate && fs18.existsSync(path39.join(candidate, "Package.swift")) ? [candidate] : [];
5074
+ const candidate = entry.isa === "XCLocalSwiftPackageReference" ? path9.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
5075
+ return candidate && fs7.existsSync(path9.join(candidate, "Package.swift")) ? [candidate] : [];
6885
5076
  })
6886
5077
  )
6887
5078
  ];
@@ -6911,7 +5102,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6911
5102
  if ((flag === "-framework" || flag === "-weak_framework") && name)
6912
5103
  sdkFrameworks.add(name);
6913
5104
  });
6914
- const absolute = (raw) => path39.resolve(ref.project.projectDir, expand(raw, settings2));
5105
+ const absolute = (raw) => path9.resolve(ref.project.projectDir, expand(raw, settings2));
6915
5106
  const requested = options.nativeModules;
6916
5107
  const includeBinary = (name, dir) => {
6917
5108
  if (!requested || nativeTargets.has(ref) || requested.includes(name) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module2) => requested.includes(module2)))
@@ -6923,14 +5114,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6923
5114
  for (const directory of expandSearchPath(absolute(raw), searchRules)) {
6924
5115
  if (frameworkSearchDirectories.has(directory)) continue;
6925
5116
  frameworkSearchDirectories.add(directory);
6926
- if (!fs18.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
5117
+ if (!fs7.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
6927
5118
  continue;
6928
- for (const entry of fs18.readdirSync(directory, { withFileTypes: true })) {
5119
+ for (const entry of fs7.readdirSync(directory, { withFileTypes: true })) {
6929
5120
  const name = /^(.+)\.framework$/.exec(entry.name)?.[1];
6930
5121
  if (!name || byProduct.has(entry.name) || searchedFrameworks.has(name))
6931
5122
  continue;
6932
- const file = path39.join(directory, entry.name);
6933
- if (fs18.statSync(file, { throwIfNoEntry: false })?.isDirectory())
5123
+ const file = path9.join(directory, entry.name);
5124
+ if (fs7.statSync(file, { throwIfNoEntry: false })?.isDirectory())
6934
5125
  searchedFrameworks.set(name, file);
6935
5126
  }
6936
5127
  }
@@ -6938,9 +5129,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6938
5129
  }
6939
5130
  for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
6940
5131
  const dir = absolute(raw);
6941
- const modulemap = path39.join(dir, "module.modulemap");
6942
- if (!fs18.existsSync(modulemap)) continue;
6943
- const name = moduleMapName(fs18.readFileSync(modulemap, "utf8"));
5132
+ const modulemap = path9.join(dir, "module.modulemap");
5133
+ if (!fs7.existsSync(modulemap)) continue;
5134
+ const name = moduleMapName(fs7.readFileSync(modulemap, "utf8"));
6944
5135
  if (name && !binaryFrameworks.has(name)) includeBinary(name, dir);
6945
5136
  }
6946
5137
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -6949,7 +5140,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
6949
5140
  const inputs = list(phase.inputPaths).map(absolute);
6950
5141
  for (const raw of list(phase.inputFileListPaths)) {
6951
5142
  const file = absolute(raw);
6952
- if (!fs18.existsSync(file)) continue;
5143
+ if (!fs7.existsSync(file)) continue;
6953
5144
  xcconfigs.add(file);
6954
5145
  inputs.push(...fileListEntries(file, absolute));
6955
5146
  }
@@ -7014,7 +5205,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
7014
5205
  ...productAttributes.get(dependencyId)?.length ? { attributes: productAttributes.get(dependencyId) } : {},
7015
5206
  source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
7016
5207
  kind: "local",
7017
- dir: path39.resolve(
5208
+ dir: path9.resolve(
7018
5209
  project.projectDir,
7019
5210
  str(reference.relativePath) ?? ""
7020
5211
  )
@@ -7048,10 +5239,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
7048
5239
  continue;
7049
5240
  }
7050
5241
  if (tree === "BUILT_PRODUCTS_DIR" || tree === "DEVELOPER_DIR" || // a target in the workspace builds it, so it exists only after that build
7051
- byProduct.has(path39.basename(rawPath)))
5242
+ byProduct.has(path9.basename(rawPath)))
7052
5243
  continue;
7053
5244
  const resolved = fileId ? project.resolvePath(fileId) : null;
7054
- if (fileId && resolved !== null && !fs18.existsSync(resolved)) {
5245
+ if (fileId && resolved !== null && !fs7.existsSync(resolved)) {
7055
5246
  if (!ios_sdk_frameworks_default.frameworks.includes(name))
7056
5247
  throw new Error(
7057
5248
  `${str(target.name) ?? "target"}: linked framework ${name} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
@@ -7078,7 +5269,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
7078
5269
  ({ product }) => !options.nativeModules || nativeTargets.has(built.ref) || options.nativeModules.includes(product)
7079
5270
  );
7080
5271
  const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
7081
- let packageResolved = fs18.existsSync(resolvedFile) ? [fs18.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => path39.join(dir, "Package.resolved")))].filter((file) => fs18.existsSync(file)).map((file) => fs18.realpathSync.native(file)).sort();
5272
+ let packageResolved = fs7.existsSync(resolvedFile) ? [fs7.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => path9.join(dir, "Package.resolved")))].filter((file) => fs7.existsSync(file)).map((file) => fs7.realpathSync.native(file)).sort();
7082
5273
  if (packageResolved.length === 0) {
7083
5274
  const requirements = remotePackageRequirements(projects);
7084
5275
  if (requirements.length > 0) {
@@ -7129,19 +5320,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
7129
5320
  } : {},
7130
5321
  rootDir: commonAncestor(
7131
5322
  [
7132
- workspace ? path39.dirname(workspace) : app.project.projectDir,
5323
+ workspace ? path9.dirname(workspace) : app.project.projectDir,
7133
5324
  ...used.map((project) => project.projectDir),
7134
5325
  ...localPackageDirs,
7135
5326
  ...linkedProducts.flatMap(
7136
- ({ source }) => source.kind === "local" && fs18.existsSync(source.dir) ? [source.dir] : []
5327
+ ({ source }) => source.kind === "local" && fs7.existsSync(source.dir) ? [source.dir] : []
7137
5328
  ),
7138
5329
  ...new Set(podSourceDirs),
7139
5330
  // a target's own files may sit beside the project, such as an asset
7140
5331
  // catalog one folder up, and xcode builds them from there
7141
5332
  ...new Set(
7142
- [...module.allSources, ...module.resources].filter((file) => fs18.existsSync(file)).map((file) => path39.dirname(file))
5333
+ [...module.allSources, ...module.resources].filter((file) => fs7.existsSync(file)).map((file) => path9.dirname(file))
7143
5334
  )
7144
- ].map((dir) => fs18.realpathSync.native(dir))
5335
+ ].map((dir) => fs7.realpathSync.native(dir))
7145
5336
  ),
7146
5337
  projectFiles: [
7147
5338
  .../* @__PURE__ */ new Set([
@@ -7153,7 +5344,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
7153
5344
  ].sort(),
7154
5345
  projectDirs: [...new Set(used.map((project) => project.projectDir))].sort(),
7155
5346
  appIconName: settings("ASSETCATALOG_COMPILER_APPICON_NAME"),
7156
- infoPlist: infoPlistPending ? null : plist3.build(info),
5347
+ infoPlist: infoPlistPending ? null : import_plist2.default.build(info),
7157
5348
  infoPlistFile,
7158
5349
  ...keychainAccessGroups === void 0 ? {} : { keychainAccessGroups },
7159
5350
  postBundleScripts,
@@ -7162,7 +5353,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
7162
5353
  resourceProducts,
7163
5354
  linkedProducts,
7164
5355
  localPackageDirs: [
7165
- ...new Set(localPackageDirs.map((dir) => fs18.realpathSync.native(dir)))
5356
+ ...new Set(localPackageDirs.map((dir) => fs7.realpathSync.native(dir)))
7166
5357
  ].sort(),
7167
5358
  binaryFrameworks: [...binaryFrameworks].map(([name, file]) => ({ name, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
7168
5359
  sdkFrameworks: [...sdkFrameworks].filter(
@@ -7177,7 +5368,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
7177
5368
  }
7178
5369
 
7179
5370
  // src/native-app-identity-project.ts
7180
- function nonEmptyString2(value) {
5371
+ function nonEmptyString(value) {
7181
5372
  return typeof value === "string" && value.length > 0 ? value : void 0;
7182
5373
  }
7183
5374
  var SDK_BEFORE_SCENE_REQUIREMENT = "26.0";
@@ -7203,17 +5394,17 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
7203
5394
  const dictionary = parseInfoPlist(app.infoPlist);
7204
5395
  if (!isRecord(dictionary)) throw new Error("native app Info.plist is not a dictionary");
7205
5396
  const settings = app.settings;
7206
- const bundleIdentifier = nonEmptyString2(dictionary.CFBundleIdentifier) ?? nonEmptyString2(settings?.("PRODUCT_BUNDLE_IDENTIFIER"));
5397
+ const bundleIdentifier = nonEmptyString(dictionary.CFBundleIdentifier) ?? nonEmptyString(settings?.("PRODUCT_BUNDLE_IDENTIFIER"));
7207
5398
  if (!bundleIdentifier) throw new Error("native app has no bundle identifier");
7208
- const appVersion = nonEmptyString2(dictionary.CFBundleShortVersionString) ?? nonEmptyString2(settings?.("MARKETING_VERSION"));
7209
- const buildVersion = nonEmptyString2(dictionary.CFBundleVersion) ?? nonEmptyString2(settings?.("CURRENT_PROJECT_VERSION"));
5399
+ const appVersion = nonEmptyString(dictionary.CFBundleShortVersionString) ?? nonEmptyString(settings?.("MARKETING_VERSION"));
5400
+ const buildVersion = nonEmptyString(dictionary.CFBundleVersion) ?? nonEmptyString(settings?.("CURRENT_PROJECT_VERSION"));
7210
5401
  if (!appVersion || !buildVersion) {
7211
5402
  throw new Error(
7212
5403
  "native app has no version or build version; values its Xcode scheme derives in a build phase can be exported as process environment variables when opening"
7213
5404
  );
7214
5405
  }
7215
- const bundleName = nonEmptyString2(dictionary.CFBundleName) ?? nonEmptyString2(settings?.("PRODUCT_NAME")) ?? app.name;
7216
- const applicationDisplayName = nonEmptyString2(dictionary.CFBundleDisplayName);
5406
+ const bundleName = nonEmptyString(dictionary.CFBundleName) ?? nonEmptyString(settings?.("PRODUCT_NAME")) ?? app.name;
5407
+ const applicationDisplayName = nonEmptyString(dictionary.CFBundleDisplayName);
7217
5408
  const applicationName = applicationDisplayName ?? bundleName;
7218
5409
  const declaredBackgroundColor = dictionary.RCTRootViewBackgroundColor;
7219
5410
  const rootViewBackgroundColor = typeof declaredBackgroundColor === "number" && Number.isInteger(declaredBackgroundColor) ? declaredBackgroundColor : void 0;
@@ -7251,23 +5442,23 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
7251
5442
  const querySchemes = dictionary.LSApplicationQueriesSchemes;
7252
5443
  const urlQuerySchemes = Array.isArray(querySchemes) ? querySchemes : [];
7253
5444
  const intentIds = dictionary.OneAppIntentIdentifiers;
7254
- const appIntentIdentifiers = Array.isArray(intentIds) && intentIds.every((v6) => typeof v6 === "string") ? intentIds : [];
5445
+ const appIntentIdentifiers = Array.isArray(intentIds) && intentIds.every((v) => typeof v === "string") ? intentIds : [];
7255
5446
  const backgroundIds = dictionary.BGTaskSchedulerPermittedIdentifiers;
7256
- const backgroundTaskIdentifiers = Array.isArray(backgroundIds) && backgroundIds.every((v6) => typeof v6 === "string") ? backgroundIds : [];
5447
+ const backgroundTaskIdentifiers = Array.isArray(backgroundIds) && backgroundIds.every((v) => typeof v === "string") ? backgroundIds : [];
7257
5448
  const declaredModes = dictionary.UIBackgroundModes;
7258
- const backgroundModes = Array.isArray(declaredModes) && declaredModes.every((v6) => typeof v6 === "string") ? declaredModes : [];
7259
- const supportedInterfaceOrientations = Array.isArray(dictionary.UISupportedInterfaceOrientations) && dictionary.UISupportedInterfaceOrientations.every((v6) => typeof v6 === "string") ? dictionary.UISupportedInterfaceOrientations : [];
5449
+ const backgroundModes = Array.isArray(declaredModes) && declaredModes.every((v) => typeof v === "string") ? declaredModes : [];
5450
+ const supportedInterfaceOrientations = Array.isArray(dictionary.UISupportedInterfaceOrientations) && dictionary.UISupportedInterfaceOrientations.every((v) => typeof v === "string") ? dictionary.UISupportedInterfaceOrientations : [];
7260
5451
  const ipadSupportedInterfaceOrientations = Array.isArray(dictionary["UISupportedInterfaceOrientations~ipad"]) && dictionary["UISupportedInterfaceOrientations~ipad"].every(
7261
- (v6) => typeof v6 === "string"
5452
+ (v) => typeof v === "string"
7262
5453
  ) ? dictionary["UISupportedInterfaceOrientations~ipad"] : [];
7263
- const defaultScreenOrientationMask = nonEmptyString2(
5454
+ const defaultScreenOrientationMask = nonEmptyString(
7264
5455
  dictionary.EXDefaultScreenOrientationMask
7265
5456
  );
7266
- const shareIntoAppGroupId = nonEmptyString2(dictionary.ExpoShareIntoAppGroupId);
7267
- const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
5457
+ const shareIntoAppGroupId = nonEmptyString(dictionary.ExpoShareIntoAppGroupId);
5458
+ const rtcAppGroupIdentifier = nonEmptyString(dictionary.RTCAppGroupIdentifier);
7268
5459
  const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
7269
5460
  const rootModuleName = readRootModuleName(
7270
- app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && fs19.existsSync(file)).map((file) => fs19.readFileSync(file, "utf8"))
5461
+ app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && fs8.existsSync(file)).map((file) => fs8.readFileSync(file, "utf8"))
7271
5462
  );
7272
5463
  const identity = {
7273
5464
  ...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
@@ -7290,7 +5481,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
7290
5481
  googleSignIn: readGoogleSignInConfiguration(
7291
5482
  dictionary,
7292
5483
  Object.fromEntries(
7293
- app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(fs19.readFileSync(file, "utf8"))])
5484
+ app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(fs8.readFileSync(file, "utf8"))])
7294
5485
  )
7295
5486
  ),
7296
5487
  supportedInterfaceOrientations,
@@ -7300,11 +5491,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
7300
5491
  bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => value),
7301
5492
  appIconArtwork: resolveNativeAppIconArtwork(
7302
5493
  app.resources,
7303
- (file) => fs19.readFileSync(file, "utf8"),
5494
+ (file) => fs8.readFileSync(file, "utf8"),
7304
5495
  (file) => {
7305
- const extension = path40.extname(file).toLowerCase();
5496
+ const extension = path10.extname(file).toLowerCase();
7306
5497
  const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
7307
- return `data:${contentType};base64,${fs19.readFileSync(file).toString("base64")}`;
5498
+ return `data:${contentType};base64,${fs8.readFileSync(file).toString("base64")}`;
7308
5499
  },
7309
5500
  icons,
7310
5501
  app.appIconName,
@@ -7341,11 +5532,11 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
7341
5532
  const read = selectNativeAppIdentityReader(platform, {
7342
5533
  android: () => null,
7343
5534
  ios: () => {
7344
- const nested = path40.join(projectRoot, "ios");
7345
- const iosRoot = fs19.existsSync(nested) ? nested : projectRoot;
5535
+ const nested = path10.join(projectRoot, "ios");
5536
+ const iosRoot = fs8.existsSync(nested) ? nested : projectRoot;
7346
5537
  const prefix = iosRoot === nested ? "ios/" : "";
7347
5538
  const files = {};
7348
- for (const entry of fs19.readdirSync(iosRoot, { withFileTypes: true })) {
5539
+ for (const entry of fs8.readdirSync(iosRoot, { withFileTypes: true })) {
7349
5540
  if (entry.name === "Pods") continue;
7350
5541
  if (entry.isDirectory()) {
7351
5542
  const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : [
@@ -7353,17 +5544,17 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
7353
5544
  "AppDelegate.swift",
7354
5545
  "AppDelegate.mm",
7355
5546
  "AppDelegate.m",
7356
- ...fs19.readdirSync(path40.join(iosRoot, entry.name)).filter((name) => name.endsWith(".entitlements"))
5547
+ ...fs8.readdirSync(path10.join(iosRoot, entry.name)).filter((name) => name.endsWith(".entitlements"))
7357
5548
  ];
7358
5549
  for (const name of names) {
7359
5550
  const relative2 = `${prefix}${entry.name}/${name}`;
7360
- const file = path40.join(projectRoot, relative2);
7361
- if (fs19.existsSync(file)) files[relative2] = fs19.readFileSync(file, "utf8");
5551
+ const file = path10.join(projectRoot, relative2);
5552
+ if (fs8.existsSync(file)) files[relative2] = fs8.readFileSync(file, "utf8");
7362
5553
  }
7363
5554
  } else if (/AppDelegate\.(?:swift|mm|m)$|\.entitlements$/.test(entry.name)) {
7364
5555
  const relative2 = `${prefix}${entry.name}`;
7365
- const file = path40.join(projectRoot, relative2);
7366
- if (fs19.existsSync(file)) files[relative2] = fs19.readFileSync(file, "utf8");
5556
+ const file = path10.join(projectRoot, relative2);
5557
+ if (fs8.existsSync(file)) files[relative2] = fs8.readFileSync(file, "utf8");
7367
5558
  }
7368
5559
  }
7369
5560
  const identity = extractNativeAppIdentityFromFiles(
@@ -7380,41 +5571,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
7380
5571
  function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
7381
5572
  const files = {};
7382
5573
  if (androidMergedManifest) {
7383
- const file = path40.resolve(projectRoot, androidMergedManifest);
7384
- if (!fs19.existsSync(file)) return null;
7385
- files[androidMergedManifest] = fs19.readFileSync(file, "utf8");
5574
+ const file = path10.resolve(projectRoot, androidMergedManifest);
5575
+ if (!fs8.existsSync(file)) return null;
5576
+ files[androidMergedManifest] = fs8.readFileSync(file, "utf8");
7386
5577
  } else {
7387
- const androidRoot = path40.join(projectRoot, "android");
7388
- if (!fs19.existsSync(androidRoot)) return null;
5578
+ const androidRoot = path10.join(projectRoot, "android");
5579
+ if (!fs8.existsSync(androidRoot)) return null;
7389
5580
  const collect = (directory) => {
7390
- for (const entry of fs19.readdirSync(directory, { withFileTypes: true })) {
7391
- const file = path40.join(directory, entry.name);
5581
+ for (const entry of fs8.readdirSync(directory, { withFileTypes: true })) {
5582
+ const file = path10.join(directory, entry.name);
7392
5583
  if (entry.isDirectory()) collect(file);
7393
5584
  else if (entry.isFile() && entry.name === "AndroidManifest.xml")
7394
- files[path40.relative(projectRoot, file).split(path40.sep).join("/")] = fs19.readFileSync(file, "utf8");
5585
+ files[path10.relative(projectRoot, file).split(path10.sep).join("/")] = fs8.readFileSync(file, "utf8");
7395
5586
  }
7396
5587
  };
7397
- for (const module of fs19.readdirSync(androidRoot, { withFileTypes: true })) {
5588
+ for (const module of fs8.readdirSync(androidRoot, { withFileTypes: true })) {
7398
5589
  if (!module.isDirectory()) continue;
7399
- const outputs = path40.join(
5590
+ const outputs = path10.join(
7400
5591
  androidRoot,
7401
5592
  module.name,
7402
5593
  "build/intermediates/merged_manifests"
7403
5594
  );
7404
- if (fs19.existsSync(outputs)) collect(outputs);
5595
+ if (fs8.existsSync(outputs)) collect(outputs);
7405
5596
  }
7406
5597
  }
7407
5598
  for (const manifest of Object.keys(files)) {
7408
5599
  const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
7409
5600
  if (!resourceDirectory) continue;
7410
- const absolute = path40.resolve(projectRoot, resourceDirectory);
7411
- if (!fs19.existsSync(absolute)) continue;
7412
- for (const entry of fs19.readdirSync(absolute, { withFileTypes: true })) {
5601
+ const absolute = path10.resolve(projectRoot, resourceDirectory);
5602
+ if (!fs8.existsSync(absolute)) continue;
5603
+ for (const entry of fs8.readdirSync(absolute, { withFileTypes: true })) {
7413
5604
  if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
7414
- for (const resource of fs19.readdirSync(path40.join(absolute, entry.name))) {
5605
+ for (const resource of fs8.readdirSync(path10.join(absolute, entry.name))) {
7415
5606
  if (!resource.endsWith(".xml")) continue;
7416
5607
  const file = `${resourceDirectory}/${entry.name}/${resource}`;
7417
- files[file] = fs19.readFileSync(path40.resolve(projectRoot, file), "utf8");
5608
+ files[file] = fs8.readFileSync(path10.resolve(projectRoot, file), "utf8");
7418
5609
  }
7419
5610
  }
7420
5611
  }
@@ -7435,7 +5626,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
7435
5626
  parseInfoPlist,
7436
5627
  buildSdkVersion
7437
5628
  );
7438
- const projectManifestPath = path40.join(projectRoot, "package.json");
5629
+ const projectManifestPath = path10.join(projectRoot, "package.json");
7439
5630
  const projectRequire = createRequire(projectManifestPath);
7440
5631
  let reanimatedManifestPath;
7441
5632
  try {
@@ -7449,22 +5640,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
7449
5640
  throw error;
7450
5641
  }
7451
5642
  const installedManifest = JSON.parse(
7452
- fs19.readFileSync(reanimatedManifestPath, "utf8")
5643
+ fs8.readFileSync(reanimatedManifestPath, "utf8")
7453
5644
  );
7454
- const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
5645
+ const installedVersion = isRecord(installedManifest) ? nonEmptyString(installedManifest.version) : void 0;
7455
5646
  if (!installedVersion) throw new Error("Reanimated package version is malformed");
7456
5647
  if (Number.parseInt(installedVersion, 10) < 4) return identity;
7457
5648
  const defaults = JSON.parse(
7458
- fs19.readFileSync(
7459
- path40.join(
7460
- path40.dirname(reanimatedManifestPath),
5649
+ fs8.readFileSync(
5650
+ path10.join(
5651
+ path10.dirname(reanimatedManifestPath),
7461
5652
  "src/featureFlags/staticFlags.json"
7462
5653
  ),
7463
5654
  "utf8"
7464
5655
  )
7465
5656
  );
7466
5657
  if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
7467
- const manifest = JSON.parse(fs19.readFileSync(projectManifestPath, "utf8"));
5658
+ const manifest = JSON.parse(fs8.readFileSync(projectManifestPath, "utf8"));
7468
5659
  const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
7469
5660
  const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
7470
5661
  if (overrides !== void 0 && !isRecord(overrides)) {