peachsim 0.1.2185 → 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/cli/commands/cpu-profile.ts +6 -2
- package/cli/commands/shell-url.ts +3 -6
- 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 +2755 -2385
- 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 +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +3265 -3223
- package/dist-lib/expo-swift-metadata.cjs +2 -1
- package/dist-lib/expo-swift-metadata.mjs +2 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +4587 -4217
- package/dist-lib/host/fetch-proxy-handler.cjs +8 -7
- 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 +474 -283
- 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 +647 -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 +775 -584
- package/dist-lib/native-app-identity-project.cjs +45 -4
- package/dist-lib/native-app-identity-project.mjs +45 -4
- package/dist-lib/native-app-identity.cjs +40 -2
- package/dist-lib/native-app-identity.mjs +40 -2
- 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 +5257 -4878
- 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 +3 -3
- package/dist-lib/vite.cjs +8 -7
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/compositor-backend.d.ts +1 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +10 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIImageAsset.h +1 -1
- 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/expo-native-workspace.ts +7 -1
- package/src/java-module-abi.ts +145 -0
- package/src/javaAbiContract.ts +14 -0
- package/src/kotlin-host.ts +57 -3
- package/src/native-app-identity-project.ts +10 -2
- package/src/native-app-identity.ts +15 -1
- package/src/nativeAppIconContract.ts +37 -0
- package/src/nitro-source.ts +2 -167
- package/src/react-native-autolinking.ts +153 -0
- package/src/swift-installed-targets.ts +8 -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,21 +7491,21 @@ 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
|
}
|
|
7355
7505
|
|
|
7356
7506
|
// src/swift-standin-digest.ts
|
|
7357
7507
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
7358
|
-
var STANDIN_SOURCE_DIGEST = true ? "
|
|
7508
|
+
var STANDIN_SOURCE_DIGEST = true ? "62c7fc880aa6efc985c4786587cb8441b81094e44c28f8d65e1d6dffda9c24f4" : standinSourceDigest();
|
|
7359
7509
|
|
|
7360
7510
|
// src/expo-native-workspace.ts
|
|
7361
7511
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -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
|
|
|
@@ -7569,6 +7719,34 @@ init_is_record();
|
|
|
7569
7719
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
7570
7720
|
init_assetCatalogContract();
|
|
7571
7721
|
init_is_record();
|
|
7722
|
+
function resolveNativeBundleIcons(icons, catalogNames, resolveReference) {
|
|
7723
|
+
if (!isRecord(icons) && catalogNames.length === 0) return void 0;
|
|
7724
|
+
const resolve4 = (value) => {
|
|
7725
|
+
if (typeof value === "string") return resolveReference(value);
|
|
7726
|
+
if (Array.isArray(value)) return value.map(resolve4);
|
|
7727
|
+
if (isRecord(value))
|
|
7728
|
+
return Object.fromEntries(
|
|
7729
|
+
Object.entries(value).map(([key, entry]) => [
|
|
7730
|
+
resolveReference(key),
|
|
7731
|
+
resolve4(entry)
|
|
7732
|
+
])
|
|
7733
|
+
);
|
|
7734
|
+
return value;
|
|
7735
|
+
};
|
|
7736
|
+
const dictionary = isRecord(icons) ? Object.fromEntries(
|
|
7737
|
+
Object.entries(icons).map(([key, value]) => [key, resolve4(value)])
|
|
7738
|
+
) : {};
|
|
7739
|
+
if (catalogNames.length === 0) return dictionary;
|
|
7740
|
+
return {
|
|
7741
|
+
...dictionary,
|
|
7742
|
+
CFBundleAlternateIcons: {
|
|
7743
|
+
...Object.fromEntries(
|
|
7744
|
+
catalogNames.map((name2) => [name2, { CFBundleIconName: name2 }])
|
|
7745
|
+
),
|
|
7746
|
+
...isRecord(dictionary.CFBundleAlternateIcons) ? dictionary.CFBundleAlternateIcons : {}
|
|
7747
|
+
}
|
|
7748
|
+
};
|
|
7749
|
+
}
|
|
7572
7750
|
function resolveNativeAppIconArtwork(resources, readText, resourceUri, icons, primaryName, alternateNames, resolveReference) {
|
|
7573
7751
|
const members = new Set(resources);
|
|
7574
7752
|
const dictionary = isRecord(icons) ? icons : {};
|
|
@@ -7992,10 +8170,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
|
|
|
7992
8170
|
var APP_DELEGATE_PATH_RE = /(?:^|\/)(?:ios\/)?([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
|
|
7993
8171
|
function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
|
|
7994
8172
|
const pbxprojPath = Object.keys(files).find(
|
|
7995
|
-
(
|
|
8173
|
+
(path26) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path26)
|
|
7996
8174
|
) ?? Object.keys(files).find(
|
|
7997
|
-
(
|
|
7998
|
-
) ?? Object.keys(files).find((
|
|
8175
|
+
(path26) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path26)
|
|
8176
|
+
) ?? Object.keys(files).find((path26) => /(?:^|\/)project\.pbxproj$/.test(path26));
|
|
7999
8177
|
if (!pbxprojPath) return null;
|
|
8000
8178
|
const pbxproj = files[pbxprojPath];
|
|
8001
8179
|
let objects = {};
|
|
@@ -8037,7 +8215,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
8037
8215
|
} else if (applicationTargetNames.size === 1) {
|
|
8038
8216
|
targetName = [...applicationTargetNames][0];
|
|
8039
8217
|
} else if (applicationTargetNames.size > 1) {
|
|
8040
|
-
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(
|
|
8041
8219
|
(name2) => typeof name2 === "string" && applicationTargetNames.has(name2)
|
|
8042
8220
|
);
|
|
8043
8221
|
if (delegateTargets.length === 1) {
|
|
@@ -8166,8 +8344,11 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
8166
8344
|
);
|
|
8167
8345
|
if (alternateSetting === null)
|
|
8168
8346
|
throw new Error("native alternate icon setting is unresolved");
|
|
8347
|
+
const catalogAlternateNames = [];
|
|
8169
8348
|
for (const match of alternateSetting.replace(/\\"/g, '"').matchAll(/"([^"]*)"|([^\s(),]+)/g)) {
|
|
8170
|
-
|
|
8349
|
+
const name2 = match[1] ?? match[2];
|
|
8350
|
+
alternateIconNames.add(name2);
|
|
8351
|
+
catalogAlternateNames.push(name2);
|
|
8171
8352
|
}
|
|
8172
8353
|
const intentIds = dictionary.OneAppIntentIdentifiers;
|
|
8173
8354
|
const appIntentIdentifiers = Array.isArray(intentIds) && intentIds.every((value) => typeof value === "string") ? intentIds.map((value) => resolveBuildSetting(value, settings)) : [];
|
|
@@ -8275,7 +8456,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
8275
8456
|
if (Object.hasOwn(files, file)) return [file];
|
|
8276
8457
|
const prefix2 = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
|
|
8277
8458
|
return paths.filter(
|
|
8278
|
-
(
|
|
8459
|
+
(path26) => path26.startsWith(prefix2) && !/(?:^|\/)\./.test(path26.slice(prefix2.length))
|
|
8279
8460
|
);
|
|
8280
8461
|
},
|
|
8281
8462
|
join7,
|
|
@@ -8286,7 +8467,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
8286
8467
|
}
|
|
8287
8468
|
const rootModuleName = readRootModuleName(
|
|
8288
8469
|
Object.entries(files).filter(
|
|
8289
|
-
([
|
|
8470
|
+
([path26]) => !path26.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path26) || path26.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
|
|
8290
8471
|
).map(([, source]) => source)
|
|
8291
8472
|
);
|
|
8292
8473
|
return {
|
|
@@ -8315,6 +8496,11 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
8315
8496
|
ipadSupportedInterfaceOrientations,
|
|
8316
8497
|
...defaultScreenOrientationMask === void 0 ? {} : { defaultScreenOrientationMask },
|
|
8317
8498
|
alternateIconNames: [...alternateIconNames],
|
|
8499
|
+
bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => {
|
|
8500
|
+
const resolved = resolveBuildSetting(value, settings);
|
|
8501
|
+
if (resolved === null) throw new Error("native bundle icon reference is unresolved");
|
|
8502
|
+
return resolved;
|
|
8503
|
+
}),
|
|
8318
8504
|
...resourceUri ? {
|
|
8319
8505
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
8320
8506
|
[...resources],
|
|
@@ -8375,23 +8561,23 @@ function extractNativeAppIdentityFromFiles(files, platform, parseInfoPlist, iosT
|
|
|
8375
8561
|
// src/prepared-xcode-phases.ts
|
|
8376
8562
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8377
8563
|
var import_node_crypto2 = require("node:crypto");
|
|
8378
|
-
var
|
|
8379
|
-
var
|
|
8564
|
+
var import_node_fs10 = __toESM(require("node:fs"), 1);
|
|
8565
|
+
var import_node_path8 = __toESM(require("node:path"), 1);
|
|
8380
8566
|
var workspaces = /* @__PURE__ */ new Map();
|
|
8381
8567
|
var recording;
|
|
8382
8568
|
function relativeFile(root, file) {
|
|
8383
|
-
const relative3 =
|
|
8384
|
-
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))
|
|
8385
8571
|
throw new Error(`prepared Xcode output is outside its workspace: ${file}`);
|
|
8386
|
-
return relative3.split(
|
|
8572
|
+
return relative3.split(import_node_path8.default.sep).join("/");
|
|
8387
8573
|
}
|
|
8388
8574
|
function output(root, file) {
|
|
8389
8575
|
const relative3 = relativeFile(root, file);
|
|
8390
|
-
const stat =
|
|
8576
|
+
const stat = import_node_fs10.default.statSync(file, { throwIfNoEntry: false });
|
|
8391
8577
|
if (!stat) return { path: relative3, sha256: null };
|
|
8392
8578
|
if (!stat.isFile()) throw new Error(`prepared Xcode output is not a file: ${file}`);
|
|
8393
|
-
relativeFile(root,
|
|
8394
|
-
const bytes =
|
|
8579
|
+
relativeFile(root, import_node_fs10.default.realpathSync(file));
|
|
8580
|
+
const bytes = import_node_fs10.default.readFileSync(file);
|
|
8395
8581
|
const prefix2 = Buffer.from(root);
|
|
8396
8582
|
const hash = (0, import_node_crypto2.createHash)("sha256");
|
|
8397
8583
|
let offset = 0;
|
|
@@ -8407,8 +8593,8 @@ function output(root, file) {
|
|
|
8407
8593
|
}
|
|
8408
8594
|
function preparedXcodePhase(project, target, phase, configuration, outputs, recorded) {
|
|
8409
8595
|
const root = recording?.root ?? [...workspaces.keys()].find((root2) => {
|
|
8410
|
-
const relative3 =
|
|
8411
|
-
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);
|
|
8412
8598
|
});
|
|
8413
8599
|
if (!root) return false;
|
|
8414
8600
|
const entry = {
|
|
@@ -8444,8 +8630,8 @@ function preparedXcodePhase(project, target, phase, configuration, outputs, reco
|
|
|
8444
8630
|
|
|
8445
8631
|
// src/swift-binary-modules.ts
|
|
8446
8632
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8447
|
-
var
|
|
8448
|
-
var
|
|
8633
|
+
var import_node_fs11 = __toESM(require("node:fs"), 1);
|
|
8634
|
+
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
8449
8635
|
init_home_paths();
|
|
8450
8636
|
|
|
8451
8637
|
// src/swift-package.ts
|
|
@@ -8490,7 +8676,7 @@ function moduleMapName(text2) {
|
|
|
8490
8676
|
}
|
|
8491
8677
|
|
|
8492
8678
|
// src/swift-binary-modules.ts
|
|
8493
|
-
var cacheDir2 =
|
|
8679
|
+
var cacheDir2 = import_node_path9.default.join(cacheDir(), "swift-binary-modules");
|
|
8494
8680
|
function frameworkModules(paths) {
|
|
8495
8681
|
const modules = /* @__PURE__ */ new Set();
|
|
8496
8682
|
for (const file of paths) {
|
|
@@ -8500,21 +8686,21 @@ function frameworkModules(paths) {
|
|
|
8500
8686
|
return [...modules].sort();
|
|
8501
8687
|
}
|
|
8502
8688
|
function localSwiftBinaryModules(dir) {
|
|
8503
|
-
if (!
|
|
8504
|
-
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());
|
|
8505
8691
|
const frameworks = frameworkModules(
|
|
8506
8692
|
slices.flatMap(
|
|
8507
|
-
(slice) =>
|
|
8693
|
+
(slice) => import_node_fs11.default.readdirSync(import_node_path9.default.join(dir, slice.name)).map((entry) => `${slice.name}/${entry}`)
|
|
8508
8694
|
)
|
|
8509
8695
|
);
|
|
8510
8696
|
if (frameworks.length > 0) return frameworks;
|
|
8511
8697
|
const modules = /* @__PURE__ */ new Set();
|
|
8512
8698
|
for (const slice of slices) {
|
|
8513
|
-
const headers =
|
|
8514
|
-
if (!
|
|
8515
|
-
for (const file of
|
|
8516
|
-
if (
|
|
8517
|
-
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"));
|
|
8518
8704
|
if (module2) modules.add(module2);
|
|
8519
8705
|
}
|
|
8520
8706
|
}
|
|
@@ -8527,8 +8713,8 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
8527
8713
|
// src/swift-coverage/provenance.ts
|
|
8528
8714
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8529
8715
|
var import_node_crypto3 = require("node:crypto");
|
|
8530
|
-
var
|
|
8531
|
-
var
|
|
8716
|
+
var import_node_fs12 = require("node:fs");
|
|
8717
|
+
var import_node_path10 = require("node:path");
|
|
8532
8718
|
var SWIFT_COVERAGE_DIGEST_SOURCES = [
|
|
8533
8719
|
"swift-coverage/indexdump.ts",
|
|
8534
8720
|
"swift-coverage/indexing.ts",
|
|
@@ -8558,11 +8744,11 @@ function swiftCoverageSourceDigests(srcDir) {
|
|
|
8558
8744
|
return Object.fromEntries(
|
|
8559
8745
|
SWIFT_COVERAGE_DIGEST_SOURCES.map((file) => [
|
|
8560
8746
|
file,
|
|
8561
|
-
(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")
|
|
8562
8748
|
])
|
|
8563
8749
|
);
|
|
8564
8750
|
}
|
|
8565
|
-
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, ".."));
|
|
8566
8752
|
|
|
8567
8753
|
// src/swift-coverage/xcode-asset-symbols.ts
|
|
8568
8754
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -8748,9 +8934,9 @@ var assetSymbolSettingKeys = [
|
|
|
8748
8934
|
|
|
8749
8935
|
// src/swift-package-manifest.ts
|
|
8750
8936
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8751
|
-
var
|
|
8752
|
-
var
|
|
8753
|
-
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");
|
|
8754
8940
|
init_home_paths();
|
|
8755
8941
|
|
|
8756
8942
|
// src/swift-distribution.ts
|
|
@@ -8785,12 +8971,12 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
8785
8971
|
|
|
8786
8972
|
// src/swift-toolchain.ts
|
|
8787
8973
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8788
|
-
var
|
|
8789
|
-
var
|
|
8974
|
+
var import_node_fs13 = __toESM(require("node:fs"), 1);
|
|
8975
|
+
var import_node_path11 = __toESM(require("node:path"), 1);
|
|
8790
8976
|
function peachsimPackageRoot() {
|
|
8791
8977
|
let dir = __sootsim_import_meta_dirname;
|
|
8792
|
-
while (!
|
|
8793
|
-
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);
|
|
8794
8980
|
return dir;
|
|
8795
8981
|
}
|
|
8796
8982
|
var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-81b2c791c27276bf";
|
|
@@ -9027,10 +9213,10 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
9027
9213
|
|
|
9028
9214
|
// src/swift-objc-sdk.ts
|
|
9029
9215
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
9030
|
-
var
|
|
9216
|
+
var import_node_path12 = __toESM(require("node:path"), 1);
|
|
9031
9217
|
var IOS_SDK_TARGET = "arm64-apple-ios16.0-simulator";
|
|
9032
9218
|
var OVERLAY_PATH = /^usr\/lib\/swift\/([^/]+)\.swiftmodule\/arm64-apple-ios-simulator\.swiftinterface$/;
|
|
9033
|
-
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);
|
|
9034
9220
|
var IOS_SDK_HEADERS = {};
|
|
9035
9221
|
var IOS_SDK_OVERLAYS = {};
|
|
9036
9222
|
for (const [file, text2] of tree) {
|
|
@@ -9304,8 +9490,8 @@ var WASM_OPTIMIZE_IDENTITY = `wasm-opt ${import_wasm_opt.BINARYEN_VERSION} -Oz $
|
|
|
9304
9490
|
|
|
9305
9491
|
// src/swift-icu.ts
|
|
9306
9492
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
9307
|
-
var
|
|
9308
|
-
var
|
|
9493
|
+
var import_node_child_process4 = require("node:child_process");
|
|
9494
|
+
var import_node_util4 = require("node:util");
|
|
9309
9495
|
var import_node_zlib = require("node:zlib");
|
|
9310
9496
|
|
|
9311
9497
|
// ../sootsim-swift/src/icuData.ts
|
|
@@ -9320,10 +9506,10 @@ var VERSION = 1;
|
|
|
9320
9506
|
var SWIFT_ICU_PACKED = `picu${VERSION}`;
|
|
9321
9507
|
|
|
9322
9508
|
// src/swift-icu.ts
|
|
9323
|
-
var
|
|
9324
|
-
var deflate = (0,
|
|
9325
|
-
var compressBrotli = (0,
|
|
9326
|
-
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);
|
|
9327
9513
|
|
|
9328
9514
|
// src/swift-link-roots.ts
|
|
9329
9515
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -9426,7 +9612,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
|
|
|
9426
9612
|
var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
9427
9613
|
(module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
|
|
9428
9614
|
).join("");
|
|
9429
|
-
var compilerSourceDigest = true ? "
|
|
9615
|
+
var compilerSourceDigest = true ? "08a3436f8de8fff57c3ffe7822dc37ac9addd391678cb64d73212534a6e94aa1" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
|
|
9430
9616
|
var CORE_FOUNDATION_HANDLE_IMPORTS = [
|
|
9431
9617
|
"CFAllocator",
|
|
9432
9618
|
"CFArray",
|
|
@@ -9463,12 +9649,12 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
9463
9649
|
init_is_record();
|
|
9464
9650
|
|
|
9465
9651
|
// src/swift-package-manifest.ts
|
|
9466
|
-
var cacheDir3 =
|
|
9467
|
-
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);
|
|
9468
9654
|
|
|
9469
9655
|
// src/xcode-json-project.ts
|
|
9470
9656
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
9471
|
-
var
|
|
9657
|
+
var import_node_path14 = __toESM(require("node:path"), 1);
|
|
9472
9658
|
var import_json52 = __toESM(require_lib(), 1);
|
|
9473
9659
|
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9474
9660
|
var text = (value) => typeof value === "string" ? value : void 0;
|
|
@@ -9526,7 +9712,7 @@ var PHASE_ISA = {
|
|
|
9526
9712
|
function readXcodeJsonProject(xcodeproj, source) {
|
|
9527
9713
|
const json = import_json52.default.parse(source);
|
|
9528
9714
|
if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
|
|
9529
|
-
const projectDir =
|
|
9715
|
+
const projectDir = import_node_path14.default.dirname(xcodeproj);
|
|
9530
9716
|
const objects = {};
|
|
9531
9717
|
let next = 0;
|
|
9532
9718
|
const add = (entry, id) => {
|
|
@@ -9539,7 +9725,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
9539
9725
|
const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
|
|
9540
9726
|
if (base) {
|
|
9541
9727
|
if (base[1] === "PROJECT")
|
|
9542
|
-
return { sourceTree: "<absolute>", path:
|
|
9728
|
+
return { sourceTree: "<absolute>", path: import_node_path14.default.join(projectDir, base[2]) };
|
|
9543
9729
|
if (base[1] === "PRODUCTS")
|
|
9544
9730
|
return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
|
|
9545
9731
|
return null;
|
|
@@ -9547,7 +9733,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
9547
9733
|
const unescaped = raw.replaceAll("\\<", "<");
|
|
9548
9734
|
if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
|
|
9549
9735
|
if (unescaped.startsWith("~")) return null;
|
|
9550
|
-
return groupDir === null ? null : { sourceTree: "<absolute>", path:
|
|
9736
|
+
return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path14.default.join(groupDir, unescaped) };
|
|
9551
9737
|
};
|
|
9552
9738
|
const memberships = [];
|
|
9553
9739
|
const folders = [];
|
|
@@ -9558,7 +9744,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
9558
9744
|
const kind = text(entry.kind) ?? "file-reference";
|
|
9559
9745
|
const raw = text(entry.path) ?? "";
|
|
9560
9746
|
const located = raw === "" ? null : locate(raw, parent.dir);
|
|
9561
|
-
const name2 = text(entry.name) ??
|
|
9747
|
+
const name2 = text(entry.name) ?? import_node_path14.default.basename(raw);
|
|
9562
9748
|
const node = { id: "", name: name2, dir: null, parent, children: [] };
|
|
9563
9749
|
if (kind === "group" || kind === "variant-group" || kind === "version-group") {
|
|
9564
9750
|
node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
|
|
@@ -9679,7 +9865,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
9679
9865
|
if (!isObject(entry)) continue;
|
|
9680
9866
|
const repository = text(entry.repository);
|
|
9681
9867
|
const local = text(entry.path);
|
|
9682
|
-
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$/, "");
|
|
9683
9869
|
const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
|
|
9684
9870
|
isa: "XCRemoteSwiftPackageReference",
|
|
9685
9871
|
repositoryURL: repository ?? "",
|
|
@@ -9899,28 +10085,28 @@ var CONDITIONS = {
|
|
|
9899
10085
|
variant: "normal"
|
|
9900
10086
|
};
|
|
9901
10087
|
function walkFiles(dir) {
|
|
9902
|
-
if (!
|
|
10088
|
+
if (!import_node_fs14.default.existsSync(dir)) return [];
|
|
9903
10089
|
const out = [];
|
|
9904
|
-
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))) {
|
|
9905
10091
|
if (entry.name.startsWith(".")) continue;
|
|
9906
|
-
const full =
|
|
10092
|
+
const full = import_node_path15.default.join(dir, entry.name);
|
|
9907
10093
|
if (entry.isDirectory()) out.push(...walkFiles(full));
|
|
9908
10094
|
else if (entry.isFile()) out.push(full);
|
|
9909
10095
|
}
|
|
9910
10096
|
return out;
|
|
9911
10097
|
}
|
|
9912
|
-
var isDirectory = (dir) =>
|
|
10098
|
+
var isDirectory = (dir) => import_node_fs14.default.existsSync(dir) && import_node_fs14.default.statSync(dir).isDirectory();
|
|
9913
10099
|
function readXcconfig(file, read) {
|
|
9914
|
-
if (read.includes(file) || !
|
|
10100
|
+
if (read.includes(file) || !import_node_fs14.default.existsSync(file)) return {};
|
|
9915
10101
|
read.push(file);
|
|
9916
10102
|
const settings = {};
|
|
9917
|
-
for (const raw of
|
|
10103
|
+
for (const raw of import_node_fs14.default.readFileSync(file, "utf8").split("\n")) {
|
|
9918
10104
|
const line = raw.replace(/\/\/.*$/, "").trim();
|
|
9919
10105
|
const include = /^#include\??\s+"([^"]+)"/.exec(line);
|
|
9920
10106
|
if (include) {
|
|
9921
10107
|
Object.assign(
|
|
9922
10108
|
settings,
|
|
9923
|
-
readXcconfig(
|
|
10109
|
+
readXcconfig(import_node_path15.default.resolve(import_node_path15.default.dirname(file), include[1]), read)
|
|
9924
10110
|
);
|
|
9925
10111
|
continue;
|
|
9926
10112
|
}
|
|
@@ -9970,22 +10156,22 @@ function decodeXml(text2) {
|
|
|
9970
10156
|
return text2.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
9971
10157
|
}
|
|
9972
10158
|
function workspaceReferences(workspace) {
|
|
9973
|
-
const data =
|
|
9974
|
-
if (!
|
|
10159
|
+
const data = import_node_path15.default.join(workspace, "contents.xcworkspacedata");
|
|
10160
|
+
if (!import_node_fs14.default.existsSync(data))
|
|
9975
10161
|
throw new Error(`${workspace} has no contents.xcworkspacedata`);
|
|
9976
|
-
const container =
|
|
10162
|
+
const container = import_node_path15.default.dirname(workspace);
|
|
9977
10163
|
const locate = (location, base) => {
|
|
9978
10164
|
const colon = location.indexOf(":");
|
|
9979
10165
|
const kind = location.slice(0, colon);
|
|
9980
10166
|
const rest = location.slice(colon + 1);
|
|
9981
|
-
if (kind === "group") return
|
|
9982
|
-
if (kind === "container" || kind === "self") return
|
|
9983
|
-
if (kind === "absolute") return
|
|
9984
|
-
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}`);
|
|
9985
10171
|
};
|
|
9986
10172
|
const groups = [container];
|
|
9987
10173
|
const references = [];
|
|
9988
|
-
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)) {
|
|
9989
10175
|
if (closing) {
|
|
9990
10176
|
if (tag === "Group") groups.pop();
|
|
9991
10177
|
continue;
|
|
@@ -10036,8 +10222,8 @@ function remotePackageRequirements(projects) {
|
|
|
10036
10222
|
var loaded = /* @__PURE__ */ new Map();
|
|
10037
10223
|
function xcodeProjectFile(xcodeproj) {
|
|
10038
10224
|
for (const name2 of ["project.pbxproj", "project.xcproj"]) {
|
|
10039
|
-
const file =
|
|
10040
|
-
if (
|
|
10225
|
+
const file = import_node_path15.default.join(xcodeproj, name2);
|
|
10226
|
+
if (import_node_fs14.default.existsSync(file)) return file;
|
|
10041
10227
|
}
|
|
10042
10228
|
return null;
|
|
10043
10229
|
}
|
|
@@ -10045,7 +10231,7 @@ function loadProject(xcodeproj) {
|
|
|
10045
10231
|
const projectFile = xcodeProjectFile(xcodeproj);
|
|
10046
10232
|
if (!projectFile)
|
|
10047
10233
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
10048
|
-
const source =
|
|
10234
|
+
const source = import_node_fs14.default.readFileSync(projectFile, "utf8");
|
|
10049
10235
|
const digest = (0, import_node_crypto5.createHash)("sha256").update(source).digest("hex");
|
|
10050
10236
|
const cached = loaded.get(projectFile);
|
|
10051
10237
|
if (cached?.digest === digest) return cached.project;
|
|
@@ -10062,10 +10248,10 @@ function loadProject(xcodeproj) {
|
|
|
10062
10248
|
if (!project || project.isa !== "PBXProject") {
|
|
10063
10249
|
throw new Error(`${projectFile} has no PBXProject root`);
|
|
10064
10250
|
}
|
|
10065
|
-
const projectDir =
|
|
10066
|
-
|
|
10251
|
+
const projectDir = import_node_fs14.default.realpathSync.native(
|
|
10252
|
+
import_node_path15.default.resolve(import_node_path15.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
|
|
10067
10253
|
);
|
|
10068
|
-
const resolvePath = xcodePathResolver(objects, projectDir,
|
|
10254
|
+
const resolvePath = xcodePathResolver(objects, projectDir, import_node_path15.default.join);
|
|
10069
10255
|
const result = {
|
|
10070
10256
|
xcodeproj,
|
|
10071
10257
|
projectFile,
|
|
@@ -10102,8 +10288,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
10102
10288
|
const relative3 = str(config.baseConfigurationReferenceRelativePath);
|
|
10103
10289
|
const own = isDict(config.buildSettings) ? config.buildSettings : {};
|
|
10104
10290
|
const directory = anchor ? project.resolvePath(anchor) : null;
|
|
10105
|
-
const baseFile = base ? project.resolvePath(base) : directory && relative3 ?
|
|
10106
|
-
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)))
|
|
10107
10293
|
throw new Error(
|
|
10108
10294
|
`Unable to open base configuration reference file '${baseFile ?? base ?? relative3 ?? anchor}'`
|
|
10109
10295
|
);
|
|
@@ -10149,7 +10335,7 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
10149
10335
|
const derivedSettings = {
|
|
10150
10336
|
DEVELOPER_DIR: () => options.environment?.DEVELOPER_DIR ?? process.env.DEVELOPER_DIR ?? (developerDir ??= process.platform === "darwin" ? (
|
|
10151
10337
|
// runner-toolchain-platform: darwin
|
|
10152
|
-
(0,
|
|
10338
|
+
(0, import_node_child_process6.execFileSync)("xcode-select", ["-p"], {
|
|
10153
10339
|
encoding: "utf8",
|
|
10154
10340
|
stdio: ["ignore", "pipe", "pipe"]
|
|
10155
10341
|
}).trim()
|
|
@@ -10201,26 +10387,26 @@ function scriptCommand(shell, script) {
|
|
|
10201
10387
|
return [executable, ...args, "-c", script];
|
|
10202
10388
|
}
|
|
10203
10389
|
function expandSearchPath(directory, rules2) {
|
|
10204
|
-
if (
|
|
10390
|
+
if (import_node_path15.default.basename(directory) !== "**") return [directory];
|
|
10205
10391
|
const expanded = [];
|
|
10206
10392
|
const seen = /* @__PURE__ */ new Set();
|
|
10207
|
-
const queue = [
|
|
10393
|
+
const queue = [import_node_path15.default.dirname(directory)];
|
|
10208
10394
|
for (let at = 0; at < queue.length; at++) {
|
|
10209
10395
|
const current = queue[at];
|
|
10210
10396
|
let real;
|
|
10211
10397
|
try {
|
|
10212
|
-
real =
|
|
10398
|
+
real = import_node_fs14.default.realpathSync.native(current);
|
|
10213
10399
|
} catch {
|
|
10214
10400
|
continue;
|
|
10215
10401
|
}
|
|
10216
|
-
if (!
|
|
10402
|
+
if (!import_node_fs14.default.statSync(real).isDirectory() || seen.has(real)) continue;
|
|
10217
10403
|
seen.add(real);
|
|
10218
10404
|
expanded.push(current);
|
|
10219
|
-
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)) {
|
|
10220
10406
|
if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
|
|
10221
10407
|
if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
|
|
10222
10408
|
continue;
|
|
10223
|
-
queue.push(
|
|
10409
|
+
queue.push(import_node_path15.default.join(current, entry.name));
|
|
10224
10410
|
}
|
|
10225
10411
|
}
|
|
10226
10412
|
return expanded;
|
|
@@ -10291,7 +10477,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
|
|
|
10291
10477
|
for (const token of tokens) {
|
|
10292
10478
|
if (token.startsWith("-")) break;
|
|
10293
10479
|
const file = resolve4(token);
|
|
10294
|
-
if (file?.endsWith(".xcassets")) catalogs.push(
|
|
10480
|
+
if (file?.endsWith(".xcassets")) catalogs.push(import_node_path15.default.resolve(projectDir, file));
|
|
10295
10481
|
}
|
|
10296
10482
|
}
|
|
10297
10483
|
return catalogs;
|
|
@@ -10336,14 +10522,14 @@ function shellCopies(script, settings, projectDir) {
|
|
|
10336
10522
|
if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
|
|
10337
10523
|
return [];
|
|
10338
10524
|
copies.push({
|
|
10339
|
-
from:
|
|
10340
|
-
to:
|
|
10525
|
+
from: import_node_path15.default.resolve(projectDir, operands[0]),
|
|
10526
|
+
to: import_node_path15.default.resolve(projectDir, operands[1])
|
|
10341
10527
|
});
|
|
10342
10528
|
}
|
|
10343
10529
|
return copies;
|
|
10344
10530
|
}
|
|
10345
10531
|
function fileListEntries(file, absolute) {
|
|
10346
|
-
return
|
|
10532
|
+
return import_node_fs14.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
|
|
10347
10533
|
}
|
|
10348
10534
|
function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
10349
10535
|
const { project, target, id: targetId } = ref;
|
|
@@ -10356,7 +10542,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10356
10542
|
const copiedFiles = [];
|
|
10357
10543
|
let generatedInfoPlist = false;
|
|
10358
10544
|
const declaredInfoPlist = settings("INFOPLIST_FILE");
|
|
10359
|
-
const infoPlistOutput = declaredInfoPlist ?
|
|
10545
|
+
const infoPlistOutput = declaredInfoPlist ? import_node_path15.default.resolve(project.projectDir, declaredInfoPlist) : null;
|
|
10360
10546
|
const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
|
|
10361
10547
|
for (const phaseId of list(target.buildPhases)) {
|
|
10362
10548
|
const phase = project.object(phaseId);
|
|
@@ -10371,7 +10557,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10371
10557
|
copiedFiles.push(
|
|
10372
10558
|
...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
|
|
10373
10559
|
);
|
|
10374
|
-
const absolute = (raw) =>
|
|
10560
|
+
const absolute = (raw) => import_node_path15.default.resolve(project.projectDir, expand(raw, settings));
|
|
10375
10561
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
10376
10562
|
const outputs = list(phase.outputPaths).map(absolute);
|
|
10377
10563
|
const fileLists = /* @__PURE__ */ new Map();
|
|
@@ -10380,7 +10566,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10380
10566
|
kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
|
|
10381
10567
|
).map((raw) => {
|
|
10382
10568
|
const file = absolute(raw);
|
|
10383
|
-
if (!
|
|
10569
|
+
if (!import_node_fs14.default.existsSync(file)) {
|
|
10384
10570
|
return { file, entries: [] };
|
|
10385
10571
|
}
|
|
10386
10572
|
return { file, entries: fileListEntries(file, absolute) };
|
|
@@ -10401,7 +10587,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10401
10587
|
...fileLists.get("OUTPUT").map((item) => item.file)
|
|
10402
10588
|
];
|
|
10403
10589
|
if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
|
|
10404
|
-
for (const file of inputFiles) if (
|
|
10590
|
+
for (const file of inputFiles) if (import_node_fs14.default.existsSync(file)) projectInputs.add(file);
|
|
10405
10591
|
}
|
|
10406
10592
|
if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
|
|
10407
10593
|
const configuration = settings("CONFIGURATION");
|
|
@@ -10414,10 +10600,10 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10414
10600
|
false
|
|
10415
10601
|
))
|
|
10416
10602
|
continue;
|
|
10417
|
-
const phaseDir =
|
|
10603
|
+
const phaseDir = import_node_path15.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
10418
10604
|
for (const lists of fileLists.values())
|
|
10419
10605
|
for (const { file } of lists)
|
|
10420
|
-
if (!
|
|
10606
|
+
if (!import_node_fs14.default.existsSync(file))
|
|
10421
10607
|
throw new Error(
|
|
10422
10608
|
`${targetName}: Run Script "${script}" missing file list ${file}`
|
|
10423
10609
|
);
|
|
@@ -10436,7 +10622,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10436
10622
|
const lists = fileLists.get(kind);
|
|
10437
10623
|
env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
|
|
10438
10624
|
lists.forEach((_item, index) => {
|
|
10439
|
-
env[`SCRIPT_${kind}_FILE_LIST_${index}`] =
|
|
10625
|
+
env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path15.default.join(
|
|
10440
10626
|
phaseDir,
|
|
10441
10627
|
`${kind}-${index}.xcfilelist`
|
|
10442
10628
|
);
|
|
@@ -10447,14 +10633,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10447
10633
|
);
|
|
10448
10634
|
for (const file of inputFiles) {
|
|
10449
10635
|
signature.update(file);
|
|
10450
|
-
if (
|
|
10451
|
-
const stat =
|
|
10636
|
+
if (import_node_fs14.default.existsSync(file)) {
|
|
10637
|
+
const stat = import_node_fs14.default.statSync(file);
|
|
10452
10638
|
signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
|
|
10453
10639
|
} else signature.update("missing");
|
|
10454
10640
|
}
|
|
10455
10641
|
const stamp = signature.digest("hex");
|
|
10456
10642
|
const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
10457
|
-
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) =>
|
|
10643
|
+
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs14.default.existsSync(file))) {
|
|
10458
10644
|
preparedXcodePhase(
|
|
10459
10645
|
project.projectFile,
|
|
10460
10646
|
targetId,
|
|
@@ -10465,14 +10651,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10465
10651
|
);
|
|
10466
10652
|
continue;
|
|
10467
10653
|
}
|
|
10468
|
-
|
|
10469
|
-
|
|
10470
|
-
|
|
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 });
|
|
10471
10657
|
for (const output2 of allOutputs)
|
|
10472
|
-
|
|
10658
|
+
import_node_fs14.default.mkdirSync(import_node_path15.default.dirname(output2), { recursive: true });
|
|
10473
10659
|
for (const [kind, lists] of fileLists)
|
|
10474
10660
|
lists.forEach((item, index) => {
|
|
10475
|
-
|
|
10661
|
+
import_node_fs14.default.writeFileSync(
|
|
10476
10662
|
env[`SCRIPT_${kind}_FILE_LIST_${index}`],
|
|
10477
10663
|
`${item.entries.join("\n")}
|
|
10478
10664
|
`
|
|
@@ -10483,7 +10669,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
10483
10669
|
str(phase.shellPath) ?? "/bin/sh",
|
|
10484
10670
|
str(phase.shellScript) ?? ""
|
|
10485
10671
|
);
|
|
10486
|
-
(0,
|
|
10672
|
+
(0, import_node_child_process6.execFileSync)(shell, args, {
|
|
10487
10673
|
cwd: project.projectDir,
|
|
10488
10674
|
env,
|
|
10489
10675
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -10499,7 +10685,7 @@ ${output2}`
|
|
|
10499
10685
|
);
|
|
10500
10686
|
}
|
|
10501
10687
|
const missing2 = allOutputs.filter(
|
|
10502
|
-
(file) => file === infoPlistOutput && !
|
|
10688
|
+
(file) => file === infoPlistOutput && !import_node_fs14.default.existsSync(file)
|
|
10503
10689
|
);
|
|
10504
10690
|
if (missing2.length > 0)
|
|
10505
10691
|
throw new Error(
|
|
@@ -10518,9 +10704,9 @@ ${output2}`
|
|
|
10518
10704
|
}
|
|
10519
10705
|
project.visitMembers(
|
|
10520
10706
|
targetId,
|
|
10521
|
-
xcodePathResolver(project.objects, project.projectDir,
|
|
10522
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
10523
|
-
|
|
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,
|
|
10524
10710
|
(file, kind) => {
|
|
10525
10711
|
if (kind === "header") {
|
|
10526
10712
|
headers.add(file);
|
|
@@ -10530,9 +10716,9 @@ ${output2}`
|
|
|
10530
10716
|
resources.add(file);
|
|
10531
10717
|
return;
|
|
10532
10718
|
}
|
|
10533
|
-
if (!
|
|
10719
|
+
if (!import_node_fs14.default.existsSync(file)) {
|
|
10534
10720
|
if (options.requireSources === false) return;
|
|
10535
|
-
const script = scriptForOutput.get(
|
|
10721
|
+
const script = scriptForOutput.get(import_node_path15.default.normalize(file));
|
|
10536
10722
|
throw new Error(
|
|
10537
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}`
|
|
10538
10724
|
);
|
|
@@ -10543,17 +10729,17 @@ ${output2}`
|
|
|
10543
10729
|
);
|
|
10544
10730
|
if (options.prepareGeneratedSources && options.requireSources !== false) {
|
|
10545
10731
|
const interfaceFiles = [...resources].filter(
|
|
10546
|
-
(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"))
|
|
10547
10733
|
);
|
|
10548
10734
|
if (process.platform !== "darwin") {
|
|
10549
10735
|
let launchName = settings("INFOPLIST_KEY_UILaunchStoryboardName");
|
|
10550
|
-
if (!launchName && infoPlistOutput &&
|
|
10551
|
-
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"));
|
|
10552
10738
|
const declared = isRecord(info) ? info.UILaunchStoryboardName : void 0;
|
|
10553
10739
|
if (typeof declared === "string") launchName = expand(declared, settings);
|
|
10554
10740
|
}
|
|
10555
10741
|
const runtimeInterfaceFiles = interfaceFiles.filter(
|
|
10556
|
-
(file) =>
|
|
10742
|
+
(file) => import_node_path15.default.basename(file, import_node_path15.default.extname(file)) !== launchName
|
|
10557
10743
|
);
|
|
10558
10744
|
if (runtimeInterfaceFiles.length > 0)
|
|
10559
10745
|
throw new Error(
|
|
@@ -10564,19 +10750,19 @@ ${output2}`
|
|
|
10564
10750
|
}
|
|
10565
10751
|
const interfaceOutputs = /* @__PURE__ */ new Set();
|
|
10566
10752
|
for (const file of interfaceFiles) {
|
|
10567
|
-
const localization = file.split(
|
|
10753
|
+
const localization = file.split(import_node_path15.default.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
|
|
10568
10754
|
const extension = file.endsWith(".storyboard") ? ".storyboardc" : ".nib";
|
|
10569
|
-
const output2 =
|
|
10755
|
+
const output2 = import_node_path15.default.join(
|
|
10570
10756
|
settings("DERIVED_FILE_DIR"),
|
|
10571
10757
|
"InterfaceBuilder",
|
|
10572
10758
|
localization,
|
|
10573
|
-
|
|
10759
|
+
import_node_path15.default.basename(file, import_node_path15.default.extname(file)) + extension
|
|
10574
10760
|
);
|
|
10575
10761
|
if (interfaceOutputs.has(output2))
|
|
10576
10762
|
throw new Error(`${targetName}: duplicate Interface Builder output ${output2}`);
|
|
10577
10763
|
interfaceOutputs.add(output2);
|
|
10578
|
-
|
|
10579
|
-
|
|
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 });
|
|
10580
10766
|
const args = [
|
|
10581
10767
|
"ibtool",
|
|
10582
10768
|
"--compile",
|
|
@@ -10590,7 +10776,7 @@ ${output2}`
|
|
|
10590
10776
|
const families = settings("TARGETED_DEVICE_FAMILY").split(",").map((value) => value.trim());
|
|
10591
10777
|
if (families.includes("1")) args.push("--target-device", "iphone");
|
|
10592
10778
|
if (families.includes("2")) args.push("--target-device", "ipad");
|
|
10593
|
-
(0,
|
|
10779
|
+
(0, import_node_child_process6.execFileSync)("xcrun", args, {
|
|
10594
10780
|
cwd: project.projectDir,
|
|
10595
10781
|
stdio: ["ignore", "pipe", "pipe"],
|
|
10596
10782
|
timeout: runScriptTimeoutMs
|
|
@@ -10610,13 +10796,13 @@ ${output2}`
|
|
|
10610
10796
|
for (const definition of definitions) {
|
|
10611
10797
|
const configuredLanguage = settings("INTENTS_CODEGEN_LANGUAGE");
|
|
10612
10798
|
const language = !configuredLanguage || configuredLanguage === "Automatic" ? sources.size > 0 ? "Swift" : "Objective-C" : configuredLanguage;
|
|
10613
|
-
const output2 =
|
|
10799
|
+
const output2 = import_node_path15.default.join(
|
|
10614
10800
|
settings("DERIVED_FILE_DIR"),
|
|
10615
10801
|
"IntentDefinitionGenerated",
|
|
10616
|
-
|
|
10802
|
+
import_node_path15.default.basename(definition, ".intentdefinition")
|
|
10617
10803
|
);
|
|
10618
|
-
|
|
10619
|
-
|
|
10804
|
+
import_node_fs14.default.rmSync(output2, { recursive: true, force: true });
|
|
10805
|
+
import_node_fs14.default.mkdirSync(output2, { recursive: true });
|
|
10620
10806
|
const args = [
|
|
10621
10807
|
"intentbuilderc",
|
|
10622
10808
|
"generate",
|
|
@@ -10635,7 +10821,7 @@ ${output2}`
|
|
|
10635
10821
|
args.push("-swiftVersion", settings("SWIFT_VERSION") || "5.0");
|
|
10636
10822
|
if (settings("DEFINES_MODULE") === "YES")
|
|
10637
10823
|
args.push("-moduleName", settings("PRODUCT_MODULE_NAME"));
|
|
10638
|
-
(0,
|
|
10824
|
+
(0, import_node_child_process6.execFileSync)("xcrun", args, {
|
|
10639
10825
|
cwd: project.projectDir,
|
|
10640
10826
|
stdio: ["ignore", "pipe", "pipe"],
|
|
10641
10827
|
timeout: runScriptTimeoutMs
|
|
@@ -10660,37 +10846,37 @@ ${output2}`
|
|
|
10660
10846
|
function commonAncestor(dirs) {
|
|
10661
10847
|
let common = dirs[0];
|
|
10662
10848
|
for (const dir of dirs) {
|
|
10663
|
-
while (common !==
|
|
10664
|
-
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);
|
|
10665
10851
|
}
|
|
10666
10852
|
return common;
|
|
10667
10853
|
}
|
|
10668
|
-
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";
|
|
10669
10855
|
function installedPodsSandbox(pods) {
|
|
10670
|
-
const podfileLock =
|
|
10671
|
-
const manifestLock =
|
|
10672
|
-
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))
|
|
10673
10859
|
throw new Error(
|
|
10674
|
-
`${pods} has no ${podfileLock}: run \`pod install\` in ${
|
|
10860
|
+
`${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path15.default.dirname(pods)}`
|
|
10675
10861
|
);
|
|
10676
|
-
if (!
|
|
10862
|
+
if (!import_node_fs14.default.existsSync(manifestLock) || !import_node_fs14.default.readFileSync(manifestLock).equals(import_node_fs14.default.readFileSync(podfileLock)))
|
|
10677
10863
|
throw new Error(
|
|
10678
|
-
`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)}`
|
|
10679
10865
|
);
|
|
10680
10866
|
const specChecksums = {};
|
|
10681
|
-
const lines =
|
|
10867
|
+
const lines = import_node_fs14.default.readFileSync(manifestLock, "utf8").split("\n");
|
|
10682
10868
|
const start = lines.indexOf("SPEC CHECKSUMS:");
|
|
10683
10869
|
for (const line of start === -1 ? [] : lines.slice(start + 1)) {
|
|
10684
10870
|
const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
|
|
10685
10871
|
if (!entry) break;
|
|
10686
10872
|
specChecksums[entry[1]] = entry[2];
|
|
10687
10873
|
}
|
|
10688
|
-
const specs =
|
|
10874
|
+
const specs = import_node_path15.default.join(pods, "Local Podspecs");
|
|
10689
10875
|
return {
|
|
10690
10876
|
podfileLock,
|
|
10691
10877
|
manifestLock,
|
|
10692
10878
|
specChecksums,
|
|
10693
|
-
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)) : []
|
|
10694
10880
|
};
|
|
10695
10881
|
}
|
|
10696
10882
|
function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
@@ -10702,14 +10888,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
10702
10888
|
if (!xcodeProjectFile(xcodeproj)) {
|
|
10703
10889
|
if (installedPods && isPodsProject(xcodeproj))
|
|
10704
10890
|
throw new Error(
|
|
10705
|
-
`${
|
|
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))}`
|
|
10706
10892
|
);
|
|
10707
10893
|
return;
|
|
10708
10894
|
}
|
|
10709
|
-
const key =
|
|
10710
|
-
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"))
|
|
10711
10897
|
return;
|
|
10712
|
-
if (isPodsProject(key)) cocoapods = installedPodsSandbox(
|
|
10898
|
+
if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path15.default.dirname(key));
|
|
10713
10899
|
const project = loadProject(key);
|
|
10714
10900
|
projectAt.set(key, project);
|
|
10715
10901
|
projects.push(project);
|
|
@@ -10725,12 +10911,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
10725
10911
|
for (const reference of listed)
|
|
10726
10912
|
if (reference.endsWith(".xcodeproj")) addProject(reference);
|
|
10727
10913
|
if (projects.length === 0) {
|
|
10728
|
-
throw new Error(`${
|
|
10914
|
+
throw new Error(`${import_node_path15.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
|
|
10729
10915
|
}
|
|
10730
|
-
const podfile =
|
|
10731
|
-
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))
|
|
10732
10918
|
throw new Error(
|
|
10733
|
-
`${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`
|
|
10734
10920
|
);
|
|
10735
10921
|
return { listed, projects, projectAt, cocoapods };
|
|
10736
10922
|
}
|
|
@@ -10766,7 +10952,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
|
|
|
10766
10952
|
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
|
|
10767
10953
|
}
|
|
10768
10954
|
function defaultXcodeAppTarget(xcodeproj) {
|
|
10769
|
-
const project = loadProject(
|
|
10955
|
+
const project = loadProject(import_node_fs14.default.realpathSync.native(xcodeproj));
|
|
10770
10956
|
for (const [id, target] of Object.entries(project.objects)) {
|
|
10771
10957
|
if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
|
|
10772
10958
|
if (isIosAppTarget({ project, id, target }, { requireSources: false }))
|
|
@@ -10774,30 +10960,30 @@ function defaultXcodeAppTarget(xcodeproj) {
|
|
|
10774
10960
|
}
|
|
10775
10961
|
}
|
|
10776
10962
|
function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
10777
|
-
const container =
|
|
10963
|
+
const container = import_node_fs14.default.realpathSync.native(xcodeprojOrWorkspace);
|
|
10778
10964
|
const { projects } = workspaceProjects(container);
|
|
10779
10965
|
const containers = [
|
|
10780
10966
|
.../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
|
|
10781
10967
|
];
|
|
10782
10968
|
const found = containers.flatMap(
|
|
10783
10969
|
(dir) => [
|
|
10784
|
-
|
|
10785
|
-
...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)) : []
|
|
10786
10972
|
].map((data) => ({
|
|
10787
10973
|
dir,
|
|
10788
|
-
file:
|
|
10974
|
+
file: import_node_path15.default.join(data, "xcschemes", `${scheme}.xcscheme`)
|
|
10789
10975
|
}))
|
|
10790
|
-
).find((candidate) =>
|
|
10976
|
+
).find((candidate) => import_node_fs14.default.existsSync(candidate.file));
|
|
10791
10977
|
if (!found) {
|
|
10792
10978
|
const known = containers.flatMap(
|
|
10793
|
-
(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() : []
|
|
10794
10980
|
);
|
|
10795
10981
|
throw new Error(
|
|
10796
|
-
`${
|
|
10982
|
+
`${import_node_path15.default.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
|
|
10797
10983
|
);
|
|
10798
10984
|
}
|
|
10799
10985
|
const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
|
|
10800
|
-
|
|
10986
|
+
import_node_fs14.default.readFileSync(found.file, "utf8")
|
|
10801
10987
|
);
|
|
10802
10988
|
const attribute = (text2, name3) => {
|
|
10803
10989
|
const value = new RegExp(`\\b${name3}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
|
|
@@ -10810,12 +10996,12 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
10810
10996
|
if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
|
|
10811
10997
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
10812
10998
|
}
|
|
10813
|
-
const projectPath =
|
|
10814
|
-
|
|
10999
|
+
const projectPath = import_node_path15.default.resolve(
|
|
11000
|
+
import_node_path15.default.dirname(found.dir),
|
|
10815
11001
|
referenced.slice("container:".length)
|
|
10816
11002
|
);
|
|
10817
11003
|
const project = projects.find(
|
|
10818
|
-
(candidate) =>
|
|
11004
|
+
(candidate) => import_node_fs14.default.existsSync(projectPath) && candidate.xcodeproj === import_node_fs14.default.realpathSync.native(projectPath)
|
|
10819
11005
|
);
|
|
10820
11006
|
const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
|
|
10821
11007
|
const name2 = target && str(target.target.name);
|
|
@@ -10835,26 +11021,26 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
10835
11021
|
var NativeAppTargetSelectionError = class extends Error {
|
|
10836
11022
|
};
|
|
10837
11023
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
10838
|
-
const nested =
|
|
10839
|
-
const iosRoot =
|
|
10840
|
-
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 });
|
|
10841
11027
|
const projects = (entries.some((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")) ? entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).map((entry) => ({
|
|
10842
|
-
xcodeproj:
|
|
11028
|
+
xcodeproj: import_node_path15.default.join(iosRoot, entry.name),
|
|
10843
11029
|
workspace: null
|
|
10844
11030
|
})) : entries.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcworkspace")).flatMap((entry) => {
|
|
10845
|
-
const workspace =
|
|
11031
|
+
const workspace = import_node_path15.default.join(iosRoot, entry.name);
|
|
10846
11032
|
return workspaceReferences(workspace).map((xcodeproj2) => ({
|
|
10847
11033
|
xcodeproj: xcodeproj2,
|
|
10848
11034
|
workspace
|
|
10849
11035
|
}));
|
|
10850
11036
|
}).filter(
|
|
10851
|
-
({ 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)
|
|
10852
11038
|
).filter(
|
|
10853
11039
|
({ xcodeproj: xcodeproj2 }) => listXcodeAppTargets(xcodeproj2, { requireSources: false }).length > 0
|
|
10854
11040
|
)).map(({ xcodeproj: xcodeproj2, workspace }) => ({
|
|
10855
11041
|
xcodeproj: xcodeproj2,
|
|
10856
11042
|
workspace,
|
|
10857
|
-
name:
|
|
11043
|
+
name: import_node_path15.default.basename(xcodeproj2)
|
|
10858
11044
|
}));
|
|
10859
11045
|
if (projects.length === 0) return null;
|
|
10860
11046
|
if (projects.length > 1 && !iosTarget) {
|
|
@@ -10893,13 +11079,13 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
10893
11079
|
if (!target) throw new Error("native app identity has no iOS application target");
|
|
10894
11080
|
if (!iosTarget) {
|
|
10895
11081
|
const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
|
|
10896
|
-
const container =
|
|
11082
|
+
const container = import_node_fs14.default.existsSync(workspace) ? workspace : xcodeproj;
|
|
10897
11083
|
const hasScheme = [container, xcodeproj].some((dir) => {
|
|
10898
|
-
if (
|
|
11084
|
+
if (import_node_fs14.default.existsSync(import_node_path15.default.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
|
|
10899
11085
|
return true;
|
|
10900
|
-
const users =
|
|
10901
|
-
return
|
|
10902
|
-
(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`))
|
|
10903
11089
|
);
|
|
10904
11090
|
});
|
|
10905
11091
|
if (hasScheme) target = readXcodeScheme(container, target).target;
|
|
@@ -10910,8 +11096,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
10910
11096
|
);
|
|
10911
11097
|
return { xcodeproj, target, workspace: project.workspace };
|
|
10912
11098
|
}
|
|
10913
|
-
var workspaceResolvedFile = (xcodeprojOrWorkspace) =>
|
|
10914
|
-
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"),
|
|
10915
11101
|
"xcshareddata",
|
|
10916
11102
|
"swiftpm",
|
|
10917
11103
|
"Package.resolved"
|
|
@@ -10926,7 +11112,7 @@ var SwiftPackageResolutionRequired = class extends Error {
|
|
|
10926
11112
|
}
|
|
10927
11113
|
};
|
|
10928
11114
|
function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
|
|
10929
|
-
const xcodeprojOrWorkspace =
|
|
11115
|
+
const xcodeprojOrWorkspace = import_node_fs14.default.realpathSync.native(input);
|
|
10930
11116
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
10931
11117
|
const { listed, projects, projectAt, cocoapods } = workspaceProjects(
|
|
10932
11118
|
xcodeprojOrWorkspace,
|
|
@@ -10935,7 +11121,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
10935
11121
|
const allTargets = projects.flatMap(projectTargets);
|
|
10936
11122
|
const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
|
|
10937
11123
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
10938
|
-
const container =
|
|
11124
|
+
const container = import_node_path15.default.basename(xcodeprojOrWorkspace);
|
|
10939
11125
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
10940
11126
|
if (named.length !== 1) {
|
|
10941
11127
|
if (appTargets.length === 0)
|
|
@@ -10956,15 +11142,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
10956
11142
|
for (const ref of allTargets) {
|
|
10957
11143
|
const product = ref.project.object(str(ref.target.productReference));
|
|
10958
11144
|
const file = str(product?.path);
|
|
10959
|
-
if (file && !byProduct.has(
|
|
10960
|
-
byProduct.set(
|
|
11145
|
+
if (file && !byProduct.has(import_node_path15.default.basename(file)))
|
|
11146
|
+
byProduct.set(import_node_path15.default.basename(file), ref);
|
|
10961
11147
|
}
|
|
10962
11148
|
const proxied = (project, proxyId) => {
|
|
10963
11149
|
const proxy = project.object(proxyId);
|
|
10964
11150
|
if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
|
|
10965
11151
|
const portal = str(proxy.containerPortal);
|
|
10966
11152
|
const portalPath = project.resolvePath(portal ?? "");
|
|
10967
|
-
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;
|
|
10968
11154
|
const remote = str(proxy.remoteGlobalIDString);
|
|
10969
11155
|
if (!owner || !remote) return void 0;
|
|
10970
11156
|
return projectTargets(owner).find(
|
|
@@ -10981,7 +11167,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
10981
11167
|
const buildFile = project.object(buildFileId);
|
|
10982
11168
|
if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
10983
11169
|
const file = project.object(str(buildFile.fileRef));
|
|
10984
|
-
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;
|
|
10985
11171
|
if (resolved)
|
|
10986
11172
|
found.push({
|
|
10987
11173
|
target: resolved,
|
|
@@ -11065,8 +11251,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11065
11251
|
ref.project.visitMembers(
|
|
11066
11252
|
ref.id,
|
|
11067
11253
|
ref.project.resolvePath,
|
|
11068
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
11069
|
-
|
|
11254
|
+
(file) => isDirectory(file) ? walkFiles(file) : import_node_fs14.default.existsSync(file) ? [file] : [],
|
|
11255
|
+
import_node_path15.default.join,
|
|
11070
11256
|
(file, kind) => {
|
|
11071
11257
|
if (kind === "header") found.push(file);
|
|
11072
11258
|
}
|
|
@@ -11082,12 +11268,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11082
11268
|
for (const ref of projectTargets(project)) {
|
|
11083
11269
|
const product = productName(ref);
|
|
11084
11270
|
for (const { file, visibility } of headerPhase(ref)) {
|
|
11085
|
-
const name2 =
|
|
11271
|
+
const name2 = import_node_path15.default.basename(file);
|
|
11086
11272
|
if (!entries.has(name2))
|
|
11087
11273
|
entries.set(name2, visibility !== "Project" ? `${product}/${name2}` : file);
|
|
11088
11274
|
}
|
|
11089
11275
|
for (const file of synchronizedHeaders(ref)) {
|
|
11090
|
-
const name2 =
|
|
11276
|
+
const name2 = import_node_path15.default.basename(file);
|
|
11091
11277
|
if (!entries.has(name2)) entries.set(name2, file);
|
|
11092
11278
|
}
|
|
11093
11279
|
}
|
|
@@ -11097,7 +11283,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11097
11283
|
if (folder === null) continue;
|
|
11098
11284
|
for (const file of walkFiles(folder)) {
|
|
11099
11285
|
if (!HEADER_FILE.test(file)) continue;
|
|
11100
|
-
const name2 =
|
|
11286
|
+
const name2 = import_node_path15.default.basename(file);
|
|
11101
11287
|
if (!entries.has(name2)) entries.set(name2, file);
|
|
11102
11288
|
}
|
|
11103
11289
|
}
|
|
@@ -11105,18 +11291,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11105
11291
|
for (const id of Object.keys(project.objects)) {
|
|
11106
11292
|
if (project.object(id)?.isa !== "PBXFileReference") continue;
|
|
11107
11293
|
const file = project.resolvePath(id);
|
|
11108
|
-
if (file && HEADER_FILE.test(file) && !entries.has(
|
|
11109
|
-
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);
|
|
11110
11296
|
}
|
|
11111
11297
|
const map2 = [...entries];
|
|
11112
11298
|
projectHeaderMaps.set(project, map2);
|
|
11113
11299
|
return map2;
|
|
11114
11300
|
};
|
|
11115
11301
|
const xcconfigs = /* @__PURE__ */ new Set();
|
|
11116
|
-
const buildDir = (project) =>
|
|
11302
|
+
const buildDir = (project) => import_node_path15.default.join(project.projectDir, ".build/peach-xcode/Build");
|
|
11117
11303
|
const workspaceBuild = {
|
|
11118
|
-
SYMROOT:
|
|
11119
|
-
OBJROOT:
|
|
11304
|
+
SYMROOT: import_node_path15.default.join(buildDir(app.project), "Products"),
|
|
11305
|
+
OBJROOT: import_node_path15.default.join(buildDir(app.project), "Intermediates.noindex")
|
|
11120
11306
|
};
|
|
11121
11307
|
const moduleTarget = (ref) => {
|
|
11122
11308
|
const name2 = str(ref.target.name) ?? ref.id;
|
|
@@ -11131,16 +11317,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11131
11317
|
TARGET_NAME: name2,
|
|
11132
11318
|
TARGETNAME: "$(TARGET_NAME)",
|
|
11133
11319
|
PROJECT: "$(PROJECT_NAME)",
|
|
11134
|
-
PROJECT_NAME:
|
|
11320
|
+
PROJECT_NAME: import_node_path15.default.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
11135
11321
|
PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
|
|
11136
11322
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
11137
11323
|
SRCROOT: ref.project.projectDir,
|
|
11138
11324
|
SOURCE_ROOT: ref.project.projectDir,
|
|
11139
11325
|
PROJECT_DIR: ref.project.projectDir,
|
|
11140
|
-
SYMROOT:
|
|
11326
|
+
SYMROOT: import_node_path15.default.join(buildDir(ref.project), "Products"),
|
|
11141
11327
|
BUILD_DIR: "$(SYMROOT)",
|
|
11142
11328
|
BUILD_ROOT: "$(SYMROOT)",
|
|
11143
|
-
OBJROOT:
|
|
11329
|
+
OBJROOT: import_node_path15.default.join(buildDir(ref.project), "Intermediates.noindex"),
|
|
11144
11330
|
CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
|
|
11145
11331
|
BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
11146
11332
|
TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
@@ -11182,7 +11368,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11182
11368
|
xcconfigs
|
|
11183
11369
|
);
|
|
11184
11370
|
const searchRules = recursiveSearchRules(settings2);
|
|
11185
|
-
const absolute = (file) =>
|
|
11371
|
+
const absolute = (file) => import_node_path15.default.resolve(ref.project.projectDir, file);
|
|
11186
11372
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
|
|
11187
11373
|
const product = settings2("PRODUCT_NAME");
|
|
11188
11374
|
const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
|
|
@@ -11213,7 +11399,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11213
11399
|
`${name2}: Swift compatibility header phase has no Swift producer sources`
|
|
11214
11400
|
);
|
|
11215
11401
|
const building = options.prepareGeneratedSources && options.requireSources !== false;
|
|
11216
|
-
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;
|
|
11217
11403
|
if (versioning) {
|
|
11218
11404
|
const version = settings2("CURRENT_PROJECT_VERSION");
|
|
11219
11405
|
const custom = [
|
|
@@ -11226,7 +11412,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11226
11412
|
].filter((key) => settings2(key));
|
|
11227
11413
|
if (custom.length)
|
|
11228
11414
|
throw new Error(
|
|
11229
|
-
`${name2}: Xcode generates ${
|
|
11415
|
+
`${name2}: Xcode generates ${import_node_path15.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
|
|
11230
11416
|
);
|
|
11231
11417
|
const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
11232
11418
|
const [major, minor] = version.split(".");
|
|
@@ -11239,9 +11425,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11239
11425
|
` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number2};`,
|
|
11240
11426
|
""
|
|
11241
11427
|
].join("\n");
|
|
11242
|
-
if (!
|
|
11243
|
-
|
|
11244
|
-
|
|
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);
|
|
11245
11431
|
}
|
|
11246
11432
|
allSources.push(versioning);
|
|
11247
11433
|
}
|
|
@@ -11260,7 +11446,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11260
11446
|
const headerFiles = headerPhase(ref);
|
|
11261
11447
|
const ownHeaders = /* @__PURE__ */ new Map();
|
|
11262
11448
|
for (const { file, visibility } of headerFiles) {
|
|
11263
|
-
const name3 =
|
|
11449
|
+
const name3 = import_node_path15.default.basename(file);
|
|
11264
11450
|
const published = visibility !== "Project";
|
|
11265
11451
|
if (!ownHeaders.has(name3))
|
|
11266
11452
|
ownHeaders.set(name3, published ? `${product}/${name3}` : file);
|
|
@@ -11268,7 +11454,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11268
11454
|
ownHeaders.set(`${product}/${name3}`, file);
|
|
11269
11455
|
}
|
|
11270
11456
|
for (const file of synchronizedHeaders(ref)) {
|
|
11271
|
-
const name3 =
|
|
11457
|
+
const name3 = import_node_path15.default.basename(file);
|
|
11272
11458
|
if (ownHeaders.has(name3)) continue;
|
|
11273
11459
|
ownHeaders.set(name3, file);
|
|
11274
11460
|
const qualified = `${product}/${name3}`;
|
|
@@ -11280,24 +11466,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11280
11466
|
const otherProduct = productName(other);
|
|
11281
11467
|
for (const { file, visibility } of headerPhase(other)) {
|
|
11282
11468
|
if (visibility === "Project") continue;
|
|
11283
|
-
const key = `${otherProduct}/${
|
|
11469
|
+
const key = `${otherProduct}/${import_node_path15.default.basename(file)}`;
|
|
11284
11470
|
if (!nonFrameworkHeaders.has(key)) nonFrameworkHeaders.set(key, file);
|
|
11285
11471
|
}
|
|
11286
11472
|
}
|
|
11287
|
-
const wrapper =
|
|
11473
|
+
const wrapper = import_node_path15.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
|
|
11288
11474
|
const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
|
|
11289
|
-
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ?
|
|
11290
|
-
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) ? {
|
|
11291
11477
|
framework: true,
|
|
11292
11478
|
moduleMap,
|
|
11293
11479
|
umbrella: frameworkUmbrella,
|
|
11294
|
-
outputModuleMap:
|
|
11295
|
-
outputUmbrella:
|
|
11480
|
+
outputModuleMap: import_node_path15.default.join(wrapper, "Modules", "module.modulemap"),
|
|
11481
|
+
outputUmbrella: import_node_path15.default.join(
|
|
11296
11482
|
wrapper,
|
|
11297
11483
|
"Headers",
|
|
11298
|
-
|
|
11484
|
+
import_node_path15.default.basename(frameworkUmbrella)
|
|
11299
11485
|
),
|
|
11300
|
-
outputHeader:
|
|
11486
|
+
outputHeader: import_node_path15.default.join(
|
|
11301
11487
|
wrapper,
|
|
11302
11488
|
"Headers",
|
|
11303
11489
|
settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
|
|
@@ -11311,10 +11497,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11311
11497
|
outputUmbrella: compatibility.outputUmbrella,
|
|
11312
11498
|
outputHeader: compatibility.outputHeader
|
|
11313
11499
|
} : frameworkCompatibility;
|
|
11314
|
-
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) => {
|
|
11315
11501
|
if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
|
|
11316
|
-
const file =
|
|
11317
|
-
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] : [];
|
|
11318
11504
|
}) : [];
|
|
11319
11505
|
const fileFlags = {};
|
|
11320
11506
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -11389,15 +11575,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11389
11575
|
// xcode searches its products' include directory before
|
|
11390
11576
|
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
11391
11577
|
headerSearchPaths: [
|
|
11392
|
-
|
|
11578
|
+
import_node_path15.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
|
|
11393
11579
|
...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
|
|
11394
11580
|
(raw) => expandSearchPath(absolute(raw), searchRules)
|
|
11395
11581
|
),
|
|
11396
|
-
|
|
11582
|
+
import_node_path15.default.join(
|
|
11397
11583
|
`${settings2("DERIVED_FILE_DIR")}-normal`,
|
|
11398
11584
|
settings2("CURRENT_ARCH")
|
|
11399
11585
|
),
|
|
11400
|
-
|
|
11586
|
+
import_node_path15.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
|
|
11401
11587
|
settings2("DERIVED_FILE_DIR")
|
|
11402
11588
|
],
|
|
11403
11589
|
userHeaderSearchPaths: settingList(
|
|
@@ -11447,10 +11633,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11447
11633
|
...headerFiles.flatMap(
|
|
11448
11634
|
({ file, visibility }) => visibility === "Project" ? [] : [
|
|
11449
11635
|
[
|
|
11450
|
-
|
|
11636
|
+
import_node_path15.default.join(
|
|
11451
11637
|
wrapper,
|
|
11452
11638
|
visibility === "Public" ? "Headers" : "PrivateHeaders",
|
|
11453
|
-
|
|
11639
|
+
import_node_path15.default.basename(file)
|
|
11454
11640
|
),
|
|
11455
11641
|
file
|
|
11456
11642
|
]
|
|
@@ -11464,7 +11650,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11464
11650
|
return [];
|
|
11465
11651
|
const destination = expand(
|
|
11466
11652
|
str(phase.dstPath) ?? "",
|
|
11467
|
-
(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)
|
|
11468
11654
|
);
|
|
11469
11655
|
return list(phase.files).flatMap((id) => {
|
|
11470
11656
|
const file = ref.project.resolvePath(
|
|
@@ -11472,17 +11658,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11472
11658
|
);
|
|
11473
11659
|
return file && HEADER_FILE.test(file) ? [
|
|
11474
11660
|
[
|
|
11475
|
-
|
|
11661
|
+
import_node_path15.default.resolve(
|
|
11476
11662
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
11477
11663
|
destination,
|
|
11478
|
-
|
|
11664
|
+
import_node_path15.default.basename(file)
|
|
11479
11665
|
),
|
|
11480
11666
|
file
|
|
11481
11667
|
]
|
|
11482
11668
|
] : [];
|
|
11483
11669
|
});
|
|
11484
11670
|
}),
|
|
11485
|
-
...moduleMap ? [[
|
|
11671
|
+
...moduleMap ? [[import_node_path15.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
|
|
11486
11672
|
]) : Object.fromEntries([
|
|
11487
11673
|
...podHeaders.map((file) => [file, file]),
|
|
11488
11674
|
...moduleMap ? [[moduleMap, moduleMap]] : []
|
|
@@ -11514,7 +11700,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11514
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 }));
|
|
11515
11701
|
const frameworks = frameworkTargets.map(({ framework }) => framework);
|
|
11516
11702
|
const podSourceDirs = builtTargets.slice(0, -1).flatMap(
|
|
11517
|
-
({ 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)) : []
|
|
11518
11704
|
);
|
|
11519
11705
|
const expandValue = (value, settings2) => {
|
|
11520
11706
|
if (typeof value === "string") return expand(value, settings2);
|
|
@@ -11535,7 +11721,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11535
11721
|
const phase = owner.ref.project.object(phaseId);
|
|
11536
11722
|
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
|
|
11537
11723
|
continue;
|
|
11538
|
-
const absolute = (raw) =>
|
|
11724
|
+
const absolute = (raw) => import_node_path15.default.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
|
|
11539
11725
|
const entries = (paths) => paths.flatMap((raw) => {
|
|
11540
11726
|
const file = absolute(raw);
|
|
11541
11727
|
xcconfigs.add(file);
|
|
@@ -11551,7 +11737,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11551
11737
|
].filter((file) => file.endsWith(".bundle"));
|
|
11552
11738
|
if (inputs.length !== outputs.length)
|
|
11553
11739
|
throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
|
|
11554
|
-
const destinationRoot =
|
|
11740
|
+
const destinationRoot = import_node_path15.default.join(
|
|
11555
11741
|
owner.settings("TARGET_BUILD_DIR"),
|
|
11556
11742
|
owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
|
|
11557
11743
|
);
|
|
@@ -11560,24 +11746,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11560
11746
|
const file = str(
|
|
11561
11747
|
target.ref.project.object(str(target.ref.target.productReference))?.path
|
|
11562
11748
|
);
|
|
11563
|
-
return file &&
|
|
11749
|
+
return file && import_node_path15.default.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
|
|
11564
11750
|
});
|
|
11565
11751
|
if (!product && !isDirectory(input2))
|
|
11566
11752
|
throw new Error(
|
|
11567
11753
|
`${owner.module.name}: resource bundle input has no selected producer: ${input2}`
|
|
11568
11754
|
);
|
|
11569
|
-
const destination =
|
|
11570
|
-
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))
|
|
11571
11757
|
throw new Error(
|
|
11572
11758
|
`${owner.module.name}: invalid resource bundle copy destination`
|
|
11573
11759
|
);
|
|
11574
|
-
const infoFile = product ?
|
|
11760
|
+
const infoFile = product ? import_node_path15.default.resolve(
|
|
11575
11761
|
product.ref.project.projectDir,
|
|
11576
11762
|
product.settings("INFOPLIST_FILE")
|
|
11577
11763
|
) : null;
|
|
11578
11764
|
if (infoFile) xcconfigs.add(infoFile);
|
|
11579
11765
|
const prefix2 = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
|
|
11580
|
-
const bundlePath = prefix2 + destination.split(
|
|
11766
|
+
const bundlePath = prefix2 + destination.split(import_node_path15.default.sep).join("/");
|
|
11581
11767
|
if (resourceProducts.some((resource) => resource.path === bundlePath))
|
|
11582
11768
|
throw new Error(
|
|
11583
11769
|
`${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
|
|
@@ -11588,22 +11774,22 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11588
11774
|
resources: product.module.resources,
|
|
11589
11775
|
infoPlist: import_plist2.default.build(
|
|
11590
11776
|
expandValue(
|
|
11591
|
-
import_plist2.default.parse(
|
|
11777
|
+
import_plist2.default.parse(import_node_fs14.default.readFileSync(infoFile, "utf8")),
|
|
11592
11778
|
product.settings
|
|
11593
11779
|
)
|
|
11594
11780
|
)
|
|
11595
11781
|
} : {
|
|
11596
|
-
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(),
|
|
11597
11783
|
sourceRoot: input2
|
|
11598
11784
|
}
|
|
11599
11785
|
});
|
|
11600
11786
|
}
|
|
11601
11787
|
}
|
|
11602
11788
|
}
|
|
11603
|
-
const infoPlistFile = settings("INFOPLIST_FILE") ?
|
|
11604
|
-
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;
|
|
11605
11791
|
const infoPlistPending = module2.generatedInfoPlist && !options.prepareGeneratedSources;
|
|
11606
|
-
const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist2.default.parse(
|
|
11792
|
+
const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist2.default.parse(import_node_fs14.default.readFileSync(infoPlistFile, "utf8")) : {};
|
|
11607
11793
|
if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
|
|
11608
11794
|
throw new Error(`${module2.name} Info.plist must contain a dictionary`);
|
|
11609
11795
|
}
|
|
@@ -11627,7 +11813,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11627
11813
|
}
|
|
11628
11814
|
const bundleIdentifier = settings("PRODUCT_BUNDLE_IDENTIFIER") || (typeof info.CFBundleIdentifier === "string" ? info.CFBundleIdentifier : "");
|
|
11629
11815
|
const keychainAccessGroups = entitlementsFile ? readKeychainAccessGroups(
|
|
11630
|
-
import_plist2.default.parse(
|
|
11816
|
+
import_plist2.default.parse(import_node_fs14.default.readFileSync(entitlementsFile, "utf8")),
|
|
11631
11817
|
(value) => expand(value, (key) => {
|
|
11632
11818
|
if (key === "AppIdentifierPrefix") return "FAKETEAMID.";
|
|
11633
11819
|
if (key === "TeamIdentifierPrefix") return "";
|
|
@@ -11663,7 +11849,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11663
11849
|
};
|
|
11664
11850
|
}
|
|
11665
11851
|
const localPackageDirs = [
|
|
11666
|
-
...listed.filter((reference) =>
|
|
11852
|
+
...listed.filter((reference) => import_node_fs14.default.existsSync(import_node_path15.default.join(reference, "Package.swift"))),
|
|
11667
11853
|
...projects.flatMap(
|
|
11668
11854
|
(project) => Object.entries(project.objects).flatMap(([id, entry]) => {
|
|
11669
11855
|
if (!isDict(entry)) return [];
|
|
@@ -11673,19 +11859,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11673
11859
|
const packages = [];
|
|
11674
11860
|
while (pending.length > 0) {
|
|
11675
11861
|
const dir = pending.pop();
|
|
11676
|
-
if (
|
|
11862
|
+
if (import_node_fs14.default.existsSync(import_node_path15.default.join(dir, "Package.swift"))) {
|
|
11677
11863
|
packages.push(dir);
|
|
11678
11864
|
continue;
|
|
11679
11865
|
}
|
|
11680
11866
|
if (!isDirectory(dir)) continue;
|
|
11681
|
-
for (const child of
|
|
11867
|
+
for (const child of import_node_fs14.default.readdirSync(dir, { withFileTypes: true }))
|
|
11682
11868
|
if (child.isDirectory() && !child.name.startsWith("."))
|
|
11683
|
-
pending.push(
|
|
11869
|
+
pending.push(import_node_path15.default.join(dir, child.name));
|
|
11684
11870
|
}
|
|
11685
11871
|
return packages;
|
|
11686
11872
|
}
|
|
11687
|
-
const candidate = entry.isa === "XCLocalSwiftPackageReference" ?
|
|
11688
|
-
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] : [];
|
|
11689
11875
|
})
|
|
11690
11876
|
)
|
|
11691
11877
|
];
|
|
@@ -11715,7 +11901,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11715
11901
|
if ((flag === "-framework" || flag === "-weak_framework") && name2)
|
|
11716
11902
|
sdkFrameworks.add(name2);
|
|
11717
11903
|
});
|
|
11718
|
-
const absolute = (raw) =>
|
|
11904
|
+
const absolute = (raw) => import_node_path15.default.resolve(ref.project.projectDir, expand(raw, settings2));
|
|
11719
11905
|
const requested = options.nativeModules;
|
|
11720
11906
|
const includeBinary = (name2, dir) => {
|
|
11721
11907
|
if (!requested || nativeTargets.has(ref) || requested.includes(name2) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module3) => requested.includes(module3)))
|
|
@@ -11727,14 +11913,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11727
11913
|
for (const directory of expandSearchPath(absolute(raw), searchRules)) {
|
|
11728
11914
|
if (frameworkSearchDirectories.has(directory)) continue;
|
|
11729
11915
|
frameworkSearchDirectories.add(directory);
|
|
11730
|
-
if (!
|
|
11916
|
+
if (!import_node_fs14.default.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
|
|
11731
11917
|
continue;
|
|
11732
|
-
for (const entry of
|
|
11918
|
+
for (const entry of import_node_fs14.default.readdirSync(directory, { withFileTypes: true })) {
|
|
11733
11919
|
const name2 = /^(.+)\.framework$/.exec(entry.name)?.[1];
|
|
11734
11920
|
if (!name2 || byProduct.has(entry.name) || searchedFrameworks.has(name2))
|
|
11735
11921
|
continue;
|
|
11736
|
-
const file =
|
|
11737
|
-
if (
|
|
11922
|
+
const file = import_node_path15.default.join(directory, entry.name);
|
|
11923
|
+
if (import_node_fs14.default.statSync(file, { throwIfNoEntry: false })?.isDirectory())
|
|
11738
11924
|
searchedFrameworks.set(name2, file);
|
|
11739
11925
|
}
|
|
11740
11926
|
}
|
|
@@ -11742,9 +11928,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11742
11928
|
}
|
|
11743
11929
|
for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
|
|
11744
11930
|
const dir = absolute(raw);
|
|
11745
|
-
const modulemap =
|
|
11746
|
-
if (!
|
|
11747
|
-
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"));
|
|
11748
11934
|
if (name2 && !binaryFrameworks.has(name2)) includeBinary(name2, dir);
|
|
11749
11935
|
}
|
|
11750
11936
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -11753,7 +11939,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11753
11939
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
11754
11940
|
for (const raw of list(phase.inputFileListPaths)) {
|
|
11755
11941
|
const file = absolute(raw);
|
|
11756
|
-
if (!
|
|
11942
|
+
if (!import_node_fs14.default.existsSync(file)) continue;
|
|
11757
11943
|
xcconfigs.add(file);
|
|
11758
11944
|
inputs.push(...fileListEntries(file, absolute));
|
|
11759
11945
|
}
|
|
@@ -11818,7 +12004,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11818
12004
|
...productAttributes.get(dependencyId)?.length ? { attributes: productAttributes.get(dependencyId) } : {},
|
|
11819
12005
|
source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
|
|
11820
12006
|
kind: "local",
|
|
11821
|
-
dir:
|
|
12007
|
+
dir: import_node_path15.default.resolve(
|
|
11822
12008
|
project.projectDir,
|
|
11823
12009
|
str(reference.relativePath) ?? ""
|
|
11824
12010
|
)
|
|
@@ -11852,10 +12038,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11852
12038
|
continue;
|
|
11853
12039
|
}
|
|
11854
12040
|
if (tree2 === "BUILT_PRODUCTS_DIR" || tree2 === "DEVELOPER_DIR" || // a target in the workspace builds it, so it exists only after that build
|
|
11855
|
-
byProduct.has(
|
|
12041
|
+
byProduct.has(import_node_path15.default.basename(rawPath)))
|
|
11856
12042
|
continue;
|
|
11857
12043
|
const resolved = fileId ? project.resolvePath(fileId) : null;
|
|
11858
|
-
if (fileId && resolved !== null && !
|
|
12044
|
+
if (fileId && resolved !== null && !import_node_fs14.default.existsSync(resolved))
|
|
11859
12045
|
throw new Error(
|
|
11860
12046
|
`${str(target.name) ?? "target"}: linked framework ${name2} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
|
|
11861
12047
|
);
|
|
@@ -11878,7 +12064,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11878
12064
|
({ product }) => !options.nativeModules || nativeTargets.has(built.ref) || options.nativeModules.includes(product)
|
|
11879
12065
|
);
|
|
11880
12066
|
const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
|
|
11881
|
-
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();
|
|
11882
12068
|
if (packageResolved.length === 0) {
|
|
11883
12069
|
const requirements = remotePackageRequirements(projects);
|
|
11884
12070
|
if (requirements.length > 0) {
|
|
@@ -11929,14 +12115,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11929
12115
|
} : {},
|
|
11930
12116
|
rootDir: commonAncestor(
|
|
11931
12117
|
[
|
|
11932
|
-
workspace ?
|
|
12118
|
+
workspace ? import_node_path15.default.dirname(workspace) : app.project.projectDir,
|
|
11933
12119
|
...used.map((project) => project.projectDir),
|
|
11934
12120
|
...localPackageDirs,
|
|
11935
12121
|
...linkedProducts.flatMap(
|
|
11936
|
-
({ source }) => source.kind === "local" &&
|
|
12122
|
+
({ source }) => source.kind === "local" && import_node_fs14.default.existsSync(source.dir) ? [source.dir] : []
|
|
11937
12123
|
),
|
|
11938
12124
|
...new Set(podSourceDirs)
|
|
11939
|
-
].map((dir) =>
|
|
12125
|
+
].map((dir) => import_node_fs14.default.realpathSync.native(dir))
|
|
11940
12126
|
),
|
|
11941
12127
|
projectFiles: [
|
|
11942
12128
|
.../* @__PURE__ */ new Set([
|
|
@@ -11957,7 +12143,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
11957
12143
|
resourceProducts,
|
|
11958
12144
|
linkedProducts,
|
|
11959
12145
|
localPackageDirs: [
|
|
11960
|
-
...new Set(localPackageDirs.map((dir) =>
|
|
12146
|
+
...new Set(localPackageDirs.map((dir) => import_node_fs14.default.realpathSync.native(dir)))
|
|
11961
12147
|
].sort(),
|
|
11962
12148
|
binaryFrameworks: [...binaryFrameworks].map(([name2, file]) => ({ name: name2, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
|
|
11963
12149
|
sdkFrameworks: [...sdkFrameworks].filter(
|
|
@@ -11989,13 +12175,13 @@ const result = JSON.stringify(getConfig(root, { skipSDKVersionRequirement: true
|
|
|
11989
12175
|
if (Buffer.byteLength(result) > 1024 * 1024) throw new Error('Expo native configuration exceeds 1 MiB.');
|
|
11990
12176
|
writeFileSync(process.argv[2], result, { mode: 0o600 });`;
|
|
11991
12177
|
function hasExpoConfig(projectRoot) {
|
|
11992
|
-
const appJsonPath =
|
|
11993
|
-
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;
|
|
11994
12180
|
const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
|
|
11995
12181
|
(value) => isRecord(value) && typeof value.googleServicesFile === "string"
|
|
11996
12182
|
));
|
|
11997
12183
|
return staticExpo || ["app.config.js", "app.config.ts", "app.config.cjs", "app.config.mjs"].some(
|
|
11998
|
-
(name2) =>
|
|
12184
|
+
(name2) => import_node_fs15.default.existsSync(import_node_path16.default.join(projectRoot, name2))
|
|
11999
12185
|
);
|
|
12000
12186
|
}
|
|
12001
12187
|
function expoConfigArgs(projectRoot, resultPath) {
|
|
@@ -12003,7 +12189,7 @@ function expoConfigArgs(projectRoot, resultPath) {
|
|
|
12003
12189
|
"--input-type=commonjs",
|
|
12004
12190
|
"-e",
|
|
12005
12191
|
EXPO_CONFIG_SCRIPT,
|
|
12006
|
-
|
|
12192
|
+
import_node_path16.default.resolve(projectRoot),
|
|
12007
12193
|
resultPath
|
|
12008
12194
|
];
|
|
12009
12195
|
}
|
|
@@ -12017,17 +12203,17 @@ function readExpoConfigResult(resultPath, status, signal, stderr) {
|
|
|
12017
12203
|
throw new Error(
|
|
12018
12204
|
stderr || (signal ? `Expo native configuration evaluation was killed by ${signal}.` : "Expo native configuration evaluation failed.")
|
|
12019
12205
|
);
|
|
12020
|
-
const resolved = JSON.parse(
|
|
12206
|
+
const resolved = JSON.parse(import_node_fs15.default.readFileSync(resultPath, "utf8"));
|
|
12021
12207
|
if (!isRecord(resolved)) throw new Error("Expo native configuration is unavailable.");
|
|
12022
12208
|
return resolved;
|
|
12023
12209
|
}
|
|
12024
|
-
var resultDirectory = () =>
|
|
12210
|
+
var resultDirectory = () => import_node_fs15.default.mkdtempSync(import_node_path16.default.join(import_node_os2.default.tmpdir(), "peach-expo-config-"));
|
|
12025
12211
|
function readExpoConfig(projectRoot) {
|
|
12026
12212
|
if (!hasExpoConfig(projectRoot)) return {};
|
|
12027
12213
|
const directory = resultDirectory();
|
|
12028
|
-
const resultPath =
|
|
12214
|
+
const resultPath = import_node_path16.default.join(directory, "config.json");
|
|
12029
12215
|
try {
|
|
12030
|
-
const child = (0,
|
|
12216
|
+
const child = (0, import_node_child_process7.spawnSync)("node", expoConfigArgs(projectRoot, resultPath), {
|
|
12031
12217
|
cwd: projectRoot,
|
|
12032
12218
|
encoding: "utf8",
|
|
12033
12219
|
stdio: ["ignore", "ignore", "pipe"],
|
|
@@ -12037,7 +12223,7 @@ function readExpoConfig(projectRoot) {
|
|
|
12037
12223
|
if (child.error) throw child.error;
|
|
12038
12224
|
return readExpoConfigResult(resultPath, child.status, child.signal, child.stderr);
|
|
12039
12225
|
} finally {
|
|
12040
|
-
|
|
12226
|
+
import_node_fs15.default.rmSync(directory, { recursive: true, force: true });
|
|
12041
12227
|
}
|
|
12042
12228
|
}
|
|
12043
12229
|
var HELPER_DEPTH = 3;
|
|
@@ -12085,7 +12271,7 @@ function splitClauses(condition) {
|
|
|
12085
12271
|
function findHelper(type, name2, label, sources) {
|
|
12086
12272
|
const found = [];
|
|
12087
12273
|
for (const file of sources) {
|
|
12088
|
-
const raw =
|
|
12274
|
+
const raw = import_node_fs15.default.readFileSync(file, "utf8");
|
|
12089
12275
|
const blank = blankSwiftObjcLiterals(raw);
|
|
12090
12276
|
if (file.endsWith(".swift") && label === void 0) {
|
|
12091
12277
|
const owners = type ? [
|
|
@@ -12171,7 +12357,7 @@ function evaluateSwiftBody(body, scope, depth) {
|
|
|
12171
12357
|
}
|
|
12172
12358
|
function evaluateObjcBody(body, bundle, constants, scope) {
|
|
12173
12359
|
const plists = scope.resources.filter(
|
|
12174
|
-
(file) =>
|
|
12360
|
+
(file) => import_node_path16.default.basename(file) === "GoogleService-Info.plist"
|
|
12175
12361
|
);
|
|
12176
12362
|
const variables = /* @__PURE__ */ new Map();
|
|
12177
12363
|
const literal2 = (text2) => {
|
|
@@ -12214,7 +12400,7 @@ function evaluateObjcBody(body, bundle, constants, scope) {
|
|
|
12214
12400
|
variables.set(name2, plists.length === 1 ? plists[0] : void 0);
|
|
12215
12401
|
} else if (dictionary && variables.has(dictionary[1])) {
|
|
12216
12402
|
const file = variables.get(dictionary[1]);
|
|
12217
|
-
const parsed = typeof file === "string" ? parsePlistSource(
|
|
12403
|
+
const parsed = typeof file === "string" ? parsePlistSource(import_node_fs15.default.readFileSync(file, "utf8")) : void 0;
|
|
12218
12404
|
variables.set(name2, isRecord(parsed) ? parsed : void 0);
|
|
12219
12405
|
} else if (entry && variables.has(entry[1])) {
|
|
12220
12406
|
const key = literal2(entry[2]);
|
|
@@ -12227,7 +12413,7 @@ function evaluateObjcBody(body, bundle, constants, scope) {
|
|
|
12227
12413
|
}
|
|
12228
12414
|
function evaluateClauses(clauses, scope, bound, depth) {
|
|
12229
12415
|
const sources = scope.resources.filter(
|
|
12230
|
-
(file) =>
|
|
12416
|
+
(file) => import_node_path16.default.basename(file) === "GoogleService-Info.plist"
|
|
12231
12417
|
);
|
|
12232
12418
|
for (const clause of clauses) {
|
|
12233
12419
|
if (clause === "true") continue;
|
|
@@ -12244,7 +12430,7 @@ function evaluateClauses(clauses, scope, bound, depth) {
|
|
|
12244
12430
|
const dictionary = /^let\s+(\w+)\s*=\s*NSDictionary\s*\(\s*contentsOfFile:\s*(\w+)\s*\)$/.exec(clause);
|
|
12245
12431
|
if (dictionary && typeof bound.get(dictionary[2]) === "string") {
|
|
12246
12432
|
const parsed = parsePlistSource(
|
|
12247
|
-
|
|
12433
|
+
import_node_fs15.default.readFileSync(String(bound.get(dictionary[2])), "utf8")
|
|
12248
12434
|
);
|
|
12249
12435
|
if (!isRecord(parsed)) return false;
|
|
12250
12436
|
bound.set(dictionary[1], parsed);
|
|
@@ -12333,7 +12519,7 @@ function findDefaultConfigureCall(body, sources) {
|
|
|
12333
12519
|
const [, type, name2] = call;
|
|
12334
12520
|
for (const file of sources) {
|
|
12335
12521
|
if (!file.endsWith(".swift")) continue;
|
|
12336
|
-
const source = blankSwiftObjcLiterals(
|
|
12522
|
+
const source = blankSwiftObjcLiterals(import_node_fs15.default.readFileSync(file, "utf8"));
|
|
12337
12523
|
const declaration = new RegExp(
|
|
12338
12524
|
`\\b(?:enum|struct|class)\\s+${type}\\b[^{]*\\{`
|
|
12339
12525
|
).exec(source);
|
|
@@ -12355,10 +12541,10 @@ function readTargetGoogleServicesFile(projectRoot, container, target, prepareGen
|
|
|
12355
12541
|
prepareGeneratedSources
|
|
12356
12542
|
});
|
|
12357
12543
|
const delegates = app.allSources.filter(
|
|
12358
|
-
(file) => /^AppDelegate\.(swift|mm|m)$/.test(
|
|
12544
|
+
(file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path16.default.basename(file))
|
|
12359
12545
|
);
|
|
12360
12546
|
const defaultConfigured = delegates.some((file) => {
|
|
12361
|
-
const raw =
|
|
12547
|
+
const raw = import_node_fs15.default.readFileSync(file, "utf8");
|
|
12362
12548
|
const source = blankSwiftObjcLiterals(raw);
|
|
12363
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(
|
|
12364
12550
|
source
|
|
@@ -12429,17 +12615,17 @@ function readTargetGoogleServicesFile(projectRoot, container, target, prepareGen
|
|
|
12429
12615
|
return guarded;
|
|
12430
12616
|
});
|
|
12431
12617
|
if (!defaultConfigured) return null;
|
|
12432
|
-
const bundle =
|
|
12618
|
+
const bundle = import_node_path16.default.join(
|
|
12433
12619
|
app.settings("BUILT_PRODUCTS_DIR"),
|
|
12434
12620
|
app.settings("WRAPPER_NAME") || `${app.settings("PRODUCT_NAME")}.app`
|
|
12435
12621
|
);
|
|
12436
12622
|
const staged = app.copiedFiles.filter(
|
|
12437
|
-
({ from, to }) => to ===
|
|
12438
|
-
).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));
|
|
12439
12625
|
const resources = [
|
|
12440
12626
|
.../* @__PURE__ */ new Set([
|
|
12441
12627
|
...app.resources.filter(
|
|
12442
|
-
(file) => /^GoogleService-Info\.plist$/.test(
|
|
12628
|
+
(file) => /^GoogleService-Info\.plist$/.test(import_node_path16.default.basename(file))
|
|
12443
12629
|
),
|
|
12444
12630
|
...staged
|
|
12445
12631
|
])
|
|
@@ -12448,7 +12634,7 @@ function readTargetGoogleServicesFile(projectRoot, container, target, prepareGen
|
|
|
12448
12634
|
throw new Error(
|
|
12449
12635
|
"native Firebase default initialization requires one GoogleService-Info.plist build resource"
|
|
12450
12636
|
);
|
|
12451
|
-
return
|
|
12637
|
+
return import_node_path16.default.relative(import_node_fs15.default.realpathSync(projectRoot), resources[0]);
|
|
12452
12638
|
}
|
|
12453
12639
|
function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], iosTarget, config = readExpoConfig(projectRoot), prepareGeneratedSources = false) {
|
|
12454
12640
|
const result = {};
|
|
@@ -12469,8 +12655,8 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], i
|
|
|
12469
12655
|
const native = config[platform];
|
|
12470
12656
|
if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
|
|
12471
12657
|
try {
|
|
12472
|
-
const source =
|
|
12473
|
-
|
|
12658
|
+
const source = import_node_fs15.default.readFileSync(
|
|
12659
|
+
import_node_path16.default.resolve(projectRoot, native.googleServicesFile),
|
|
12474
12660
|
"utf8"
|
|
12475
12661
|
);
|
|
12476
12662
|
const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
|
|
@@ -12550,9 +12736,9 @@ init_is_record();
|
|
|
12550
12736
|
|
|
12551
12737
|
// src/native-app-identity-project.ts
|
|
12552
12738
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
12553
|
-
var
|
|
12554
|
-
var
|
|
12555
|
-
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);
|
|
12556
12742
|
init_is_record();
|
|
12557
12743
|
function nonEmptyString2(value) {
|
|
12558
12744
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
@@ -12600,9 +12786,13 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
12600
12786
|
}
|
|
12601
12787
|
}
|
|
12602
12788
|
const alternateSetting = settings?.("ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES") ?? "";
|
|
12789
|
+
const catalogAlternateNames = [];
|
|
12603
12790
|
for (const match of alternateSetting.replace(/\\"/g, '"').matchAll(/"([^"]*)"|([^\s(),]+)/g)) {
|
|
12604
12791
|
const val = match[1] ?? match[2];
|
|
12605
|
-
if (val)
|
|
12792
|
+
if (val) {
|
|
12793
|
+
alternateIconNames.add(val);
|
|
12794
|
+
catalogAlternateNames.push(val);
|
|
12795
|
+
}
|
|
12606
12796
|
}
|
|
12607
12797
|
const permissionUsageDescriptions = {};
|
|
12608
12798
|
for (const [key, value] of Object.entries(dictionary)) {
|
|
@@ -12636,7 +12826,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
12636
12826
|
const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
|
|
12637
12827
|
const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
|
|
12638
12828
|
const rootModuleName = readRootModuleName(
|
|
12639
|
-
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"))
|
|
12640
12830
|
);
|
|
12641
12831
|
return stampNativeBuildSdk({
|
|
12642
12832
|
...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
|
|
@@ -12658,20 +12848,21 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
12658
12848
|
googleSignIn: readGoogleSignInConfiguration(
|
|
12659
12849
|
dictionary,
|
|
12660
12850
|
Object.fromEntries(
|
|
12661
|
-
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"))])
|
|
12662
12852
|
)
|
|
12663
12853
|
),
|
|
12664
12854
|
supportedInterfaceOrientations,
|
|
12665
12855
|
ipadSupportedInterfaceOrientations,
|
|
12666
12856
|
...defaultScreenOrientationMask ? { defaultScreenOrientationMask } : {},
|
|
12667
12857
|
alternateIconNames: [...alternateIconNames],
|
|
12858
|
+
bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => value),
|
|
12668
12859
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
12669
12860
|
app.resources,
|
|
12670
|
-
(file) =>
|
|
12861
|
+
(file) => import_node_fs18.default.readFileSync(file, "utf8"),
|
|
12671
12862
|
(file) => {
|
|
12672
|
-
const extension =
|
|
12863
|
+
const extension = import_node_path19.default.extname(file).toLowerCase();
|
|
12673
12864
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
12674
|
-
return `data:${contentType};base64,${
|
|
12865
|
+
return `data:${contentType};base64,${import_node_fs18.default.readFileSync(file).toString("base64")}`;
|
|
12675
12866
|
},
|
|
12676
12867
|
icons,
|
|
12677
12868
|
app.appIconName,
|
|
@@ -12701,11 +12892,11 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
12701
12892
|
const read = selectNativeAppIdentityReader(platform, {
|
|
12702
12893
|
android: () => null,
|
|
12703
12894
|
ios: () => {
|
|
12704
|
-
const nested =
|
|
12705
|
-
const iosRoot =
|
|
12895
|
+
const nested = import_node_path19.default.join(projectRoot, "ios");
|
|
12896
|
+
const iosRoot = import_node_fs18.default.existsSync(nested) ? nested : projectRoot;
|
|
12706
12897
|
const prefix2 = iosRoot === nested ? "ios/" : "";
|
|
12707
12898
|
const files = {};
|
|
12708
|
-
for (const entry of
|
|
12899
|
+
for (const entry of import_node_fs18.default.readdirSync(iosRoot, { withFileTypes: true })) {
|
|
12709
12900
|
if (entry.name === "Pods") continue;
|
|
12710
12901
|
if (entry.isDirectory()) {
|
|
12711
12902
|
const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : [
|
|
@@ -12713,17 +12904,17 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
12713
12904
|
"AppDelegate.swift",
|
|
12714
12905
|
"AppDelegate.mm",
|
|
12715
12906
|
"AppDelegate.m",
|
|
12716
|
-
...
|
|
12907
|
+
...import_node_fs18.default.readdirSync(import_node_path19.default.join(iosRoot, entry.name)).filter((name2) => name2.endsWith(".entitlements"))
|
|
12717
12908
|
];
|
|
12718
12909
|
for (const name2 of names) {
|
|
12719
12910
|
const relative3 = `${prefix2}${entry.name}/${name2}`;
|
|
12720
|
-
const file =
|
|
12721
|
-
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");
|
|
12722
12913
|
}
|
|
12723
12914
|
} else if (/AppDelegate\.(?:swift|mm|m)$|\.entitlements$/.test(entry.name)) {
|
|
12724
12915
|
const relative3 = `${prefix2}${entry.name}`;
|
|
12725
|
-
const file =
|
|
12726
|
-
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");
|
|
12727
12918
|
}
|
|
12728
12919
|
}
|
|
12729
12920
|
const identity = extractNativeAppIdentityFromFiles(
|
|
@@ -12740,41 +12931,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
12740
12931
|
function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
12741
12932
|
const files = {};
|
|
12742
12933
|
if (androidMergedManifest) {
|
|
12743
|
-
const file =
|
|
12744
|
-
if (!
|
|
12745
|
-
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");
|
|
12746
12937
|
} else {
|
|
12747
|
-
const androidRoot =
|
|
12748
|
-
if (!
|
|
12938
|
+
const androidRoot = import_node_path19.default.join(projectRoot, "android");
|
|
12939
|
+
if (!import_node_fs18.default.existsSync(androidRoot)) return null;
|
|
12749
12940
|
const collect = (directory) => {
|
|
12750
|
-
for (const entry of
|
|
12751
|
-
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);
|
|
12752
12943
|
if (entry.isDirectory()) collect(file);
|
|
12753
12944
|
else if (entry.isFile() && entry.name === "AndroidManifest.xml")
|
|
12754
|
-
files[
|
|
12945
|
+
files[import_node_path19.default.relative(projectRoot, file).split(import_node_path19.default.sep).join("/")] = import_node_fs18.default.readFileSync(file, "utf8");
|
|
12755
12946
|
}
|
|
12756
12947
|
};
|
|
12757
|
-
for (const module2 of
|
|
12948
|
+
for (const module2 of import_node_fs18.default.readdirSync(androidRoot, { withFileTypes: true })) {
|
|
12758
12949
|
if (!module2.isDirectory()) continue;
|
|
12759
|
-
const outputs =
|
|
12950
|
+
const outputs = import_node_path19.default.join(
|
|
12760
12951
|
androidRoot,
|
|
12761
12952
|
module2.name,
|
|
12762
12953
|
"build/intermediates/merged_manifests"
|
|
12763
12954
|
);
|
|
12764
|
-
if (
|
|
12955
|
+
if (import_node_fs18.default.existsSync(outputs)) collect(outputs);
|
|
12765
12956
|
}
|
|
12766
12957
|
}
|
|
12767
12958
|
for (const manifest of Object.keys(files)) {
|
|
12768
12959
|
const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
|
|
12769
12960
|
if (!resourceDirectory) continue;
|
|
12770
|
-
const absolute =
|
|
12771
|
-
if (!
|
|
12772
|
-
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 })) {
|
|
12773
12964
|
if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
|
|
12774
|
-
for (const resource of
|
|
12965
|
+
for (const resource of import_node_fs18.default.readdirSync(import_node_path19.default.join(absolute, entry.name))) {
|
|
12775
12966
|
if (!resource.endsWith(".xml")) continue;
|
|
12776
12967
|
const file = `${resourceDirectory}/${entry.name}/${resource}`;
|
|
12777
|
-
files[file] =
|
|
12968
|
+
files[file] = import_node_fs18.default.readFileSync(import_node_path19.default.resolve(projectRoot, file), "utf8");
|
|
12778
12969
|
}
|
|
12779
12970
|
}
|
|
12780
12971
|
}
|
|
@@ -12791,8 +12982,8 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
12791
12982
|
const app = readIosAppTarget(projectRoot, iosTarget, environment);
|
|
12792
12983
|
if (!app) return null;
|
|
12793
12984
|
const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
|
|
12794
|
-
const projectManifestPath =
|
|
12795
|
-
const projectRequire = (0,
|
|
12985
|
+
const projectManifestPath = import_node_path19.default.join(projectRoot, "package.json");
|
|
12986
|
+
const projectRequire = (0, import_node_module3.createRequire)(projectManifestPath);
|
|
12796
12987
|
let reanimatedManifestPath;
|
|
12797
12988
|
try {
|
|
12798
12989
|
reanimatedManifestPath = projectRequire.resolve(
|
|
@@ -12805,22 +12996,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
12805
12996
|
throw error;
|
|
12806
12997
|
}
|
|
12807
12998
|
const installedManifest = JSON.parse(
|
|
12808
|
-
|
|
12999
|
+
import_node_fs18.default.readFileSync(reanimatedManifestPath, "utf8")
|
|
12809
13000
|
);
|
|
12810
13001
|
const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
|
|
12811
13002
|
if (!installedVersion) throw new Error("Reanimated package version is malformed");
|
|
12812
13003
|
if (Number.parseInt(installedVersion, 10) < 4) return identity;
|
|
12813
13004
|
const defaults = JSON.parse(
|
|
12814
|
-
|
|
12815
|
-
|
|
12816
|
-
|
|
13005
|
+
import_node_fs18.default.readFileSync(
|
|
13006
|
+
import_node_path19.default.join(
|
|
13007
|
+
import_node_path19.default.dirname(reanimatedManifestPath),
|
|
12817
13008
|
"src/featureFlags/staticFlags.json"
|
|
12818
13009
|
),
|
|
12819
13010
|
"utf8"
|
|
12820
13011
|
)
|
|
12821
13012
|
);
|
|
12822
13013
|
if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
|
|
12823
|
-
const manifest = JSON.parse(
|
|
13014
|
+
const manifest = JSON.parse(import_node_fs18.default.readFileSync(projectManifestPath, "utf8"));
|
|
12824
13015
|
const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
|
|
12825
13016
|
const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
|
|
12826
13017
|
if (overrides !== void 0 && !isRecord(overrides)) {
|
|
@@ -15702,8 +15893,8 @@ var COMPAT_STUBS = {
|
|
|
15702
15893
|
|
|
15703
15894
|
// src/installed-native-build-options.ts
|
|
15704
15895
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
15705
|
-
var
|
|
15706
|
-
var
|
|
15896
|
+
var import_node_fs19 = __toESM(require("node:fs"), 1);
|
|
15897
|
+
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
15707
15898
|
init_version_range();
|
|
15708
15899
|
var RIVE_PACKAGE = "@rive-app/react-native";
|
|
15709
15900
|
var RIVE_05 = [">=0.5.0 <0.6.0"];
|
|
@@ -15712,10 +15903,10 @@ function missing(error) {
|
|
|
15712
15903
|
}
|
|
15713
15904
|
function answerSync(step) {
|
|
15714
15905
|
try {
|
|
15715
|
-
if (step.type === "realpath") return
|
|
15716
|
-
if (step.type === "read") return
|
|
15717
|
-
if (step.type === "isDirectory") return
|
|
15718
|
-
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) => ({
|
|
15719
15910
|
name: entry.name,
|
|
15720
15911
|
directory: entry.isDirectory(),
|
|
15721
15912
|
symbolicLink: entry.isSymbolicLink()
|
|
@@ -15727,11 +15918,11 @@ function answerSync(step) {
|
|
|
15727
15918
|
}
|
|
15728
15919
|
async function answerAsync(step) {
|
|
15729
15920
|
try {
|
|
15730
|
-
if (step.type === "realpath") return await
|
|
15731
|
-
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");
|
|
15732
15923
|
if (step.type === "isDirectory")
|
|
15733
|
-
return (await
|
|
15734
|
-
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(
|
|
15735
15926
|
(entry) => ({
|
|
15736
15927
|
name: entry.name,
|
|
15737
15928
|
directory: entry.isDirectory(),
|
|
@@ -15764,7 +15955,7 @@ function* rubyFiles(directory, seen, iosRoot = false) {
|
|
|
15764
15955
|
const files = [];
|
|
15765
15956
|
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
15766
15957
|
if (iosRoot && (entry.name === "Pods" || entry.name === "build")) continue;
|
|
15767
|
-
const target =
|
|
15958
|
+
const target = import_node_path20.default.join(directory, entry.name);
|
|
15768
15959
|
let isDirectory2 = entry.directory;
|
|
15769
15960
|
if (entry.symbolicLink)
|
|
15770
15961
|
isDirectory2 = (yield { type: "isDirectory", path: target }) === true;
|
|
@@ -15777,7 +15968,7 @@ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
|
|
|
15777
15968
|
let sensorOptions = {};
|
|
15778
15969
|
const sensors = versions["expo-sensors"];
|
|
15779
15970
|
if (sensors && resolveCompatVersionRange([">=58.0.4 <59.0.0"], sensors).status === "matched") {
|
|
15780
|
-
const file =
|
|
15971
|
+
const file = import_node_path20.default.join(projectRoot, "ios", "Podfile.properties.json");
|
|
15781
15972
|
const source = yield { type: "read", path: file };
|
|
15782
15973
|
if (source !== null && typeof source !== "string")
|
|
15783
15974
|
throw new Error(`cannot inspect ${file}`);
|
|
@@ -15793,8 +15984,8 @@ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
|
|
|
15793
15984
|
if (!needsRiveOptions(versions)) return sensorOptions;
|
|
15794
15985
|
if (environment.USE_RIVE_LEGACY === "1" || environment.USE_RIVE_LEGACY === "true")
|
|
15795
15986
|
return { ...sensorOptions, [RIVE_PACKAGE]: { USE_RIVE_LEGACY: true } };
|
|
15796
|
-
const ios =
|
|
15797
|
-
const podfile =
|
|
15987
|
+
const ios = import_node_path20.default.join(projectRoot, "ios");
|
|
15988
|
+
const podfile = import_node_path20.default.join(ios, "Podfile");
|
|
15798
15989
|
const files = [podfile, ...yield* rubyFiles(ios, /* @__PURE__ */ new Set(), true)];
|
|
15799
15990
|
let value = false;
|
|
15800
15991
|
let assigned = false;
|
|
@@ -16060,9 +16251,9 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
16060
16251
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
16061
16252
|
var import_child_process = require("child_process");
|
|
16062
16253
|
var import_promises = require("fs/promises");
|
|
16063
|
-
var
|
|
16254
|
+
var import_node_fs20 = require("node:fs");
|
|
16064
16255
|
var import_node_os3 = require("node:os");
|
|
16065
|
-
var
|
|
16256
|
+
var import_node_path21 = require("node:path");
|
|
16066
16257
|
init_backend_origin();
|
|
16067
16258
|
init_config();
|
|
16068
16259
|
|
|
@@ -16202,8 +16393,8 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
16202
16393
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
16203
16394
|
|
|
16204
16395
|
// scripts/dev-server-scanner.ts
|
|
16205
|
-
var LISTENER_LOCK_PATH = (0,
|
|
16206
|
-
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");
|
|
16207
16398
|
var LISTENER_LOCK_STALE_MS = 25e3;
|
|
16208
16399
|
var LISTENER_LOCK_WAIT_MS = 8e3;
|
|
16209
16400
|
function sleep(ms) {
|
|
@@ -16221,8 +16412,8 @@ function pidIsAlive(pid) {
|
|
|
16221
16412
|
}
|
|
16222
16413
|
function readLockOwner() {
|
|
16223
16414
|
try {
|
|
16224
|
-
const raw = (0,
|
|
16225
|
-
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;
|
|
16226
16417
|
const pid = Number(raw.split("-")[0]);
|
|
16227
16418
|
return { raw, pid: Number.isInteger(pid) ? pid : -1, mtimeMs };
|
|
16228
16419
|
} catch {
|
|
@@ -16235,15 +16426,15 @@ function lockIsAbandoned(owner) {
|
|
|
16235
16426
|
}
|
|
16236
16427
|
function clearLock(raw) {
|
|
16237
16428
|
try {
|
|
16238
|
-
if ((0,
|
|
16239
|
-
(0,
|
|
16429
|
+
if ((0, import_node_fs20.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
|
|
16430
|
+
(0, import_node_fs20.unlinkSync)(LISTENER_LOCK_PATH);
|
|
16240
16431
|
} catch {
|
|
16241
16432
|
}
|
|
16242
16433
|
}
|
|
16243
16434
|
function readResult() {
|
|
16244
16435
|
try {
|
|
16245
16436
|
const parsed = JSON.parse(
|
|
16246
|
-
(0,
|
|
16437
|
+
(0, import_node_fs20.readFileSync)(LISTENER_RESULT_PATH, "utf8")
|
|
16247
16438
|
);
|
|
16248
16439
|
if (!parsed || typeof parsed.token !== "string" || typeof parsed.key !== "string")
|
|
16249
16440
|
return null;
|
|
@@ -16254,8 +16445,8 @@ function readResult() {
|
|
|
16254
16445
|
}
|
|
16255
16446
|
function publishResult(payload) {
|
|
16256
16447
|
const tmp = `${LISTENER_RESULT_PATH}.${process.pid}.tmp`;
|
|
16257
|
-
(0,
|
|
16258
|
-
(0,
|
|
16448
|
+
(0, import_node_fs20.writeFileSync)(tmp, JSON.stringify(payload));
|
|
16449
|
+
(0, import_node_fs20.renameSync)(tmp, LISTENER_RESULT_PATH);
|
|
16259
16450
|
}
|
|
16260
16451
|
function throwPublished(payload) {
|
|
16261
16452
|
throw Object.assign(new Error(payload.message || "listener scan failed"), {
|
|
@@ -16298,7 +16489,7 @@ async function withListenerLock(key, body) {
|
|
|
16298
16489
|
for (; ; ) {
|
|
16299
16490
|
let fd = null;
|
|
16300
16491
|
try {
|
|
16301
|
-
fd = (0,
|
|
16492
|
+
fd = (0, import_node_fs20.openSync)(LISTENER_LOCK_PATH, "wx");
|
|
16302
16493
|
} catch (error) {
|
|
16303
16494
|
const code = error instanceof Error && "code" in error ? error.code : "";
|
|
16304
16495
|
if (code !== "EEXIST") throw error;
|
|
@@ -16307,7 +16498,7 @@ async function withListenerLock(key, body) {
|
|
|
16307
16498
|
if (owner) clearLock(owner.raw);
|
|
16308
16499
|
else {
|
|
16309
16500
|
try {
|
|
16310
|
-
(0,
|
|
16501
|
+
(0, import_node_fs20.unlinkSync)(LISTENER_LOCK_PATH);
|
|
16311
16502
|
} catch {
|
|
16312
16503
|
}
|
|
16313
16504
|
}
|
|
@@ -16323,7 +16514,7 @@ async function withListenerLock(key, body) {
|
|
|
16323
16514
|
}
|
|
16324
16515
|
if (fd === null) continue;
|
|
16325
16516
|
try {
|
|
16326
|
-
(0,
|
|
16517
|
+
(0, import_node_fs20.writeSync)(fd, token);
|
|
16327
16518
|
try {
|
|
16328
16519
|
const value = await body();
|
|
16329
16520
|
publishResult({ token, key, ok: true, value });
|
|
@@ -16340,7 +16531,7 @@ async function withListenerLock(key, body) {
|
|
|
16340
16531
|
}
|
|
16341
16532
|
} finally {
|
|
16342
16533
|
try {
|
|
16343
|
-
(0,
|
|
16534
|
+
(0, import_node_fs20.closeSync)(fd);
|
|
16344
16535
|
} catch {
|
|
16345
16536
|
}
|
|
16346
16537
|
clearLock(token);
|
|
@@ -16867,7 +17058,7 @@ function parseIpv6(text2) {
|
|
|
16867
17058
|
|
|
16868
17059
|
// src/host/network-policy.ts
|
|
16869
17060
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
16870
|
-
var
|
|
17061
|
+
var import_node_path22 = require("node:path");
|
|
16871
17062
|
var import_node_url = require("node:url");
|
|
16872
17063
|
var NETWORK_POLICY_TIMEOUT_MS = 1e4;
|
|
16873
17064
|
var NetworkPolicyDeniedError = class extends Error {
|
|
@@ -16920,7 +17111,7 @@ function createNetworkAuthorizer(policy) {
|
|
|
16920
17111
|
};
|
|
16921
17112
|
}
|
|
16922
17113
|
async function loadNetworkPolicy(file) {
|
|
16923
|
-
if (!(0,
|
|
17114
|
+
if (!(0, import_node_path22.isAbsolute)(file)) {
|
|
16924
17115
|
throw new Error(`PEACH_NETWORK_POLICY must be an absolute path: ${file}`);
|
|
16925
17116
|
}
|
|
16926
17117
|
const loaded3 = await import(
|
|
@@ -17014,12 +17205,12 @@ var import_promises3 = require("stream/promises");
|
|
|
17014
17205
|
// src/cli-runtime.ts
|
|
17015
17206
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
17016
17207
|
var import_node_crypto6 = require("node:crypto");
|
|
17017
|
-
var
|
|
17018
|
-
var
|
|
17019
|
-
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");
|
|
17020
17211
|
|
|
17021
17212
|
// runtime-companion.json
|
|
17022
|
-
var runtime_companion_default = { abi: 1, sha256: "
|
|
17213
|
+
var runtime_companion_default = { abi: 1, sha256: "c63f83dd24fd36986b72da8da6b6a51edce0a2d061e3bc05d3439d22b1a86c91", file: "node/cli-c63f83dd24fd36986b72da8da6b6a51edce0a2d061e3bc05d3439d22b1a86c91.cjs" };
|
|
17023
17214
|
|
|
17024
17215
|
// src/cli-runtime.ts
|
|
17025
17216
|
var CLI_COMPANION_ABI = 1;
|
|
@@ -17027,12 +17218,12 @@ function cliCompanionPath() {
|
|
|
17027
17218
|
return `node/cli-${runtime_companion_default.sha256}.cjs`;
|
|
17028
17219
|
}
|
|
17029
17220
|
function verifyCliCompanion(root) {
|
|
17030
|
-
verifyCompanionFile((0,
|
|
17221
|
+
verifyCompanionFile((0, import_node_path23.join)(root, cliCompanionPath()));
|
|
17031
17222
|
}
|
|
17032
17223
|
function verifyCompanionFile(file) {
|
|
17033
17224
|
let bytes;
|
|
17034
17225
|
try {
|
|
17035
|
-
bytes = (0,
|
|
17226
|
+
bytes = (0, import_node_fs21.readFileSync)(file);
|
|
17036
17227
|
} catch (error) {
|
|
17037
17228
|
if (error instanceof Error) {
|
|
17038
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" : ""}` : "";
|
|
@@ -17052,8 +17243,8 @@ function getCliRuntime() {
|
|
|
17052
17243
|
if (loaded2) return loaded2.runtime;
|
|
17053
17244
|
const root = peachRuntimeRoot();
|
|
17054
17245
|
verifyCliCompanion(root);
|
|
17055
|
-
const require2 = (0,
|
|
17056
|
-
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()));
|
|
17057
17248
|
if (runtime.cliCompanionAbi !== CLI_COMPANION_ABI) {
|
|
17058
17249
|
throw new Error(
|
|
17059
17250
|
"Incompatible Peach runtime companion ABI; run `peach runtime install`"
|