peachsim 0.1.2186 → 0.1.2187
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +2706 -2381
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +3227 -3220
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +4538 -4213
- package/dist-lib/host/fetch-proxy-handler.cjs +6 -5
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +429 -279
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +645 -284
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +730 -580
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +99 -59
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +5196 -4871
- package/dist-lib/swift-compile.cjs +2 -2
- package/dist-lib/swift-compile.mjs +2 -2
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +2 -2
- package/dist-lib/vite.cjs +6 -5
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +10 -0
- package/src/android-autolinking.ts +45 -4
- package/src/android-bridge-packages.ts +2 -2
- package/src/android-gradle-sources.ts +143 -0
- package/src/androidAutolinkingContract.ts +8 -0
- package/src/androidGradleContract.ts +14 -0
- package/src/expo-kotlin-host.ts +3 -0
- package/src/java-module-abi.ts +145 -0
- package/src/javaAbiContract.ts +14 -0
- package/src/kotlin-host.ts +55 -3
- package/src/nitro-source.ts +2 -167
- package/src/react-native-autolinking.ts +153 -0
package/dist-lib/metro.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2187 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -170,6 +170,121 @@ var init_is_record = __esm({
|
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
|
|
173
|
+
// src/react-native-autolinking.ts
|
|
174
|
+
function autolinkerJson(command, output2) {
|
|
175
|
+
try {
|
|
176
|
+
return JSON.parse(output2.stdout);
|
|
177
|
+
} catch (cause) {
|
|
178
|
+
throw new Error(
|
|
179
|
+
`${command} exited 0 with ${output2.stdout.length} bytes of stdout that is not JSON (${cause instanceof Error ? cause.message : cause}); stderr: ${output2.stderr.trim().slice(0, 500) || "(empty)"}; stdout: ${output2.stdout.slice(0, 200) || "(empty)"}`,
|
|
180
|
+
{ cause }
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
async function cliAdvertises(cli, args, token, appRoot, signal) {
|
|
185
|
+
const { stdout, stderr } = await run("node", [cli, ...args], {
|
|
186
|
+
cwd: appRoot,
|
|
187
|
+
signal,
|
|
188
|
+
timeout: 3e4,
|
|
189
|
+
maxBuffer: 1 * 1024 * 1024,
|
|
190
|
+
env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" }
|
|
191
|
+
});
|
|
192
|
+
if (!stdout.trim())
|
|
193
|
+
throw new Error(
|
|
194
|
+
`${cli} ${args.join(" ")} returned empty help output${stderr.trim() ? `: ${stderr.trim()}` : ""}`
|
|
195
|
+
);
|
|
196
|
+
return stdout.includes(token);
|
|
197
|
+
}
|
|
198
|
+
function declaresDependency(appRoot, name2) {
|
|
199
|
+
const manifest = JSON.parse(
|
|
200
|
+
import_node_fs2.default.readFileSync(import_node_path2.default.join(appRoot, "package.json"), "utf8")
|
|
201
|
+
);
|
|
202
|
+
return isRecord(manifest) && ["dependencies", "devDependencies"].some((field) => {
|
|
203
|
+
const group = manifest[field];
|
|
204
|
+
return isRecord(group) && Object.hasOwn(group, name2);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
async function reactNativeAutolinkingConfig(appRoot, platform, signal) {
|
|
208
|
+
appRoot = import_node_fs2.default.realpathSync(appRoot);
|
|
209
|
+
const appRequire = (0, import_node_module.createRequire)(import_node_path2.default.join(appRoot, "package.json"));
|
|
210
|
+
const expoManifest = appRequire.resolve.paths("expo")?.map((directory) => import_node_path2.default.join(directory, "expo/package.json")).find((manifest) => import_node_fs2.default.existsSync(manifest));
|
|
211
|
+
const expoRequire = expoManifest ? (0, import_node_module.createRequire)(import_node_fs2.default.realpathSync(expoManifest)) : appRequire;
|
|
212
|
+
const nativeFile = (platform === "ios" ? ["ios/Podfile"] : ["android/settings.gradle", "android/settings.gradle.kts"]).map((name2) => import_node_path2.default.join(appRoot, name2)).find((file) => import_node_fs2.default.existsSync(file));
|
|
213
|
+
const nativeSource = nativeFile ? import_node_fs2.default.readFileSync(nativeFile, "utf8") : null;
|
|
214
|
+
const asksExpo = process.env.EXPO_USE_COMMUNITY_AUTOLINKING !== "1" && (nativeSource === null ? declaresDependency(appRoot, "expo") : nativeSource.includes("expo-modules-autolinking") || platform === "android" && nativeSource.includes("expoAutolinking.rnConfigCommand"));
|
|
215
|
+
const expoAutolinker = asksExpo ? [appRequire, expoRequire].flatMap((req) => req.resolve.paths("expo-modules-autolinking") ?? []).map((directory) => import_node_path2.default.join(directory, "expo-modules-autolinking/package.json")).find((manifest) => import_node_fs2.default.existsSync(manifest)) : void 0;
|
|
216
|
+
if (expoAutolinker) {
|
|
217
|
+
const cli2 = import_node_path2.default.join(import_node_path2.default.dirname(expoAutolinker), "bin/expo-modules-autolinking.js");
|
|
218
|
+
if (await cliAdvertises(cli2, ["--help"], "react-native-config", appRoot, signal)) {
|
|
219
|
+
const args = [
|
|
220
|
+
cli2,
|
|
221
|
+
"react-native-config",
|
|
222
|
+
"--json",
|
|
223
|
+
"--platform",
|
|
224
|
+
platform,
|
|
225
|
+
"--project-root",
|
|
226
|
+
appRoot
|
|
227
|
+
];
|
|
228
|
+
return autolinkerJson(
|
|
229
|
+
"expo-modules-autolinking react-native-config",
|
|
230
|
+
await run("node", args, {
|
|
231
|
+
timeout: 3e4,
|
|
232
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
233
|
+
env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" },
|
|
234
|
+
// expo configuration resolves its project from cwd.
|
|
235
|
+
cwd: appRoot,
|
|
236
|
+
signal
|
|
237
|
+
})
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const cliRequire = declaresDependency(appRoot, "one") ? (0, import_node_module.createRequire)(
|
|
242
|
+
(0, import_node_module.createRequire)(appRequire.resolve("one/package.json")).resolve(
|
|
243
|
+
"vxrn/package.json"
|
|
244
|
+
)
|
|
245
|
+
) : appRequire;
|
|
246
|
+
const cliManifest = cliRequire.resolve("@react-native-community/cli/package.json");
|
|
247
|
+
const cli = JSON.parse(import_node_fs2.default.readFileSync(cliManifest, "utf8"));
|
|
248
|
+
const bins = isRecord(cli) && isRecord(cli.bin) ? cli.bin : void 0;
|
|
249
|
+
const bin = [bins?.["rnc-cli"], bins?.["react-native"]].find(
|
|
250
|
+
(entry) => typeof entry === "string"
|
|
251
|
+
);
|
|
252
|
+
if (bin === void 0) throw new Error(`${cliManifest} declares no CLI bin`);
|
|
253
|
+
const cliPath = import_node_path2.default.join(import_node_path2.default.dirname(cliManifest), bin);
|
|
254
|
+
const configArgs = await cliAdvertises(
|
|
255
|
+
cliPath,
|
|
256
|
+
["config", "--help"],
|
|
257
|
+
"--platform",
|
|
258
|
+
appRoot,
|
|
259
|
+
signal
|
|
260
|
+
) ? ["config", "--platform", platform] : ["config"];
|
|
261
|
+
return autolinkerJson(
|
|
262
|
+
`react-native ${configArgs.join(" ")}`,
|
|
263
|
+
await run("node", [cliPath, ...configArgs], {
|
|
264
|
+
cwd: appRoot,
|
|
265
|
+
signal,
|
|
266
|
+
timeout: 3e4,
|
|
267
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
268
|
+
env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1", NO_COLOR: "1" }
|
|
269
|
+
})
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
var import_node_child_process, import_node_fs2, import_node_module, import_node_path2, import_node_util, run;
|
|
273
|
+
var init_react_native_autolinking = __esm({
|
|
274
|
+
"src/react-native-autolinking.ts"() {
|
|
275
|
+
"use strict";
|
|
276
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
277
|
+
import_node_child_process = require("node:child_process");
|
|
278
|
+
import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
279
|
+
import_node_module = require("node:module");
|
|
280
|
+
import_node_path2 = __toESM(require("node:path"), 1);
|
|
281
|
+
import_node_util = require("node:util");
|
|
282
|
+
init_forked_script_contract();
|
|
283
|
+
init_is_record();
|
|
284
|
+
run = (0, import_node_util.promisify)(import_node_child_process.execFile);
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
|
|
173
288
|
// src/backend-origin.ts
|
|
174
289
|
function normalizeHostname(hostname) {
|
|
175
290
|
return hostname.replace(/^\[|\]$/g, "").toLowerCase();
|
|
@@ -220,40 +335,40 @@ var init_version = __esm({
|
|
|
220
335
|
|
|
221
336
|
// src/home-paths.ts
|
|
222
337
|
function ambientHomeDir() {
|
|
223
|
-
return
|
|
338
|
+
return import_node_path5.default.join((0, import_node_os.homedir)(), ".peach");
|
|
224
339
|
}
|
|
225
340
|
function rnxHomeDir() {
|
|
226
341
|
const override = process.env[PEACH_HOME_ENV];
|
|
227
|
-
return override && override.length > 0 ?
|
|
342
|
+
return override && override.length > 0 ? import_node_path5.default.resolve(override) : ambientHomeDir();
|
|
228
343
|
}
|
|
229
344
|
function runtimesDir() {
|
|
230
|
-
return
|
|
345
|
+
return import_node_path5.default.join(rnxHomeDir(), "runtimes");
|
|
231
346
|
}
|
|
232
347
|
function runtimeDir(version) {
|
|
233
|
-
return
|
|
348
|
+
return import_node_path5.default.join(runtimesDir(), version);
|
|
234
349
|
}
|
|
235
350
|
function activeRuntimeFile() {
|
|
236
|
-
return
|
|
351
|
+
return import_node_path5.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
|
|
237
352
|
}
|
|
238
353
|
function cacheDir() {
|
|
239
|
-
return
|
|
354
|
+
return import_node_path5.default.join(rnxHomeDir(), "cache");
|
|
240
355
|
}
|
|
241
356
|
function readActiveRuntime() {
|
|
242
357
|
try {
|
|
243
|
-
const value =
|
|
358
|
+
const value = import_node_fs6.default.readFileSync(activeRuntimeFile(), "utf8").trim();
|
|
244
359
|
return value.length > 0 ? value : null;
|
|
245
360
|
} catch {
|
|
246
361
|
return null;
|
|
247
362
|
}
|
|
248
363
|
}
|
|
249
|
-
var
|
|
364
|
+
var import_node_fs6, import_node_os, import_node_path5, PEACH_HOME_ENV, ACTIVE_RUNTIME_FILE, DAEMON_LOCKFILE_MAX_BYTES;
|
|
250
365
|
var init_home_paths = __esm({
|
|
251
366
|
"src/home-paths.ts"() {
|
|
252
367
|
"use strict";
|
|
253
368
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
254
|
-
|
|
369
|
+
import_node_fs6 = __toESM(require("node:fs"), 1);
|
|
255
370
|
import_node_os = require("node:os");
|
|
256
|
-
|
|
371
|
+
import_node_path5 = __toESM(require("node:path"), 1);
|
|
257
372
|
PEACH_HOME_ENV = "PEACH_HOME";
|
|
258
373
|
ACTIVE_RUNTIME_FILE = "active";
|
|
259
374
|
DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
|
|
@@ -1429,17 +1544,17 @@ function visit(node, visitor) {
|
|
|
1429
1544
|
} else
|
|
1430
1545
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
1431
1546
|
}
|
|
1432
|
-
function visit_(key, node, visitor,
|
|
1433
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
1547
|
+
function visit_(key, node, visitor, path26) {
|
|
1548
|
+
const ctrl = callVisitor(key, node, visitor, path26);
|
|
1434
1549
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
1435
|
-
replaceNode(key,
|
|
1436
|
-
return visit_(key, ctrl, visitor,
|
|
1550
|
+
replaceNode(key, path26, ctrl);
|
|
1551
|
+
return visit_(key, ctrl, visitor, path26);
|
|
1437
1552
|
}
|
|
1438
1553
|
if (typeof ctrl !== "symbol") {
|
|
1439
1554
|
if (isCollection(node)) {
|
|
1440
|
-
|
|
1555
|
+
path26 = Object.freeze(path26.concat(node));
|
|
1441
1556
|
for (let i = 0; i < node.items.length; ++i) {
|
|
1442
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
1557
|
+
const ci = visit_(i, node.items[i], visitor, path26);
|
|
1443
1558
|
if (typeof ci === "number")
|
|
1444
1559
|
i = ci - 1;
|
|
1445
1560
|
else if (ci === BREAK)
|
|
@@ -1450,13 +1565,13 @@ function visit_(key, node, visitor, path25) {
|
|
|
1450
1565
|
}
|
|
1451
1566
|
}
|
|
1452
1567
|
} else if (isPair(node)) {
|
|
1453
|
-
|
|
1454
|
-
const ck = visit_("key", node.key, visitor,
|
|
1568
|
+
path26 = Object.freeze(path26.concat(node));
|
|
1569
|
+
const ck = visit_("key", node.key, visitor, path26);
|
|
1455
1570
|
if (ck === BREAK)
|
|
1456
1571
|
return BREAK;
|
|
1457
1572
|
else if (ck === REMOVE)
|
|
1458
1573
|
node.key = null;
|
|
1459
|
-
const cv = visit_("value", node.value, visitor,
|
|
1574
|
+
const cv = visit_("value", node.value, visitor, path26);
|
|
1460
1575
|
if (cv === BREAK)
|
|
1461
1576
|
return BREAK;
|
|
1462
1577
|
else if (cv === REMOVE)
|
|
@@ -1474,17 +1589,17 @@ async function visitAsync(node, visitor) {
|
|
|
1474
1589
|
} else
|
|
1475
1590
|
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
1476
1591
|
}
|
|
1477
|
-
async function visitAsync_(key, node, visitor,
|
|
1478
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
1592
|
+
async function visitAsync_(key, node, visitor, path26) {
|
|
1593
|
+
const ctrl = await callVisitor(key, node, visitor, path26);
|
|
1479
1594
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
1480
|
-
replaceNode(key,
|
|
1481
|
-
return visitAsync_(key, ctrl, visitor,
|
|
1595
|
+
replaceNode(key, path26, ctrl);
|
|
1596
|
+
return visitAsync_(key, ctrl, visitor, path26);
|
|
1482
1597
|
}
|
|
1483
1598
|
if (typeof ctrl !== "symbol") {
|
|
1484
1599
|
if (isCollection(node)) {
|
|
1485
|
-
|
|
1600
|
+
path26 = Object.freeze(path26.concat(node));
|
|
1486
1601
|
for (let i = 0; i < node.items.length; ++i) {
|
|
1487
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
1602
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path26);
|
|
1488
1603
|
if (typeof ci === "number")
|
|
1489
1604
|
i = ci - 1;
|
|
1490
1605
|
else if (ci === BREAK)
|
|
@@ -1495,13 +1610,13 @@ async function visitAsync_(key, node, visitor, path25) {
|
|
|
1495
1610
|
}
|
|
1496
1611
|
}
|
|
1497
1612
|
} else if (isPair(node)) {
|
|
1498
|
-
|
|
1499
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
1613
|
+
path26 = Object.freeze(path26.concat(node));
|
|
1614
|
+
const ck = await visitAsync_("key", node.key, visitor, path26);
|
|
1500
1615
|
if (ck === BREAK)
|
|
1501
1616
|
return BREAK;
|
|
1502
1617
|
else if (ck === REMOVE)
|
|
1503
1618
|
node.key = null;
|
|
1504
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
1619
|
+
const cv = await visitAsync_("value", node.value, visitor, path26);
|
|
1505
1620
|
if (cv === BREAK)
|
|
1506
1621
|
return BREAK;
|
|
1507
1622
|
else if (cv === REMOVE)
|
|
@@ -1528,23 +1643,23 @@ function initVisitor(visitor) {
|
|
|
1528
1643
|
}
|
|
1529
1644
|
return visitor;
|
|
1530
1645
|
}
|
|
1531
|
-
function callVisitor(key, node, visitor,
|
|
1646
|
+
function callVisitor(key, node, visitor, path26) {
|
|
1532
1647
|
if (typeof visitor === "function")
|
|
1533
|
-
return visitor(key, node,
|
|
1648
|
+
return visitor(key, node, path26);
|
|
1534
1649
|
if (isMap(node))
|
|
1535
|
-
return visitor.Map?.(key, node,
|
|
1650
|
+
return visitor.Map?.(key, node, path26);
|
|
1536
1651
|
if (isSeq(node))
|
|
1537
|
-
return visitor.Seq?.(key, node,
|
|
1652
|
+
return visitor.Seq?.(key, node, path26);
|
|
1538
1653
|
if (isPair(node))
|
|
1539
|
-
return visitor.Pair?.(key, node,
|
|
1654
|
+
return visitor.Pair?.(key, node, path26);
|
|
1540
1655
|
if (isScalar(node))
|
|
1541
|
-
return visitor.Scalar?.(key, node,
|
|
1656
|
+
return visitor.Scalar?.(key, node, path26);
|
|
1542
1657
|
if (isAlias(node))
|
|
1543
|
-
return visitor.Alias?.(key, node,
|
|
1658
|
+
return visitor.Alias?.(key, node, path26);
|
|
1544
1659
|
return void 0;
|
|
1545
1660
|
}
|
|
1546
|
-
function replaceNode(key,
|
|
1547
|
-
const parent =
|
|
1661
|
+
function replaceNode(key, path26, node) {
|
|
1662
|
+
const parent = path26[path26.length - 1];
|
|
1548
1663
|
if (isCollection(parent)) {
|
|
1549
1664
|
parent.items[key] = node;
|
|
1550
1665
|
} else if (isPair(parent)) {
|
|
@@ -2104,10 +2219,10 @@ var init_createNode = __esm({
|
|
|
2104
2219
|
});
|
|
2105
2220
|
|
|
2106
2221
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
2107
|
-
function collectionFromPath(schema4,
|
|
2222
|
+
function collectionFromPath(schema4, path26, value) {
|
|
2108
2223
|
let v6 = value;
|
|
2109
|
-
for (let i =
|
|
2110
|
-
const k =
|
|
2224
|
+
for (let i = path26.length - 1; i >= 0; --i) {
|
|
2225
|
+
const k = path26[i];
|
|
2111
2226
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
2112
2227
|
const a = [];
|
|
2113
2228
|
a[k] = v6;
|
|
@@ -2133,7 +2248,7 @@ var init_Collection = __esm({
|
|
|
2133
2248
|
init_createNode();
|
|
2134
2249
|
init_identity();
|
|
2135
2250
|
init_Node();
|
|
2136
|
-
isEmptyPath = (
|
|
2251
|
+
isEmptyPath = (path26) => path26 == null || typeof path26 === "object" && !!path26[Symbol.iterator]().next().done;
|
|
2137
2252
|
Collection = class extends NodeBase {
|
|
2138
2253
|
constructor(type, schema4) {
|
|
2139
2254
|
super(type);
|
|
@@ -2163,11 +2278,11 @@ var init_Collection = __esm({
|
|
|
2163
2278
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
2164
2279
|
* that already exists in the map.
|
|
2165
2280
|
*/
|
|
2166
|
-
addIn(
|
|
2167
|
-
if (isEmptyPath(
|
|
2281
|
+
addIn(path26, value) {
|
|
2282
|
+
if (isEmptyPath(path26))
|
|
2168
2283
|
this.add(value);
|
|
2169
2284
|
else {
|
|
2170
|
-
const [key, ...rest] =
|
|
2285
|
+
const [key, ...rest] = path26;
|
|
2171
2286
|
const node = this.get(key, true);
|
|
2172
2287
|
if (isCollection(node))
|
|
2173
2288
|
node.addIn(rest, value);
|
|
@@ -2181,8 +2296,8 @@ var init_Collection = __esm({
|
|
|
2181
2296
|
* Removes a value from the collection.
|
|
2182
2297
|
* @returns `true` if the item was found and removed.
|
|
2183
2298
|
*/
|
|
2184
|
-
deleteIn(
|
|
2185
|
-
const [key, ...rest] =
|
|
2299
|
+
deleteIn(path26) {
|
|
2300
|
+
const [key, ...rest] = path26;
|
|
2186
2301
|
if (rest.length === 0)
|
|
2187
2302
|
return this.delete(key);
|
|
2188
2303
|
const node = this.get(key, true);
|
|
@@ -2196,8 +2311,8 @@ var init_Collection = __esm({
|
|
|
2196
2311
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
2197
2312
|
* `true` (collections are always returned intact).
|
|
2198
2313
|
*/
|
|
2199
|
-
getIn(
|
|
2200
|
-
const [key, ...rest] =
|
|
2314
|
+
getIn(path26, keepScalar) {
|
|
2315
|
+
const [key, ...rest] = path26;
|
|
2201
2316
|
const node = this.get(key, true);
|
|
2202
2317
|
if (rest.length === 0)
|
|
2203
2318
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -2215,8 +2330,8 @@ var init_Collection = __esm({
|
|
|
2215
2330
|
/**
|
|
2216
2331
|
* Checks if the collection includes a value with the key `key`.
|
|
2217
2332
|
*/
|
|
2218
|
-
hasIn(
|
|
2219
|
-
const [key, ...rest] =
|
|
2333
|
+
hasIn(path26) {
|
|
2334
|
+
const [key, ...rest] = path26;
|
|
2220
2335
|
if (rest.length === 0)
|
|
2221
2336
|
return this.has(key);
|
|
2222
2337
|
const node = this.get(key, true);
|
|
@@ -2226,8 +2341,8 @@ var init_Collection = __esm({
|
|
|
2226
2341
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
2227
2342
|
* boolean to add/remove the item from the set.
|
|
2228
2343
|
*/
|
|
2229
|
-
setIn(
|
|
2230
|
-
const [key, ...rest] =
|
|
2344
|
+
setIn(path26, value) {
|
|
2345
|
+
const [key, ...rest] = path26;
|
|
2231
2346
|
if (rest.length === 0) {
|
|
2232
2347
|
this.set(key, value);
|
|
2233
2348
|
} else {
|
|
@@ -4200,15 +4315,15 @@ function visit2(cst, visitor) {
|
|
|
4200
4315
|
cst = { start: cst.start, value: cst.value };
|
|
4201
4316
|
_visit(Object.freeze([]), cst, visitor);
|
|
4202
4317
|
}
|
|
4203
|
-
function _visit(
|
|
4204
|
-
let ctrl = visitor(item,
|
|
4318
|
+
function _visit(path26, item, visitor) {
|
|
4319
|
+
let ctrl = visitor(item, path26);
|
|
4205
4320
|
if (typeof ctrl === "symbol")
|
|
4206
4321
|
return ctrl;
|
|
4207
4322
|
for (const field of ["key", "value"]) {
|
|
4208
4323
|
const token = item[field];
|
|
4209
4324
|
if (token && "items" in token) {
|
|
4210
4325
|
for (let i = 0; i < token.items.length; ++i) {
|
|
4211
|
-
const ci = _visit(Object.freeze(
|
|
4326
|
+
const ci = _visit(Object.freeze(path26.concat([[field, i]])), token.items[i], visitor);
|
|
4212
4327
|
if (typeof ci === "number")
|
|
4213
4328
|
i = ci - 1;
|
|
4214
4329
|
else if (ci === BREAK2)
|
|
@@ -4219,10 +4334,10 @@ function _visit(path25, item, visitor) {
|
|
|
4219
4334
|
}
|
|
4220
4335
|
}
|
|
4221
4336
|
if (typeof ctrl === "function" && field === "key")
|
|
4222
|
-
ctrl = ctrl(item,
|
|
4337
|
+
ctrl = ctrl(item, path26);
|
|
4223
4338
|
}
|
|
4224
4339
|
}
|
|
4225
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
4340
|
+
return typeof ctrl === "function" ? ctrl(item, path26) : ctrl;
|
|
4226
4341
|
}
|
|
4227
4342
|
var BREAK2, SKIP2, REMOVE2;
|
|
4228
4343
|
var init_cst_visit = __esm({
|
|
@@ -4234,9 +4349,9 @@ var init_cst_visit = __esm({
|
|
|
4234
4349
|
visit2.BREAK = BREAK2;
|
|
4235
4350
|
visit2.SKIP = SKIP2;
|
|
4236
4351
|
visit2.REMOVE = REMOVE2;
|
|
4237
|
-
visit2.itemAtPath = (cst,
|
|
4352
|
+
visit2.itemAtPath = (cst, path26) => {
|
|
4238
4353
|
let item = cst;
|
|
4239
|
-
for (const [field, index] of
|
|
4354
|
+
for (const [field, index] of path26) {
|
|
4240
4355
|
const tok = item?.[field];
|
|
4241
4356
|
if (tok && "items" in tok) {
|
|
4242
4357
|
item = tok.items[index];
|
|
@@ -4245,9 +4360,9 @@ var init_cst_visit = __esm({
|
|
|
4245
4360
|
}
|
|
4246
4361
|
return item;
|
|
4247
4362
|
};
|
|
4248
|
-
visit2.parentCollection = (cst,
|
|
4249
|
-
const parent = visit2.itemAtPath(cst,
|
|
4250
|
-
const field =
|
|
4363
|
+
visit2.parentCollection = (cst, path26) => {
|
|
4364
|
+
const parent = visit2.itemAtPath(cst, path26.slice(0, -1));
|
|
4365
|
+
const field = path26[path26.length - 1][0];
|
|
4251
4366
|
const coll = parent?.[field];
|
|
4252
4367
|
if (coll && "items" in coll)
|
|
4253
4368
|
return coll;
|
|
@@ -4342,25 +4457,25 @@ var init_browser = __esm({
|
|
|
4342
4457
|
});
|
|
4343
4458
|
|
|
4344
4459
|
// cli/commands/nodeRepoFileReader.ts
|
|
4345
|
-
var
|
|
4460
|
+
var import_node_fs8, nodeRepoFileReader;
|
|
4346
4461
|
var init_nodeRepoFileReader = __esm({
|
|
4347
4462
|
"cli/commands/nodeRepoFileReader.ts"() {
|
|
4348
4463
|
"use strict";
|
|
4349
4464
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
4350
|
-
|
|
4465
|
+
import_node_fs8 = require("node:fs");
|
|
4351
4466
|
nodeRepoFileReader = {
|
|
4352
|
-
exists:
|
|
4353
|
-
readText: (filePath) => (0,
|
|
4354
|
-
entries: (directory) => (0,
|
|
4467
|
+
exists: import_node_fs8.existsSync,
|
|
4468
|
+
readText: (filePath) => (0, import_node_fs8.readFileSync)(filePath, "utf8"),
|
|
4469
|
+
entries: (directory) => (0, import_node_fs8.readdirSync)(directory, { withFileTypes: true }).map((entry) => ({
|
|
4355
4470
|
name: entry.name,
|
|
4356
4471
|
directory: entry.isDirectory()
|
|
4357
4472
|
})),
|
|
4358
|
-
isDirectory: (filePath) => (0,
|
|
4473
|
+
isDirectory: (filePath) => (0, import_node_fs8.statSync)(filePath).isDirectory(),
|
|
4359
4474
|
readMetadata(filePath) {
|
|
4360
4475
|
try {
|
|
4361
|
-
const info = (0,
|
|
4476
|
+
const info = (0, import_node_fs8.lstatSync)(filePath);
|
|
4362
4477
|
if (!info.isFile() || info.size > 4 * 1024 * 1024) return null;
|
|
4363
|
-
return (0,
|
|
4478
|
+
return (0, import_node_fs8.readFileSync)(filePath, "utf8");
|
|
4364
4479
|
} catch {
|
|
4365
4480
|
return null;
|
|
4366
4481
|
}
|
|
@@ -4383,7 +4498,7 @@ function scanRepository(root) {
|
|
|
4383
4498
|
directories.push(next.dir);
|
|
4384
4499
|
let handle;
|
|
4385
4500
|
try {
|
|
4386
|
-
handle = (0,
|
|
4501
|
+
handle = (0, import_node_fs9.opendirSync)(next.dir);
|
|
4387
4502
|
} catch {
|
|
4388
4503
|
unreadable++;
|
|
4389
4504
|
continue;
|
|
@@ -4398,7 +4513,7 @@ function scanRepository(root) {
|
|
|
4398
4513
|
truncated = true;
|
|
4399
4514
|
continue;
|
|
4400
4515
|
}
|
|
4401
|
-
pending.push({ dir: (0,
|
|
4516
|
+
pending.push({ dir: (0, import_node_path7.join)(next.dir, entry.name), depth: next.depth + 1 });
|
|
4402
4517
|
}
|
|
4403
4518
|
} finally {
|
|
4404
4519
|
handle.closeSync();
|
|
@@ -4417,8 +4532,8 @@ function metadataValue(value, key) {
|
|
|
4417
4532
|
if (!value || typeof value !== "object") return void 0;
|
|
4418
4533
|
return Object.getOwnPropertyDescriptor(value, key)?.value;
|
|
4419
4534
|
}
|
|
4420
|
-
function readProjectJson(
|
|
4421
|
-
const text2 = readProjectMetadata(
|
|
4535
|
+
function readProjectJson(path26, files = nodeRepoFileReader) {
|
|
4536
|
+
const text2 = readProjectMetadata(path26, files);
|
|
4422
4537
|
if (text2 === null) return null;
|
|
4423
4538
|
try {
|
|
4424
4539
|
const value = JSON.parse(text2);
|
|
@@ -4428,7 +4543,7 @@ function readProjectJson(path25, files = nodeRepoFileReader) {
|
|
|
4428
4543
|
}
|
|
4429
4544
|
}
|
|
4430
4545
|
function readProjectManifest(dir, files = nodeRepoFileReader) {
|
|
4431
|
-
const parsed = readProjectJson((0,
|
|
4546
|
+
const parsed = readProjectJson((0, import_node_path7.join)(dir, "package.json"), files);
|
|
4432
4547
|
if (!parsed || typeof parsed !== "object") return null;
|
|
4433
4548
|
const record = (value) => {
|
|
4434
4549
|
if (!value || typeof value !== "object") return {};
|
|
@@ -4445,13 +4560,13 @@ function readProjectManifest(dir, files = nodeRepoFileReader) {
|
|
|
4445
4560
|
devDependencies: record(metadataValue(parsed, "devDependencies"))
|
|
4446
4561
|
};
|
|
4447
4562
|
}
|
|
4448
|
-
var
|
|
4563
|
+
var import_node_fs9, import_node_path7, import_json5, REPORT_SKIP_DIRS, PODFILE_NEW_ARCH_MARK, PODFILE_NEW_ARCH_RUBY;
|
|
4449
4564
|
var init_detect = __esm({
|
|
4450
4565
|
"cli/commands/detect.ts"() {
|
|
4451
4566
|
"use strict";
|
|
4452
4567
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
4453
|
-
|
|
4454
|
-
|
|
4568
|
+
import_node_fs9 = require("node:fs");
|
|
4569
|
+
import_node_path7 = require("node:path");
|
|
4455
4570
|
import_json5 = __toESM(require_lib(), 1);
|
|
4456
4571
|
init_browser();
|
|
4457
4572
|
init_nodeRepoFileReader();
|
|
@@ -4516,37 +4631,37 @@ var init_swiftContract = __esm({
|
|
|
4516
4631
|
});
|
|
4517
4632
|
|
|
4518
4633
|
// src/kotlin-toolchain.ts
|
|
4519
|
-
var
|
|
4634
|
+
var import_node_child_process8, import_node_util6, run5;
|
|
4520
4635
|
var init_kotlin_toolchain = __esm({
|
|
4521
4636
|
"src/kotlin-toolchain.ts"() {
|
|
4522
4637
|
"use strict";
|
|
4523
4638
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
4524
|
-
|
|
4525
|
-
|
|
4639
|
+
import_node_child_process8 = require("node:child_process");
|
|
4640
|
+
import_node_util6 = require("node:util");
|
|
4526
4641
|
init_home_paths();
|
|
4527
4642
|
init_is_record();
|
|
4528
|
-
|
|
4643
|
+
run5 = (0, import_node_util6.promisify)(import_node_child_process8.execFile);
|
|
4529
4644
|
}
|
|
4530
4645
|
});
|
|
4531
4646
|
|
|
4532
4647
|
// src/swift-source-file.ts
|
|
4533
4648
|
function relativeInside(root, file) {
|
|
4534
|
-
const relative3 =
|
|
4535
|
-
return relative3 === ".." || relative3.startsWith(`..${
|
|
4649
|
+
const relative3 = import_node_path17.default.relative(root, file);
|
|
4650
|
+
return relative3 === ".." || relative3.startsWith(`..${import_node_path17.default.sep}`) || import_node_path17.default.isAbsolute(relative3) ? null : relative3;
|
|
4536
4651
|
}
|
|
4537
4652
|
function packageInputPath(canonicalRoot, file) {
|
|
4538
|
-
const canonicalFile =
|
|
4653
|
+
const canonicalFile = import_node_fs16.default.realpathSync(file);
|
|
4539
4654
|
if (relativeInside(canonicalRoot, canonicalFile) === null) {
|
|
4540
4655
|
throw new Error(`swift input escapes the selected package: ${file}`);
|
|
4541
4656
|
}
|
|
4542
4657
|
return canonicalFile;
|
|
4543
4658
|
}
|
|
4544
4659
|
function readPackageFile(root, file, maxBytes) {
|
|
4545
|
-
const canonicalFile = packageInputPath(
|
|
4546
|
-
const expected =
|
|
4547
|
-
const fd =
|
|
4660
|
+
const canonicalFile = packageInputPath(import_node_fs16.default.realpathSync(root), file);
|
|
4661
|
+
const expected = import_node_fs16.default.statSync(canonicalFile);
|
|
4662
|
+
const fd = import_node_fs16.default.openSync(canonicalFile, import_node_fs16.default.constants.O_RDONLY | import_node_fs16.default.constants.O_NOFOLLOW);
|
|
4548
4663
|
try {
|
|
4549
|
-
const stat =
|
|
4664
|
+
const stat = import_node_fs16.default.fstatSync(fd);
|
|
4550
4665
|
if (stat.dev !== expected.dev || stat.ino !== expected.ino) {
|
|
4551
4666
|
throw new Error(`swift input changed while opening: ${file}`);
|
|
4552
4667
|
}
|
|
@@ -4556,25 +4671,25 @@ function readPackageFile(root, file, maxBytes) {
|
|
|
4556
4671
|
const bytes = Buffer.alloc(stat.size + 1);
|
|
4557
4672
|
let offset = 0;
|
|
4558
4673
|
while (offset < bytes.length) {
|
|
4559
|
-
const count =
|
|
4674
|
+
const count = import_node_fs16.default.readSync(fd, bytes, offset, bytes.length - offset, null);
|
|
4560
4675
|
if (count === 0) break;
|
|
4561
4676
|
offset += count;
|
|
4562
4677
|
}
|
|
4563
|
-
if (offset !== stat.size ||
|
|
4678
|
+
if (offset !== stat.size || import_node_fs16.default.fstatSync(fd).size !== stat.size) {
|
|
4564
4679
|
throw new Error(`swift input changed while reading: ${file}`);
|
|
4565
4680
|
}
|
|
4566
4681
|
return bytes.subarray(0, offset);
|
|
4567
4682
|
} finally {
|
|
4568
|
-
|
|
4683
|
+
import_node_fs16.default.closeSync(fd);
|
|
4569
4684
|
}
|
|
4570
4685
|
}
|
|
4571
|
-
var
|
|
4686
|
+
var import_node_fs16, import_node_path17;
|
|
4572
4687
|
var init_swift_source_file = __esm({
|
|
4573
4688
|
"src/swift-source-file.ts"() {
|
|
4574
4689
|
"use strict";
|
|
4575
4690
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
4576
|
-
|
|
4577
|
-
|
|
4691
|
+
import_node_fs16 = __toESM(require("node:fs"), 1);
|
|
4692
|
+
import_node_path17 = __toESM(require("node:path"), 1);
|
|
4578
4693
|
}
|
|
4579
4694
|
});
|
|
4580
4695
|
|
|
@@ -4599,19 +4714,19 @@ var init_swift_submit = __esm({
|
|
|
4599
4714
|
});
|
|
4600
4715
|
|
|
4601
4716
|
// src/nitro-dependencies.ts
|
|
4602
|
-
var
|
|
4717
|
+
var import_node_child_process9, import_node_util7, run6, DOUBLE_CONVERSION_WASM32_BACKPORT, RN_SHARED_DEPENDENCIES, RN_FMT_11_DEPENDENCIES, RN_FAST_FLOAT_6_DEPENDENCIES, RN_FMT_12_DEPENDENCIES;
|
|
4603
4718
|
var init_nitro_dependencies = __esm({
|
|
4604
4719
|
"src/nitro-dependencies.ts"() {
|
|
4605
4720
|
"use strict";
|
|
4606
4721
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
4607
|
-
|
|
4608
|
-
|
|
4722
|
+
import_node_child_process9 = require("node:child_process");
|
|
4723
|
+
import_node_util7 = require("node:util");
|
|
4609
4724
|
init_home_paths();
|
|
4610
4725
|
init_is_record();
|
|
4611
4726
|
init_kotlin_toolchain();
|
|
4612
4727
|
init_swift_source_file();
|
|
4613
4728
|
init_swift_submit();
|
|
4614
|
-
|
|
4729
|
+
run6 = (0, import_node_util7.promisify)(import_node_child_process9.execFile);
|
|
4615
4730
|
DOUBLE_CONVERSION_WASM32_BACKPORT = {
|
|
4616
4731
|
upstreamCommit: "8857767d5b2f5a035321e3712e8cd0008840ba6b",
|
|
4617
4732
|
originalSha256: "b495b11f7b61693486894f747add5b454894b8b3ca41aa1610d370ba16407ab7",
|
|
@@ -4697,19 +4812,19 @@ function readJson(root, relative3) {
|
|
|
4697
4812
|
return JSON.parse(
|
|
4698
4813
|
readPackageFile(
|
|
4699
4814
|
root,
|
|
4700
|
-
|
|
4815
|
+
import_node_path18.default.join(root, relative3),
|
|
4701
4816
|
MAX_SWIFT_COMPILE_SOURCE_BYTES
|
|
4702
4817
|
).toString("utf8")
|
|
4703
4818
|
);
|
|
4704
4819
|
}
|
|
4705
4820
|
function registrations(root) {
|
|
4706
|
-
const directory =
|
|
4707
|
-
const initializers =
|
|
4821
|
+
const directory = import_node_path18.default.join(root, "nitrogen/generated/ios");
|
|
4822
|
+
const initializers = import_node_fs17.default.readdirSync(directory).filter((file) => file.endsWith("Autolinking.mm"));
|
|
4708
4823
|
if (initializers.length !== 1)
|
|
4709
4824
|
throw new Error(`${root}: expected one generated Nitro iOS initializer`);
|
|
4710
4825
|
const source = readPackageFile(
|
|
4711
4826
|
root,
|
|
4712
|
-
|
|
4827
|
+
import_node_path18.default.join(directory, initializers[0]),
|
|
4713
4828
|
MAX_SWIFT_COMPILE_SOURCE_BYTES
|
|
4714
4829
|
).toString("utf8");
|
|
4715
4830
|
const namespaces = [
|
|
@@ -4772,18 +4887,18 @@ function registrations(root) {
|
|
|
4772
4887
|
if (new Set(classes.map(({ name: name2 }) => name2)).size !== classes.length)
|
|
4773
4888
|
throw new Error(`${root}: duplicate generated Nitro iOS registration`);
|
|
4774
4889
|
classes.sort((a, b) => a.name.localeCompare(b.name));
|
|
4775
|
-
const ios =
|
|
4776
|
-
if (swiftModule === null &&
|
|
4890
|
+
const ios = import_node_path18.default.join(root, "ios");
|
|
4891
|
+
if (swiftModule === null && import_node_fs17.default.existsSync(ios) && import_node_fs17.default.readdirSync(ios, { recursive: true, encoding: "utf8" }).some((file) => file.endsWith(".swift") && !file.startsWith("Tests")))
|
|
4777
4892
|
swiftModule = initializers[0].slice(0, -"Autolinking.mm".length);
|
|
4778
4893
|
return { namespace, swiftModule, classes, views: viewNames(root, classes) };
|
|
4779
4894
|
}
|
|
4780
4895
|
function viewNames(root, classes) {
|
|
4781
|
-
const directory =
|
|
4782
|
-
if (!
|
|
4896
|
+
const directory = import_node_path18.default.join(root, "nitrogen/generated/shared/json");
|
|
4897
|
+
if (!import_node_fs17.default.existsSync(directory)) return /* @__PURE__ */ new Set();
|
|
4783
4898
|
const views = /* @__PURE__ */ new Set();
|
|
4784
|
-
for (const file of
|
|
4899
|
+
for (const file of import_node_fs17.default.readdirSync(directory)) {
|
|
4785
4900
|
if (!file.endsWith("Config.json")) continue;
|
|
4786
|
-
const config = readJson(root,
|
|
4901
|
+
const config = readJson(root, import_node_path18.default.join("nitrogen/generated/shared/json", file));
|
|
4787
4902
|
const name2 = object3(config) ? config.uiViewClassName : void 0;
|
|
4788
4903
|
if (typeof name2 === "string" && classes.some((entry) => entry.name === name2))
|
|
4789
4904
|
views.add(name2);
|
|
@@ -4791,28 +4906,25 @@ function viewNames(root, classes) {
|
|
|
4791
4906
|
return views;
|
|
4792
4907
|
}
|
|
4793
4908
|
function hasNitroIosInitializer(root) {
|
|
4794
|
-
const generated =
|
|
4795
|
-
return
|
|
4909
|
+
const generated = import_node_path18.default.join(root, "nitrogen/generated/ios");
|
|
4910
|
+
return import_node_fs17.default.existsSync(generated) && import_node_fs17.default.readdirSync(generated).some((file) => file.endsWith("Autolinking.mm"));
|
|
4796
4911
|
}
|
|
4797
4912
|
function nitroRegisteredNames(root) {
|
|
4798
4913
|
if (!hasNitroIosInitializer(root)) return null;
|
|
4799
4914
|
const { classes, views } = registrations(root);
|
|
4800
4915
|
return { names: classes.map(({ name: name2 }) => name2), views: [...views].sort() };
|
|
4801
4916
|
}
|
|
4802
|
-
var
|
|
4917
|
+
var import_node_fs17, import_node_path18;
|
|
4803
4918
|
var init_nitro_source = __esm({
|
|
4804
4919
|
"src/nitro-source.ts"() {
|
|
4805
4920
|
"use strict";
|
|
4806
4921
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
import_node_path17 = __toESM(require("node:path"), 1);
|
|
4810
|
-
import_node_util7 = require("node:util");
|
|
4811
|
-
init_forked_script_contract();
|
|
4922
|
+
import_node_fs17 = __toESM(require("node:fs"), 1);
|
|
4923
|
+
import_node_path18 = __toESM(require("node:path"), 1);
|
|
4812
4924
|
init_nitro_dependencies();
|
|
4925
|
+
init_react_native_autolinking();
|
|
4813
4926
|
init_swift_source_file();
|
|
4814
4927
|
init_swift_submit();
|
|
4815
|
-
run6 = (0, import_node_util7.promisify)(import_node_child_process9.execFile);
|
|
4816
4928
|
}
|
|
4817
4929
|
});
|
|
4818
4930
|
|
|
@@ -5695,16 +5807,16 @@ function sendJavaScript(req, res, source) {
|
|
|
5695
5807
|
res.end(req.method === "HEAD" ? void 0 : source);
|
|
5696
5808
|
}
|
|
5697
5809
|
function resolveReplacementModuleFile(fromFile, specifier) {
|
|
5698
|
-
const base =
|
|
5810
|
+
const base = import_node_path24.default.resolve(import_node_path24.default.dirname(fromFile), specifier);
|
|
5699
5811
|
const candidates = [
|
|
5700
5812
|
...REPLACEMENT_MODULE_EXTENSIONS.some(
|
|
5701
|
-
(ext) => ext ===
|
|
5813
|
+
(ext) => ext === import_node_path24.default.extname(base).toLowerCase()
|
|
5702
5814
|
) ? [base] : [],
|
|
5703
5815
|
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
|
|
5704
|
-
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) =>
|
|
5816
|
+
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path24.default.join(base, `index${ext}`))
|
|
5705
5817
|
];
|
|
5706
5818
|
const found = candidates.find(
|
|
5707
|
-
(candidate) => (0,
|
|
5819
|
+
(candidate) => (0, import_node_fs22.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
|
|
5708
5820
|
);
|
|
5709
5821
|
if (!found) {
|
|
5710
5822
|
throw new Error(
|
|
@@ -5715,8 +5827,8 @@ function resolveReplacementModuleFile(fromFile, specifier) {
|
|
|
5715
5827
|
}
|
|
5716
5828
|
function isInsideAny(roots, file) {
|
|
5717
5829
|
return roots.some((root) => {
|
|
5718
|
-
const relative3 =
|
|
5719
|
-
return !relative3.startsWith("..") && !
|
|
5830
|
+
const relative3 = import_node_path24.default.relative(root, file);
|
|
5831
|
+
return !relative3.startsWith("..") && !import_node_path24.default.isAbsolute(relative3);
|
|
5720
5832
|
});
|
|
5721
5833
|
}
|
|
5722
5834
|
function isReplacementModuleRequestUrl(rawUrl) {
|
|
@@ -5765,19 +5877,19 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
5765
5877
|
res.end("missing path param");
|
|
5766
5878
|
return true;
|
|
5767
5879
|
}
|
|
5768
|
-
const extension =
|
|
5880
|
+
const extension = import_node_path24.default.extname(targetPath).toLowerCase();
|
|
5769
5881
|
if (!REPLACEMENT_MODULE_EXTENSIONS.some((allowed) => allowed === extension)) {
|
|
5770
5882
|
res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
|
|
5771
5883
|
res.end(`replacement files must be ${REPLACEMENT_MODULE_EXTENSIONS.join(", ")}`);
|
|
5772
5884
|
return true;
|
|
5773
5885
|
}
|
|
5774
|
-
if (!
|
|
5886
|
+
if (!import_node_path24.default.isAbsolute(targetPath)) {
|
|
5775
5887
|
res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
|
|
5776
5888
|
res.end("replacement file path must be absolute");
|
|
5777
5889
|
return true;
|
|
5778
5890
|
}
|
|
5779
5891
|
const runtimePackages = new Set(url.searchParams.getAll("runtimePackage"));
|
|
5780
|
-
const servedRoots = options.servedRoots?.map((root) =>
|
|
5892
|
+
const servedRoots = options.servedRoots?.map((root) => import_node_path24.default.resolve(root));
|
|
5781
5893
|
if (servedRoots && !isInsideAny(servedRoots, targetPath)) {
|
|
5782
5894
|
res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
|
|
5783
5895
|
res.end("replacement file must be inside a folder the bundler serves");
|
|
@@ -5829,14 +5941,14 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
5829
5941
|
}
|
|
5830
5942
|
return true;
|
|
5831
5943
|
}
|
|
5832
|
-
var
|
|
5944
|
+
var import_node_fs22, import_promises5, import_node_path24, REPLACEMENT_MODULE_ROUTE;
|
|
5833
5945
|
var init_replacement_module_handler = __esm({
|
|
5834
5946
|
"src/host/replacement-module-handler.ts"() {
|
|
5835
5947
|
"use strict";
|
|
5836
5948
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
5837
|
-
|
|
5949
|
+
import_node_fs22 = require("node:fs");
|
|
5838
5950
|
import_promises5 = __toESM(require("node:fs/promises"), 1);
|
|
5839
|
-
|
|
5951
|
+
import_node_path24 = __toESM(require("node:path"), 1);
|
|
5840
5952
|
init_replacementModule();
|
|
5841
5953
|
init_backend_origin();
|
|
5842
5954
|
REPLACEMENT_MODULE_ROUTE = "/__sootsim-replacement-module";
|
|
@@ -5978,7 +6090,7 @@ function resolveAppStubs(appDir, config, configDir) {
|
|
|
5978
6090
|
const { modules, views, hybridObjects } = expandStubs(appDir, source);
|
|
5979
6091
|
assertRegisteredHybridObjects(appDir, source, hybridObjects);
|
|
5980
6092
|
for (const [name2, answer] of Object.entries(hybridObjects))
|
|
5981
|
-
nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0,
|
|
6093
|
+
nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0, import_node_path25.resolve)(source.baseDir, answer) };
|
|
5982
6094
|
for (const [name2, stub] of Object.entries(modules))
|
|
5983
6095
|
nativeModules[name2] = lowerStub(stub, source.baseDir);
|
|
5984
6096
|
for (const [name2, stub] of Object.entries(views))
|
|
@@ -6043,10 +6155,10 @@ function assertRegisteredHybridObjects(appDir, source, hybridObjects) {
|
|
|
6043
6155
|
);
|
|
6044
6156
|
}
|
|
6045
6157
|
function lowerStub(stub, baseDir) {
|
|
6046
|
-
return stub === "noop" ? stub : { file: (0,
|
|
6158
|
+
return stub === "noop" ? stub : { file: (0, import_node_path25.resolve)(baseDir, stub) };
|
|
6047
6159
|
}
|
|
6048
6160
|
function readPackageJson(dir) {
|
|
6049
|
-
const text2 = readSmallFile((0,
|
|
6161
|
+
const text2 = readSmallFile((0, import_node_path25.join)(dir, "package.json"));
|
|
6050
6162
|
if (!text2) return null;
|
|
6051
6163
|
try {
|
|
6052
6164
|
const parsed = JSON.parse(text2);
|
|
@@ -6058,9 +6170,9 @@ function readPackageJson(dir) {
|
|
|
6058
6170
|
function installedPackageDir(appDir, name2) {
|
|
6059
6171
|
let current = appDir;
|
|
6060
6172
|
while (true) {
|
|
6061
|
-
const dir = (0,
|
|
6062
|
-
if ((0,
|
|
6063
|
-
const parent = (0,
|
|
6173
|
+
const dir = (0, import_node_path25.join)(current, "node_modules", name2);
|
|
6174
|
+
if ((0, import_node_fs23.existsSync)((0, import_node_path25.join)(dir, "package.json"))) return (0, import_node_fs23.realpathSync)(dir);
|
|
6175
|
+
const parent = (0, import_node_path25.dirname)(current);
|
|
6064
6176
|
if (parent === current) return null;
|
|
6065
6177
|
current = parent;
|
|
6066
6178
|
}
|
|
@@ -6164,7 +6276,7 @@ function mergeRequests(previous, next) {
|
|
|
6164
6276
|
function packageNativeRequests(dir) {
|
|
6165
6277
|
const found = /* @__PURE__ */ new Map();
|
|
6166
6278
|
const directories = scanRepository(dir).directories.filter((sub) => {
|
|
6167
|
-
const segments = (0,
|
|
6279
|
+
const segments = (0, import_node_path25.relative)(dir, sub).split("/");
|
|
6168
6280
|
return !NATIVE_SOURCE_DIRS.has(segments[0]) && !segments.some((segment) => PACKAGE_SKIP_DIRS.has(segment));
|
|
6169
6281
|
});
|
|
6170
6282
|
let files = 0;
|
|
@@ -6172,7 +6284,7 @@ function packageNativeRequests(dir) {
|
|
|
6172
6284
|
for (const name2 of listDir(sub)) {
|
|
6173
6285
|
if (!SOURCE_FILE.test(name2) || name2.endsWith(".d.ts") || files >= 2e3) continue;
|
|
6174
6286
|
files++;
|
|
6175
|
-
const file = (0,
|
|
6287
|
+
const file = (0, import_node_path25.join)(sub, name2);
|
|
6176
6288
|
const text2 = readSmallFile(file);
|
|
6177
6289
|
if (!text2) continue;
|
|
6178
6290
|
for (const { line: _line, ...request } of sourceNativeRequests(file, text2, true)) {
|
|
@@ -6290,27 +6402,27 @@ function wireSlotMigration(appDir, configPath, wire, kept = []) {
|
|
|
6290
6402
|
}
|
|
6291
6403
|
function listDir(dir) {
|
|
6292
6404
|
try {
|
|
6293
|
-
return (0,
|
|
6405
|
+
return (0, import_node_fs23.readdirSync)(dir);
|
|
6294
6406
|
} catch {
|
|
6295
6407
|
return [];
|
|
6296
6408
|
}
|
|
6297
6409
|
}
|
|
6298
6410
|
function readSmallFile(file) {
|
|
6299
6411
|
try {
|
|
6300
|
-
return (0,
|
|
6412
|
+
return (0, import_node_fs23.statSync)(file).size <= 1024 * 1024 ? (0, import_node_fs23.readFileSync)(file, "utf8") : null;
|
|
6301
6413
|
} catch {
|
|
6302
6414
|
return null;
|
|
6303
6415
|
}
|
|
6304
6416
|
}
|
|
6305
6417
|
function hasNativeCode(dir, platform) {
|
|
6306
|
-
const expoConfig = (0,
|
|
6418
|
+
const expoConfig = (0, import_node_path25.join)(dir, "expo-module.config.json");
|
|
6307
6419
|
const platforms = metadataValue(readProjectJson(expoConfig), "platforms");
|
|
6308
6420
|
if (Array.isArray(platforms))
|
|
6309
6421
|
return platforms.includes(platform) || platform === "ios" && platforms.includes("apple");
|
|
6310
|
-
if ([platform, "expo-module.config.json"].some((entry) => (0,
|
|
6422
|
+
if ([platform, "expo-module.config.json"].some((entry) => (0, import_node_fs23.existsSync)((0, import_node_path25.join)(dir, entry))))
|
|
6311
6423
|
return true;
|
|
6312
6424
|
if (listDir(dir).some((name2) => name2.endsWith(".podspec"))) return true;
|
|
6313
|
-
const manifest = readSmallFile((0,
|
|
6425
|
+
const manifest = readSmallFile((0, import_node_path25.join)(dir, "package.json"));
|
|
6314
6426
|
return manifest !== null && manifest.includes('"codegenConfig"');
|
|
6315
6427
|
}
|
|
6316
6428
|
function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__PURE__ */ new Set(), includeLegacy = false, providers) {
|
|
@@ -6323,7 +6435,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6323
6435
|
(excluded) => dir === excluded || dir.startsWith(`${excluded}/`)
|
|
6324
6436
|
))
|
|
6325
6437
|
continue;
|
|
6326
|
-
if ((0,
|
|
6438
|
+
if ((0, import_node_fs23.existsSync)((0, import_node_path25.join)(dir, "expo-module.config.json"))) {
|
|
6327
6439
|
if (platform && !hasNativeCode(dir, platform)) {
|
|
6328
6440
|
excludedModuleDirs.push(dir);
|
|
6329
6441
|
continue;
|
|
@@ -6332,7 +6444,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6332
6444
|
}
|
|
6333
6445
|
for (const name2 of listDir(dir)) {
|
|
6334
6446
|
if (SOURCE_FILE.test(name2) && !name2.endsWith(".d.ts"))
|
|
6335
|
-
sourceFiles.push((0,
|
|
6447
|
+
sourceFiles.push((0, import_node_path25.join)(dir, name2));
|
|
6336
6448
|
}
|
|
6337
6449
|
}
|
|
6338
6450
|
}
|
|
@@ -6342,7 +6454,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6342
6454
|
scanRepository(dir).directories.flatMap(
|
|
6343
6455
|
(sub) => listDir(sub).filter(
|
|
6344
6456
|
(name2) => NATIVE_SOURCE_FILE.test(name2) && (!platform || (platform === "ios" ? name2.endsWith(".swift") : name2.endsWith(".kt")))
|
|
6345
|
-
).map((name2) => (0,
|
|
6457
|
+
).map((name2) => (0, import_node_path25.join)(sub, name2))
|
|
6346
6458
|
)
|
|
6347
6459
|
])
|
|
6348
6460
|
);
|
|
@@ -6351,7 +6463,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6351
6463
|
const known = owners.get(dir);
|
|
6352
6464
|
if (known) return known;
|
|
6353
6465
|
const name2 = readPackageJson(dir)?.name;
|
|
6354
|
-
const parent = (0,
|
|
6466
|
+
const parent = (0, import_node_path25.dirname)(dir);
|
|
6355
6467
|
const result = typeof name2 === "string" ? name2 : parent === dir ? pkg.name ?? "app" : owner(parent);
|
|
6356
6468
|
owners.set(dir, result);
|
|
6357
6469
|
return result;
|
|
@@ -6365,25 +6477,25 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6365
6477
|
else {
|
|
6366
6478
|
const moduleDir2 = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`));
|
|
6367
6479
|
if (moduleDir2 && (file.endsWith(".swift") || !known.expoModule)) {
|
|
6368
|
-
known.expoModule = (0,
|
|
6480
|
+
known.expoModule = (0, import_node_path25.relative)(appDir, moduleDir2) || ".";
|
|
6369
6481
|
known.swift = file.endsWith(".swift");
|
|
6370
6482
|
}
|
|
6371
6483
|
}
|
|
6372
6484
|
return;
|
|
6373
6485
|
}
|
|
6374
6486
|
providers ??= dependencyNativeOwners(appDir, pkg);
|
|
6375
|
-
const packageName = providers.get(key) ?? owner((0,
|
|
6487
|
+
const packageName = providers.get(key) ?? owner((0, import_node_path25.dirname)(file));
|
|
6376
6488
|
if (knownPackages.has(packageName)) return;
|
|
6377
6489
|
const moduleDir = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`)) ?? null;
|
|
6378
6490
|
found.set(key, {
|
|
6379
6491
|
kind,
|
|
6380
6492
|
name: name2,
|
|
6381
6493
|
package: packageName,
|
|
6382
|
-
path: `${(0,
|
|
6383
|
-
expoModule: moduleDir ? (0,
|
|
6494
|
+
path: `${(0, import_node_path25.relative)(appDir, file)}:${line}`,
|
|
6495
|
+
expoModule: moduleDir ? (0, import_node_path25.relative)(appDir, moduleDir) || "." : null,
|
|
6384
6496
|
optional: optional3,
|
|
6385
6497
|
swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
|
|
6386
|
-
(
|
|
6498
|
+
(path26) => path26.endsWith(".swift") && [...(readSmallFile(path26) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
|
|
6387
6499
|
(match) => match[1] === name2
|
|
6388
6500
|
)
|
|
6389
6501
|
) : false,
|
|
@@ -6431,30 +6543,30 @@ function workspacePackageDirs(appDir, pkg) {
|
|
|
6431
6543
|
for (const name2 of Object.keys({ ...pkg.dependencies, ...pkg.devDependencies })) {
|
|
6432
6544
|
let current = appDir;
|
|
6433
6545
|
while (true) {
|
|
6434
|
-
const link = (0,
|
|
6435
|
-
if ((0,
|
|
6436
|
-
if ((0,
|
|
6437
|
-
const target = (0,
|
|
6546
|
+
const link = (0, import_node_path25.join)(current, "node_modules", name2);
|
|
6547
|
+
if ((0, import_node_fs23.existsSync)(link)) {
|
|
6548
|
+
if ((0, import_node_fs23.lstatSync)(link).isSymbolicLink()) {
|
|
6549
|
+
const target = (0, import_node_fs23.realpathSync)(link);
|
|
6438
6550
|
if (!target.split("/").includes("node_modules") && !target.startsWith(`${appDir}/`)) {
|
|
6439
6551
|
dirs.add(target);
|
|
6440
6552
|
}
|
|
6441
6553
|
}
|
|
6442
6554
|
break;
|
|
6443
6555
|
}
|
|
6444
|
-
const parent = (0,
|
|
6556
|
+
const parent = (0, import_node_path25.dirname)(current);
|
|
6445
6557
|
if (parent === current) break;
|
|
6446
6558
|
current = parent;
|
|
6447
6559
|
}
|
|
6448
6560
|
}
|
|
6449
6561
|
return [...dirs];
|
|
6450
6562
|
}
|
|
6451
|
-
var
|
|
6563
|
+
var import_node_fs23, import_node_path25, import_oxc_parser2, import_sucrase, SOURCE_FILE, NATIVE_LOOKUP, NATIVE_SOURCE_DIRS, PACKAGE_SKIP_DIRS, NATIVE_SOURCE_FILE;
|
|
6452
6564
|
var init_app_stubs = __esm({
|
|
6453
6565
|
"cli/app-stubs.ts"() {
|
|
6454
6566
|
"use strict";
|
|
6455
6567
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6456
|
-
|
|
6457
|
-
|
|
6568
|
+
import_node_fs23 = require("node:fs");
|
|
6569
|
+
import_node_path25 = require("node:path");
|
|
6458
6570
|
init_version_range();
|
|
6459
6571
|
import_oxc_parser2 = require("oxc-parser");
|
|
6460
6572
|
import_sucrase = require("sucrase");
|
|
@@ -6490,12 +6602,12 @@ function resolveFileEntries(entries, configDir) {
|
|
|
6490
6602
|
return Object.fromEntries(
|
|
6491
6603
|
Object.entries(entries).map(([name2, resolution]) => [
|
|
6492
6604
|
name2,
|
|
6493
|
-
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file:
|
|
6605
|
+
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path26.default.resolve(configDir, resolution.file) } : resolution
|
|
6494
6606
|
])
|
|
6495
6607
|
);
|
|
6496
6608
|
}
|
|
6497
6609
|
function resolveConfigReplacementFiles(config, configPath) {
|
|
6498
|
-
const configDir =
|
|
6610
|
+
const configDir = import_node_path26.default.dirname(configPath);
|
|
6499
6611
|
return {
|
|
6500
6612
|
...config,
|
|
6501
6613
|
modules: resolveFileEntries(config.modules, configDir)
|
|
@@ -6511,7 +6623,7 @@ async function loadRNXAppStubs(project) {
|
|
|
6511
6623
|
return resolveAppStubs(
|
|
6512
6624
|
project.appDir,
|
|
6513
6625
|
config,
|
|
6514
|
-
project.configPath ?
|
|
6626
|
+
project.configPath ? import_node_path26.default.dirname(project.configPath) : project.appDir
|
|
6515
6627
|
);
|
|
6516
6628
|
} catch (error) {
|
|
6517
6629
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -6530,7 +6642,7 @@ async function loadConfigFile(project) {
|
|
|
6530
6642
|
[`${rnxPublicBrand.packageName}/config`]: config_exports
|
|
6531
6643
|
}
|
|
6532
6644
|
});
|
|
6533
|
-
const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0,
|
|
6645
|
+
const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0, import_node_fs24.readFileSync)(project.configPath, "utf8")) : await jiti.import(project.configPath, { default: true });
|
|
6534
6646
|
if (!isPeachConfig(loaded3)) {
|
|
6535
6647
|
throw new Error("the default export must be a peach config object");
|
|
6536
6648
|
}
|
|
@@ -6566,13 +6678,13 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
|
|
|
6566
6678
|
const project = resolveAppProject(startDir);
|
|
6567
6679
|
return { project, ...await loadRNXAppStubs(project) };
|
|
6568
6680
|
}
|
|
6569
|
-
var
|
|
6681
|
+
var import_node_fs24, import_node_path26, import_jiti, WIRE_SLOTS;
|
|
6570
6682
|
var init_app_config = __esm({
|
|
6571
6683
|
"cli/app-config.ts"() {
|
|
6572
6684
|
"use strict";
|
|
6573
6685
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6574
|
-
|
|
6575
|
-
|
|
6686
|
+
import_node_fs24 = require("node:fs");
|
|
6687
|
+
import_node_path26 = __toESM(require("node:path"), 1);
|
|
6576
6688
|
import_jiti = require("jiti");
|
|
6577
6689
|
init_config();
|
|
6578
6690
|
init_config();
|
|
@@ -6672,14 +6784,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
6672
6784
|
const neededPackages = /* @__PURE__ */ new Set();
|
|
6673
6785
|
const factories = [];
|
|
6674
6786
|
const visit3 = (filePath) => {
|
|
6675
|
-
const real =
|
|
6787
|
+
const real = import_node_fs25.default.realpathSync(filePath);
|
|
6676
6788
|
const previous = files.get(real);
|
|
6677
6789
|
if (previous !== void 0) return previous;
|
|
6678
6790
|
const id = "peach-config-file:" + files.size;
|
|
6679
6791
|
files.set(real, id);
|
|
6680
6792
|
const compiled = compileReplacementModule({
|
|
6681
6793
|
filePath: real,
|
|
6682
|
-
source:
|
|
6794
|
+
source: import_node_fs25.default.readFileSync(real, "utf8"),
|
|
6683
6795
|
runtimePackages,
|
|
6684
6796
|
localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
|
|
6685
6797
|
});
|
|
@@ -6703,7 +6815,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
6703
6815
|
if (!entries || typeof entries !== "object") continue;
|
|
6704
6816
|
for (const resolution of Object.values(entries)) {
|
|
6705
6817
|
if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
|
|
6706
|
-
resolution.file = visit3(
|
|
6818
|
+
resolution.file = visit3(import_node_path27.default.resolve(resolution.file));
|
|
6707
6819
|
}
|
|
6708
6820
|
}
|
|
6709
6821
|
}
|
|
@@ -6727,13 +6839,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
6727
6839
|
const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
|
|
6728
6840
|
return prefix2 + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
|
|
6729
6841
|
}
|
|
6730
|
-
var
|
|
6842
|
+
var import_node_fs25, import_node_path27, import_sucrase2, import_terser, PREFIX_START, PREFIX_END;
|
|
6731
6843
|
var init_configured_bundle_producer = __esm({
|
|
6732
6844
|
"src/configured-bundle-producer.ts"() {
|
|
6733
6845
|
"use strict";
|
|
6734
6846
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6735
|
-
|
|
6736
|
-
|
|
6847
|
+
import_node_fs25 = __toESM(require("node:fs"), 1);
|
|
6848
|
+
import_node_path27 = __toESM(require("node:path"), 1);
|
|
6737
6849
|
init_bundle_global_footer();
|
|
6738
6850
|
import_sucrase2 = require("sucrase");
|
|
6739
6851
|
import_terser = require("terser");
|
|
@@ -6806,11 +6918,11 @@ init_app_project();
|
|
|
6806
6918
|
|
|
6807
6919
|
// src/android-autolinking.ts
|
|
6808
6920
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6809
|
-
var
|
|
6810
|
-
var
|
|
6811
|
-
var
|
|
6812
|
-
var
|
|
6813
|
-
var
|
|
6921
|
+
var import_node_child_process2 = require("node:child_process");
|
|
6922
|
+
var import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
6923
|
+
var import_node_module2 = require("node:module");
|
|
6924
|
+
var import_node_path3 = __toESM(require("node:path"), 1);
|
|
6925
|
+
var import_node_util2 = require("node:util");
|
|
6814
6926
|
|
|
6815
6927
|
// src/androidAutolinkingContract.ts
|
|
6816
6928
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -6828,10 +6940,11 @@ function insertAndroidAutolinkingFooter(source, packages) {
|
|
|
6828
6940
|
// src/android-autolinking.ts
|
|
6829
6941
|
init_forked_script_contract();
|
|
6830
6942
|
init_is_record();
|
|
6831
|
-
|
|
6943
|
+
init_react_native_autolinking();
|
|
6944
|
+
var run2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
|
|
6832
6945
|
var resolving = /* @__PURE__ */ new Map();
|
|
6833
6946
|
async function resolveExpoAndroidAutolinking(appRoot) {
|
|
6834
|
-
const root =
|
|
6947
|
+
const root = import_node_fs3.default.realpathSync(appRoot);
|
|
6835
6948
|
const existing = resolving.get(root);
|
|
6836
6949
|
if (existing) return existing;
|
|
6837
6950
|
const pending = resolveAndroidModules(root);
|
|
@@ -6845,17 +6958,17 @@ async function resolveExpoAndroidAutolinking(appRoot) {
|
|
|
6845
6958
|
async function resolveAndroidModules(appRoot) {
|
|
6846
6959
|
let autolinker;
|
|
6847
6960
|
try {
|
|
6848
|
-
autolinker = (0,
|
|
6961
|
+
autolinker = (0, import_node_module2.createRequire)(import_node_path3.default.join(appRoot, "package.json")).resolve(
|
|
6849
6962
|
"expo-modules-autolinking/package.json"
|
|
6850
6963
|
);
|
|
6851
6964
|
} catch (error) {
|
|
6852
6965
|
if (isRecord(error) && error.code === "MODULE_NOT_FOUND") return [];
|
|
6853
6966
|
throw error;
|
|
6854
6967
|
}
|
|
6855
|
-
const { stdout } = await
|
|
6968
|
+
const { stdout } = await run2(
|
|
6856
6969
|
process.execPath,
|
|
6857
6970
|
[
|
|
6858
|
-
|
|
6971
|
+
import_node_path3.default.join(import_node_path3.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
|
|
6859
6972
|
"resolve",
|
|
6860
6973
|
"--platform",
|
|
6861
6974
|
"android",
|
|
@@ -6878,14 +6991,51 @@ async function resolveAndroidModules(appRoot) {
|
|
|
6878
6991
|
return resolved.modules;
|
|
6879
6992
|
}
|
|
6880
6993
|
async function collectAndroidAutolinkedPackages(appRoot) {
|
|
6881
|
-
const modules = await
|
|
6882
|
-
|
|
6994
|
+
const [modules, dependencies] = await Promise.all([
|
|
6995
|
+
resolveExpoAndroidAutolinking(appRoot),
|
|
6996
|
+
resolveReactNativeAndroidAutolinking(appRoot)
|
|
6997
|
+
]);
|
|
6998
|
+
return readAndroidAutolinkedPackages([
|
|
6999
|
+
...modules.map((entry) => entry.packageName),
|
|
7000
|
+
...dependencies.map((entry) => entry.name)
|
|
7001
|
+
]);
|
|
7002
|
+
}
|
|
7003
|
+
async function resolveReactNativeAndroidAutolinking(appRoot) {
|
|
7004
|
+
const config = await reactNativeAutolinkingConfig(appRoot, "android");
|
|
7005
|
+
if (!isRecord(config) || !isRecord(config.dependencies))
|
|
7006
|
+
throw new Error(`${appRoot}: React Native autolinking config has no dependencies`);
|
|
7007
|
+
const linked = [];
|
|
7008
|
+
for (const [name2, dependency] of Object.entries(config.dependencies)) {
|
|
7009
|
+
if (!isRecord(dependency) || !isRecord(dependency.platforms))
|
|
7010
|
+
throw new Error(
|
|
7011
|
+
`${appRoot}: React Native autolinking dependency ${name2} is malformed`
|
|
7012
|
+
);
|
|
7013
|
+
const android = dependency.platforms.android;
|
|
7014
|
+
if (android == null) continue;
|
|
7015
|
+
if (!isRecord(android) || typeof dependency.root !== "string")
|
|
7016
|
+
throw new Error(
|
|
7017
|
+
`${appRoot}: React Native autolinking dependency ${name2} has no Android project`
|
|
7018
|
+
);
|
|
7019
|
+
const string4 = (field) => {
|
|
7020
|
+
const value = android[field];
|
|
7021
|
+
if (value == null || typeof value === "string") return value ?? null;
|
|
7022
|
+
throw new Error(`${appRoot}: Android dependency ${name2} has invalid ${field}`);
|
|
7023
|
+
};
|
|
7024
|
+
linked.push({
|
|
7025
|
+
name: name2,
|
|
7026
|
+
root: dependency.root,
|
|
7027
|
+
sourceDir: string4("sourceDir"),
|
|
7028
|
+
packageImportPath: string4("packageImportPath"),
|
|
7029
|
+
packageInstance: string4("packageInstance")
|
|
7030
|
+
});
|
|
7031
|
+
}
|
|
7032
|
+
return linked;
|
|
6883
7033
|
}
|
|
6884
7034
|
|
|
6885
7035
|
// src/android-root-module.ts
|
|
6886
7036
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6887
|
-
var
|
|
6888
|
-
var
|
|
7037
|
+
var import_node_fs4 = __toESM(require("node:fs"), 1);
|
|
7038
|
+
var import_node_path4 = __toESM(require("node:path"), 1);
|
|
6889
7039
|
|
|
6890
7040
|
// src/android-xml.ts
|
|
6891
7041
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -6982,29 +7132,29 @@ function launcherActivities(application) {
|
|
|
6982
7132
|
function readModuleNamespace(moduleRoot, manifest) {
|
|
6983
7133
|
if (manifest.attributes.package) return manifest.attributes.package;
|
|
6984
7134
|
for (const name2 of ["build.gradle", "build.gradle.kts"]) {
|
|
6985
|
-
const file =
|
|
6986
|
-
if (!
|
|
7135
|
+
const file = import_node_path4.default.join(moduleRoot, name2);
|
|
7136
|
+
if (!import_node_fs4.default.existsSync(file)) continue;
|
|
6987
7137
|
const match = /\bnamespace\s*=?\s*["']([\w.]+)["']/.exec(
|
|
6988
|
-
|
|
7138
|
+
import_node_fs4.default.readFileSync(file, "utf8")
|
|
6989
7139
|
);
|
|
6990
7140
|
if (match) return match[1];
|
|
6991
7141
|
}
|
|
6992
7142
|
return void 0;
|
|
6993
7143
|
}
|
|
6994
7144
|
function readModuleRootModuleName(moduleRoot) {
|
|
6995
|
-
const sourceSets =
|
|
6996
|
-
const manifestFile =
|
|
6997
|
-
if (!
|
|
6998
|
-
const document = parseXml(
|
|
7145
|
+
const sourceSets = import_node_path4.default.join(moduleRoot, "src");
|
|
7146
|
+
const manifestFile = import_node_path4.default.join(sourceSets, "main/AndroidManifest.xml");
|
|
7147
|
+
if (!import_node_fs4.default.existsSync(manifestFile)) return null;
|
|
7148
|
+
const document = parseXml(import_node_fs4.default.readFileSync(manifestFile, "utf8"), manifestFile);
|
|
6999
7149
|
const manifest = document.children[0];
|
|
7000
7150
|
const application = manifest?.children.find((child) => child.name === "application");
|
|
7001
7151
|
if (manifest?.name !== "manifest" || !application) return null;
|
|
7002
7152
|
const launchers = launcherActivities(application);
|
|
7003
7153
|
if (launchers.length === 0) return null;
|
|
7004
|
-
for (const set2 of
|
|
7005
|
-
const file =
|
|
7006
|
-
if (!set2.isDirectory() || set2.name === "main" || !
|
|
7007
|
-
if (
|
|
7154
|
+
for (const set2 of import_node_fs4.default.readdirSync(sourceSets, { withFileTypes: true })) {
|
|
7155
|
+
const file = import_node_path4.default.join(sourceSets, set2.name, "AndroidManifest.xml");
|
|
7156
|
+
if (!set2.isDirectory() || set2.name === "main" || !import_node_fs4.default.existsSync(file)) continue;
|
|
7157
|
+
if (import_node_fs4.default.readFileSync(file, "utf8").includes("<activity")) return void 0;
|
|
7008
7158
|
}
|
|
7009
7159
|
const launcher = launchers[0];
|
|
7010
7160
|
const enabled = launcher.attributes["android:enabled"];
|
|
@@ -7016,23 +7166,23 @@ function readModuleRootModuleName(moduleRoot) {
|
|
|
7016
7166
|
const qualified = declared.startsWith(".") ? namespace && `${namespace}${declared}` : declared.includes(".") ? declared : namespace && `${namespace}.${declared}`;
|
|
7017
7167
|
if (!qualified || qualified.includes("$")) return void 0;
|
|
7018
7168
|
const relative3 = qualified.split(".").join("/");
|
|
7019
|
-
const files =
|
|
7169
|
+
const files = import_node_fs4.default.readdirSync(sourceSets, { withFileTypes: true }).filter((set2) => set2.isDirectory()).flatMap(
|
|
7020
7170
|
(set2) => ["java", "kotlin"].flatMap(
|
|
7021
7171
|
(language) => ["kt", "java"].map(
|
|
7022
|
-
(extension) =>
|
|
7172
|
+
(extension) => import_node_path4.default.join(sourceSets, set2.name, language, `${relative3}.${extension}`)
|
|
7023
7173
|
)
|
|
7024
7174
|
)
|
|
7025
|
-
).filter((file) =>
|
|
7175
|
+
).filter((file) => import_node_fs4.default.existsSync(file));
|
|
7026
7176
|
if (files.length !== 1) return void 0;
|
|
7027
7177
|
return readAndroidRootModuleFromActivitySource(
|
|
7028
|
-
|
|
7178
|
+
import_node_fs4.default.readFileSync(files[0], "utf8"),
|
|
7029
7179
|
qualified.slice(qualified.lastIndexOf(".") + 1)
|
|
7030
7180
|
);
|
|
7031
7181
|
}
|
|
7032
7182
|
function readAndroidLauncherRootModuleName(projectRoot) {
|
|
7033
|
-
const androidRoot =
|
|
7034
|
-
if (!
|
|
7035
|
-
const names =
|
|
7183
|
+
const androidRoot = import_node_path4.default.join(projectRoot, "android");
|
|
7184
|
+
if (!import_node_fs4.default.existsSync(androidRoot)) return void 0;
|
|
7185
|
+
const names = import_node_fs4.default.readdirSync(androidRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => readModuleRootModuleName(import_node_path4.default.join(androidRoot, entry.name))).filter((name2) => name2 !== null);
|
|
7036
7186
|
return names.length === 1 ? names[0] : void 0;
|
|
7037
7187
|
}
|
|
7038
7188
|
|
|
@@ -7052,7 +7202,7 @@ function insertAndroidRootModuleFooter(source, name2) {
|
|
|
7052
7202
|
// src/dev-server-open.ts
|
|
7053
7203
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
7054
7204
|
var import_node_crypto = require("node:crypto");
|
|
7055
|
-
var
|
|
7205
|
+
var import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
7056
7206
|
function tagRnxBundleForPlugin(bundleUrl, replacementOrigin, replacementToken, projectRoot, appName) {
|
|
7057
7207
|
const absolute = /^[a-z][a-z\d+.-]*:\/\//i.test(bundleUrl);
|
|
7058
7208
|
const url = new URL(bundleUrl, absolute ? void 0 : "http://peach.local");
|
|
@@ -7060,7 +7210,7 @@ function tagRnxBundleForPlugin(bundleUrl, replacementOrigin, replacementToken, p
|
|
|
7060
7210
|
url.searchParams.set("rnxAppName", appName);
|
|
7061
7211
|
url.searchParams.set(
|
|
7062
7212
|
"rnxProjectId",
|
|
7063
|
-
(0, import_node_crypto.createHash)("sha256").update(
|
|
7213
|
+
(0, import_node_crypto.createHash)("sha256").update(import_node_fs5.default.realpathSync(projectRoot)).digest("hex").slice(0, 32)
|
|
7064
7214
|
);
|
|
7065
7215
|
}
|
|
7066
7216
|
url.searchParams.set("rnxReplacementOrigin", replacementOrigin);
|
|
@@ -7321,10 +7471,10 @@ function peachRuntimeRoot() {
|
|
|
7321
7471
|
|
|
7322
7472
|
// src/expo-autolinking.ts
|
|
7323
7473
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
7324
|
-
var
|
|
7325
|
-
var
|
|
7474
|
+
var import_node_child_process3 = require("node:child_process");
|
|
7475
|
+
var import_node_util3 = require("node:util");
|
|
7326
7476
|
init_forked_script_contract();
|
|
7327
|
-
var
|
|
7477
|
+
var run3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
|
|
7328
7478
|
|
|
7329
7479
|
// src/expo-native-prebuilt.ts
|
|
7330
7480
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -7341,14 +7491,14 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
7341
7491
|
|
|
7342
7492
|
// src/swift-objc-sdk-tree.ts
|
|
7343
7493
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
7344
|
-
var
|
|
7345
|
-
var
|
|
7494
|
+
var import_node_fs7 = require("node:fs");
|
|
7495
|
+
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
7346
7496
|
function readIosSdkTree(root) {
|
|
7347
|
-
return (0,
|
|
7348
|
-
const file =
|
|
7497
|
+
return (0, import_node_fs7.readdirSync)(root, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => {
|
|
7498
|
+
const file = import_node_path6.default.join(entry.parentPath, entry.name);
|
|
7349
7499
|
return [
|
|
7350
|
-
|
|
7351
|
-
(0,
|
|
7500
|
+
import_node_path6.default.relative(root, file).split(import_node_path6.default.sep).join("/"),
|
|
7501
|
+
(0, import_node_fs7.readFileSync)(file, "utf8")
|
|
7352
7502
|
];
|
|
7353
7503
|
}).sort(([a], [b]) => a < b ? -1 : 1);
|
|
7354
7504
|
}
|
|
@@ -7399,10 +7549,10 @@ init_is_record();
|
|
|
7399
7549
|
|
|
7400
7550
|
// src/native-firebase-config.ts
|
|
7401
7551
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
7402
|
-
var
|
|
7403
|
-
var
|
|
7552
|
+
var import_node_child_process7 = require("node:child_process");
|
|
7553
|
+
var import_node_fs15 = __toESM(require("node:fs"), 1);
|
|
7404
7554
|
var import_node_os2 = __toESM(require("node:os"), 1);
|
|
7405
|
-
var
|
|
7555
|
+
var import_node_path16 = __toESM(require("node:path"), 1);
|
|
7406
7556
|
init_is_record();
|
|
7407
7557
|
|
|
7408
7558
|
// src/plist.ts
|
|
@@ -7414,10 +7564,10 @@ function parsePlistSource(source) {
|
|
|
7414
7564
|
|
|
7415
7565
|
// src/xcode-project.ts
|
|
7416
7566
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
7417
|
-
var
|
|
7567
|
+
var import_node_child_process6 = require("node:child_process");
|
|
7418
7568
|
var import_node_crypto5 = require("node:crypto");
|
|
7419
|
-
var
|
|
7420
|
-
var
|
|
7569
|
+
var import_node_fs14 = __toESM(require("node:fs"), 1);
|
|
7570
|
+
var import_node_path15 = __toESM(require("node:path"), 1);
|
|
7421
7571
|
var import_plist2 = __toESM(require("plist"), 1);
|
|
7422
7572
|
init_is_record();
|
|
7423
7573
|
|
|
@@ -8020,10 +8170,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
|
|
|
8020
8170
|
var APP_DELEGATE_PATH_RE = /(?:^|\/)(?:ios\/)?([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
|
|
8021
8171
|
function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
|
|
8022
8172
|
const pbxprojPath = Object.keys(files).find(
|
|
8023
|
-
(
|
|
8173
|
+
(path26) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path26)
|
|
8024
8174
|
) ?? Object.keys(files).find(
|
|
8025
|
-
(
|
|
8026
|
-
) ?? Object.keys(files).find((
|
|
8175
|
+
(path26) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path26)
|
|
8176
|
+
) ?? Object.keys(files).find((path26) => /(?:^|\/)project\.pbxproj$/.test(path26));
|
|
8027
8177
|
if (!pbxprojPath) return null;
|
|
8028
8178
|
const pbxproj = files[pbxprojPath];
|
|
8029
8179
|
let objects = {};
|
|
@@ -8065,7 +8215,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
8065
8215
|
} else if (applicationTargetNames.size === 1) {
|
|
8066
8216
|
targetName = [...applicationTargetNames][0];
|
|
8067
8217
|
} else if (applicationTargetNames.size > 1) {
|
|
8068
|
-
const delegateTargets = Object.keys(files).filter((
|
|
8218
|
+
const delegateTargets = Object.keys(files).filter((path26) => !path26.includes("/Pods/")).map((path26) => path26.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
|
|
8069
8219
|
(name2) => typeof name2 === "string" && applicationTargetNames.has(name2)
|
|
8070
8220
|
);
|
|
8071
8221
|
if (delegateTargets.length === 1) {
|
|
@@ -8306,7 +8456,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
8306
8456
|
if (Object.hasOwn(files, file)) return [file];
|
|
8307
8457
|
const prefix2 = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
|
|
8308
8458
|
return paths.filter(
|
|
8309
|
-
(
|
|
8459
|
+
(path26) => path26.startsWith(prefix2) && !/(?:^|\/)\./.test(path26.slice(prefix2.length))
|
|
8310
8460
|
);
|
|
8311
8461
|
},
|
|
8312
8462
|
join7,
|
|
@@ -8317,7 +8467,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
8317
8467
|
}
|
|
8318
8468
|
const rootModuleName = readRootModuleName(
|
|
8319
8469
|
Object.entries(files).filter(
|
|
8320
|
-
([
|
|
8470
|
+
([path26]) => !path26.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path26) || path26.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
|
|
8321
8471
|
).map(([, source]) => source)
|
|
8322
8472
|
);
|
|
8323
8473
|
return {
|
|
@@ -8411,23 +8561,23 @@ function extractNativeAppIdentityFromFiles(files, platform, parseInfoPlist, iosT
|
|
|
8411
8561
|
// src/prepared-xcode-phases.ts
|
|
8412
8562
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8413
8563
|
var import_node_crypto2 = require("node:crypto");
|
|
8414
|
-
var
|
|
8415
|
-
var
|
|
8564
|
+
var import_node_fs10 = __toESM(require("node:fs"), 1);
|
|
8565
|
+
var import_node_path8 = __toESM(require("node:path"), 1);
|
|
8416
8566
|
var workspaces = /* @__PURE__ */ new Map();
|
|
8417
8567
|
var recording;
|
|
8418
8568
|
function relativeFile(root, file) {
|
|
8419
|
-
const relative3 =
|
|
8420
|
-
if (!relative3 || relative3 === ".." || relative3.startsWith(`..${
|
|
8569
|
+
const relative3 = import_node_path8.default.relative(root, file);
|
|
8570
|
+
if (!relative3 || relative3 === ".." || relative3.startsWith(`..${import_node_path8.default.sep}`) || import_node_path8.default.isAbsolute(relative3))
|
|
8421
8571
|
throw new Error(`prepared Xcode output is outside its workspace: ${file}`);
|
|
8422
|
-
return relative3.split(
|
|
8572
|
+
return relative3.split(import_node_path8.default.sep).join("/");
|
|
8423
8573
|
}
|
|
8424
8574
|
function output(root, file) {
|
|
8425
8575
|
const relative3 = relativeFile(root, file);
|
|
8426
|
-
const stat =
|
|
8576
|
+
const stat = import_node_fs10.default.statSync(file, { throwIfNoEntry: false });
|
|
8427
8577
|
if (!stat) return { path: relative3, sha256: null };
|
|
8428
8578
|
if (!stat.isFile()) throw new Error(`prepared Xcode output is not a file: ${file}`);
|
|
8429
|
-
relativeFile(root,
|
|
8430
|
-
const bytes =
|
|
8579
|
+
relativeFile(root, import_node_fs10.default.realpathSync(file));
|
|
8580
|
+
const bytes = import_node_fs10.default.readFileSync(file);
|
|
8431
8581
|
const prefix2 = Buffer.from(root);
|
|
8432
8582
|
const hash = (0, import_node_crypto2.createHash)("sha256");
|
|
8433
8583
|
let offset = 0;
|
|
@@ -8443,8 +8593,8 @@ function output(root, file) {
|
|
|
8443
8593
|
}
|
|
8444
8594
|
function preparedXcodePhase(project, target, phase, configuration, outputs, recorded) {
|
|
8445
8595
|
const root = recording?.root ?? [...workspaces.keys()].find((root2) => {
|
|
8446
|
-
const relative3 =
|
|
8447
|
-
return relative3 !== ".." && !relative3.startsWith(`..${
|
|
8596
|
+
const relative3 = import_node_path8.default.relative(root2, project);
|
|
8597
|
+
return relative3 !== ".." && !relative3.startsWith(`..${import_node_path8.default.sep}`) && !import_node_path8.default.isAbsolute(relative3);
|
|
8448
8598
|
});
|
|
8449
8599
|
if (!root) return false;
|
|
8450
8600
|
const entry = {
|
|
@@ -8480,8 +8630,8 @@ function preparedXcodePhase(project, target, phase, configuration, outputs, reco
|
|
|
8480
8630
|
|
|
8481
8631
|
// src/swift-binary-modules.ts
|
|
8482
8632
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8483
|
-
var
|
|
8484
|
-
var
|
|
8633
|
+
var import_node_fs11 = __toESM(require("node:fs"), 1);
|
|
8634
|
+
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
8485
8635
|
init_home_paths();
|
|
8486
8636
|
|
|
8487
8637
|
// src/swift-package.ts
|
|
@@ -8526,7 +8676,7 @@ function moduleMapName(text2) {
|
|
|
8526
8676
|
}
|
|
8527
8677
|
|
|
8528
8678
|
// src/swift-binary-modules.ts
|
|
8529
|
-
var cacheDir2 =
|
|
8679
|
+
var cacheDir2 = import_node_path9.default.join(cacheDir(), "swift-binary-modules");
|
|
8530
8680
|
function frameworkModules(paths) {
|
|
8531
8681
|
const modules = /* @__PURE__ */ new Set();
|
|
8532
8682
|
for (const file of paths) {
|
|
@@ -8536,21 +8686,21 @@ function frameworkModules(paths) {
|
|
|
8536
8686
|
return [...modules].sort();
|
|
8537
8687
|
}
|
|
8538
8688
|
function localSwiftBinaryModules(dir) {
|
|
8539
|
-
if (!
|
|
8540
|
-
const slices =
|
|
8689
|
+
if (!import_node_fs11.default.existsSync(dir)) return [];
|
|
8690
|
+
const slices = import_node_fs11.default.readdirSync(dir, { withFileTypes: true }).filter((slice) => slice.isDirectory());
|
|
8541
8691
|
const frameworks = frameworkModules(
|
|
8542
8692
|
slices.flatMap(
|
|
8543
|
-
(slice) =>
|
|
8693
|
+
(slice) => import_node_fs11.default.readdirSync(import_node_path9.default.join(dir, slice.name)).map((entry) => `${slice.name}/${entry}`)
|
|
8544
8694
|
)
|
|
8545
8695
|
);
|
|
8546
8696
|
if (frameworks.length > 0) return frameworks;
|
|
8547
8697
|
const modules = /* @__PURE__ */ new Set();
|
|
8548
8698
|
for (const slice of slices) {
|
|
8549
|
-
const headers =
|
|
8550
|
-
if (!
|
|
8551
|
-
for (const file of
|
|
8552
|
-
if (
|
|
8553
|
-
const module2 = moduleMapName(
|
|
8699
|
+
const headers = import_node_path9.default.join(dir, slice.name, "Headers");
|
|
8700
|
+
if (!import_node_fs11.default.existsSync(headers)) continue;
|
|
8701
|
+
for (const file of import_node_fs11.default.readdirSync(headers, { recursive: true, encoding: "utf8" })) {
|
|
8702
|
+
if (import_node_path9.default.basename(file) !== "module.modulemap") continue;
|
|
8703
|
+
const module2 = moduleMapName(import_node_fs11.default.readFileSync(import_node_path9.default.join(headers, file), "utf8"));
|
|
8554
8704
|
if (module2) modules.add(module2);
|
|
8555
8705
|
}
|
|
8556
8706
|
}
|
|
@@ -8563,8 +8713,8 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
8563
8713
|
// src/swift-coverage/provenance.ts
|
|
8564
8714
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8565
8715
|
var import_node_crypto3 = require("node:crypto");
|
|
8566
|
-
var
|
|
8567
|
-
var
|
|
8716
|
+
var import_node_fs12 = require("node:fs");
|
|
8717
|
+
var import_node_path10 = require("node:path");
|
|
8568
8718
|
var SWIFT_COVERAGE_DIGEST_SOURCES = [
|
|
8569
8719
|
"swift-coverage/indexdump.ts",
|
|
8570
8720
|
"swift-coverage/indexing.ts",
|
|
@@ -8594,11 +8744,11 @@ function swiftCoverageSourceDigests(srcDir) {
|
|
|
8594
8744
|
return Object.fromEntries(
|
|
8595
8745
|
SWIFT_COVERAGE_DIGEST_SOURCES.map((file) => [
|
|
8596
8746
|
file,
|
|
8597
|
-
(0, import_node_crypto3.createHash)("sha256").update((0,
|
|
8747
|
+
(0, import_node_crypto3.createHash)("sha256").update((0, import_node_fs12.readFileSync)((0, import_node_path10.join)(srcDir, file))).digest("hex")
|
|
8598
8748
|
])
|
|
8599
8749
|
);
|
|
8600
8750
|
}
|
|
8601
|
-
var swiftCoverageProvenance = typeof define_SWIFT_COVERAGE_SOURCE_DIGESTS_default === "object" ? define_SWIFT_COVERAGE_SOURCE_DIGESTS_default : swiftCoverageSourceDigests((0,
|
|
8751
|
+
var swiftCoverageProvenance = typeof define_SWIFT_COVERAGE_SOURCE_DIGESTS_default === "object" ? define_SWIFT_COVERAGE_SOURCE_DIGESTS_default : swiftCoverageSourceDigests((0, import_node_path10.join)(__sootsim_import_meta_dirname, ".."));
|
|
8602
8752
|
|
|
8603
8753
|
// src/swift-coverage/xcode-asset-symbols.ts
|
|
8604
8754
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -8784,9 +8934,9 @@ var assetSymbolSettingKeys = [
|
|
|
8784
8934
|
|
|
8785
8935
|
// src/swift-package-manifest.ts
|
|
8786
8936
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8787
|
-
var
|
|
8788
|
-
var
|
|
8789
|
-
var
|
|
8937
|
+
var import_node_child_process5 = require("node:child_process");
|
|
8938
|
+
var import_node_path13 = __toESM(require("node:path"), 1);
|
|
8939
|
+
var import_node_util5 = require("node:util");
|
|
8790
8940
|
init_home_paths();
|
|
8791
8941
|
|
|
8792
8942
|
// src/swift-distribution.ts
|
|
@@ -8821,12 +8971,12 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
8821
8971
|
|
|
8822
8972
|
// src/swift-toolchain.ts
|
|
8823
8973
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8824
|
-
var
|
|
8825
|
-
var
|
|
8974
|
+
var import_node_fs13 = __toESM(require("node:fs"), 1);
|
|
8975
|
+
var import_node_path11 = __toESM(require("node:path"), 1);
|
|
8826
8976
|
function peachsimPackageRoot() {
|
|
8827
8977
|
let dir = __sootsim_import_meta_dirname;
|
|
8828
|
-
while (!
|
|
8829
|
-
dir =
|
|
8978
|
+
while (!import_node_fs13.default.existsSync(import_node_path11.default.join(dir, "package.json")) && dir !== import_node_path11.default.dirname(dir))
|
|
8979
|
+
dir = import_node_path11.default.dirname(dir);
|
|
8830
8980
|
return dir;
|
|
8831
8981
|
}
|
|
8832
8982
|
var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-81b2c791c27276bf";
|
|
@@ -9063,10 +9213,10 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
9063
9213
|
|
|
9064
9214
|
// src/swift-objc-sdk.ts
|
|
9065
9215
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
9066
|
-
var
|
|
9216
|
+
var import_node_path12 = __toESM(require("node:path"), 1);
|
|
9067
9217
|
var IOS_SDK_TARGET = "arm64-apple-ios16.0-simulator";
|
|
9068
9218
|
var OVERLAY_PATH = /^usr\/lib\/swift\/([^/]+)\.swiftmodule\/arm64-apple-ios-simulator\.swiftinterface$/;
|
|
9069
|
-
var tree = typeof __PEACH_BUNDLED_IOS_SDK__ === "undefined" ? readIosSdkTree(
|
|
9219
|
+
var tree = typeof __PEACH_BUNDLED_IOS_SDK__ === "undefined" ? readIosSdkTree(import_node_path12.default.join(peachsimPackageRoot(), "sdk", "ios")) : Object.entries(__PEACH_BUNDLED_IOS_SDK__).sort(([a], [b]) => a < b ? -1 : 1);
|
|
9070
9220
|
var IOS_SDK_HEADERS = {};
|
|
9071
9221
|
var IOS_SDK_OVERLAYS = {};
|
|
9072
9222
|
for (const [file, text2] of tree) {
|
|
@@ -9340,8 +9490,8 @@ var WASM_OPTIMIZE_IDENTITY = `wasm-opt ${import_wasm_opt.BINARYEN_VERSION} -Oz $
|
|
|
9340
9490
|
|
|
9341
9491
|
// src/swift-icu.ts
|
|
9342
9492
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
9343
|
-
var
|
|
9344
|
-
var
|
|
9493
|
+
var import_node_child_process4 = require("node:child_process");
|
|
9494
|
+
var import_node_util4 = require("node:util");
|
|
9345
9495
|
var import_node_zlib = require("node:zlib");
|
|
9346
9496
|
|
|
9347
9497
|
// ../sootsim-swift/src/icuData.ts
|
|
@@ -9356,10 +9506,10 @@ var VERSION = 1;
|
|
|
9356
9506
|
var SWIFT_ICU_PACKED = `picu${VERSION}`;
|
|
9357
9507
|
|
|
9358
9508
|
// src/swift-icu.ts
|
|
9359
|
-
var
|
|
9360
|
-
var deflate = (0,
|
|
9361
|
-
var compressBrotli = (0,
|
|
9362
|
-
var inflateGzip = (0,
|
|
9509
|
+
var run4 = (0, import_node_util4.promisify)(import_node_child_process4.execFile);
|
|
9510
|
+
var deflate = (0, import_node_util4.promisify)(import_node_zlib.gzip);
|
|
9511
|
+
var compressBrotli = (0, import_node_util4.promisify)(import_node_zlib.brotliCompress);
|
|
9512
|
+
var inflateGzip = (0, import_node_util4.promisify)(import_node_zlib.gunzip);
|
|
9363
9513
|
|
|
9364
9514
|
// src/swift-link-roots.ts
|
|
9365
9515
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -9462,7 +9612,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
|
|
|
9462
9612
|
var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
9463
9613
|
(module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
|
|
9464
9614
|
).join("");
|
|
9465
|
-
var compilerSourceDigest = true ? "
|
|
9615
|
+
var compilerSourceDigest = true ? "08a3436f8de8fff57c3ffe7822dc37ac9addd391678cb64d73212534a6e94aa1" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
|
|
9466
9616
|
var CORE_FOUNDATION_HANDLE_IMPORTS = [
|
|
9467
9617
|
"CFAllocator",
|
|
9468
9618
|
"CFArray",
|
|
@@ -9499,12 +9649,12 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
9499
9649
|
init_is_record();
|
|
9500
9650
|
|
|
9501
9651
|
// src/swift-package-manifest.ts
|
|
9502
|
-
var cacheDir3 =
|
|
9503
|
-
var execFileAsync = (0,
|
|
9652
|
+
var cacheDir3 = import_node_path13.default.join(cacheDir(), "swift-manifests");
|
|
9653
|
+
var execFileAsync = (0, import_node_util5.promisify)(import_node_child_process5.execFile);
|
|
9504
9654
|
|
|
9505
9655
|
// src/xcode-json-project.ts
|
|
9506
9656
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
9507
|
-
var
|
|
9657
|
+
var import_node_path14 = __toESM(require("node:path"), 1);
|
|
9508
9658
|
var import_json52 = __toESM(require_lib(), 1);
|
|
9509
9659
|
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9510
9660
|
var text = (value) => typeof value === "string" ? value : void 0;
|
|
@@ -9562,7 +9712,7 @@ var PHASE_ISA = {
|
|
|
9562
9712
|
function readXcodeJsonProject(xcodeproj, source) {
|
|
9563
9713
|
const json = import_json52.default.parse(source);
|
|
9564
9714
|
if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
|
|
9565
|
-
const projectDir =
|
|
9715
|
+
const projectDir = import_node_path14.default.dirname(xcodeproj);
|
|
9566
9716
|
const objects = {};
|
|
9567
9717
|
let next = 0;
|
|
9568
9718
|
const add = (entry, id) => {
|
|
@@ -9575,7 +9725,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
9575
9725
|
const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
|
|
9576
9726
|
if (base) {
|
|
9577
9727
|
if (base[1] === "PROJECT")
|
|
9578
|
-
return { sourceTree: "<absolute>", path:
|
|
9728
|
+
return { sourceTree: "<absolute>", path: import_node_path14.default.join(projectDir, base[2]) };
|
|
9579
9729
|
if (base[1] === "PRODUCTS")
|
|
9580
9730
|
return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
|
|
9581
9731
|
return null;
|
|
@@ -9583,7 +9733,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
9583
9733
|
const unescaped = raw.replaceAll("\\<", "<");
|
|
9584
9734
|
if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
|
|
9585
9735
|
if (unescaped.startsWith("~")) return null;
|
|
9586
|
-
return groupDir === null ? null : { sourceTree: "<absolute>", path:
|
|
9736
|
+
return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path14.default.join(groupDir, unescaped) };
|
|
9587
9737
|
};
|
|
9588
9738
|
const memberships = [];
|
|
9589
9739
|
const folders = [];
|
|
@@ -9594,7 +9744,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
9594
9744
|
const kind = text(entry.kind) ?? "file-reference";
|
|
9595
9745
|
const raw = text(entry.path) ?? "";
|
|
9596
9746
|
const located = raw === "" ? null : locate(raw, parent.dir);
|
|
9597
|
-
const name2 = text(entry.name) ??
|
|
9747
|
+
const name2 = text(entry.name) ?? import_node_path14.default.basename(raw);
|
|
9598
9748
|
const node = { id: "", name: name2, dir: null, parent, children: [] };
|
|
9599
9749
|
if (kind === "group" || kind === "variant-group" || kind === "version-group") {
|
|
9600
9750
|
node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
|
|
@@ -9715,7 +9865,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
9715
9865
|
if (!isObject(entry)) continue;
|
|
9716
9866
|
const repository = text(entry.repository);
|
|
9717
9867
|
const local = text(entry.path);
|
|
9718
|
-
const name2 = local !== void 0 ?
|
|
9868
|
+
const name2 = local !== void 0 ? import_node_path14.default.basename(import_node_path14.default.resolve(import_node_path14.default.dirname(xcodeproj), local)) : import_node_path14.default.basename(repository ?? "").replace(/\.git$/, "");
|
|
9719
9869
|
const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
|
|
9720
9870
|
isa: "XCRemoteSwiftPackageReference",
|
|
9721
9871
|
repositoryURL: repository ?? "",
|
|
@@ -9935,28 +10085,28 @@ var CONDITIONS = {
|
|
|
9935
10085
|
variant: "normal"
|
|
9936
10086
|
};
|
|
9937
10087
|
function walkFiles(dir) {
|
|
9938
|
-
if (!
|
|
10088
|
+
if (!import_node_fs14.default.existsSync(dir)) return [];
|
|
9939
10089
|
const out = [];
|
|
9940
|
-
for (const entry of
|
|
10090
|
+
for (const entry of import_node_fs14.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
9941
10091
|
if (entry.name.startsWith(".")) continue;
|
|
9942
|
-
const full =
|
|
10092
|
+
const full = import_node_path15.default.join(dir, entry.name);
|
|
9943
10093
|
if (entry.isDirectory()) out.push(...walkFiles(full));
|
|
9944
10094
|
else if (entry.isFile()) out.push(full);
|
|
9945
10095
|
}
|
|
9946
10096
|
return out;
|
|
9947
10097
|
}
|
|
9948
|
-
var isDirectory = (dir) =>
|
|
10098
|
+
var isDirectory = (dir) => import_node_fs14.default.existsSync(dir) && import_node_fs14.default.statSync(dir).isDirectory();
|
|
9949
10099
|
function readXcconfig(file, read) {
|
|
9950
|
-
if (read.includes(file) || !
|
|
10100
|
+
if (read.includes(file) || !import_node_fs14.default.existsSync(file)) return {};
|
|
9951
10101
|
read.push(file);
|
|
9952
10102
|
const settings = {};
|
|
9953
|
-
for (const raw of
|
|
10103
|
+
for (const raw of import_node_fs14.default.readFileSync(file, "utf8").split("\n")) {
|
|
9954
10104
|
const line = raw.replace(/\/\/.*$/, "").trim();
|
|
9955
10105
|
const include = /^#include\??\s+"([^"]+)"/.exec(line);
|
|
9956
10106
|
if (include) {
|
|
9957
10107
|
Object.assign(
|
|
9958
10108
|
settings,
|
|
9959
|
-
readXcconfig(
|
|
10109
|
+
readXcconfig(import_node_path15.default.resolve(import_node_path15.default.dirname(file), include[1]), read)
|
|
9960
10110
|
);
|
|
9961
10111
|
continue;
|
|
9962
10112
|
}
|
|
@@ -10006,22 +10156,22 @@ function decodeXml(text2) {
|
|
|
10006
10156
|
return text2.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
10007
10157
|
}
|
|
10008
10158
|
function workspaceReferences(workspace) {
|
|
10009
|
-
const data =
|
|
10010
|
-
if (!
|
|
10159
|
+
const data = import_node_path15.default.join(workspace, "contents.xcworkspacedata");
|
|
10160
|
+
if (!import_node_fs14.default.existsSync(data))
|
|
10011
10161
|
throw new Error(`${workspace} has no contents.xcworkspacedata`);
|
|
10012
|
-
const container =
|
|
10162
|
+
const container = import_node_path15.default.dirname(workspace);
|
|
10013
10163
|
const locate = (location, base) => {
|
|
10014
10164
|
const colon = location.indexOf(":");
|
|
10015
10165
|
const kind = location.slice(0, colon);
|
|
10016
10166
|
const rest = location.slice(colon + 1);
|
|
10017
|
-
if (kind === "group") return
|
|
10018
|
-
if (kind === "container" || kind === "self") return
|
|
10019
|
-
if (kind === "absolute") return
|
|
10020
|
-
throw new Error(`${
|
|
10167
|
+
if (kind === "group") return import_node_path15.default.resolve(base, rest);
|
|
10168
|
+
if (kind === "container" || kind === "self") return import_node_path15.default.resolve(container, rest);
|
|
10169
|
+
if (kind === "absolute") return import_node_path15.default.resolve(rest);
|
|
10170
|
+
throw new Error(`${import_node_path15.default.basename(workspace)} has an unsupported location ${location}`);
|
|
10021
10171
|
};
|
|
10022
10172
|
const groups = [container];
|
|
10023
10173
|
const references = [];
|
|
10024
|
-
for (const [, closing, tag, attributes, selfClosing] of
|
|
10174
|
+
for (const [, closing, tag, attributes, selfClosing] of import_node_fs14.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
|
|
10025
10175
|
if (closing) {
|
|
10026
10176
|
if (tag === "Group") groups.pop();
|
|
10027
10177
|
continue;
|
|
@@ -10072,8 +10222,8 @@ function remotePackageRequirements(projects) {
|
|
|
10072
10222
|
var loaded = /* @__PURE__ */ new Map();
|
|
10073
10223
|
function xcodeProjectFile(xcodeproj) {
|
|
10074
10224
|
for (const name2 of ["project.pbxproj", "project.xcproj"]) {
|
|
10075
|
-
const file =
|
|
10076
|
-
if (
|
|
10225
|
+
const file = import_node_path15.default.join(xcodeproj, name2);
|
|
10226
|
+
if (import_node_fs14.default.existsSync(file)) return file;
|
|
10077
10227
|
}
|
|
10078
10228
|
return null;
|
|
10079
10229
|
}
|
|
@@ -10081,7 +10231,7 @@ function loadProject(xcodeproj) {
|
|
|
10081
10231
|
const projectFile = xcodeProjectFile(xcodeproj);
|
|
10082
10232
|
if (!projectFile)
|
|
10083
10233
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
10084
|
-
const source =
|
|
10234
|
+
const source = import_node_fs14.default.readFileSync(projectFile, "utf8");
|
|
10085
10235
|
const digest = (0, import_node_crypto5.createHash)("sha256").update(source).digest("hex");
|
|
10086
10236
|
const cached = loaded.get(projectFile);
|
|
10087
10237
|
if (cached?.digest === digest) return cached.project;
|
|
@@ -10098,10 +10248,10 @@ function loadProject(xcodeproj) {
|
|
|
10098
10248
|
if (!project || project.isa !== "PBXProject") {
|
|
10099
10249
|
throw new Error(`${projectFile} has no PBXProject root`);
|
|
10100
10250
|
}
|
|
10101
|
-
const projectDir =
|
|
10102
|
-
|
|
10251
|
+
const projectDir = import_node_fs14.default.realpathSync.native(
|
|
10252
|
+
import_node_path15.default.resolve(import_node_path15.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
|
|
10103
10253
|
);
|
|
10104
|
-
const resolvePath = xcodePathResolver(objects, projectDir,
|
|
10254
|
+
const resolvePath = xcodePathResolver(objects, projectDir, import_node_path15.default.join);
|
|
10105
10255
|
const result = {
|
|
10106
10256
|
xcodeproj,
|
|
10107
10257
|
projectFile,
|
|
@@ -10138,8 +10288,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
10138
10288
|
const relative3 = str(config.baseConfigurationReferenceRelativePath);
|
|
10139
10289
|
const own = isDict(config.buildSettings) ? config.buildSettings : {};
|
|
10140
10290
|
const directory = anchor ? project.resolvePath(anchor) : null;
|
|
10141
|
-
const baseFile = base ? project.resolvePath(base) : directory && relative3 ?
|
|
10142
|
-
if (options.requireSources !== false && (base || anchor || relative3) && (!baseFile || !
|
|
10291
|
+
const baseFile = base ? project.resolvePath(base) : directory && relative3 ? import_node_path15.default.resolve(directory, relative3) : null;
|
|
10292
|
+
if (options.requireSources !== false && (base || anchor || relative3) && (!baseFile || !import_node_fs14.default.existsSync(baseFile)))
|
|
10143
10293
|
throw new Error(
|
|
10144
10294
|
`Unable to open base configuration reference file '${baseFile ?? base ?? relative3 ?? anchor}'`
|
|
10145
10295
|
);
|
|
@@ -10185,7 +10335,7 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
10185
10335
|
const derivedSettings = {
|
|
10186
10336
|
DEVELOPER_DIR: () => options.environment?.DEVELOPER_DIR ?? process.env.DEVELOPER_DIR ?? (developerDir ??= process.platform === "darwin" ? (
|
|
10187
10337
|
// runner-toolchain-platform: darwin
|
|
10188
|
-
(0,
|
|
10338
|
+
(0, import_node_child_process6.execFileSync)("xcode-select", ["-p"], {
|
|
10189
10339
|
encoding: "utf8",
|
|
10190
10340
|
stdio: ["ignore", "pipe", "pipe"]
|
|
10191
10341
|
}).trim()
|
|
@@ -10237,26 +10387,26 @@ function scriptCommand(shell, script) {
|
|
|
10237
10387
|
return [executable, ...args, "-c", script];
|
|
10238
10388
|
}
|
|
10239
10389
|
function expandSearchPath(directory, rules2) {
|
|
10240
|
-
if (
|
|
10390
|
+
if (import_node_path15.default.basename(directory) !== "**") return [directory];
|
|
10241
10391
|
const expanded = [];
|
|
10242
10392
|
const seen = /* @__PURE__ */ new Set();
|
|
10243
|
-
const queue = [
|
|
10393
|
+
const queue = [import_node_path15.default.dirname(directory)];
|
|
10244
10394
|
for (let at = 0; at < queue.length; at++) {
|
|
10245
10395
|
const current = queue[at];
|
|
10246
10396
|
let real;
|
|
10247
10397
|
try {
|
|
10248
|
-
real =
|
|
10398
|
+
real = import_node_fs14.default.realpathSync.native(current);
|
|
10249
10399
|
} catch {
|
|
10250
10400
|
continue;
|
|
10251
10401
|
}
|
|
10252
|
-
if (!
|
|
10402
|
+
if (!import_node_fs14.default.statSync(real).isDirectory() || seen.has(real)) continue;
|
|
10253
10403
|
seen.add(real);
|
|
10254
10404
|
expanded.push(current);
|
|
10255
|
-
for (const entry of
|
|
10405
|
+
for (const entry of import_node_fs14.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
10256
10406
|
if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
|
|
10257
10407
|
if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
|
|
10258
10408
|
continue;
|
|
10259
|
-
queue.push(
|
|
10409
|
+
queue.push(import_node_path15.default.join(current, entry.name));
|
|
10260
10410
|
}
|
|
10261
10411
|
}
|
|
10262
10412
|
return expanded;
|
|
@@ -10327,7 +10477,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
|
|
|
10327
10477
|
for (const token of tokens) {
|
|
10328
10478
|
if (token.startsWith("-")) break;
|
|
10329
10479
|
const file = resolve4(token);
|
|
10330
|
-
if (file?.endsWith(".xcassets")) catalogs.push(
|
|
10480
|
+
if (file?.endsWith(".xcassets")) catalogs.push(import_node_path15.default.resolve(projectDir, file));
|
|
10331
10481
|
}
|
|
10332
10482
|
}
|
|
10333
10483
|
return catalogs;
|
|
@@ -10372,14 +10522,14 @@ function shellCopies(script, settings, projectDir) {
|
|
|
10372
10522
|
if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
|
|
10373
10523
|
return [];
|
|
10374
10524
|
copies.push({
|
|
10375
|
-
from:
|
|
10376
|
-
to:
|
|
10525
|
+
from: import_node_path15.default.resolve(projectDir, operands[0]),
|
|
10526
|
+
to: import_node_path15.default.resolve(projectDir, operands[1])
|
|
10377
10527
|
});
|
|
10378
10528
|
}
|
|
10379
10529
|
return copies;
|
|
10380
10530
|
}
|
|
10381
10531
|
function fileListEntries(file, absolute) {
|
|
10382
|
-
return
|
|
10532
|
+
return import_node_fs14.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
|
|
10383
10533
|
}
|
|
10384
10534
|
function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
10385
10535
|
const { project, target, id: targetId } = ref;
|
|
@@ -10392,7 +10542,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10392
10542
|
const copiedFiles = [];
|
|
10393
10543
|
let generatedInfoPlist = false;
|
|
10394
10544
|
const declaredInfoPlist = settings("INFOPLIST_FILE");
|
|
10395
|
-
const infoPlistOutput = declaredInfoPlist ?
|
|
10545
|
+
const infoPlistOutput = declaredInfoPlist ? import_node_path15.default.resolve(project.projectDir, declaredInfoPlist) : null;
|
|
10396
10546
|
const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
|
|
10397
10547
|
for (const phaseId of list(target.buildPhases)) {
|
|
10398
10548
|
const phase = project.object(phaseId);
|
|
@@ -10407,7 +10557,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10407
10557
|
copiedFiles.push(
|
|
10408
10558
|
...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
|
|
10409
10559
|
);
|
|
10410
|
-
const absolute = (raw) =>
|
|
10560
|
+
const absolute = (raw) => import_node_path15.default.resolve(project.projectDir, expand(raw, settings));
|
|
10411
10561
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
10412
10562
|
const outputs = list(phase.outputPaths).map(absolute);
|
|
10413
10563
|
const fileLists = /* @__PURE__ */ new Map();
|
|
@@ -10416,7 +10566,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10416
10566
|
kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
|
|
10417
10567
|
).map((raw) => {
|
|
10418
10568
|
const file = absolute(raw);
|
|
10419
|
-
if (!
|
|
10569
|
+
if (!import_node_fs14.default.existsSync(file)) {
|
|
10420
10570
|
return { file, entries: [] };
|
|
10421
10571
|
}
|
|
10422
10572
|
return { file, entries: fileListEntries(file, absolute) };
|
|
@@ -10437,7 +10587,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10437
10587
|
...fileLists.get("OUTPUT").map((item) => item.file)
|
|
10438
10588
|
];
|
|
10439
10589
|
if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
|
|
10440
|
-
for (const file of inputFiles) if (
|
|
10590
|
+
for (const file of inputFiles) if (import_node_fs14.default.existsSync(file)) projectInputs.add(file);
|
|
10441
10591
|
}
|
|
10442
10592
|
if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
|
|
10443
10593
|
const configuration = settings("CONFIGURATION");
|
|
@@ -10450,10 +10600,10 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10450
10600
|
false
|
|
10451
10601
|
))
|
|
10452
10602
|
continue;
|
|
10453
|
-
const phaseDir =
|
|
10603
|
+
const phaseDir = import_node_path15.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
10454
10604
|
for (const lists of fileLists.values())
|
|
10455
10605
|
for (const { file } of lists)
|
|
10456
|
-
if (!
|
|
10606
|
+
if (!import_node_fs14.default.existsSync(file))
|
|
10457
10607
|
throw new Error(
|
|
10458
10608
|
`${targetName}: Run Script "${script}" missing file list ${file}`
|
|
10459
10609
|
);
|
|
@@ -10472,7 +10622,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10472
10622
|
const lists = fileLists.get(kind);
|
|
10473
10623
|
env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
|
|
10474
10624
|
lists.forEach((_item, index) => {
|
|
10475
|
-
env[`SCRIPT_${kind}_FILE_LIST_${index}`] =
|
|
10625
|
+
env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path15.default.join(
|
|
10476
10626
|
phaseDir,
|
|
10477
10627
|
`${kind}-${index}.xcfilelist`
|
|
10478
10628
|
);
|
|
@@ -10483,14 +10633,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10483
10633
|
);
|
|
10484
10634
|
for (const file of inputFiles) {
|
|
10485
10635
|
signature.update(file);
|
|
10486
|
-
if (
|
|
10487
|
-
const stat =
|
|
10636
|
+
if (import_node_fs14.default.existsSync(file)) {
|
|
10637
|
+
const stat = import_node_fs14.default.statSync(file);
|
|
10488
10638
|
signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
|
|
10489
10639
|
} else signature.update("missing");
|
|
10490
10640
|
}
|
|
10491
10641
|
const stamp = signature.digest("hex");
|
|
10492
10642
|
const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
10493
|
-
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) =>
|
|
10643
|
+
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs14.default.existsSync(file))) {
|
|
10494
10644
|
preparedXcodePhase(
|
|
10495
10645
|
project.projectFile,
|
|
10496
10646
|
targetId,
|
|
@@ -10501,14 +10651,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10501
10651
|
);
|
|
10502
10652
|
continue;
|
|
10503
10653
|
}
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10654
|
+
import_node_fs14.default.mkdirSync(phaseDir, { recursive: true });
|
|
10655
|
+
import_node_fs14.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
|
|
10656
|
+
import_node_fs14.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
|
|
10507
10657
|
for (const output2 of allOutputs)
|
|
10508
|
-
|
|
10658
|
+
import_node_fs14.default.mkdirSync(import_node_path15.default.dirname(output2), { recursive: true });
|
|
10509
10659
|
for (const [kind, lists] of fileLists)
|
|
10510
10660
|
lists.forEach((item, index) => {
|
|
10511
|
-
|
|
10661
|
+
import_node_fs14.default.writeFileSync(
|
|
10512
10662
|
env[`SCRIPT_${kind}_FILE_LIST_${index}`],
|
|
10513
10663
|
`${item.entries.join("\n")}
|
|
10514
10664
|
`
|
|
@@ -10519,7 +10669,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10519
10669
|
str(phase.shellPath) ?? "/bin/sh",
|
|
10520
10670
|
str(phase.shellScript) ?? ""
|
|
10521
10671
|
);
|
|
10522
|
-
(0,
|
|
10672
|
+
(0, import_node_child_process6.execFileSync)(shell, args, {
|
|
10523
10673
|
cwd: project.projectDir,
|
|
10524
10674
|
env,
|
|
10525
10675
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -10535,7 +10685,7 @@ ${output2}`
|
|
|
10535
10685
|
);
|
|
10536
10686
|
}
|
|
10537
10687
|
const missing2 = allOutputs.filter(
|
|
10538
|
-
(file) => file === infoPlistOutput && !
|
|
10688
|
+
(file) => file === infoPlistOutput && !import_node_fs14.default.existsSync(file)
|
|
10539
10689
|
);
|
|
10540
10690
|
if (missing2.length > 0)
|
|
10541
10691
|
throw new Error(
|
|
@@ -10554,9 +10704,9 @@ ${output2}`
|
|
|
10554
10704
|
}
|
|
10555
10705
|
project.visitMembers(
|
|
10556
10706
|
targetId,
|
|
10557
|
-
xcodePathResolver(project.objects, project.projectDir,
|
|
10558
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
10559
|
-
|
|
10707
|
+
xcodePathResolver(project.objects, project.projectDir, import_node_path15.default.join, settings),
|
|
10708
|
+
(file) => isDirectory(file) ? walkFiles(file) : import_node_fs14.default.existsSync(file) ? [file] : [],
|
|
10709
|
+
import_node_path15.default.join,
|
|
10560
10710
|
(file, kind) => {
|
|
10561
10711
|
if (kind === "header") {
|
|
10562
10712
|
headers.add(file);
|
|
@@ -10566,9 +10716,9 @@ ${output2}`
|
|
|
10566
10716
|
resources.add(file);
|
|
10567
10717
|
return;
|
|
10568
10718
|
}
|
|
10569
|
-
if (!
|
|
10719
|
+
if (!import_node_fs14.default.existsSync(file)) {
|
|
10570
10720
|
if (options.requireSources === false) return;
|
|
10571
|
-
const script = scriptForOutput.get(
|
|
10721
|
+
const script = scriptForOutput.get(import_node_path15.default.normalize(file));
|
|
10572
10722
|
throw new Error(
|
|
10573
10723
|
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}`
|
|
10574
10724
|
);
|
|
@@ -10579,17 +10729,17 @@ ${output2}`
|
|
|
10579
10729
|
);
|
|
10580
10730
|
if (options.prepareGeneratedSources && options.requireSources !== false) {
|
|
10581
10731
|
const interfaceFiles = [...resources].filter(
|
|
10582
|
-
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(
|
|
10732
|
+
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(import_node_path15.default.sep).some((part) => part.endsWith(".bundle"))
|
|
10583
10733
|
);
|
|
10584
10734
|
if (process.platform !== "darwin") {
|
|
10585
10735
|
let launchName = settings("INFOPLIST_KEY_UILaunchStoryboardName");
|
|
10586
|
-
if (!launchName && infoPlistOutput &&
|
|
10587
|
-
const info = import_plist2.default.parse(
|
|
10736
|
+
if (!launchName && infoPlistOutput && import_node_fs14.default.existsSync(infoPlistOutput)) {
|
|
10737
|
+
const info = import_plist2.default.parse(import_node_fs14.default.readFileSync(infoPlistOutput, "utf8"));
|
|
10588
10738
|
const declared = isRecord(info) ? info.UILaunchStoryboardName : void 0;
|
|
10589
10739
|
if (typeof declared === "string") launchName = expand(declared, settings);
|
|
10590
10740
|
}
|
|
10591
10741
|
const runtimeInterfaceFiles = interfaceFiles.filter(
|
|
10592
|
-
(file) =>
|
|
10742
|
+
(file) => import_node_path15.default.basename(file, import_node_path15.default.extname(file)) !== launchName
|
|
10593
10743
|
);
|
|
10594
10744
|
if (runtimeInterfaceFiles.length > 0)
|
|
10595
10745
|
throw new Error(
|
|
@@ -10600,19 +10750,19 @@ ${output2}`
|
|
|
10600
10750
|
}
|
|
10601
10751
|
const interfaceOutputs = /* @__PURE__ */ new Set();
|
|
10602
10752
|
for (const file of interfaceFiles) {
|
|
10603
|
-
const localization = file.split(
|
|
10753
|
+
const localization = file.split(import_node_path15.default.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
|
|
10604
10754
|
const extension = file.endsWith(".storyboard") ? ".storyboardc" : ".nib";
|
|
10605
|
-
const output2 =
|
|
10755
|
+
const output2 = import_node_path15.default.join(
|
|
10606
10756
|
settings("DERIVED_FILE_DIR"),
|
|
10607
10757
|
"InterfaceBuilder",
|
|
10608
10758
|
localization,
|
|
10609
|
-
|
|
10759
|
+
import_node_path15.default.basename(file, import_node_path15.default.extname(file)) + extension
|
|
10610
10760
|
);
|
|
10611
10761
|
if (interfaceOutputs.has(output2))
|
|
10612
10762
|
throw new Error(`${targetName}: duplicate Interface Builder output ${output2}`);
|
|
10613
10763
|
interfaceOutputs.add(output2);
|
|
10614
|
-
|
|
10615
|
-
|
|
10764
|
+
import_node_fs14.default.rmSync(output2, { recursive: true, force: true });
|
|
10765
|
+
import_node_fs14.default.mkdirSync(import_node_path15.default.dirname(output2), { recursive: true });
|
|
10616
10766
|
const args = [
|
|
10617
10767
|
"ibtool",
|
|
10618
10768
|
"--compile",
|
|
@@ -10626,7 +10776,7 @@ ${output2}`
|
|
|
10626
10776
|
const families = settings("TARGETED_DEVICE_FAMILY").split(",").map((value) => value.trim());
|
|
10627
10777
|
if (families.includes("1")) args.push("--target-device", "iphone");
|
|
10628
10778
|
if (families.includes("2")) args.push("--target-device", "ipad");
|
|
10629
|
-
(0,
|
|
10779
|
+
(0, import_node_child_process6.execFileSync)("xcrun", args, {
|
|
10630
10780
|
cwd: project.projectDir,
|
|
10631
10781
|
stdio: ["ignore", "pipe", "pipe"],
|
|
10632
10782
|
timeout: runScriptTimeoutMs
|
|
@@ -10646,13 +10796,13 @@ ${output2}`
|
|
|
10646
10796
|
for (const definition of definitions) {
|
|
10647
10797
|
const configuredLanguage = settings("INTENTS_CODEGEN_LANGUAGE");
|
|
10648
10798
|
const language = !configuredLanguage || configuredLanguage === "Automatic" ? sources.size > 0 ? "Swift" : "Objective-C" : configuredLanguage;
|
|
10649
|
-
const output2 =
|
|
10799
|
+
const output2 = import_node_path15.default.join(
|
|
10650
10800
|
settings("DERIVED_FILE_DIR"),
|
|
10651
10801
|
"IntentDefinitionGenerated",
|
|
10652
|
-
|
|
10802
|
+
import_node_path15.default.basename(definition, ".intentdefinition")
|
|
10653
10803
|
);
|
|
10654
|
-
|
|
10655
|
-
|
|
10804
|
+
import_node_fs14.default.rmSync(output2, { recursive: true, force: true });
|
|
10805
|
+
import_node_fs14.default.mkdirSync(output2, { recursive: true });
|
|
10656
10806
|
const args = [
|
|
10657
10807
|
"intentbuilderc",
|
|
10658
10808
|
"generate",
|
|
@@ -10671,7 +10821,7 @@ ${output2}`
|
|
|
10671
10821
|
args.push("-swiftVersion", settings("SWIFT_VERSION") || "5.0");
|
|
10672
10822
|
if (settings("DEFINES_MODULE") === "YES")
|
|
10673
10823
|
args.push("-moduleName", settings("PRODUCT_MODULE_NAME"));
|
|
10674
|
-
(0,
|
|
10824
|
+
(0, import_node_child_process6.execFileSync)("xcrun", args, {
|
|
10675
10825
|
cwd: project.projectDir,
|
|
10676
10826
|
stdio: ["ignore", "pipe", "pipe"],
|
|
10677
10827
|
timeout: runScriptTimeoutMs
|
|
@@ -10696,37 +10846,37 @@ ${output2}`
|
|
|
10696
10846
|
function commonAncestor(dirs) {
|
|
10697
10847
|
let common = dirs[0];
|
|
10698
10848
|
for (const dir of dirs) {
|
|
10699
|
-
while (common !==
|
|
10700
|
-
common =
|
|
10849
|
+
while (common !== import_node_path15.default.dirname(common) && import_node_path15.default.relative(common, dir).startsWith(".."))
|
|
10850
|
+
common = import_node_path15.default.dirname(common);
|
|
10701
10851
|
}
|
|
10702
10852
|
return common;
|
|
10703
10853
|
}
|
|
10704
|
-
var isPodsProject = (xcodeproj) =>
|
|
10854
|
+
var isPodsProject = (xcodeproj) => import_node_path15.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path15.default.basename(import_node_path15.default.dirname(xcodeproj)) === "Pods";
|
|
10705
10855
|
function installedPodsSandbox(pods) {
|
|
10706
|
-
const podfileLock =
|
|
10707
|
-
const manifestLock =
|
|
10708
|
-
if (!
|
|
10856
|
+
const podfileLock = import_node_path15.default.join(import_node_path15.default.dirname(pods), "Podfile.lock");
|
|
10857
|
+
const manifestLock = import_node_path15.default.join(pods, "Manifest.lock");
|
|
10858
|
+
if (!import_node_fs14.default.existsSync(podfileLock))
|
|
10709
10859
|
throw new Error(
|
|
10710
|
-
`${pods} has no ${podfileLock}: run \`pod install\` in ${
|
|
10860
|
+
`${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path15.default.dirname(pods)}`
|
|
10711
10861
|
);
|
|
10712
|
-
if (!
|
|
10862
|
+
if (!import_node_fs14.default.existsSync(manifestLock) || !import_node_fs14.default.readFileSync(manifestLock).equals(import_node_fs14.default.readFileSync(podfileLock)))
|
|
10713
10863
|
throw new Error(
|
|
10714
|
-
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${
|
|
10864
|
+
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path15.default.dirname(pods)}`
|
|
10715
10865
|
);
|
|
10716
10866
|
const specChecksums = {};
|
|
10717
|
-
const lines =
|
|
10867
|
+
const lines = import_node_fs14.default.readFileSync(manifestLock, "utf8").split("\n");
|
|
10718
10868
|
const start = lines.indexOf("SPEC CHECKSUMS:");
|
|
10719
10869
|
for (const line of start === -1 ? [] : lines.slice(start + 1)) {
|
|
10720
10870
|
const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
|
|
10721
10871
|
if (!entry) break;
|
|
10722
10872
|
specChecksums[entry[1]] = entry[2];
|
|
10723
10873
|
}
|
|
10724
|
-
const specs =
|
|
10874
|
+
const specs = import_node_path15.default.join(pods, "Local Podspecs");
|
|
10725
10875
|
return {
|
|
10726
10876
|
podfileLock,
|
|
10727
10877
|
manifestLock,
|
|
10728
10878
|
specChecksums,
|
|
10729
|
-
localPodspecs: isDirectory(specs) ?
|
|
10879
|
+
localPodspecs: isDirectory(specs) ? import_node_fs14.default.readdirSync(specs).filter((name2) => name2.endsWith(".podspec.json")).sort().map((name2) => import_node_path15.default.join(specs, name2)) : []
|
|
10730
10880
|
};
|
|
10731
10881
|
}
|
|
10732
10882
|
function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
@@ -10738,14 +10888,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
10738
10888
|
if (!xcodeProjectFile(xcodeproj)) {
|
|
10739
10889
|
if (installedPods && isPodsProject(xcodeproj))
|
|
10740
10890
|
throw new Error(
|
|
10741
|
-
`${
|
|
10891
|
+
`${import_node_path15.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path15.default.dirname(import_node_path15.default.dirname(xcodeproj))}`
|
|
10742
10892
|
);
|
|
10743
10893
|
return;
|
|
10744
10894
|
}
|
|
10745
|
-
const key =
|
|
10746
|
-
if (projectAt.has(key) || !installedPods && key.split(
|
|
10895
|
+
const key = import_node_fs14.default.realpathSync.native(xcodeproj);
|
|
10896
|
+
if (projectAt.has(key) || !installedPods && key.split(import_node_path15.default.sep).includes("Pods"))
|
|
10747
10897
|
return;
|
|
10748
|
-
if (isPodsProject(key)) cocoapods = installedPodsSandbox(
|
|
10898
|
+
if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path15.default.dirname(key));
|
|
10749
10899
|
const project = loadProject(key);
|
|
10750
10900
|
projectAt.set(key, project);
|
|
10751
10901
|
projects.push(project);
|
|
@@ -10761,12 +10911,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
10761
10911
|
for (const reference of listed)
|
|
10762
10912
|
if (reference.endsWith(".xcodeproj")) addProject(reference);
|
|
10763
10913
|
if (projects.length === 0) {
|
|
10764
|
-
throw new Error(`${
|
|
10914
|
+
throw new Error(`${import_node_path15.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
|
|
10765
10915
|
}
|
|
10766
|
-
const podfile =
|
|
10767
|
-
if (installedPods && !cocoapods &&
|
|
10916
|
+
const podfile = import_node_path15.default.join(import_node_path15.default.dirname(xcodeprojOrWorkspace), "Podfile");
|
|
10917
|
+
if (installedPods && !cocoapods && import_node_fs14.default.existsSync(podfile))
|
|
10768
10918
|
throw new Error(
|
|
10769
|
-
`${podfile} is not installed into ${
|
|
10919
|
+
`${podfile} is not installed into ${import_node_path15.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path15.default.dirname(podfile)} and open the workspace it writes`
|
|
10770
10920
|
);
|
|
10771
10921
|
return { listed, projects, projectAt, cocoapods };
|
|
10772
10922
|
}
|
|
@@ -10802,7 +10952,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
|
|
|
10802
10952
|
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
|
|
10803
10953
|
}
|
|
10804
10954
|
function defaultXcodeAppTarget(xcodeproj) {
|
|
10805
|
-
const project = loadProject(
|
|
10955
|
+
const project = loadProject(import_node_fs14.default.realpathSync.native(xcodeproj));
|
|
10806
10956
|
for (const [id, target] of Object.entries(project.objects)) {
|
|
10807
10957
|
if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
|
|
10808
10958
|
if (isIosAppTarget({ project, id, target }, { requireSources: false }))
|
|
@@ -10810,30 +10960,30 @@ function defaultXcodeAppTarget(xcodeproj) {
|
|
|
10810
10960
|
}
|
|
10811
10961
|
}
|
|
10812
10962
|
function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
10813
|
-
const container =
|
|
10963
|
+
const container = import_node_fs14.default.realpathSync.native(xcodeprojOrWorkspace);
|
|
10814
10964
|
const { projects } = workspaceProjects(container);
|
|
10815
10965
|
const containers = [
|
|
10816
10966
|
.../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
|
|
10817
10967
|
];
|
|
10818
10968
|
const found = containers.flatMap(
|
|
10819
10969
|
(dir) => [
|
|
10820
|
-
|
|
10821
|
-
...isDirectory(
|
|
10970
|
+
import_node_path15.default.join(dir, "xcshareddata"),
|
|
10971
|
+
...isDirectory(import_node_path15.default.join(dir, "xcuserdata")) ? import_node_fs14.default.readdirSync(import_node_path15.default.join(dir, "xcuserdata")).sort().map((user) => import_node_path15.default.join(dir, "xcuserdata", user)) : []
|
|
10822
10972
|
].map((data) => ({
|
|
10823
10973
|
dir,
|
|
10824
|
-
file:
|
|
10974
|
+
file: import_node_path15.default.join(data, "xcschemes", `${scheme}.xcscheme`)
|
|
10825
10975
|
}))
|
|
10826
|
-
).find((candidate) =>
|
|
10976
|
+
).find((candidate) => import_node_fs14.default.existsSync(candidate.file));
|
|
10827
10977
|
if (!found) {
|
|
10828
10978
|
const known = containers.flatMap(
|
|
10829
|
-
(dir) =>
|
|
10979
|
+
(dir) => import_node_fs14.default.existsSync(import_node_path15.default.join(dir, "xcshareddata", "xcschemes")) ? import_node_fs14.default.readdirSync(import_node_path15.default.join(dir, "xcshareddata", "xcschemes")).filter((name3) => name3.endsWith(".xcscheme")).map((name3) => name3.slice(0, -".xcscheme".length)).sort() : []
|
|
10830
10980
|
);
|
|
10831
10981
|
throw new Error(
|
|
10832
|
-
`${
|
|
10982
|
+
`${import_node_path15.default.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
|
|
10833
10983
|
);
|
|
10834
10984
|
}
|
|
10835
10985
|
const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
|
|
10836
|
-
|
|
10986
|
+
import_node_fs14.default.readFileSync(found.file, "utf8")
|
|
10837
10987
|
);
|
|
10838
10988
|
const attribute = (text2, name3) => {
|
|
10839
10989
|
const value = new RegExp(`\\b${name3}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
|
|
@@ -10846,12 +10996,12 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
10846
10996
|
if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
|
|
10847
10997
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
10848
10998
|
}
|
|
10849
|
-
const projectPath =
|
|
10850
|
-
|
|
10999
|
+
const projectPath = import_node_path15.default.resolve(
|
|
11000
|
+
import_node_path15.default.dirname(found.dir),
|
|
10851
11001
|
referenced.slice("container:".length)
|
|
10852
11002
|
);
|
|
10853
11003
|
const project = projects.find(
|
|
10854
|
-
(candidate) =>
|
|
11004
|
+
(candidate) => import_node_fs14.default.existsSync(projectPath) && candidate.xcodeproj === import_node_fs14.default.realpathSync.native(projectPath)
|
|
10855
11005
|
);
|
|
10856
11006
|
const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
|
|
10857
11007
|
const name2 = target && str(target.target.name);
|
|
@@ -10871,26 +11021,26 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
10871
11021
|
var NativeAppTargetSelectionError = class extends Error {
|
|
10872
11022
|
};
|
|
10873
11023
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
10874
|
-
const nested =
|
|
10875
|
-
const iosRoot =
|
|
10876
|
-
const entries =
|
|
11024
|
+
const nested = import_node_path15.default.join(projectRoot, "ios");
|
|
11025
|
+
const iosRoot = import_node_fs14.default.existsSync(nested) ? nested : projectRoot;
|
|
11026
|
+
const entries = import_node_fs14.default.readdirSync(iosRoot, { withFileTypes: true });
|
|
10877
11027
|
const projects = (entries.some((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")) ? entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).map((entry) => ({
|
|
10878
|
-
xcodeproj:
|
|
11028
|
+
xcodeproj: import_node_path15.default.join(iosRoot, entry.name),
|
|
10879
11029
|
workspace: null
|
|
10880
11030
|
})) : entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcworkspace")).flatMap((entry) => {
|
|
10881
|
-
const workspace =
|
|
11031
|
+
const workspace = import_node_path15.default.join(iosRoot, entry.name);
|
|
10882
11032
|
return workspaceReferences(workspace).map((xcodeproj2) => ({
|
|
10883
11033
|
xcodeproj: xcodeproj2,
|
|
10884
11034
|
workspace
|
|
10885
11035
|
}));
|
|
10886
11036
|
}).filter(
|
|
10887
|
-
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(
|
|
11037
|
+
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(import_node_path15.default.sep).includes("Pods") && import_node_fs14.default.existsSync(xcodeproj2)
|
|
10888
11038
|
).filter(
|
|
10889
11039
|
({ xcodeproj: xcodeproj2 }) => listXcodeAppTargets(xcodeproj2, { requireSources: false }).length > 0
|
|
10890
11040
|
)).map(({ xcodeproj: xcodeproj2, workspace }) => ({
|
|
10891
11041
|
xcodeproj: xcodeproj2,
|
|
10892
11042
|
workspace,
|
|
10893
|
-
name:
|
|
11043
|
+
name: import_node_path15.default.basename(xcodeproj2)
|
|
10894
11044
|
}));
|
|
10895
11045
|
if (projects.length === 0) return null;
|
|
10896
11046
|
if (projects.length > 1 && !iosTarget) {
|
|
@@ -10929,13 +11079,13 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
10929
11079
|
if (!target) throw new Error("native app identity has no iOS application target");
|
|
10930
11080
|
if (!iosTarget) {
|
|
10931
11081
|
const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
|
|
10932
|
-
const container =
|
|
11082
|
+
const container = import_node_fs14.default.existsSync(workspace) ? workspace : xcodeproj;
|
|
10933
11083
|
const hasScheme = [container, xcodeproj].some((dir) => {
|
|
10934
|
-
if (
|
|
11084
|
+
if (import_node_fs14.default.existsSync(import_node_path15.default.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
|
|
10935
11085
|
return true;
|
|
10936
|
-
const users =
|
|
10937
|
-
return
|
|
10938
|
-
(user) =>
|
|
11086
|
+
const users = import_node_path15.default.join(dir, "xcuserdata");
|
|
11087
|
+
return import_node_fs14.default.existsSync(users) && import_node_fs14.default.readdirSync(users).some(
|
|
11088
|
+
(user) => import_node_fs14.default.existsSync(import_node_path15.default.join(users, user, "xcschemes", `${target}.xcscheme`))
|
|
10939
11089
|
);
|
|
10940
11090
|
});
|
|
10941
11091
|
if (hasScheme) target = readXcodeScheme(container, target).target;
|
|
@@ -10946,8 +11096,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
10946
11096
|
);
|
|
10947
11097
|
return { xcodeproj, target, workspace: project.workspace };
|
|
10948
11098
|
}
|
|
10949
|
-
var workspaceResolvedFile = (xcodeprojOrWorkspace) =>
|
|
10950
|
-
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace :
|
|
11099
|
+
var workspaceResolvedFile = (xcodeprojOrWorkspace) => import_node_path15.default.join(
|
|
11100
|
+
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : import_node_path15.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
|
|
10951
11101
|
"xcshareddata",
|
|
10952
11102
|
"swiftpm",
|
|
10953
11103
|
"Package.resolved"
|
|
@@ -10962,7 +11112,7 @@ var SwiftPackageResolutionRequired = class extends Error {
|
|
|
10962
11112
|
}
|
|
10963
11113
|
};
|
|
10964
11114
|
function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
|
|
10965
|
-
const xcodeprojOrWorkspace =
|
|
11115
|
+
const xcodeprojOrWorkspace = import_node_fs14.default.realpathSync.native(input);
|
|
10966
11116
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
10967
11117
|
const { listed, projects, projectAt, cocoapods } = workspaceProjects(
|
|
10968
11118
|
xcodeprojOrWorkspace,
|
|
@@ -10971,7 +11121,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
10971
11121
|
const allTargets = projects.flatMap(projectTargets);
|
|
10972
11122
|
const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
|
|
10973
11123
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
10974
|
-
const container =
|
|
11124
|
+
const container = import_node_path15.default.basename(xcodeprojOrWorkspace);
|
|
10975
11125
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
10976
11126
|
if (named.length !== 1) {
|
|
10977
11127
|
if (appTargets.length === 0)
|
|
@@ -10992,15 +11142,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
10992
11142
|
for (const ref of allTargets) {
|
|
10993
11143
|
const product = ref.project.object(str(ref.target.productReference));
|
|
10994
11144
|
const file = str(product?.path);
|
|
10995
|
-
if (file && !byProduct.has(
|
|
10996
|
-
byProduct.set(
|
|
11145
|
+
if (file && !byProduct.has(import_node_path15.default.basename(file)))
|
|
11146
|
+
byProduct.set(import_node_path15.default.basename(file), ref);
|
|
10997
11147
|
}
|
|
10998
11148
|
const proxied = (project, proxyId) => {
|
|
10999
11149
|
const proxy = project.object(proxyId);
|
|
11000
11150
|
if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
|
|
11001
11151
|
const portal = str(proxy.containerPortal);
|
|
11002
11152
|
const portalPath = project.resolvePath(portal ?? "");
|
|
11003
|
-
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath &&
|
|
11153
|
+
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs14.default.existsSync(portalPath) ? projectAt.get(import_node_fs14.default.realpathSync.native(portalPath)) : void 0;
|
|
11004
11154
|
const remote = str(proxy.remoteGlobalIDString);
|
|
11005
11155
|
if (!owner || !remote) return void 0;
|
|
11006
11156
|
return projectTargets(owner).find(
|
|
@@ -11017,7 +11167,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11017
11167
|
const buildFile = project.object(buildFileId);
|
|
11018
11168
|
if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
11019
11169
|
const file = project.object(str(buildFile.fileRef));
|
|
11020
|
-
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(
|
|
11170
|
+
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path15.default.basename(str(file.path) ?? "")) : void 0;
|
|
11021
11171
|
if (resolved)
|
|
11022
11172
|
found.push({
|
|
11023
11173
|
target: resolved,
|
|
@@ -11101,8 +11251,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11101
11251
|
ref.project.visitMembers(
|
|
11102
11252
|
ref.id,
|
|
11103
11253
|
ref.project.resolvePath,
|
|
11104
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
11105
|
-
|
|
11254
|
+
(file) => isDirectory(file) ? walkFiles(file) : import_node_fs14.default.existsSync(file) ? [file] : [],
|
|
11255
|
+
import_node_path15.default.join,
|
|
11106
11256
|
(file, kind) => {
|
|
11107
11257
|
if (kind === "header") found.push(file);
|
|
11108
11258
|
}
|
|
@@ -11118,12 +11268,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11118
11268
|
for (const ref of projectTargets(project)) {
|
|
11119
11269
|
const product = productName(ref);
|
|
11120
11270
|
for (const { file, visibility } of headerPhase(ref)) {
|
|
11121
|
-
const name2 =
|
|
11271
|
+
const name2 = import_node_path15.default.basename(file);
|
|
11122
11272
|
if (!entries.has(name2))
|
|
11123
11273
|
entries.set(name2, visibility !== "Project" ? `${product}/${name2}` : file);
|
|
11124
11274
|
}
|
|
11125
11275
|
for (const file of synchronizedHeaders(ref)) {
|
|
11126
|
-
const name2 =
|
|
11276
|
+
const name2 = import_node_path15.default.basename(file);
|
|
11127
11277
|
if (!entries.has(name2)) entries.set(name2, file);
|
|
11128
11278
|
}
|
|
11129
11279
|
}
|
|
@@ -11133,7 +11283,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11133
11283
|
if (folder === null) continue;
|
|
11134
11284
|
for (const file of walkFiles(folder)) {
|
|
11135
11285
|
if (!HEADER_FILE.test(file)) continue;
|
|
11136
|
-
const name2 =
|
|
11286
|
+
const name2 = import_node_path15.default.basename(file);
|
|
11137
11287
|
if (!entries.has(name2)) entries.set(name2, file);
|
|
11138
11288
|
}
|
|
11139
11289
|
}
|
|
@@ -11141,18 +11291,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11141
11291
|
for (const id of Object.keys(project.objects)) {
|
|
11142
11292
|
if (project.object(id)?.isa !== "PBXFileReference") continue;
|
|
11143
11293
|
const file = project.resolvePath(id);
|
|
11144
|
-
if (file && HEADER_FILE.test(file) && !entries.has(
|
|
11145
|
-
entries.set(
|
|
11294
|
+
if (file && HEADER_FILE.test(file) && !entries.has(import_node_path15.default.basename(file)))
|
|
11295
|
+
entries.set(import_node_path15.default.basename(file), file);
|
|
11146
11296
|
}
|
|
11147
11297
|
const map2 = [...entries];
|
|
11148
11298
|
projectHeaderMaps.set(project, map2);
|
|
11149
11299
|
return map2;
|
|
11150
11300
|
};
|
|
11151
11301
|
const xcconfigs = /* @__PURE__ */ new Set();
|
|
11152
|
-
const buildDir = (project) =>
|
|
11302
|
+
const buildDir = (project) => import_node_path15.default.join(project.projectDir, ".build/peach-xcode/Build");
|
|
11153
11303
|
const workspaceBuild = {
|
|
11154
|
-
SYMROOT:
|
|
11155
|
-
OBJROOT:
|
|
11304
|
+
SYMROOT: import_node_path15.default.join(buildDir(app.project), "Products"),
|
|
11305
|
+
OBJROOT: import_node_path15.default.join(buildDir(app.project), "Intermediates.noindex")
|
|
11156
11306
|
};
|
|
11157
11307
|
const moduleTarget = (ref) => {
|
|
11158
11308
|
const name2 = str(ref.target.name) ?? ref.id;
|
|
@@ -11167,16 +11317,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11167
11317
|
TARGET_NAME: name2,
|
|
11168
11318
|
TARGETNAME: "$(TARGET_NAME)",
|
|
11169
11319
|
PROJECT: "$(PROJECT_NAME)",
|
|
11170
|
-
PROJECT_NAME:
|
|
11320
|
+
PROJECT_NAME: import_node_path15.default.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
11171
11321
|
PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
|
|
11172
11322
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
11173
11323
|
SRCROOT: ref.project.projectDir,
|
|
11174
11324
|
SOURCE_ROOT: ref.project.projectDir,
|
|
11175
11325
|
PROJECT_DIR: ref.project.projectDir,
|
|
11176
|
-
SYMROOT:
|
|
11326
|
+
SYMROOT: import_node_path15.default.join(buildDir(ref.project), "Products"),
|
|
11177
11327
|
BUILD_DIR: "$(SYMROOT)",
|
|
11178
11328
|
BUILD_ROOT: "$(SYMROOT)",
|
|
11179
|
-
OBJROOT:
|
|
11329
|
+
OBJROOT: import_node_path15.default.join(buildDir(ref.project), "Intermediates.noindex"),
|
|
11180
11330
|
CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
|
|
11181
11331
|
BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
11182
11332
|
TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
@@ -11218,7 +11368,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11218
11368
|
xcconfigs
|
|
11219
11369
|
);
|
|
11220
11370
|
const searchRules = recursiveSearchRules(settings2);
|
|
11221
|
-
const absolute = (file) =>
|
|
11371
|
+
const absolute = (file) => import_node_path15.default.resolve(ref.project.projectDir, file);
|
|
11222
11372
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
|
|
11223
11373
|
const product = settings2("PRODUCT_NAME");
|
|
11224
11374
|
const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
|
|
@@ -11249,7 +11399,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11249
11399
|
`${name2}: Swift compatibility header phase has no Swift producer sources`
|
|
11250
11400
|
);
|
|
11251
11401
|
const building = options.prepareGeneratedSources && options.requireSources !== false;
|
|
11252
|
-
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ?
|
|
11402
|
+
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path15.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
|
|
11253
11403
|
if (versioning) {
|
|
11254
11404
|
const version = settings2("CURRENT_PROJECT_VERSION");
|
|
11255
11405
|
const custom = [
|
|
@@ -11262,7 +11412,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11262
11412
|
].filter((key) => settings2(key));
|
|
11263
11413
|
if (custom.length)
|
|
11264
11414
|
throw new Error(
|
|
11265
|
-
`${name2}: Xcode generates ${
|
|
11415
|
+
`${name2}: Xcode generates ${import_node_path15.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
|
|
11266
11416
|
);
|
|
11267
11417
|
const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
11268
11418
|
const [major, minor] = version.split(".");
|
|
@@ -11275,9 +11425,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11275
11425
|
` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number2};`,
|
|
11276
11426
|
""
|
|
11277
11427
|
].join("\n");
|
|
11278
|
-
if (!
|
|
11279
|
-
|
|
11280
|
-
|
|
11428
|
+
if (!import_node_fs14.default.existsSync(versioning) || import_node_fs14.default.readFileSync(versioning, "utf8") !== unit) {
|
|
11429
|
+
import_node_fs14.default.mkdirSync(import_node_path15.default.dirname(versioning), { recursive: true });
|
|
11430
|
+
import_node_fs14.default.writeFileSync(versioning, unit);
|
|
11281
11431
|
}
|
|
11282
11432
|
allSources.push(versioning);
|
|
11283
11433
|
}
|
|
@@ -11296,7 +11446,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11296
11446
|
const headerFiles = headerPhase(ref);
|
|
11297
11447
|
const ownHeaders = /* @__PURE__ */ new Map();
|
|
11298
11448
|
for (const { file, visibility } of headerFiles) {
|
|
11299
|
-
const name3 =
|
|
11449
|
+
const name3 = import_node_path15.default.basename(file);
|
|
11300
11450
|
const published = visibility !== "Project";
|
|
11301
11451
|
if (!ownHeaders.has(name3))
|
|
11302
11452
|
ownHeaders.set(name3, published ? `${product}/${name3}` : file);
|
|
@@ -11304,7 +11454,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11304
11454
|
ownHeaders.set(`${product}/${name3}`, file);
|
|
11305
11455
|
}
|
|
11306
11456
|
for (const file of synchronizedHeaders(ref)) {
|
|
11307
|
-
const name3 =
|
|
11457
|
+
const name3 = import_node_path15.default.basename(file);
|
|
11308
11458
|
if (ownHeaders.has(name3)) continue;
|
|
11309
11459
|
ownHeaders.set(name3, file);
|
|
11310
11460
|
const qualified = `${product}/${name3}`;
|
|
@@ -11316,24 +11466,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11316
11466
|
const otherProduct = productName(other);
|
|
11317
11467
|
for (const { file, visibility } of headerPhase(other)) {
|
|
11318
11468
|
if (visibility === "Project") continue;
|
|
11319
|
-
const key = `${otherProduct}/${
|
|
11469
|
+
const key = `${otherProduct}/${import_node_path15.default.basename(file)}`;
|
|
11320
11470
|
if (!nonFrameworkHeaders.has(key)) nonFrameworkHeaders.set(key, file);
|
|
11321
11471
|
}
|
|
11322
11472
|
}
|
|
11323
|
-
const wrapper =
|
|
11473
|
+
const wrapper = import_node_path15.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
|
|
11324
11474
|
const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
|
|
11325
|
-
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ?
|
|
11326
|
-
const frameworkCompatibility = frameworkUmbrella && moduleMap &&
|
|
11475
|
+
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? import_node_path15.default.join(import_node_path15.default.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
|
|
11476
|
+
const frameworkCompatibility = frameworkUmbrella && moduleMap && import_node_fs14.default.existsSync(moduleMap) && import_node_fs14.default.existsSync(frameworkUmbrella) ? {
|
|
11327
11477
|
framework: true,
|
|
11328
11478
|
moduleMap,
|
|
11329
11479
|
umbrella: frameworkUmbrella,
|
|
11330
|
-
outputModuleMap:
|
|
11331
|
-
outputUmbrella:
|
|
11480
|
+
outputModuleMap: import_node_path15.default.join(wrapper, "Modules", "module.modulemap"),
|
|
11481
|
+
outputUmbrella: import_node_path15.default.join(
|
|
11332
11482
|
wrapper,
|
|
11333
11483
|
"Headers",
|
|
11334
|
-
|
|
11484
|
+
import_node_path15.default.basename(frameworkUmbrella)
|
|
11335
11485
|
),
|
|
11336
|
-
outputHeader:
|
|
11486
|
+
outputHeader: import_node_path15.default.join(
|
|
11337
11487
|
wrapper,
|
|
11338
11488
|
"Headers",
|
|
11339
11489
|
settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
|
|
@@ -11347,10 +11497,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11347
11497
|
outputUmbrella: compatibility.outputUmbrella,
|
|
11348
11498
|
outputHeader: compatibility.outputHeader
|
|
11349
11499
|
} : frameworkCompatibility;
|
|
11350
|
-
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap &&
|
|
11500
|
+
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path15.default.relative(import_node_path15.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path15.default.sep)[0] !== ".." && import_node_fs14.default.existsSync(moduleMap) ? import_node_fs14.default.readdirSync(import_node_path15.default.dirname(moduleMap)).flatMap((entry) => {
|
|
11351
11501
|
if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
|
|
11352
|
-
const file =
|
|
11353
|
-
return
|
|
11502
|
+
const file = import_node_path15.default.join(import_node_path15.default.dirname(moduleMap), entry);
|
|
11503
|
+
return import_node_fs14.default.existsSync(file) ? [file] : [];
|
|
11354
11504
|
}) : [];
|
|
11355
11505
|
const fileFlags = {};
|
|
11356
11506
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -11425,15 +11575,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11425
11575
|
// xcode searches its products' include directory before
|
|
11426
11576
|
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
11427
11577
|
headerSearchPaths: [
|
|
11428
|
-
|
|
11578
|
+
import_node_path15.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
|
|
11429
11579
|
...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
|
|
11430
11580
|
(raw) => expandSearchPath(absolute(raw), searchRules)
|
|
11431
11581
|
),
|
|
11432
|
-
|
|
11582
|
+
import_node_path15.default.join(
|
|
11433
11583
|
`${settings2("DERIVED_FILE_DIR")}-normal`,
|
|
11434
11584
|
settings2("CURRENT_ARCH")
|
|
11435
11585
|
),
|
|
11436
|
-
|
|
11586
|
+
import_node_path15.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
|
|
11437
11587
|
settings2("DERIVED_FILE_DIR")
|
|
11438
11588
|
],
|
|
11439
11589
|
userHeaderSearchPaths: settingList(
|
|
@@ -11483,10 +11633,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11483
11633
|
...headerFiles.flatMap(
|
|
11484
11634
|
({ file, visibility }) => visibility === "Project" ? [] : [
|
|
11485
11635
|
[
|
|
11486
|
-
|
|
11636
|
+
import_node_path15.default.join(
|
|
11487
11637
|
wrapper,
|
|
11488
11638
|
visibility === "Public" ? "Headers" : "PrivateHeaders",
|
|
11489
|
-
|
|
11639
|
+
import_node_path15.default.basename(file)
|
|
11490
11640
|
),
|
|
11491
11641
|
file
|
|
11492
11642
|
]
|
|
@@ -11500,7 +11650,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11500
11650
|
return [];
|
|
11501
11651
|
const destination = expand(
|
|
11502
11652
|
str(phase.dstPath) ?? "",
|
|
11503
|
-
(name3) => name3 === "PUBLIC_HEADERS_FOLDER_PATH" ?
|
|
11653
|
+
(name3) => name3 === "PUBLIC_HEADERS_FOLDER_PATH" ? import_node_path15.default.join(wrapper, "Headers") : name3 === "PRIVATE_HEADERS_FOLDER_PATH" ? import_node_path15.default.join(wrapper, "PrivateHeaders") : settings2(name3)
|
|
11504
11654
|
);
|
|
11505
11655
|
return list(phase.files).flatMap((id) => {
|
|
11506
11656
|
const file = ref.project.resolvePath(
|
|
@@ -11508,17 +11658,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11508
11658
|
);
|
|
11509
11659
|
return file && HEADER_FILE.test(file) ? [
|
|
11510
11660
|
[
|
|
11511
|
-
|
|
11661
|
+
import_node_path15.default.resolve(
|
|
11512
11662
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
11513
11663
|
destination,
|
|
11514
|
-
|
|
11664
|
+
import_node_path15.default.basename(file)
|
|
11515
11665
|
),
|
|
11516
11666
|
file
|
|
11517
11667
|
]
|
|
11518
11668
|
] : [];
|
|
11519
11669
|
});
|
|
11520
11670
|
}),
|
|
11521
|
-
...moduleMap ? [[
|
|
11671
|
+
...moduleMap ? [[import_node_path15.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
|
|
11522
11672
|
]) : Object.fromEntries([
|
|
11523
11673
|
...podHeaders.map((file) => [file, file]),
|
|
11524
11674
|
...moduleMap ? [[moduleMap, moduleMap]] : []
|
|
@@ -11550,7 +11700,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11550
11700
|
const frameworkTargets = selectedTargets.filter((target) => target !== builtTargets.at(-1)).filter(({ ref }) => MODULE_PRODUCTS.has(str(ref.target.productType) ?? "")).map(({ ref, module: module3 }) => ({ ref, framework: module3 }));
|
|
11551
11701
|
const frameworks = frameworkTargets.map(({ framework }) => framework);
|
|
11552
11702
|
const podSourceDirs = builtTargets.slice(0, -1).flatMap(
|
|
11553
|
-
({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) =>
|
|
11703
|
+
({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) => import_node_path15.default.dirname(file)).filter((dir) => import_node_fs14.default.existsSync(dir)) : []
|
|
11554
11704
|
);
|
|
11555
11705
|
const expandValue = (value, settings2) => {
|
|
11556
11706
|
if (typeof value === "string") return expand(value, settings2);
|
|
@@ -11571,7 +11721,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11571
11721
|
const phase = owner.ref.project.object(phaseId);
|
|
11572
11722
|
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
|
|
11573
11723
|
continue;
|
|
11574
|
-
const absolute = (raw) =>
|
|
11724
|
+
const absolute = (raw) => import_node_path15.default.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
|
|
11575
11725
|
const entries = (paths) => paths.flatMap((raw) => {
|
|
11576
11726
|
const file = absolute(raw);
|
|
11577
11727
|
xcconfigs.add(file);
|
|
@@ -11587,7 +11737,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11587
11737
|
].filter((file) => file.endsWith(".bundle"));
|
|
11588
11738
|
if (inputs.length !== outputs.length)
|
|
11589
11739
|
throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
|
|
11590
|
-
const destinationRoot =
|
|
11740
|
+
const destinationRoot = import_node_path15.default.join(
|
|
11591
11741
|
owner.settings("TARGET_BUILD_DIR"),
|
|
11592
11742
|
owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
|
|
11593
11743
|
);
|
|
@@ -11596,24 +11746,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11596
11746
|
const file = str(
|
|
11597
11747
|
target.ref.project.object(str(target.ref.target.productReference))?.path
|
|
11598
11748
|
);
|
|
11599
|
-
return file &&
|
|
11749
|
+
return file && import_node_path15.default.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
|
|
11600
11750
|
});
|
|
11601
11751
|
if (!product && !isDirectory(input2))
|
|
11602
11752
|
throw new Error(
|
|
11603
11753
|
`${owner.module.name}: resource bundle input has no selected producer: ${input2}`
|
|
11604
11754
|
);
|
|
11605
|
-
const destination =
|
|
11606
|
-
if (destination === ".." || destination.startsWith(`..${
|
|
11755
|
+
const destination = import_node_path15.default.relative(destinationRoot, outputs[index]);
|
|
11756
|
+
if (destination === ".." || destination.startsWith(`..${import_node_path15.default.sep}`) || import_node_path15.default.isAbsolute(destination) || import_node_path15.default.basename(input2) !== import_node_path15.default.basename(destination))
|
|
11607
11757
|
throw new Error(
|
|
11608
11758
|
`${owner.module.name}: invalid resource bundle copy destination`
|
|
11609
11759
|
);
|
|
11610
|
-
const infoFile = product ?
|
|
11760
|
+
const infoFile = product ? import_node_path15.default.resolve(
|
|
11611
11761
|
product.ref.project.projectDir,
|
|
11612
11762
|
product.settings("INFOPLIST_FILE")
|
|
11613
11763
|
) : null;
|
|
11614
11764
|
if (infoFile) xcconfigs.add(infoFile);
|
|
11615
11765
|
const prefix2 = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
|
|
11616
|
-
const bundlePath = prefix2 + destination.split(
|
|
11766
|
+
const bundlePath = prefix2 + destination.split(import_node_path15.default.sep).join("/");
|
|
11617
11767
|
if (resourceProducts.some((resource) => resource.path === bundlePath))
|
|
11618
11768
|
throw new Error(
|
|
11619
11769
|
`${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
|
|
@@ -11624,22 +11774,22 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11624
11774
|
resources: product.module.resources,
|
|
11625
11775
|
infoPlist: import_plist2.default.build(
|
|
11626
11776
|
expandValue(
|
|
11627
|
-
import_plist2.default.parse(
|
|
11777
|
+
import_plist2.default.parse(import_node_fs14.default.readFileSync(infoFile, "utf8")),
|
|
11628
11778
|
product.settings
|
|
11629
11779
|
)
|
|
11630
11780
|
)
|
|
11631
11781
|
} : {
|
|
11632
|
-
resources:
|
|
11782
|
+
resources: import_node_fs14.default.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path15.default.join(entry.parentPath, entry.name)).sort(),
|
|
11633
11783
|
sourceRoot: input2
|
|
11634
11784
|
}
|
|
11635
11785
|
});
|
|
11636
11786
|
}
|
|
11637
11787
|
}
|
|
11638
11788
|
}
|
|
11639
|
-
const infoPlistFile = settings("INFOPLIST_FILE") ?
|
|
11640
|
-
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ?
|
|
11789
|
+
const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path15.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
|
|
11790
|
+
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? import_node_path15.default.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
|
|
11641
11791
|
const infoPlistPending = module2.generatedInfoPlist && !options.prepareGeneratedSources;
|
|
11642
|
-
const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist2.default.parse(
|
|
11792
|
+
const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist2.default.parse(import_node_fs14.default.readFileSync(infoPlistFile, "utf8")) : {};
|
|
11643
11793
|
if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
|
|
11644
11794
|
throw new Error(`${module2.name} Info.plist must contain a dictionary`);
|
|
11645
11795
|
}
|
|
@@ -11663,7 +11813,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11663
11813
|
}
|
|
11664
11814
|
const bundleIdentifier = settings("PRODUCT_BUNDLE_IDENTIFIER") || (typeof info.CFBundleIdentifier === "string" ? info.CFBundleIdentifier : "");
|
|
11665
11815
|
const keychainAccessGroups = entitlementsFile ? readKeychainAccessGroups(
|
|
11666
|
-
import_plist2.default.parse(
|
|
11816
|
+
import_plist2.default.parse(import_node_fs14.default.readFileSync(entitlementsFile, "utf8")),
|
|
11667
11817
|
(value) => expand(value, (key) => {
|
|
11668
11818
|
if (key === "AppIdentifierPrefix") return "FAKETEAMID.";
|
|
11669
11819
|
if (key === "TeamIdentifierPrefix") return "";
|
|
@@ -11699,7 +11849,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11699
11849
|
};
|
|
11700
11850
|
}
|
|
11701
11851
|
const localPackageDirs = [
|
|
11702
|
-
...listed.filter((reference) =>
|
|
11852
|
+
...listed.filter((reference) => import_node_fs14.default.existsSync(import_node_path15.default.join(reference, "Package.swift"))),
|
|
11703
11853
|
...projects.flatMap(
|
|
11704
11854
|
(project) => Object.entries(project.objects).flatMap(([id, entry]) => {
|
|
11705
11855
|
if (!isDict(entry)) return [];
|
|
@@ -11709,19 +11859,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11709
11859
|
const packages = [];
|
|
11710
11860
|
while (pending.length > 0) {
|
|
11711
11861
|
const dir = pending.pop();
|
|
11712
|
-
if (
|
|
11862
|
+
if (import_node_fs14.default.existsSync(import_node_path15.default.join(dir, "Package.swift"))) {
|
|
11713
11863
|
packages.push(dir);
|
|
11714
11864
|
continue;
|
|
11715
11865
|
}
|
|
11716
11866
|
if (!isDirectory(dir)) continue;
|
|
11717
|
-
for (const child of
|
|
11867
|
+
for (const child of import_node_fs14.default.readdirSync(dir, { withFileTypes: true }))
|
|
11718
11868
|
if (child.isDirectory() && !child.name.startsWith("."))
|
|
11719
|
-
pending.push(
|
|
11869
|
+
pending.push(import_node_path15.default.join(dir, child.name));
|
|
11720
11870
|
}
|
|
11721
11871
|
return packages;
|
|
11722
11872
|
}
|
|
11723
|
-
const candidate = entry.isa === "XCLocalSwiftPackageReference" ?
|
|
11724
|
-
return candidate &&
|
|
11873
|
+
const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path15.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
|
|
11874
|
+
return candidate && import_node_fs14.default.existsSync(import_node_path15.default.join(candidate, "Package.swift")) ? [candidate] : [];
|
|
11725
11875
|
})
|
|
11726
11876
|
)
|
|
11727
11877
|
];
|
|
@@ -11751,7 +11901,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11751
11901
|
if ((flag === "-framework" || flag === "-weak_framework") && name2)
|
|
11752
11902
|
sdkFrameworks.add(name2);
|
|
11753
11903
|
});
|
|
11754
|
-
const absolute = (raw) =>
|
|
11904
|
+
const absolute = (raw) => import_node_path15.default.resolve(ref.project.projectDir, expand(raw, settings2));
|
|
11755
11905
|
const requested = options.nativeModules;
|
|
11756
11906
|
const includeBinary = (name2, dir) => {
|
|
11757
11907
|
if (!requested || nativeTargets.has(ref) || requested.includes(name2) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module3) => requested.includes(module3)))
|
|
@@ -11763,14 +11913,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11763
11913
|
for (const directory of expandSearchPath(absolute(raw), searchRules)) {
|
|
11764
11914
|
if (frameworkSearchDirectories.has(directory)) continue;
|
|
11765
11915
|
frameworkSearchDirectories.add(directory);
|
|
11766
|
-
if (!
|
|
11916
|
+
if (!import_node_fs14.default.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
|
|
11767
11917
|
continue;
|
|
11768
|
-
for (const entry of
|
|
11918
|
+
for (const entry of import_node_fs14.default.readdirSync(directory, { withFileTypes: true })) {
|
|
11769
11919
|
const name2 = /^(.+)\.framework$/.exec(entry.name)?.[1];
|
|
11770
11920
|
if (!name2 || byProduct.has(entry.name) || searchedFrameworks.has(name2))
|
|
11771
11921
|
continue;
|
|
11772
|
-
const file =
|
|
11773
|
-
if (
|
|
11922
|
+
const file = import_node_path15.default.join(directory, entry.name);
|
|
11923
|
+
if (import_node_fs14.default.statSync(file, { throwIfNoEntry: false })?.isDirectory())
|
|
11774
11924
|
searchedFrameworks.set(name2, file);
|
|
11775
11925
|
}
|
|
11776
11926
|
}
|
|
@@ -11778,9 +11928,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11778
11928
|
}
|
|
11779
11929
|
for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
|
|
11780
11930
|
const dir = absolute(raw);
|
|
11781
|
-
const modulemap =
|
|
11782
|
-
if (!
|
|
11783
|
-
const name2 = moduleMapName(
|
|
11931
|
+
const modulemap = import_node_path15.default.join(dir, "module.modulemap");
|
|
11932
|
+
if (!import_node_fs14.default.existsSync(modulemap)) continue;
|
|
11933
|
+
const name2 = moduleMapName(import_node_fs14.default.readFileSync(modulemap, "utf8"));
|
|
11784
11934
|
if (name2 && !binaryFrameworks.has(name2)) includeBinary(name2, dir);
|
|
11785
11935
|
}
|
|
11786
11936
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -11789,7 +11939,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11789
11939
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
11790
11940
|
for (const raw of list(phase.inputFileListPaths)) {
|
|
11791
11941
|
const file = absolute(raw);
|
|
11792
|
-
if (!
|
|
11942
|
+
if (!import_node_fs14.default.existsSync(file)) continue;
|
|
11793
11943
|
xcconfigs.add(file);
|
|
11794
11944
|
inputs.push(...fileListEntries(file, absolute));
|
|
11795
11945
|
}
|
|
@@ -11854,7 +12004,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11854
12004
|
...productAttributes.get(dependencyId)?.length ? { attributes: productAttributes.get(dependencyId) } : {},
|
|
11855
12005
|
source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
|
|
11856
12006
|
kind: "local",
|
|
11857
|
-
dir:
|
|
12007
|
+
dir: import_node_path15.default.resolve(
|
|
11858
12008
|
project.projectDir,
|
|
11859
12009
|
str(reference.relativePath) ?? ""
|
|
11860
12010
|
)
|
|
@@ -11888,10 +12038,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11888
12038
|
continue;
|
|
11889
12039
|
}
|
|
11890
12040
|
if (tree2 === "BUILT_PRODUCTS_DIR" || tree2 === "DEVELOPER_DIR" || // a target in the workspace builds it, so it exists only after that build
|
|
11891
|
-
byProduct.has(
|
|
12041
|
+
byProduct.has(import_node_path15.default.basename(rawPath)))
|
|
11892
12042
|
continue;
|
|
11893
12043
|
const resolved = fileId ? project.resolvePath(fileId) : null;
|
|
11894
|
-
if (fileId && resolved !== null && !
|
|
12044
|
+
if (fileId && resolved !== null && !import_node_fs14.default.existsSync(resolved))
|
|
11895
12045
|
throw new Error(
|
|
11896
12046
|
`${str(target.name) ?? "target"}: linked framework ${name2} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
|
|
11897
12047
|
);
|
|
@@ -11914,7 +12064,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11914
12064
|
({ product }) => !options.nativeModules || nativeTargets.has(built.ref) || options.nativeModules.includes(product)
|
|
11915
12065
|
);
|
|
11916
12066
|
const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
|
|
11917
|
-
let packageResolved =
|
|
12067
|
+
let packageResolved = import_node_fs14.default.existsSync(resolvedFile) ? [import_node_fs14.default.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path15.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs14.default.existsSync(file)).map((file) => import_node_fs14.default.realpathSync.native(file)).sort();
|
|
11918
12068
|
if (packageResolved.length === 0) {
|
|
11919
12069
|
const requirements = remotePackageRequirements(projects);
|
|
11920
12070
|
if (requirements.length > 0) {
|
|
@@ -11965,14 +12115,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11965
12115
|
} : {},
|
|
11966
12116
|
rootDir: commonAncestor(
|
|
11967
12117
|
[
|
|
11968
|
-
workspace ?
|
|
12118
|
+
workspace ? import_node_path15.default.dirname(workspace) : app.project.projectDir,
|
|
11969
12119
|
...used.map((project) => project.projectDir),
|
|
11970
12120
|
...localPackageDirs,
|
|
11971
12121
|
...linkedProducts.flatMap(
|
|
11972
|
-
({ source }) => source.kind === "local" &&
|
|
12122
|
+
({ source }) => source.kind === "local" && import_node_fs14.default.existsSync(source.dir) ? [source.dir] : []
|
|
11973
12123
|
),
|
|
11974
12124
|
...new Set(podSourceDirs)
|
|
11975
|
-
].map((dir) =>
|
|
12125
|
+
].map((dir) => import_node_fs14.default.realpathSync.native(dir))
|
|
11976
12126
|
),
|
|
11977
12127
|
projectFiles: [
|
|
11978
12128
|
.../* @__PURE__ */ new Set([
|
|
@@ -11993,7 +12143,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11993
12143
|
resourceProducts,
|
|
11994
12144
|
linkedProducts,
|
|
11995
12145
|
localPackageDirs: [
|
|
11996
|
-
...new Set(localPackageDirs.map((dir) =>
|
|
12146
|
+
...new Set(localPackageDirs.map((dir) => import_node_fs14.default.realpathSync.native(dir)))
|
|
11997
12147
|
].sort(),
|
|
11998
12148
|
binaryFrameworks: [...binaryFrameworks].map(([name2, file]) => ({ name: name2, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
|
|
11999
12149
|
sdkFrameworks: [...sdkFrameworks].filter(
|
|
@@ -12025,13 +12175,13 @@ const result = JSON.stringify(getConfig(root, { skipSDKVersionRequirement: true
|
|
|
12025
12175
|
if (Buffer.byteLength(result) > 1024 * 1024) throw new Error('Expo native configuration exceeds 1 MiB.');
|
|
12026
12176
|
writeFileSync(process.argv[2], result, { mode: 0o600 });`;
|
|
12027
12177
|
function hasExpoConfig(projectRoot) {
|
|
12028
|
-
const appJsonPath =
|
|
12029
|
-
const appJson =
|
|
12178
|
+
const appJsonPath = import_node_path16.default.join(projectRoot, "app.json");
|
|
12179
|
+
const appJson = import_node_fs15.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs15.default.readFileSync(appJsonPath, "utf8")) : null;
|
|
12030
12180
|
const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
|
|
12031
12181
|
(value) => isRecord(value) && typeof value.googleServicesFile === "string"
|
|
12032
12182
|
));
|
|
12033
12183
|
return staticExpo || ["app.config.js", "app.config.ts", "app.config.cjs", "app.config.mjs"].some(
|
|
12034
|
-
(name2) =>
|
|
12184
|
+
(name2) => import_node_fs15.default.existsSync(import_node_path16.default.join(projectRoot, name2))
|
|
12035
12185
|
);
|
|
12036
12186
|
}
|
|
12037
12187
|
function expoConfigArgs(projectRoot, resultPath) {
|
|
@@ -12039,7 +12189,7 @@ function expoConfigArgs(projectRoot, resultPath) {
|
|
|
12039
12189
|
"--input-type=commonjs",
|
|
12040
12190
|
"-e",
|
|
12041
12191
|
EXPO_CONFIG_SCRIPT,
|
|
12042
|
-
|
|
12192
|
+
import_node_path16.default.resolve(projectRoot),
|
|
12043
12193
|
resultPath
|
|
12044
12194
|
];
|
|
12045
12195
|
}
|
|
@@ -12053,17 +12203,17 @@ function readExpoConfigResult(resultPath, status, signal, stderr) {
|
|
|
12053
12203
|
throw new Error(
|
|
12054
12204
|
stderr || (signal ? `Expo native configuration evaluation was killed by ${signal}.` : "Expo native configuration evaluation failed.")
|
|
12055
12205
|
);
|
|
12056
|
-
const resolved = JSON.parse(
|
|
12206
|
+
const resolved = JSON.parse(import_node_fs15.default.readFileSync(resultPath, "utf8"));
|
|
12057
12207
|
if (!isRecord(resolved)) throw new Error("Expo native configuration is unavailable.");
|
|
12058
12208
|
return resolved;
|
|
12059
12209
|
}
|
|
12060
|
-
var resultDirectory = () =>
|
|
12210
|
+
var resultDirectory = () => import_node_fs15.default.mkdtempSync(import_node_path16.default.join(import_node_os2.default.tmpdir(), "peach-expo-config-"));
|
|
12061
12211
|
function readExpoConfig(projectRoot) {
|
|
12062
12212
|
if (!hasExpoConfig(projectRoot)) return {};
|
|
12063
12213
|
const directory = resultDirectory();
|
|
12064
|
-
const resultPath =
|
|
12214
|
+
const resultPath = import_node_path16.default.join(directory, "config.json");
|
|
12065
12215
|
try {
|
|
12066
|
-
const child = (0,
|
|
12216
|
+
const child = (0, import_node_child_process7.spawnSync)("node", expoConfigArgs(projectRoot, resultPath), {
|
|
12067
12217
|
cwd: projectRoot,
|
|
12068
12218
|
encoding: "utf8",
|
|
12069
12219
|
stdio: ["ignore", "ignore", "pipe"],
|
|
@@ -12073,7 +12223,7 @@ function readExpoConfig(projectRoot) {
|
|
|
12073
12223
|
if (child.error) throw child.error;
|
|
12074
12224
|
return readExpoConfigResult(resultPath, child.status, child.signal, child.stderr);
|
|
12075
12225
|
} finally {
|
|
12076
|
-
|
|
12226
|
+
import_node_fs15.default.rmSync(directory, { recursive: true, force: true });
|
|
12077
12227
|
}
|
|
12078
12228
|
}
|
|
12079
12229
|
var HELPER_DEPTH = 3;
|
|
@@ -12121,7 +12271,7 @@ function splitClauses(condition) {
|
|
|
12121
12271
|
function findHelper(type, name2, label, sources) {
|
|
12122
12272
|
const found = [];
|
|
12123
12273
|
for (const file of sources) {
|
|
12124
|
-
const raw =
|
|
12274
|
+
const raw = import_node_fs15.default.readFileSync(file, "utf8");
|
|
12125
12275
|
const blank = blankSwiftObjcLiterals(raw);
|
|
12126
12276
|
if (file.endsWith(".swift") && label === void 0) {
|
|
12127
12277
|
const owners = type ? [
|
|
@@ -12207,7 +12357,7 @@ function evaluateSwiftBody(body, scope, depth) {
|
|
|
12207
12357
|
}
|
|
12208
12358
|
function evaluateObjcBody(body, bundle, constants, scope) {
|
|
12209
12359
|
const plists = scope.resources.filter(
|
|
12210
|
-
(file) =>
|
|
12360
|
+
(file) => import_node_path16.default.basename(file) === "GoogleService-Info.plist"
|
|
12211
12361
|
);
|
|
12212
12362
|
const variables = /* @__PURE__ */ new Map();
|
|
12213
12363
|
const literal2 = (text2) => {
|
|
@@ -12250,7 +12400,7 @@ function evaluateObjcBody(body, bundle, constants, scope) {
|
|
|
12250
12400
|
variables.set(name2, plists.length === 1 ? plists[0] : void 0);
|
|
12251
12401
|
} else if (dictionary && variables.has(dictionary[1])) {
|
|
12252
12402
|
const file = variables.get(dictionary[1]);
|
|
12253
|
-
const parsed = typeof file === "string" ? parsePlistSource(
|
|
12403
|
+
const parsed = typeof file === "string" ? parsePlistSource(import_node_fs15.default.readFileSync(file, "utf8")) : void 0;
|
|
12254
12404
|
variables.set(name2, isRecord(parsed) ? parsed : void 0);
|
|
12255
12405
|
} else if (entry && variables.has(entry[1])) {
|
|
12256
12406
|
const key = literal2(entry[2]);
|
|
@@ -12263,7 +12413,7 @@ function evaluateObjcBody(body, bundle, constants, scope) {
|
|
|
12263
12413
|
}
|
|
12264
12414
|
function evaluateClauses(clauses, scope, bound, depth) {
|
|
12265
12415
|
const sources = scope.resources.filter(
|
|
12266
|
-
(file) =>
|
|
12416
|
+
(file) => import_node_path16.default.basename(file) === "GoogleService-Info.plist"
|
|
12267
12417
|
);
|
|
12268
12418
|
for (const clause of clauses) {
|
|
12269
12419
|
if (clause === "true") continue;
|
|
@@ -12280,7 +12430,7 @@ function evaluateClauses(clauses, scope, bound, depth) {
|
|
|
12280
12430
|
const dictionary = /^let\s+(\w+)\s*=\s*NSDictionary\s*\(\s*contentsOfFile:\s*(\w+)\s*\)$/.exec(clause);
|
|
12281
12431
|
if (dictionary && typeof bound.get(dictionary[2]) === "string") {
|
|
12282
12432
|
const parsed = parsePlistSource(
|
|
12283
|
-
|
|
12433
|
+
import_node_fs15.default.readFileSync(String(bound.get(dictionary[2])), "utf8")
|
|
12284
12434
|
);
|
|
12285
12435
|
if (!isRecord(parsed)) return false;
|
|
12286
12436
|
bound.set(dictionary[1], parsed);
|
|
@@ -12369,7 +12519,7 @@ function findDefaultConfigureCall(body, sources) {
|
|
|
12369
12519
|
const [, type, name2] = call;
|
|
12370
12520
|
for (const file of sources) {
|
|
12371
12521
|
if (!file.endsWith(".swift")) continue;
|
|
12372
|
-
const source = blankSwiftObjcLiterals(
|
|
12522
|
+
const source = blankSwiftObjcLiterals(import_node_fs15.default.readFileSync(file, "utf8"));
|
|
12373
12523
|
const declaration = new RegExp(
|
|
12374
12524
|
`\\b(?:enum|struct|class)\\s+${type}\\b[^{]*\\{`
|
|
12375
12525
|
).exec(source);
|
|
@@ -12391,10 +12541,10 @@ function readTargetGoogleServicesFile(projectRoot, container, target, prepareGen
|
|
|
12391
12541
|
prepareGeneratedSources
|
|
12392
12542
|
});
|
|
12393
12543
|
const delegates = app.allSources.filter(
|
|
12394
|
-
(file) => /^AppDelegate\.(swift|mm|m)$/.test(
|
|
12544
|
+
(file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path16.default.basename(file))
|
|
12395
12545
|
);
|
|
12396
12546
|
const defaultConfigured = delegates.some((file) => {
|
|
12397
|
-
const raw =
|
|
12547
|
+
const raw = import_node_fs15.default.readFileSync(file, "utf8");
|
|
12398
12548
|
const source = blankSwiftObjcLiterals(raw);
|
|
12399
12549
|
const launch = /(?:\bfunc\s+application\s*\([\s\S]*?didFinishLaunchingWithOptions[\s\S]*?\)\s*->\s*Bool|^-\s*\(BOOL\)\s*application\s*:[\s\S]*?didFinishLaunchingWithOptions[^{]*)\s*\{/m.exec(
|
|
12400
12550
|
source
|
|
@@ -12465,17 +12615,17 @@ function readTargetGoogleServicesFile(projectRoot, container, target, prepareGen
|
|
|
12465
12615
|
return guarded;
|
|
12466
12616
|
});
|
|
12467
12617
|
if (!defaultConfigured) return null;
|
|
12468
|
-
const bundle =
|
|
12618
|
+
const bundle = import_node_path16.default.join(
|
|
12469
12619
|
app.settings("BUILT_PRODUCTS_DIR"),
|
|
12470
12620
|
app.settings("WRAPPER_NAME") || `${app.settings("PRODUCT_NAME")}.app`
|
|
12471
12621
|
);
|
|
12472
12622
|
const staged = app.copiedFiles.filter(
|
|
12473
|
-
({ from, to }) => to ===
|
|
12474
|
-
).map(({ from }) =>
|
|
12623
|
+
({ from, to }) => to === import_node_path16.default.join(bundle, "GoogleService-Info.plist") && import_node_fs15.default.existsSync(from)
|
|
12624
|
+
).map(({ from }) => import_node_fs15.default.realpathSync(from));
|
|
12475
12625
|
const resources = [
|
|
12476
12626
|
.../* @__PURE__ */ new Set([
|
|
12477
12627
|
...app.resources.filter(
|
|
12478
|
-
(file) => /^GoogleService-Info\.plist$/.test(
|
|
12628
|
+
(file) => /^GoogleService-Info\.plist$/.test(import_node_path16.default.basename(file))
|
|
12479
12629
|
),
|
|
12480
12630
|
...staged
|
|
12481
12631
|
])
|
|
@@ -12484,7 +12634,7 @@ function readTargetGoogleServicesFile(projectRoot, container, target, prepareGen
|
|
|
12484
12634
|
throw new Error(
|
|
12485
12635
|
"native Firebase default initialization requires one GoogleService-Info.plist build resource"
|
|
12486
12636
|
);
|
|
12487
|
-
return
|
|
12637
|
+
return import_node_path16.default.relative(import_node_fs15.default.realpathSync(projectRoot), resources[0]);
|
|
12488
12638
|
}
|
|
12489
12639
|
function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], iosTarget, config = readExpoConfig(projectRoot), prepareGeneratedSources = false) {
|
|
12490
12640
|
const result = {};
|
|
@@ -12505,8 +12655,8 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], i
|
|
|
12505
12655
|
const native = config[platform];
|
|
12506
12656
|
if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
|
|
12507
12657
|
try {
|
|
12508
|
-
const source =
|
|
12509
|
-
|
|
12658
|
+
const source = import_node_fs15.default.readFileSync(
|
|
12659
|
+
import_node_path16.default.resolve(projectRoot, native.googleServicesFile),
|
|
12510
12660
|
"utf8"
|
|
12511
12661
|
);
|
|
12512
12662
|
const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
|
|
@@ -12586,9 +12736,9 @@ init_is_record();
|
|
|
12586
12736
|
|
|
12587
12737
|
// src/native-app-identity-project.ts
|
|
12588
12738
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
12589
|
-
var
|
|
12590
|
-
var
|
|
12591
|
-
var
|
|
12739
|
+
var import_node_fs18 = __toESM(require("node:fs"), 1);
|
|
12740
|
+
var import_node_module3 = require("node:module");
|
|
12741
|
+
var import_node_path19 = __toESM(require("node:path"), 1);
|
|
12592
12742
|
init_is_record();
|
|
12593
12743
|
function nonEmptyString2(value) {
|
|
12594
12744
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
@@ -12676,7 +12826,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
12676
12826
|
const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
|
|
12677
12827
|
const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
|
|
12678
12828
|
const rootModuleName = readRootModuleName(
|
|
12679
|
-
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) &&
|
|
12829
|
+
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && import_node_fs18.default.existsSync(file)).map((file) => import_node_fs18.default.readFileSync(file, "utf8"))
|
|
12680
12830
|
);
|
|
12681
12831
|
return stampNativeBuildSdk({
|
|
12682
12832
|
...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
|
|
@@ -12698,7 +12848,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
12698
12848
|
googleSignIn: readGoogleSignInConfiguration(
|
|
12699
12849
|
dictionary,
|
|
12700
12850
|
Object.fromEntries(
|
|
12701
|
-
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(
|
|
12851
|
+
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs18.default.readFileSync(file, "utf8"))])
|
|
12702
12852
|
)
|
|
12703
12853
|
),
|
|
12704
12854
|
supportedInterfaceOrientations,
|
|
@@ -12708,11 +12858,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
12708
12858
|
bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => value),
|
|
12709
12859
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
12710
12860
|
app.resources,
|
|
12711
|
-
(file) =>
|
|
12861
|
+
(file) => import_node_fs18.default.readFileSync(file, "utf8"),
|
|
12712
12862
|
(file) => {
|
|
12713
|
-
const extension =
|
|
12863
|
+
const extension = import_node_path19.default.extname(file).toLowerCase();
|
|
12714
12864
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
12715
|
-
return `data:${contentType};base64,${
|
|
12865
|
+
return `data:${contentType};base64,${import_node_fs18.default.readFileSync(file).toString("base64")}`;
|
|
12716
12866
|
},
|
|
12717
12867
|
icons,
|
|
12718
12868
|
app.appIconName,
|
|
@@ -12742,11 +12892,11 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
12742
12892
|
const read = selectNativeAppIdentityReader(platform, {
|
|
12743
12893
|
android: () => null,
|
|
12744
12894
|
ios: () => {
|
|
12745
|
-
const nested =
|
|
12746
|
-
const iosRoot =
|
|
12895
|
+
const nested = import_node_path19.default.join(projectRoot, "ios");
|
|
12896
|
+
const iosRoot = import_node_fs18.default.existsSync(nested) ? nested : projectRoot;
|
|
12747
12897
|
const prefix2 = iosRoot === nested ? "ios/" : "";
|
|
12748
12898
|
const files = {};
|
|
12749
|
-
for (const entry of
|
|
12899
|
+
for (const entry of import_node_fs18.default.readdirSync(iosRoot, { withFileTypes: true })) {
|
|
12750
12900
|
if (entry.name === "Pods") continue;
|
|
12751
12901
|
if (entry.isDirectory()) {
|
|
12752
12902
|
const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : [
|
|
@@ -12754,17 +12904,17 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
12754
12904
|
"AppDelegate.swift",
|
|
12755
12905
|
"AppDelegate.mm",
|
|
12756
12906
|
"AppDelegate.m",
|
|
12757
|
-
...
|
|
12907
|
+
...import_node_fs18.default.readdirSync(import_node_path19.default.join(iosRoot, entry.name)).filter((name2) => name2.endsWith(".entitlements"))
|
|
12758
12908
|
];
|
|
12759
12909
|
for (const name2 of names) {
|
|
12760
12910
|
const relative3 = `${prefix2}${entry.name}/${name2}`;
|
|
12761
|
-
const file =
|
|
12762
|
-
if (
|
|
12911
|
+
const file = import_node_path19.default.join(projectRoot, relative3);
|
|
12912
|
+
if (import_node_fs18.default.existsSync(file)) files[relative3] = import_node_fs18.default.readFileSync(file, "utf8");
|
|
12763
12913
|
}
|
|
12764
12914
|
} else if (/AppDelegate\.(?:swift|mm|m)$|\.entitlements$/.test(entry.name)) {
|
|
12765
12915
|
const relative3 = `${prefix2}${entry.name}`;
|
|
12766
|
-
const file =
|
|
12767
|
-
if (
|
|
12916
|
+
const file = import_node_path19.default.join(projectRoot, relative3);
|
|
12917
|
+
if (import_node_fs18.default.existsSync(file)) files[relative3] = import_node_fs18.default.readFileSync(file, "utf8");
|
|
12768
12918
|
}
|
|
12769
12919
|
}
|
|
12770
12920
|
const identity = extractNativeAppIdentityFromFiles(
|
|
@@ -12781,41 +12931,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
12781
12931
|
function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
12782
12932
|
const files = {};
|
|
12783
12933
|
if (androidMergedManifest) {
|
|
12784
|
-
const file =
|
|
12785
|
-
if (!
|
|
12786
|
-
files[androidMergedManifest] =
|
|
12934
|
+
const file = import_node_path19.default.resolve(projectRoot, androidMergedManifest);
|
|
12935
|
+
if (!import_node_fs18.default.existsSync(file)) return null;
|
|
12936
|
+
files[androidMergedManifest] = import_node_fs18.default.readFileSync(file, "utf8");
|
|
12787
12937
|
} else {
|
|
12788
|
-
const androidRoot =
|
|
12789
|
-
if (!
|
|
12938
|
+
const androidRoot = import_node_path19.default.join(projectRoot, "android");
|
|
12939
|
+
if (!import_node_fs18.default.existsSync(androidRoot)) return null;
|
|
12790
12940
|
const collect = (directory) => {
|
|
12791
|
-
for (const entry of
|
|
12792
|
-
const file =
|
|
12941
|
+
for (const entry of import_node_fs18.default.readdirSync(directory, { withFileTypes: true })) {
|
|
12942
|
+
const file = import_node_path19.default.join(directory, entry.name);
|
|
12793
12943
|
if (entry.isDirectory()) collect(file);
|
|
12794
12944
|
else if (entry.isFile() && entry.name === "AndroidManifest.xml")
|
|
12795
|
-
files[
|
|
12945
|
+
files[import_node_path19.default.relative(projectRoot, file).split(import_node_path19.default.sep).join("/")] = import_node_fs18.default.readFileSync(file, "utf8");
|
|
12796
12946
|
}
|
|
12797
12947
|
};
|
|
12798
|
-
for (const module2 of
|
|
12948
|
+
for (const module2 of import_node_fs18.default.readdirSync(androidRoot, { withFileTypes: true })) {
|
|
12799
12949
|
if (!module2.isDirectory()) continue;
|
|
12800
|
-
const outputs =
|
|
12950
|
+
const outputs = import_node_path19.default.join(
|
|
12801
12951
|
androidRoot,
|
|
12802
12952
|
module2.name,
|
|
12803
12953
|
"build/intermediates/merged_manifests"
|
|
12804
12954
|
);
|
|
12805
|
-
if (
|
|
12955
|
+
if (import_node_fs18.default.existsSync(outputs)) collect(outputs);
|
|
12806
12956
|
}
|
|
12807
12957
|
}
|
|
12808
12958
|
for (const manifest of Object.keys(files)) {
|
|
12809
12959
|
const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
|
|
12810
12960
|
if (!resourceDirectory) continue;
|
|
12811
|
-
const absolute =
|
|
12812
|
-
if (!
|
|
12813
|
-
for (const entry of
|
|
12961
|
+
const absolute = import_node_path19.default.resolve(projectRoot, resourceDirectory);
|
|
12962
|
+
if (!import_node_fs18.default.existsSync(absolute)) continue;
|
|
12963
|
+
for (const entry of import_node_fs18.default.readdirSync(absolute, { withFileTypes: true })) {
|
|
12814
12964
|
if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
|
|
12815
|
-
for (const resource of
|
|
12965
|
+
for (const resource of import_node_fs18.default.readdirSync(import_node_path19.default.join(absolute, entry.name))) {
|
|
12816
12966
|
if (!resource.endsWith(".xml")) continue;
|
|
12817
12967
|
const file = `${resourceDirectory}/${entry.name}/${resource}`;
|
|
12818
|
-
files[file] =
|
|
12968
|
+
files[file] = import_node_fs18.default.readFileSync(import_node_path19.default.resolve(projectRoot, file), "utf8");
|
|
12819
12969
|
}
|
|
12820
12970
|
}
|
|
12821
12971
|
}
|
|
@@ -12832,8 +12982,8 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
12832
12982
|
const app = readIosAppTarget(projectRoot, iosTarget, environment);
|
|
12833
12983
|
if (!app) return null;
|
|
12834
12984
|
const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
|
|
12835
|
-
const projectManifestPath =
|
|
12836
|
-
const projectRequire = (0,
|
|
12985
|
+
const projectManifestPath = import_node_path19.default.join(projectRoot, "package.json");
|
|
12986
|
+
const projectRequire = (0, import_node_module3.createRequire)(projectManifestPath);
|
|
12837
12987
|
let reanimatedManifestPath;
|
|
12838
12988
|
try {
|
|
12839
12989
|
reanimatedManifestPath = projectRequire.resolve(
|
|
@@ -12846,22 +12996,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
12846
12996
|
throw error;
|
|
12847
12997
|
}
|
|
12848
12998
|
const installedManifest = JSON.parse(
|
|
12849
|
-
|
|
12999
|
+
import_node_fs18.default.readFileSync(reanimatedManifestPath, "utf8")
|
|
12850
13000
|
);
|
|
12851
13001
|
const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
|
|
12852
13002
|
if (!installedVersion) throw new Error("Reanimated package version is malformed");
|
|
12853
13003
|
if (Number.parseInt(installedVersion, 10) < 4) return identity;
|
|
12854
13004
|
const defaults = JSON.parse(
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
13005
|
+
import_node_fs18.default.readFileSync(
|
|
13006
|
+
import_node_path19.default.join(
|
|
13007
|
+
import_node_path19.default.dirname(reanimatedManifestPath),
|
|
12858
13008
|
"src/featureFlags/staticFlags.json"
|
|
12859
13009
|
),
|
|
12860
13010
|
"utf8"
|
|
12861
13011
|
)
|
|
12862
13012
|
);
|
|
12863
13013
|
if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
|
|
12864
|
-
const manifest = JSON.parse(
|
|
13014
|
+
const manifest = JSON.parse(import_node_fs18.default.readFileSync(projectManifestPath, "utf8"));
|
|
12865
13015
|
const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
|
|
12866
13016
|
const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
|
|
12867
13017
|
if (overrides !== void 0 && !isRecord(overrides)) {
|
|
@@ -15743,8 +15893,8 @@ var COMPAT_STUBS = {
|
|
|
15743
15893
|
|
|
15744
15894
|
// src/installed-native-build-options.ts
|
|
15745
15895
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
15746
|
-
var
|
|
15747
|
-
var
|
|
15896
|
+
var import_node_fs19 = __toESM(require("node:fs"), 1);
|
|
15897
|
+
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
15748
15898
|
init_version_range();
|
|
15749
15899
|
var RIVE_PACKAGE = "@rive-app/react-native";
|
|
15750
15900
|
var RIVE_05 = [">=0.5.0 <0.6.0"];
|
|
@@ -15753,10 +15903,10 @@ function missing(error) {
|
|
|
15753
15903
|
}
|
|
15754
15904
|
function answerSync(step) {
|
|
15755
15905
|
try {
|
|
15756
|
-
if (step.type === "realpath") return
|
|
15757
|
-
if (step.type === "read") return
|
|
15758
|
-
if (step.type === "isDirectory") return
|
|
15759
|
-
return
|
|
15906
|
+
if (step.type === "realpath") return import_node_fs19.default.realpathSync(step.path);
|
|
15907
|
+
if (step.type === "read") return import_node_fs19.default.readFileSync(step.path, "utf8");
|
|
15908
|
+
if (step.type === "isDirectory") return import_node_fs19.default.statSync(step.path).isDirectory();
|
|
15909
|
+
return import_node_fs19.default.readdirSync(step.path, { withFileTypes: true }).map((entry) => ({
|
|
15760
15910
|
name: entry.name,
|
|
15761
15911
|
directory: entry.isDirectory(),
|
|
15762
15912
|
symbolicLink: entry.isSymbolicLink()
|
|
@@ -15768,11 +15918,11 @@ function answerSync(step) {
|
|
|
15768
15918
|
}
|
|
15769
15919
|
async function answerAsync(step) {
|
|
15770
15920
|
try {
|
|
15771
|
-
if (step.type === "realpath") return await
|
|
15772
|
-
if (step.type === "read") return await
|
|
15921
|
+
if (step.type === "realpath") return await import_node_fs19.default.promises.realpath(step.path);
|
|
15922
|
+
if (step.type === "read") return await import_node_fs19.default.promises.readFile(step.path, "utf8");
|
|
15773
15923
|
if (step.type === "isDirectory")
|
|
15774
|
-
return (await
|
|
15775
|
-
return (await
|
|
15924
|
+
return (await import_node_fs19.default.promises.stat(step.path)).isDirectory();
|
|
15925
|
+
return (await import_node_fs19.default.promises.readdir(step.path, { withFileTypes: true })).map(
|
|
15776
15926
|
(entry) => ({
|
|
15777
15927
|
name: entry.name,
|
|
15778
15928
|
directory: entry.isDirectory(),
|
|
@@ -15805,7 +15955,7 @@ function* rubyFiles(directory, seen, iosRoot = false) {
|
|
|
15805
15955
|
const files = [];
|
|
15806
15956
|
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
15807
15957
|
if (iosRoot && (entry.name === "Pods" || entry.name === "build")) continue;
|
|
15808
|
-
const target =
|
|
15958
|
+
const target = import_node_path20.default.join(directory, entry.name);
|
|
15809
15959
|
let isDirectory2 = entry.directory;
|
|
15810
15960
|
if (entry.symbolicLink)
|
|
15811
15961
|
isDirectory2 = (yield { type: "isDirectory", path: target }) === true;
|
|
@@ -15818,7 +15968,7 @@ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
|
|
|
15818
15968
|
let sensorOptions = {};
|
|
15819
15969
|
const sensors = versions["expo-sensors"];
|
|
15820
15970
|
if (sensors && resolveCompatVersionRange([">=58.0.4 <59.0.0"], sensors).status === "matched") {
|
|
15821
|
-
const file =
|
|
15971
|
+
const file = import_node_path20.default.join(projectRoot, "ios", "Podfile.properties.json");
|
|
15822
15972
|
const source = yield { type: "read", path: file };
|
|
15823
15973
|
if (source !== null && typeof source !== "string")
|
|
15824
15974
|
throw new Error(`cannot inspect ${file}`);
|
|
@@ -15834,8 +15984,8 @@ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
|
|
|
15834
15984
|
if (!needsRiveOptions(versions)) return sensorOptions;
|
|
15835
15985
|
if (environment.USE_RIVE_LEGACY === "1" || environment.USE_RIVE_LEGACY === "true")
|
|
15836
15986
|
return { ...sensorOptions, [RIVE_PACKAGE]: { USE_RIVE_LEGACY: true } };
|
|
15837
|
-
const ios =
|
|
15838
|
-
const podfile =
|
|
15987
|
+
const ios = import_node_path20.default.join(projectRoot, "ios");
|
|
15988
|
+
const podfile = import_node_path20.default.join(ios, "Podfile");
|
|
15839
15989
|
const files = [podfile, ...yield* rubyFiles(ios, /* @__PURE__ */ new Set(), true)];
|
|
15840
15990
|
let value = false;
|
|
15841
15991
|
let assigned = false;
|
|
@@ -16101,9 +16251,9 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
16101
16251
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
16102
16252
|
var import_child_process = require("child_process");
|
|
16103
16253
|
var import_promises = require("fs/promises");
|
|
16104
|
-
var
|
|
16254
|
+
var import_node_fs20 = require("node:fs");
|
|
16105
16255
|
var import_node_os3 = require("node:os");
|
|
16106
|
-
var
|
|
16256
|
+
var import_node_path21 = require("node:path");
|
|
16107
16257
|
init_backend_origin();
|
|
16108
16258
|
init_config();
|
|
16109
16259
|
|
|
@@ -16243,8 +16393,8 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
16243
16393
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
16244
16394
|
|
|
16245
16395
|
// scripts/dev-server-scanner.ts
|
|
16246
|
-
var LISTENER_LOCK_PATH = (0,
|
|
16247
|
-
var LISTENER_RESULT_PATH = (0,
|
|
16396
|
+
var LISTENER_LOCK_PATH = (0, import_node_path21.join)((0, import_node_os3.tmpdir)(), "peach-listener-scan.lock");
|
|
16397
|
+
var LISTENER_RESULT_PATH = (0, import_node_path21.join)((0, import_node_os3.tmpdir)(), "peach-listener-scan.result");
|
|
16248
16398
|
var LISTENER_LOCK_STALE_MS = 25e3;
|
|
16249
16399
|
var LISTENER_LOCK_WAIT_MS = 8e3;
|
|
16250
16400
|
function sleep(ms) {
|
|
@@ -16262,8 +16412,8 @@ function pidIsAlive(pid) {
|
|
|
16262
16412
|
}
|
|
16263
16413
|
function readLockOwner() {
|
|
16264
16414
|
try {
|
|
16265
|
-
const raw = (0,
|
|
16266
|
-
const mtimeMs = (0,
|
|
16415
|
+
const raw = (0, import_node_fs20.readFileSync)(LISTENER_LOCK_PATH, "utf8");
|
|
16416
|
+
const mtimeMs = (0, import_node_fs20.statSync)(LISTENER_LOCK_PATH).mtimeMs;
|
|
16267
16417
|
const pid = Number(raw.split("-")[0]);
|
|
16268
16418
|
return { raw, pid: Number.isInteger(pid) ? pid : -1, mtimeMs };
|
|
16269
16419
|
} catch {
|
|
@@ -16276,15 +16426,15 @@ function lockIsAbandoned(owner) {
|
|
|
16276
16426
|
}
|
|
16277
16427
|
function clearLock(raw) {
|
|
16278
16428
|
try {
|
|
16279
|
-
if ((0,
|
|
16280
|
-
(0,
|
|
16429
|
+
if ((0, import_node_fs20.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
|
|
16430
|
+
(0, import_node_fs20.unlinkSync)(LISTENER_LOCK_PATH);
|
|
16281
16431
|
} catch {
|
|
16282
16432
|
}
|
|
16283
16433
|
}
|
|
16284
16434
|
function readResult() {
|
|
16285
16435
|
try {
|
|
16286
16436
|
const parsed = JSON.parse(
|
|
16287
|
-
(0,
|
|
16437
|
+
(0, import_node_fs20.readFileSync)(LISTENER_RESULT_PATH, "utf8")
|
|
16288
16438
|
);
|
|
16289
16439
|
if (!parsed || typeof parsed.token !== "string" || typeof parsed.key !== "string")
|
|
16290
16440
|
return null;
|
|
@@ -16295,8 +16445,8 @@ function readResult() {
|
|
|
16295
16445
|
}
|
|
16296
16446
|
function publishResult(payload) {
|
|
16297
16447
|
const tmp = `${LISTENER_RESULT_PATH}.${process.pid}.tmp`;
|
|
16298
|
-
(0,
|
|
16299
|
-
(0,
|
|
16448
|
+
(0, import_node_fs20.writeFileSync)(tmp, JSON.stringify(payload));
|
|
16449
|
+
(0, import_node_fs20.renameSync)(tmp, LISTENER_RESULT_PATH);
|
|
16300
16450
|
}
|
|
16301
16451
|
function throwPublished(payload) {
|
|
16302
16452
|
throw Object.assign(new Error(payload.message || "listener scan failed"), {
|
|
@@ -16339,7 +16489,7 @@ async function withListenerLock(key, body) {
|
|
|
16339
16489
|
for (; ; ) {
|
|
16340
16490
|
let fd = null;
|
|
16341
16491
|
try {
|
|
16342
|
-
fd = (0,
|
|
16492
|
+
fd = (0, import_node_fs20.openSync)(LISTENER_LOCK_PATH, "wx");
|
|
16343
16493
|
} catch (error) {
|
|
16344
16494
|
const code = error instanceof Error && "code" in error ? error.code : "";
|
|
16345
16495
|
if (code !== "EEXIST") throw error;
|
|
@@ -16348,7 +16498,7 @@ async function withListenerLock(key, body) {
|
|
|
16348
16498
|
if (owner) clearLock(owner.raw);
|
|
16349
16499
|
else {
|
|
16350
16500
|
try {
|
|
16351
|
-
(0,
|
|
16501
|
+
(0, import_node_fs20.unlinkSync)(LISTENER_LOCK_PATH);
|
|
16352
16502
|
} catch {
|
|
16353
16503
|
}
|
|
16354
16504
|
}
|
|
@@ -16364,7 +16514,7 @@ async function withListenerLock(key, body) {
|
|
|
16364
16514
|
}
|
|
16365
16515
|
if (fd === null) continue;
|
|
16366
16516
|
try {
|
|
16367
|
-
(0,
|
|
16517
|
+
(0, import_node_fs20.writeSync)(fd, token);
|
|
16368
16518
|
try {
|
|
16369
16519
|
const value = await body();
|
|
16370
16520
|
publishResult({ token, key, ok: true, value });
|
|
@@ -16381,7 +16531,7 @@ async function withListenerLock(key, body) {
|
|
|
16381
16531
|
}
|
|
16382
16532
|
} finally {
|
|
16383
16533
|
try {
|
|
16384
|
-
(0,
|
|
16534
|
+
(0, import_node_fs20.closeSync)(fd);
|
|
16385
16535
|
} catch {
|
|
16386
16536
|
}
|
|
16387
16537
|
clearLock(token);
|
|
@@ -16908,7 +17058,7 @@ function parseIpv6(text2) {
|
|
|
16908
17058
|
|
|
16909
17059
|
// src/host/network-policy.ts
|
|
16910
17060
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
16911
|
-
var
|
|
17061
|
+
var import_node_path22 = require("node:path");
|
|
16912
17062
|
var import_node_url = require("node:url");
|
|
16913
17063
|
var NETWORK_POLICY_TIMEOUT_MS = 1e4;
|
|
16914
17064
|
var NetworkPolicyDeniedError = class extends Error {
|
|
@@ -16961,7 +17111,7 @@ function createNetworkAuthorizer(policy) {
|
|
|
16961
17111
|
};
|
|
16962
17112
|
}
|
|
16963
17113
|
async function loadNetworkPolicy(file) {
|
|
16964
|
-
if (!(0,
|
|
17114
|
+
if (!(0, import_node_path22.isAbsolute)(file)) {
|
|
16965
17115
|
throw new Error(`PEACH_NETWORK_POLICY must be an absolute path: ${file}`);
|
|
16966
17116
|
}
|
|
16967
17117
|
const loaded3 = await import(
|
|
@@ -17055,9 +17205,9 @@ var import_promises3 = require("stream/promises");
|
|
|
17055
17205
|
// src/cli-runtime.ts
|
|
17056
17206
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
17057
17207
|
var import_node_crypto6 = require("node:crypto");
|
|
17058
|
-
var
|
|
17059
|
-
var
|
|
17060
|
-
var
|
|
17208
|
+
var import_node_fs21 = require("node:fs");
|
|
17209
|
+
var import_node_module4 = require("node:module");
|
|
17210
|
+
var import_node_path23 = require("node:path");
|
|
17061
17211
|
|
|
17062
17212
|
// runtime-companion.json
|
|
17063
17213
|
var runtime_companion_default = { abi: 1, sha256: "c63f83dd24fd36986b72da8da6b6a51edce0a2d061e3bc05d3439d22b1a86c91", file: "node/cli-c63f83dd24fd36986b72da8da6b6a51edce0a2d061e3bc05d3439d22b1a86c91.cjs" };
|
|
@@ -17068,12 +17218,12 @@ function cliCompanionPath() {
|
|
|
17068
17218
|
return `node/cli-${runtime_companion_default.sha256}.cjs`;
|
|
17069
17219
|
}
|
|
17070
17220
|
function verifyCliCompanion(root) {
|
|
17071
|
-
verifyCompanionFile((0,
|
|
17221
|
+
verifyCompanionFile((0, import_node_path23.join)(root, cliCompanionPath()));
|
|
17072
17222
|
}
|
|
17073
17223
|
function verifyCompanionFile(file) {
|
|
17074
17224
|
let bytes;
|
|
17075
17225
|
try {
|
|
17076
|
-
bytes = (0,
|
|
17226
|
+
bytes = (0, import_node_fs21.readFileSync)(file);
|
|
17077
17227
|
} catch (error) {
|
|
17078
17228
|
if (error instanceof Error) {
|
|
17079
17229
|
const missing2 = "code" in error && error.code === "ENOENT" ? `; run \`peach runtime install\`, which fetches the companion this CLI published${process.platform === "win32" ? ", and check Windows Security protection history if it repeats" : ""}` : "";
|
|
@@ -17093,8 +17243,8 @@ function getCliRuntime() {
|
|
|
17093
17243
|
if (loaded2) return loaded2.runtime;
|
|
17094
17244
|
const root = peachRuntimeRoot();
|
|
17095
17245
|
verifyCliCompanion(root);
|
|
17096
|
-
const require2 = (0,
|
|
17097
|
-
const runtime = require2((0,
|
|
17246
|
+
const require2 = (0, import_node_module4.createRequire)(__sootsim_import_meta_url);
|
|
17247
|
+
const runtime = require2((0, import_node_path23.join)(root, cliCompanionPath()));
|
|
17098
17248
|
if (runtime.cliCompanionAbi !== CLI_COMPANION_ABI) {
|
|
17099
17249
|
throw new Error(
|
|
17100
17250
|
"Incompatible Peach runtime companion ABI; run `peach runtime install`"
|