peachsim 0.1.2176 → 0.1.2179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +2205 -1861
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +837 -571
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1732 -1396
- package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +59 -54
- 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 +2223 -1876
- 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 +1587 -1319
- package/dist-lib/vite.cjs +2 -2
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNChangeHistoryEvent.h +116 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNChangeHistoryFetchRequest.h +79 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContact+NSItemProvider.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContact+Predicates.h +60 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContact.h +169 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactFetchRequest.h +72 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactFormatter.h +136 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactProperty.h +47 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactRelation.h +287 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactStore.h +242 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactVCardSerialization.h +62 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContactsUserDefaults.h +29 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContainer+Predicates.h +29 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNContainer.h +44 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNError.h +64 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNFetchRequest.h +17 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNFetchResult.h +26 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNGroup+Predicates.h +28 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNGroup.h +34 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNInstantMessageAddress.h +52 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNLabeledValue.h +69 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNMutableContact.h +74 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNMutableGroup.h +25 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNMutablePostalAddress.h +35 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNPhoneNumber.h +44 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNPostalAddress.h +50 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNPostalAddressFormatter.h +91 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNSaveRequest.h +136 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/CNSocialProfile.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/Contacts.apinotes +28 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/Contacts.h +42 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Headers/ContactsDefines.h +14 -0
- package/sdk/ios/System/Library/Frameworks/Contacts.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/ContactsUI.framework/Headers/CNContactPickerViewController.h +92 -0
- package/sdk/ios/System/Library/Frameworks/ContactsUI.framework/Headers/CNContactViewController.h +157 -0
- package/sdk/ios/System/Library/Frameworks/ContactsUI.framework/Headers/ContactsUI.h +10 -0
- package/sdk/ios/System/Library/Frameworks/ContactsUI.framework/Headers/UIApplicationShortcutIcon+Contacts.h +22 -0
- package/sdk/ios/System/Library/Frameworks/ContactsUI.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchedResultsController.h +8 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKAlarm.h +114 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKCalendar.h +134 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKCalendarItem.h +129 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKError.h +105 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKEvent.h +205 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKEventStore.h +477 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKObject.h +34 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKParticipant.h +115 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKRecurrenceDayOfWeek.h +71 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKRecurrenceEnd.h +61 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKRecurrenceRule.h +193 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKReminder.h +80 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKSource.h +47 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKStructuredLocation.h +28 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKTypes.h +253 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKVirtualConferenceDescriptor.h +109 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EKVirtualConferenceProvider.h +63 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EventKit.apinotes +72 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EventKit.h +29 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Headers/EventKitDefines.h +30 -0
- package/sdk/ios/System/Library/Frameworks/EventKit.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PKDefines.h +26 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PKPushCredentials.h +37 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PKPushPayload.h +36 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PKPushRegistry.h +330 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PKVoIPPushMetadata.h +27 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PushKit.apinotes +43 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Headers/PushKit.h +12 -0
- package/sdk/ios/System/Library/Frameworks/PushKit.framework/Modules/module.modulemap +6 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/ARQuickLookPreviewItem.h +63 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLBase.h +34 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLFilePreviewRequest.h +32 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewController.h +174 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewItem.h +45 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewProvider.h +27 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewReply.h +106 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewSceneActivationConfiguration.h +41 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLPreviewingController.h +74 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailProvider.h +37 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailReply.h +67 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QLThumbnailRequest.h +33 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.apinotes +35 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QuickLook.h +30 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Headers/QuickLookUICore.h +12 -0
- package/sdk/ios/System/Library/Frameworks/QuickLook.framework/Modules/module.modulemap +8 -0
- package/src/core-data-entity-classes.ts +316 -0
- package/src/swift-host.ts +12 -0
- package/src/turbo-source.ts +89 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2179 | (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;
|
|
@@ -1173,10 +1173,10 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
1173
1173
|
var import_node_async_hooks2 = require("node:async_hooks");
|
|
1174
1174
|
var import_node_child_process43 = require("node:child_process");
|
|
1175
1175
|
var import_node_crypto40 = require("node:crypto");
|
|
1176
|
-
var
|
|
1176
|
+
var import_node_fs79 = __toESM(require("node:fs"), 1);
|
|
1177
1177
|
var import_node_module8 = require("node:module");
|
|
1178
1178
|
var import_node_os17 = __toESM(require("node:os"), 1);
|
|
1179
|
-
var
|
|
1179
|
+
var import_node_path76 = __toESM(require("node:path"), 1);
|
|
1180
1180
|
var import_node_url6 = require("node:url");
|
|
1181
1181
|
var import_node_util16 = require("node:util");
|
|
1182
1182
|
|
|
@@ -2589,17 +2589,17 @@ function visit(node, visitor) {
|
|
|
2589
2589
|
visit.BREAK = BREAK;
|
|
2590
2590
|
visit.SKIP = SKIP;
|
|
2591
2591
|
visit.REMOVE = REMOVE;
|
|
2592
|
-
function visit_(key2, node, visitor,
|
|
2593
|
-
const ctrl = callVisitor(key2, node, visitor,
|
|
2592
|
+
function visit_(key2, node, visitor, path66) {
|
|
2593
|
+
const ctrl = callVisitor(key2, node, visitor, path66);
|
|
2594
2594
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
2595
|
-
replaceNode(key2,
|
|
2596
|
-
return visit_(key2, ctrl, visitor,
|
|
2595
|
+
replaceNode(key2, path66, ctrl);
|
|
2596
|
+
return visit_(key2, ctrl, visitor, path66);
|
|
2597
2597
|
}
|
|
2598
2598
|
if (typeof ctrl !== "symbol") {
|
|
2599
2599
|
if (isCollection(node)) {
|
|
2600
|
-
|
|
2600
|
+
path66 = Object.freeze(path66.concat(node));
|
|
2601
2601
|
for (let i = 0; i < node.items.length; ++i) {
|
|
2602
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
2602
|
+
const ci = visit_(i, node.items[i], visitor, path66);
|
|
2603
2603
|
if (typeof ci === "number")
|
|
2604
2604
|
i = ci - 1;
|
|
2605
2605
|
else if (ci === BREAK)
|
|
@@ -2610,13 +2610,13 @@ function visit_(key2, node, visitor, path65) {
|
|
|
2610
2610
|
}
|
|
2611
2611
|
}
|
|
2612
2612
|
} else if (isPair(node)) {
|
|
2613
|
-
|
|
2614
|
-
const ck = visit_("key", node.key, visitor,
|
|
2613
|
+
path66 = Object.freeze(path66.concat(node));
|
|
2614
|
+
const ck = visit_("key", node.key, visitor, path66);
|
|
2615
2615
|
if (ck === BREAK)
|
|
2616
2616
|
return BREAK;
|
|
2617
2617
|
else if (ck === REMOVE)
|
|
2618
2618
|
node.key = null;
|
|
2619
|
-
const cv = visit_("value", node.value, visitor,
|
|
2619
|
+
const cv = visit_("value", node.value, visitor, path66);
|
|
2620
2620
|
if (cv === BREAK)
|
|
2621
2621
|
return BREAK;
|
|
2622
2622
|
else if (cv === REMOVE)
|
|
@@ -2637,17 +2637,17 @@ async function visitAsync(node, visitor) {
|
|
|
2637
2637
|
visitAsync.BREAK = BREAK;
|
|
2638
2638
|
visitAsync.SKIP = SKIP;
|
|
2639
2639
|
visitAsync.REMOVE = REMOVE;
|
|
2640
|
-
async function visitAsync_(key2, node, visitor,
|
|
2641
|
-
const ctrl = await callVisitor(key2, node, visitor,
|
|
2640
|
+
async function visitAsync_(key2, node, visitor, path66) {
|
|
2641
|
+
const ctrl = await callVisitor(key2, node, visitor, path66);
|
|
2642
2642
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
2643
|
-
replaceNode(key2,
|
|
2644
|
-
return visitAsync_(key2, ctrl, visitor,
|
|
2643
|
+
replaceNode(key2, path66, ctrl);
|
|
2644
|
+
return visitAsync_(key2, ctrl, visitor, path66);
|
|
2645
2645
|
}
|
|
2646
2646
|
if (typeof ctrl !== "symbol") {
|
|
2647
2647
|
if (isCollection(node)) {
|
|
2648
|
-
|
|
2648
|
+
path66 = Object.freeze(path66.concat(node));
|
|
2649
2649
|
for (let i = 0; i < node.items.length; ++i) {
|
|
2650
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
2650
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path66);
|
|
2651
2651
|
if (typeof ci === "number")
|
|
2652
2652
|
i = ci - 1;
|
|
2653
2653
|
else if (ci === BREAK)
|
|
@@ -2658,13 +2658,13 @@ async function visitAsync_(key2, node, visitor, path65) {
|
|
|
2658
2658
|
}
|
|
2659
2659
|
}
|
|
2660
2660
|
} else if (isPair(node)) {
|
|
2661
|
-
|
|
2662
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
2661
|
+
path66 = Object.freeze(path66.concat(node));
|
|
2662
|
+
const ck = await visitAsync_("key", node.key, visitor, path66);
|
|
2663
2663
|
if (ck === BREAK)
|
|
2664
2664
|
return BREAK;
|
|
2665
2665
|
else if (ck === REMOVE)
|
|
2666
2666
|
node.key = null;
|
|
2667
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
2667
|
+
const cv = await visitAsync_("value", node.value, visitor, path66);
|
|
2668
2668
|
if (cv === BREAK)
|
|
2669
2669
|
return BREAK;
|
|
2670
2670
|
else if (cv === REMOVE)
|
|
@@ -2691,23 +2691,23 @@ function initVisitor(visitor) {
|
|
|
2691
2691
|
}
|
|
2692
2692
|
return visitor;
|
|
2693
2693
|
}
|
|
2694
|
-
function callVisitor(key2, node, visitor,
|
|
2694
|
+
function callVisitor(key2, node, visitor, path66) {
|
|
2695
2695
|
if (typeof visitor === "function")
|
|
2696
|
-
return visitor(key2, node,
|
|
2696
|
+
return visitor(key2, node, path66);
|
|
2697
2697
|
if (isMap(node))
|
|
2698
|
-
return visitor.Map?.(key2, node,
|
|
2698
|
+
return visitor.Map?.(key2, node, path66);
|
|
2699
2699
|
if (isSeq(node))
|
|
2700
|
-
return visitor.Seq?.(key2, node,
|
|
2700
|
+
return visitor.Seq?.(key2, node, path66);
|
|
2701
2701
|
if (isPair(node))
|
|
2702
|
-
return visitor.Pair?.(key2, node,
|
|
2702
|
+
return visitor.Pair?.(key2, node, path66);
|
|
2703
2703
|
if (isScalar(node))
|
|
2704
|
-
return visitor.Scalar?.(key2, node,
|
|
2704
|
+
return visitor.Scalar?.(key2, node, path66);
|
|
2705
2705
|
if (isAlias(node))
|
|
2706
|
-
return visitor.Alias?.(key2, node,
|
|
2706
|
+
return visitor.Alias?.(key2, node, path66);
|
|
2707
2707
|
return void 0;
|
|
2708
2708
|
}
|
|
2709
|
-
function replaceNode(key2,
|
|
2710
|
-
const parent =
|
|
2709
|
+
function replaceNode(key2, path66, node) {
|
|
2710
|
+
const parent = path66[path66.length - 1];
|
|
2711
2711
|
if (isCollection(parent)) {
|
|
2712
2712
|
parent.items[key2] = node;
|
|
2713
2713
|
} else if (isPair(parent)) {
|
|
@@ -3206,10 +3206,10 @@ function createNode(value, tagName, ctx) {
|
|
|
3206
3206
|
}
|
|
3207
3207
|
|
|
3208
3208
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
3209
|
-
function collectionFromPath(schema4,
|
|
3209
|
+
function collectionFromPath(schema4, path66, value) {
|
|
3210
3210
|
let v6 = value;
|
|
3211
|
-
for (let i =
|
|
3212
|
-
const k =
|
|
3211
|
+
for (let i = path66.length - 1; i >= 0; --i) {
|
|
3212
|
+
const k = path66[i];
|
|
3213
3213
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
3214
3214
|
const a = [];
|
|
3215
3215
|
a[k] = v6;
|
|
@@ -3228,7 +3228,7 @@ function collectionFromPath(schema4, path65, value) {
|
|
|
3228
3228
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
3229
3229
|
});
|
|
3230
3230
|
}
|
|
3231
|
-
var isEmptyPath = (
|
|
3231
|
+
var isEmptyPath = (path66) => path66 == null || typeof path66 === "object" && !!path66[Symbol.iterator]().next().done;
|
|
3232
3232
|
var Collection = class extends NodeBase {
|
|
3233
3233
|
constructor(type, schema4) {
|
|
3234
3234
|
super(type);
|
|
@@ -3258,11 +3258,11 @@ var Collection = class extends NodeBase {
|
|
|
3258
3258
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
3259
3259
|
* that already exists in the map.
|
|
3260
3260
|
*/
|
|
3261
|
-
addIn(
|
|
3262
|
-
if (isEmptyPath(
|
|
3261
|
+
addIn(path66, value) {
|
|
3262
|
+
if (isEmptyPath(path66))
|
|
3263
3263
|
this.add(value);
|
|
3264
3264
|
else {
|
|
3265
|
-
const [key2, ...rest] =
|
|
3265
|
+
const [key2, ...rest] = path66;
|
|
3266
3266
|
const node = this.get(key2, true);
|
|
3267
3267
|
if (isCollection(node))
|
|
3268
3268
|
node.addIn(rest, value);
|
|
@@ -3276,8 +3276,8 @@ var Collection = class extends NodeBase {
|
|
|
3276
3276
|
* Removes a value from the collection.
|
|
3277
3277
|
* @returns `true` if the item was found and removed.
|
|
3278
3278
|
*/
|
|
3279
|
-
deleteIn(
|
|
3280
|
-
const [key2, ...rest] =
|
|
3279
|
+
deleteIn(path66) {
|
|
3280
|
+
const [key2, ...rest] = path66;
|
|
3281
3281
|
if (rest.length === 0)
|
|
3282
3282
|
return this.delete(key2);
|
|
3283
3283
|
const node = this.get(key2, true);
|
|
@@ -3291,8 +3291,8 @@ var Collection = class extends NodeBase {
|
|
|
3291
3291
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
3292
3292
|
* `true` (collections are always returned intact).
|
|
3293
3293
|
*/
|
|
3294
|
-
getIn(
|
|
3295
|
-
const [key2, ...rest] =
|
|
3294
|
+
getIn(path66, keepScalar) {
|
|
3295
|
+
const [key2, ...rest] = path66;
|
|
3296
3296
|
const node = this.get(key2, true);
|
|
3297
3297
|
if (rest.length === 0)
|
|
3298
3298
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -3310,8 +3310,8 @@ var Collection = class extends NodeBase {
|
|
|
3310
3310
|
/**
|
|
3311
3311
|
* Checks if the collection includes a value with the key `key`.
|
|
3312
3312
|
*/
|
|
3313
|
-
hasIn(
|
|
3314
|
-
const [key2, ...rest] =
|
|
3313
|
+
hasIn(path66) {
|
|
3314
|
+
const [key2, ...rest] = path66;
|
|
3315
3315
|
if (rest.length === 0)
|
|
3316
3316
|
return this.has(key2);
|
|
3317
3317
|
const node = this.get(key2, true);
|
|
@@ -3321,8 +3321,8 @@ var Collection = class extends NodeBase {
|
|
|
3321
3321
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
3322
3322
|
* boolean to add/remove the item from the set.
|
|
3323
3323
|
*/
|
|
3324
|
-
setIn(
|
|
3325
|
-
const [key2, ...rest] =
|
|
3324
|
+
setIn(path66, value) {
|
|
3325
|
+
const [key2, ...rest] = path66;
|
|
3326
3326
|
if (rest.length === 0) {
|
|
3327
3327
|
this.set(key2, value);
|
|
3328
3328
|
} else {
|
|
@@ -4911,9 +4911,9 @@ function visit2(cst, visitor) {
|
|
|
4911
4911
|
visit2.BREAK = BREAK2;
|
|
4912
4912
|
visit2.SKIP = SKIP2;
|
|
4913
4913
|
visit2.REMOVE = REMOVE2;
|
|
4914
|
-
visit2.itemAtPath = (cst,
|
|
4914
|
+
visit2.itemAtPath = (cst, path66) => {
|
|
4915
4915
|
let item = cst;
|
|
4916
|
-
for (const [field, index] of
|
|
4916
|
+
for (const [field, index] of path66) {
|
|
4917
4917
|
const tok = item?.[field];
|
|
4918
4918
|
if (tok && "items" in tok) {
|
|
4919
4919
|
item = tok.items[index];
|
|
@@ -4922,23 +4922,23 @@ visit2.itemAtPath = (cst, path65) => {
|
|
|
4922
4922
|
}
|
|
4923
4923
|
return item;
|
|
4924
4924
|
};
|
|
4925
|
-
visit2.parentCollection = (cst,
|
|
4926
|
-
const parent = visit2.itemAtPath(cst,
|
|
4927
|
-
const field =
|
|
4925
|
+
visit2.parentCollection = (cst, path66) => {
|
|
4926
|
+
const parent = visit2.itemAtPath(cst, path66.slice(0, -1));
|
|
4927
|
+
const field = path66[path66.length - 1][0];
|
|
4928
4928
|
const coll = parent?.[field];
|
|
4929
4929
|
if (coll && "items" in coll)
|
|
4930
4930
|
return coll;
|
|
4931
4931
|
throw new Error("Parent collection not found");
|
|
4932
4932
|
};
|
|
4933
|
-
function _visit(
|
|
4934
|
-
let ctrl = visitor(item,
|
|
4933
|
+
function _visit(path66, item, visitor) {
|
|
4934
|
+
let ctrl = visitor(item, path66);
|
|
4935
4935
|
if (typeof ctrl === "symbol")
|
|
4936
4936
|
return ctrl;
|
|
4937
4937
|
for (const field of ["key", "value"]) {
|
|
4938
4938
|
const token = item[field];
|
|
4939
4939
|
if (token && "items" in token) {
|
|
4940
4940
|
for (let i = 0; i < token.items.length; ++i) {
|
|
4941
|
-
const ci = _visit(Object.freeze(
|
|
4941
|
+
const ci = _visit(Object.freeze(path66.concat([[field, i]])), token.items[i], visitor);
|
|
4942
4942
|
if (typeof ci === "number")
|
|
4943
4943
|
i = ci - 1;
|
|
4944
4944
|
else if (ci === BREAK2)
|
|
@@ -4949,10 +4949,10 @@ function _visit(path65, item, visitor) {
|
|
|
4949
4949
|
}
|
|
4950
4950
|
}
|
|
4951
4951
|
if (typeof ctrl === "function" && field === "key")
|
|
4952
|
-
ctrl = ctrl(item,
|
|
4952
|
+
ctrl = ctrl(item, path66);
|
|
4953
4953
|
}
|
|
4954
4954
|
}
|
|
4955
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
4955
|
+
return typeof ctrl === "function" ? ctrl(item, path66) : ctrl;
|
|
4956
4956
|
}
|
|
4957
4957
|
|
|
4958
4958
|
// ../../node_modules/yaml/browser/dist/parse/lexer.js
|
|
@@ -5075,8 +5075,8 @@ function metadataValue(value, key2) {
|
|
|
5075
5075
|
if (!value || typeof value !== "object") return void 0;
|
|
5076
5076
|
return Object.getOwnPropertyDescriptor(value, key2)?.value;
|
|
5077
5077
|
}
|
|
5078
|
-
function readProjectJson(
|
|
5079
|
-
const text5 = readProjectMetadata(
|
|
5078
|
+
function readProjectJson(path66, files2 = nodeRepoFileReader) {
|
|
5079
|
+
const text5 = readProjectMetadata(path66, files2);
|
|
5080
5080
|
if (text5 === null) return null;
|
|
5081
5081
|
try {
|
|
5082
5082
|
const value = JSON.parse(text5);
|
|
@@ -5631,7 +5631,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
5631
5631
|
expoModule: moduleDir ? (0, import_node_path6.relative)(appDir, moduleDir) || "." : null,
|
|
5632
5632
|
optional: optional3,
|
|
5633
5633
|
swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
|
|
5634
|
-
(
|
|
5634
|
+
(path66) => path66.endsWith(".swift") && [...(readSmallFile(path66) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
|
|
5635
5635
|
(match) => match[1] === name3
|
|
5636
5636
|
)
|
|
5637
5637
|
) : false,
|
|
@@ -7235,10 +7235,10 @@ function isNativeAppIdentity(value) {
|
|
|
7235
7235
|
return false;
|
|
7236
7236
|
if (value.urlQuerySchemes !== void 0 && !Array.isArray(value.urlQuerySchemes))
|
|
7237
7237
|
return false;
|
|
7238
|
-
if (value.appIntentIdentifiers !== void 0 && (!Array.isArray(value.appIntentIdentifiers) || !value.appIntentIdentifiers.every((
|
|
7238
|
+
if (value.appIntentIdentifiers !== void 0 && (!Array.isArray(value.appIntentIdentifiers) || !value.appIntentIdentifiers.every((identifier2) => typeof identifier2 === "string")))
|
|
7239
7239
|
return false;
|
|
7240
7240
|
if (value.backgroundTaskIdentifiers !== void 0 && (!Array.isArray(value.backgroundTaskIdentifiers) || !value.backgroundTaskIdentifiers.every(
|
|
7241
|
-
(
|
|
7241
|
+
(identifier2) => typeof identifier2 === "string"
|
|
7242
7242
|
)))
|
|
7243
7243
|
return false;
|
|
7244
7244
|
if (value.backgroundModes !== void 0 && (!Array.isArray(value.backgroundModes) || !value.backgroundModes.every((mode) => typeof mode === "string")))
|
|
@@ -7616,8 +7616,8 @@ export *
|
|
|
7616
7616
|
}`;
|
|
7617
7617
|
}
|
|
7618
7618
|
function swiftPackageIdentity(url) {
|
|
7619
|
-
const
|
|
7620
|
-
return (
|
|
7619
|
+
const path66 = url.endsWith("/") ? url.slice(0, -1) : url;
|
|
7620
|
+
return (path66.split("/").pop() ?? path66).replace(/\.git$/, "").toLowerCase();
|
|
7621
7621
|
}
|
|
7622
7622
|
var withoutGlogModuleMap = (flags) => flags.filter(
|
|
7623
7623
|
(flag) => !(flag.startsWith("-fmodule-map-file=") && flag.endsWith("/glog.modulemap"))
|
|
@@ -8164,8 +8164,8 @@ var import_node_fs22 = require("node:fs");
|
|
|
8164
8164
|
var import_node_path18 = require("node:path");
|
|
8165
8165
|
var Refusal = class extends Error {
|
|
8166
8166
|
};
|
|
8167
|
-
var refuse = (
|
|
8168
|
-
throw new Refusal(`Generated asset symbols are unproven for ${
|
|
8167
|
+
var refuse = (path66, reason) => {
|
|
8168
|
+
throw new Refusal(`Generated asset symbols are unproven for ${path66}: ${reason}`);
|
|
8169
8169
|
};
|
|
8170
8170
|
var isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8171
8171
|
var scope = (source) => ({
|
|
@@ -8453,14 +8453,14 @@ function addAsset(into, asset) {
|
|
|
8453
8453
|
function checkStack(dir, type, devices) {
|
|
8454
8454
|
const sets = (parent, allowed) => (0, import_node_fs22.readdirSync)(parent, { withFileTypes: true }).flatMap((entry) => {
|
|
8455
8455
|
if (entry.name.startsWith(".") || entry.isFile()) return [];
|
|
8456
|
-
const
|
|
8456
|
+
const path66 = (0, import_node_path18.join)(parent, entry.name);
|
|
8457
8457
|
const extension = (0, import_node_path18.extname)(entry.name);
|
|
8458
8458
|
if (!entry.isDirectory() || !allowed.includes(extension))
|
|
8459
8459
|
return refuse(
|
|
8460
|
-
|
|
8460
|
+
path66,
|
|
8461
8461
|
`image stack content other than ${allowed.join(", ")} is unproven`
|
|
8462
8462
|
);
|
|
8463
|
-
return [{ path:
|
|
8463
|
+
return [{ path: path66, extension }];
|
|
8464
8464
|
});
|
|
8465
8465
|
for (const layer of sets(dir, [`.${type}layer`, ".imageset", ".colorset"])) {
|
|
8466
8466
|
if (layer.extension !== `.${type}layer`) continue;
|
|
@@ -8472,37 +8472,37 @@ function checkStack(dir, type, devices) {
|
|
|
8472
8472
|
function walk(dir, into, devices, extensions) {
|
|
8473
8473
|
for (const entry of (0, import_node_fs22.readdirSync)(dir, { withFileTypes: true })) {
|
|
8474
8474
|
if (entry.name.startsWith(".") || entry.isFile()) continue;
|
|
8475
|
-
const
|
|
8476
|
-
if (!entry.isDirectory()) return refuse(
|
|
8475
|
+
const path66 = (0, import_node_path18.join)(dir, entry.name);
|
|
8476
|
+
if (!entry.isDirectory()) return refuse(path66, "it is neither a file nor a directory");
|
|
8477
8477
|
const extension = (0, import_node_path18.extname)(entry.name).slice(1);
|
|
8478
8478
|
const type = extension.toLowerCase();
|
|
8479
8479
|
const base = entry.name.slice(0, entry.name.length - extension.length - 1);
|
|
8480
8480
|
if (type !== extension && knownTypes.has(type))
|
|
8481
|
-
return refuse(
|
|
8481
|
+
return refuse(path66, "its type extension is not lowercase");
|
|
8482
8482
|
if (type === "colorset" || type === "imageset" || type === "symbolset") {
|
|
8483
8483
|
addAsset(into, {
|
|
8484
8484
|
kind: type === "colorset" ? "color" : "image",
|
|
8485
8485
|
name: base,
|
|
8486
|
-
...assetState(
|
|
8486
|
+
...assetState(path66, type, devices),
|
|
8487
8487
|
extensions,
|
|
8488
|
-
source:
|
|
8488
|
+
source: path66
|
|
8489
8489
|
});
|
|
8490
8490
|
continue;
|
|
8491
8491
|
}
|
|
8492
8492
|
if (silentTypes.has(type)) continue;
|
|
8493
8493
|
if (stackTypes.has(type)) {
|
|
8494
|
-
checkStack(
|
|
8494
|
+
checkStack(path66, type, devices);
|
|
8495
8495
|
continue;
|
|
8496
8496
|
}
|
|
8497
|
-
if (unprovenTypes.has(type)) return refuse(
|
|
8497
|
+
if (unprovenTypes.has(type)) return refuse(path66, `${type} assets are unproven`);
|
|
8498
8498
|
const name3 = type === "spriteatlas" ? base : entry.name;
|
|
8499
|
-
if (!folderProperties((0, import_node_path18.join)(
|
|
8500
|
-
walk(
|
|
8499
|
+
if (!folderProperties((0, import_node_path18.join)(path66, "Contents.json")).namespace) {
|
|
8500
|
+
walk(path66, into, devices, extensions);
|
|
8501
8501
|
continue;
|
|
8502
8502
|
}
|
|
8503
|
-
const child = into.namespaces.get(name3) ?? scope(
|
|
8503
|
+
const child = into.namespaces.get(name3) ?? scope(path66);
|
|
8504
8504
|
into.namespaces.set(name3, child);
|
|
8505
|
-
walk(
|
|
8505
|
+
walk(path66, child, devices, extensions);
|
|
8506
8506
|
}
|
|
8507
8507
|
}
|
|
8508
8508
|
var hasKind = (into, kind) => [...into.assets.values()].some((asset) => asset.kind === kind && asset.included) || [...into.namespaces.values()].some((child) => hasKind(child, kind));
|
|
@@ -8571,11 +8571,11 @@ function members(into, kind, prefix, extensions) {
|
|
|
8571
8571
|
const assets2 = /* @__PURE__ */ new Set();
|
|
8572
8572
|
const out = [];
|
|
8573
8573
|
for (const entry of entries) {
|
|
8574
|
-
const
|
|
8574
|
+
const path66 = `${prefix}${entry.name}`;
|
|
8575
8575
|
const source = entry.child ? entry.child.source : entry.asset.source;
|
|
8576
8576
|
if (Array.from(entry.name).some((char) => char.charCodeAt(0) > 127))
|
|
8577
8577
|
refuse(source, "its name is not ASCII");
|
|
8578
|
-
const named = (text6) => `The \\"${escape(
|
|
8578
|
+
const named = (text6) => `The \\"${escape(path66)}\\" ${text6}`;
|
|
8579
8579
|
if (entry.child) {
|
|
8580
8580
|
const text6 = symbol(entry.name, true);
|
|
8581
8581
|
if (!text6)
|
|
@@ -8598,9 +8598,9 @@ function members(into, kind, prefix, extensions) {
|
|
|
8598
8598
|
namespaces.add(text6);
|
|
8599
8599
|
out.push({
|
|
8600
8600
|
type: "namespace",
|
|
8601
|
-
path:
|
|
8601
|
+
path: path66,
|
|
8602
8602
|
symbol: spelled(text6),
|
|
8603
|
-
members: members(entry.child, kind, `${
|
|
8603
|
+
members: members(entry.child, kind, `${path66}/`, extensions)
|
|
8604
8604
|
});
|
|
8605
8605
|
}
|
|
8606
8606
|
continue;
|
|
@@ -8627,7 +8627,7 @@ function members(into, kind, prefix, extensions) {
|
|
|
8627
8627
|
else if (!omitted)
|
|
8628
8628
|
out.push({
|
|
8629
8629
|
type: "asset",
|
|
8630
|
-
path:
|
|
8630
|
+
path: path66,
|
|
8631
8631
|
name: entry.name,
|
|
8632
8632
|
symbol: spelled(text5),
|
|
8633
8633
|
thinnable: asset.thinnable,
|
|
@@ -9161,11 +9161,11 @@ function catalogDigest(directory) {
|
|
|
9161
9161
|
for (const entry of (0, import_node_fs23.readdirSync)(dir, { withFileTypes: true }).sort(
|
|
9162
9162
|
(a, b) => a.name.localeCompare(b.name)
|
|
9163
9163
|
)) {
|
|
9164
|
-
const
|
|
9165
|
-
if (entry.isDirectory()) walk3(
|
|
9166
|
-
else if (entry.isFile() && (0, import_node_fs23.statSync)(
|
|
9167
|
-
hashes.push([(0, import_node_path19.relative)(directory,
|
|
9168
|
-
else throw new Error(`Unsupported asset catalog entry: ${
|
|
9164
|
+
const path66 = (0, import_node_path19.join)(dir, entry.name);
|
|
9165
|
+
if (entry.isDirectory()) walk3(path66);
|
|
9166
|
+
else if (entry.isFile() && (0, import_node_fs23.statSync)(path66).size <= 64 * 1024 * 1024)
|
|
9167
|
+
hashes.push([(0, import_node_path19.relative)(directory, path66), sha2562((0, import_node_fs23.readFileSync)(path66))]);
|
|
9168
|
+
else throw new Error(`Unsupported asset catalog entry: ${path66}`);
|
|
9169
9169
|
}
|
|
9170
9170
|
};
|
|
9171
9171
|
walk3(directory);
|
|
@@ -9177,7 +9177,7 @@ function symbolSource(plan, root) {
|
|
|
9177
9177
|
const known = symbolTexts.get(key2);
|
|
9178
9178
|
if (known !== void 0) return { status: "source", text: known };
|
|
9179
9179
|
const source = assetSymbolSource(
|
|
9180
|
-
plan.catalogs.map(({ path:
|
|
9180
|
+
plan.catalogs.map(({ path: path66 }) => (0, import_node_path19.join)(root, path66)),
|
|
9181
9181
|
plan.settings
|
|
9182
9182
|
);
|
|
9183
9183
|
if (source.status === "source") symbolTexts.set(key2, source.text);
|
|
@@ -9235,9 +9235,9 @@ function planAssetSymbols(resources, root, settings) {
|
|
|
9235
9235
|
`Generated asset symbols are proven only for TARGETED_DEVICE_FAMILY 1, 2, 1,2, 1,7, 1,2,6 or 1,2,7; this target resolves to "${families}".`
|
|
9236
9236
|
);
|
|
9237
9237
|
const plan = {
|
|
9238
|
-
catalogs: catalogs.map((
|
|
9239
|
-
path:
|
|
9240
|
-
sha256: catalogDigest((0, import_node_path19.join)(root,
|
|
9238
|
+
catalogs: catalogs.map((path66) => ({
|
|
9239
|
+
path: path66,
|
|
9240
|
+
sha256: catalogDigest((0, import_node_path19.join)(root, path66))
|
|
9241
9241
|
})),
|
|
9242
9242
|
settings: { deployment: target, devices, extensions: extensions === "YES" }
|
|
9243
9243
|
};
|
|
@@ -12113,10 +12113,10 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
12113
12113
|
const enclosing = scopes.length > 0 ? scopes[scopes.length - 1].prefix : [];
|
|
12114
12114
|
if (scope2?.[3] === "enum" && opens > 0 && /(^|\s)(public|open)\s/.test(scope2[2] ?? "") && !/\bwhere\b/.test(first.masked) && first.masked[scope2.index + scope2[0].length] !== "<") {
|
|
12115
12115
|
const name3 = scope2[4];
|
|
12116
|
-
const
|
|
12117
|
-
if (!byPath.has(
|
|
12116
|
+
const path66 = scopeOf(name3, enclosing, false);
|
|
12117
|
+
if (!byPath.has(path66.join(".")) && (path66.length === 1 || byPath.has(path66.slice(0, -1).join(".")))) {
|
|
12118
12118
|
const keptAttrs = [...(scope2[1] ?? "").matchAll(/@\w+(?:\([^)]*\))?/g)].map((attr) => attr[0]).filter((attr) => !attr.startsWith("@objc"));
|
|
12119
|
-
const id = `s:peach-synthesized-${module2}-${
|
|
12119
|
+
const id = `s:peach-synthesized-${module2}-${path66.join(".")}`;
|
|
12120
12120
|
const body = [];
|
|
12121
12121
|
let inner = 1;
|
|
12122
12122
|
let closed = false;
|
|
@@ -12171,15 +12171,15 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
12171
12171
|
symbols.push({
|
|
12172
12172
|
kind: { identifier: "swift.enum" },
|
|
12173
12173
|
identifier: { precise: id },
|
|
12174
|
-
pathComponents:
|
|
12174
|
+
pathComponents: path66,
|
|
12175
12175
|
declarationFragments: fragments,
|
|
12176
12176
|
accessLevel: "public"
|
|
12177
12177
|
});
|
|
12178
|
-
if (
|
|
12178
|
+
if (path66.length > 1)
|
|
12179
12179
|
relationships.push({
|
|
12180
12180
|
kind: "memberOf",
|
|
12181
12181
|
source: id,
|
|
12182
|
-
target: byPath.get(
|
|
12182
|
+
target: byPath.get(path66.slice(0, -1).join("."))
|
|
12183
12183
|
});
|
|
12184
12184
|
for (const kase of cases) {
|
|
12185
12185
|
const memberId = `${id}-${kase.leaf}`;
|
|
@@ -12188,7 +12188,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
12188
12188
|
symbols.push({
|
|
12189
12189
|
kind: { identifier: "swift.enum.case" },
|
|
12190
12190
|
identifier: { precise: memberId },
|
|
12191
|
-
pathComponents: [...
|
|
12191
|
+
pathComponents: [...path66, kase.leaf],
|
|
12192
12192
|
declarationFragments: [
|
|
12193
12193
|
{ kind: "keyword", spelling: "case" },
|
|
12194
12194
|
{ kind: "text", spelling: " " },
|
|
@@ -12204,7 +12204,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
12204
12204
|
symbols.push({
|
|
12205
12205
|
kind: { identifier: "swift.init" },
|
|
12206
12206
|
identifier: { precise: initId },
|
|
12207
|
-
pathComponents: [...
|
|
12207
|
+
pathComponents: [...path66, "init(rawValue:)"],
|
|
12208
12208
|
declarationFragments: [
|
|
12209
12209
|
{ kind: "keyword", spelling: "init" },
|
|
12210
12210
|
{ kind: "text", spelling: "?(" },
|
|
@@ -12273,7 +12273,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12273
12273
|
})
|
|
12274
12274
|
)
|
|
12275
12275
|
);
|
|
12276
|
-
const trap = (
|
|
12276
|
+
const trap = (path66) => `fatalError("${path66} is ${options.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
|
|
12277
12277
|
const skipped = [];
|
|
12278
12278
|
const behavior = options.behavior ?? /* @__PURE__ */ new Map();
|
|
12279
12279
|
const used = /* @__PURE__ */ new Set();
|
|
@@ -12623,34 +12623,34 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12623
12623
|
lines.push(...physical);
|
|
12624
12624
|
owners.push(...physical.map(() => current2));
|
|
12625
12625
|
};
|
|
12626
|
-
const emitAt = (
|
|
12627
|
-
if (omit.has(
|
|
12626
|
+
const emitAt = (path66, line) => {
|
|
12627
|
+
if (omit.has(path66)) return;
|
|
12628
12628
|
const previous = current2;
|
|
12629
|
-
current2 =
|
|
12629
|
+
current2 = path66;
|
|
12630
12630
|
emit(line);
|
|
12631
12631
|
current2 = previous;
|
|
12632
12632
|
};
|
|
12633
12633
|
const emitInertState = (id, indent2, build) => {
|
|
12634
|
-
const
|
|
12634
|
+
const path66 = pathOf(byId.get(id));
|
|
12635
12635
|
emitAt(hiddenInit(id), `${indent2}init(_peachInert: Void) { ${build} }`);
|
|
12636
12636
|
const list2 = conforms.get(id) ?? [];
|
|
12637
12637
|
const has = (name3) => (children.get(id) ?? []).some((member) => leaf(member) === name3);
|
|
12638
12638
|
if (list2.includes("Encodable") && !has("encode(to:)"))
|
|
12639
12639
|
emitAt(
|
|
12640
|
-
`${
|
|
12640
|
+
`${path66}.encode(to:)`,
|
|
12641
12641
|
`${indent2}public func encode(to encoder: Encoder) throws {}`
|
|
12642
12642
|
);
|
|
12643
12643
|
if (list2.includes("Decodable") && !has("init(from:)"))
|
|
12644
12644
|
emitAt(
|
|
12645
|
-
`${
|
|
12645
|
+
`${path66}.init(from:)`,
|
|
12646
12646
|
`${indent2}public init(from decoder: Decoder) throws { self.init(_peachInert: ()) }`
|
|
12647
12647
|
);
|
|
12648
12648
|
};
|
|
12649
12649
|
const scoped = (body) => (symbol2, ...rest) => {
|
|
12650
|
-
const
|
|
12651
|
-
if (omit.has(
|
|
12650
|
+
const path66 = pathOf(symbol2);
|
|
12651
|
+
if (omit.has(path66)) return void skipped.push({ path: path66, reason: omit.get(path66) });
|
|
12652
12652
|
const previous = current2;
|
|
12653
|
-
current2 =
|
|
12653
|
+
current2 = path66;
|
|
12654
12654
|
try {
|
|
12655
12655
|
body(symbol2, ...rest);
|
|
12656
12656
|
} finally {
|
|
@@ -12682,7 +12682,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12682
12682
|
};
|
|
12683
12683
|
const emitMember = scoped(
|
|
12684
12684
|
(member, indent2, context) => {
|
|
12685
|
-
const
|
|
12685
|
+
const path66 = pathOf(member);
|
|
12686
12686
|
if (TYPE_KINDS.has(member.kind.identifier)) {
|
|
12687
12687
|
const origin = origins.get(member.identifier.precise)?.split(".")[0];
|
|
12688
12688
|
const parent = owner.get(member.identifier.precise);
|
|
@@ -12699,7 +12699,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12699
12699
|
))
|
|
12700
12700
|
return;
|
|
12701
12701
|
if (!MEMBER_KINDS.has(member.kind.identifier)) {
|
|
12702
|
-
skipped.push({ path:
|
|
12702
|
+
skipped.push({ path: path66, reason: `unhandled ${member.kind.identifier}` });
|
|
12703
12703
|
return;
|
|
12704
12704
|
}
|
|
12705
12705
|
const { 1: spelledAttrs, 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
@@ -12707,27 +12707,27 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12707
12707
|
/@(\w+)(?:\([^)]*\))?\s*/g,
|
|
12708
12708
|
(attr, name3) => typeByPath.has(name3) ? "" : attr
|
|
12709
12709
|
) : spelledAttrs;
|
|
12710
|
-
const attrs = options.unobjc?.has(
|
|
12710
|
+
const attrs = options.unobjc?.has(path66) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : wrapped;
|
|
12711
12711
|
const modifiers = /^((?:(?:required|final|override|convenience|unowned(?:\(\w+\))?|weak|lazy|nonisolated|mutating|nonmutating) )*)(.*)$/s.exec(
|
|
12712
12712
|
rest
|
|
12713
12713
|
);
|
|
12714
12714
|
const flags = new Set(
|
|
12715
12715
|
modifiers[1].trim().split(/\s+/).filter(Boolean).map((flag) => flag.replace(/\(.*/, ""))
|
|
12716
12716
|
);
|
|
12717
|
-
const requiredInit = context.inClass && !!options.requiredInits?.has(
|
|
12718
|
-
const restatesRequired = context.inClass &&
|
|
12717
|
+
const requiredInit = context.inClass && !!options.requiredInits?.has(path66);
|
|
12718
|
+
const restatesRequired = context.inClass && path66.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
|
|
12719
12719
|
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
12720
12720
|
);
|
|
12721
12721
|
const required = context.inClass && (flags.has("required") || requiredInit || restatesRequired);
|
|
12722
12722
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
12723
12723
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
12724
12724
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
12725
|
-
const override = context.inClass && !options.plain?.has(
|
|
12725
|
+
const override = context.inClass && !options.plain?.has(path66) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path66) || isObjC(member) && path66.endsWith(".init()")) ? "override " : "";
|
|
12726
12726
|
const head = `${indent2}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
12727
|
-
const measured = behavior.get(
|
|
12728
|
-
if (measured) used.add(
|
|
12727
|
+
const measured = behavior.get(path66);
|
|
12728
|
+
if (measured) used.add(path66);
|
|
12729
12729
|
const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
|
|
12730
|
-
const body = overloadBody ?? measured?.body ?? (options.inert ? inertBody(member) : trap(
|
|
12730
|
+
const body = overloadBody ?? measured?.body ?? (options.inert ? inertBody(member) : trap(path66));
|
|
12731
12731
|
switch (member.kind.identifier) {
|
|
12732
12732
|
case "swift.property":
|
|
12733
12733
|
case "swift.type.property":
|
|
@@ -12740,13 +12740,13 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12740
12740
|
const parameter = !measured && !options.inert && !settable && /:\s*some\s/.test(decl) ? opaqueParameter(member) : void 0;
|
|
12741
12741
|
const getter = parameter ? `return ({ () -> ${parameter} in ${body} })()` : body;
|
|
12742
12742
|
const computed = decl.replace(/^((?:static |class )*)let /, "$1var ");
|
|
12743
|
-
const wrapper = options.projections?.get(
|
|
12743
|
+
const wrapper = options.projections?.get(path66);
|
|
12744
12744
|
if (wrapper) {
|
|
12745
12745
|
const type = /^var\s+`?\w+`?\s*:\s*(.+)$/s.exec(computed)?.[1];
|
|
12746
|
-
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [
|
|
12746
|
+
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path66]);
|
|
12747
12747
|
if (!initial)
|
|
12748
12748
|
return void skipped.push({
|
|
12749
|
-
path:
|
|
12749
|
+
path: path66,
|
|
12750
12750
|
reason: `wrapped by ${wrapper} with no inert initial value`
|
|
12751
12751
|
});
|
|
12752
12752
|
const own = new RegExp(
|
|
@@ -12767,7 +12767,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12767
12767
|
return;
|
|
12768
12768
|
}
|
|
12769
12769
|
emit(
|
|
12770
|
-
`${head}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options.inert ? "" : trap(
|
|
12770
|
+
`${head}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options.inert ? "" : trap(path66))} }` : ""} }`
|
|
12771
12771
|
);
|
|
12772
12772
|
return;
|
|
12773
12773
|
}
|
|
@@ -12826,7 +12826,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12826
12826
|
};
|
|
12827
12827
|
const emitType = scoped(
|
|
12828
12828
|
(symbol2, indent2) => {
|
|
12829
|
-
const
|
|
12829
|
+
const path66 = pathOf(symbol2);
|
|
12830
12830
|
const id = symbol2.identifier.precise;
|
|
12831
12831
|
const inner = `${indent2} `;
|
|
12832
12832
|
switch (symbol2.kind.identifier) {
|
|
@@ -12843,10 +12843,10 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12843
12843
|
case "swift.class": {
|
|
12844
12844
|
const shape = header(symbol2, "class", indent2);
|
|
12845
12845
|
if (!shape)
|
|
12846
|
-
return void skipped.push({ path:
|
|
12847
|
-
const parent = options.superclasses?.get(
|
|
12846
|
+
return void skipped.push({ path: path66, reason: `unparsed class ${text(symbol2)}` });
|
|
12847
|
+
const parent = options.superclasses?.get(path66) ?? superclass.get(id);
|
|
12848
12848
|
const blocked = classBlocked(id);
|
|
12849
|
-
if (blocked) return void skipped.push({ path:
|
|
12849
|
+
if (blocked) return void skipped.push({ path: path66, reason: blocked });
|
|
12850
12850
|
const ancestors = /* @__PURE__ */ new Set();
|
|
12851
12851
|
const inherited = /* @__PURE__ */ new Set();
|
|
12852
12852
|
for (let at = superId.get(id); at; at = superId.get(at)) {
|
|
@@ -12869,9 +12869,9 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12869
12869
|
`${indent2}${shape.attrs}${objcName ? `@objc(${objcName}) ` : ""}${shape.final}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
|
|
12870
12870
|
);
|
|
12871
12871
|
const members2 = membersOf(id);
|
|
12872
|
-
const extra = options.behavior?.get(
|
|
12872
|
+
const extra = options.behavior?.get(path66)?.members;
|
|
12873
12873
|
if (extra) {
|
|
12874
|
-
used.add(
|
|
12874
|
+
used.add(path66);
|
|
12875
12875
|
emit(`${inner}${extra}`);
|
|
12876
12876
|
}
|
|
12877
12877
|
for (const member of members2)
|
|
@@ -12927,11 +12927,11 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12927
12927
|
if (protocol && member.kind.identifier === "swift.method" && leaf(member).endsWith("()") && have.has(`instance|leaf|${leaf(member).slice(0, -2)}`))
|
|
12928
12928
|
propertyWitnesses.push({
|
|
12929
12929
|
owner: current2,
|
|
12930
|
-
head: `extension ${pathOf(protocol)} where Self: ${
|
|
12930
|
+
head: `extension ${pathOf(protocol)} where Self: ${path66} {`,
|
|
12931
12931
|
member,
|
|
12932
|
-
path:
|
|
12932
|
+
path: path66
|
|
12933
12933
|
});
|
|
12934
|
-
else emitWitness(member, inner,
|
|
12934
|
+
else emitWitness(member, inner, path66, open && isObjC(member));
|
|
12935
12935
|
}
|
|
12936
12936
|
}
|
|
12937
12937
|
if (options.inert && designated2 && classBuild(id) === "hidden")
|
|
@@ -12939,13 +12939,13 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12939
12939
|
const coder = members2.some((member) => leaf(member) === "init(coder:)");
|
|
12940
12940
|
if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
12941
12941
|
emit(
|
|
12942
|
-
`${inner}public required init?(coder: NSCoder) { ${options.inert ? "return nil" : trap(`${
|
|
12942
|
+
`${inner}public required init?(coder: NSCoder) { ${options.inert ? "return nil" : trap(`${path66}.init(coder:)`)} }`
|
|
12943
12943
|
);
|
|
12944
12944
|
if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
|
|
12945
12945
|
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
12946
12946
|
))
|
|
12947
12947
|
emit(
|
|
12948
|
-
`${inner}public required init() { ${options.inert ? superInit(id) : trap(`${
|
|
12948
|
+
`${inner}public required init() { ${options.inert ? superInit(id) : trap(`${path66}.init()`)} }`
|
|
12949
12949
|
);
|
|
12950
12950
|
emit(`${indent2}}`);
|
|
12951
12951
|
return;
|
|
@@ -12953,7 +12953,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12953
12953
|
case "swift.struct": {
|
|
12954
12954
|
const shape = header(symbol2, "struct", indent2);
|
|
12955
12955
|
if (!shape)
|
|
12956
|
-
return void skipped.push({ path:
|
|
12956
|
+
return void skipped.push({ path: path66, reason: `unparsed struct ${text(symbol2)}` });
|
|
12957
12957
|
const members2 = membersOf(id);
|
|
12958
12958
|
const raw2 = rawType(members2);
|
|
12959
12959
|
const list2 = inheritance(id);
|
|
@@ -12994,7 +12994,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12994
12994
|
emitInertState(
|
|
12995
12995
|
id,
|
|
12996
12996
|
inner,
|
|
12997
|
-
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [
|
|
12997
|
+
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path66]) ?? "0"}` : ""
|
|
12998
12998
|
);
|
|
12999
12999
|
emit(`${indent2}}`);
|
|
13000
13000
|
return;
|
|
@@ -13002,7 +13002,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
13002
13002
|
case "swift.enum": {
|
|
13003
13003
|
const shape = header(symbol2, "enum", indent2);
|
|
13004
13004
|
if (!shape)
|
|
13005
|
-
return void skipped.push({ path:
|
|
13005
|
+
return void skipped.push({ path: path66, reason: `unparsed enum ${text(symbol2)}` });
|
|
13006
13006
|
const members2 = membersOf(id);
|
|
13007
13007
|
const cases = members2.filter(
|
|
13008
13008
|
(member) => member.kind.identifier === "swift.enum.case"
|
|
@@ -13012,7 +13012,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
13012
13012
|
const missing = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
|
|
13013
13013
|
if (raw2 && (isObjC(symbol2) || /^c:@C?M@[^@]+@E@/.test(id)) && missing.length > 0)
|
|
13014
13014
|
return void skipped.push({
|
|
13015
|
-
path:
|
|
13015
|
+
path: path66,
|
|
13016
13016
|
reason: `no header value for ${missing.map(leaf).join(", ")}`
|
|
13017
13017
|
});
|
|
13018
13018
|
const list2 = inheritance(id, raw2 ?? void 0).filter(
|
|
@@ -13052,8 +13052,8 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
13052
13052
|
});
|
|
13053
13053
|
}
|
|
13054
13054
|
if (options.inert) {
|
|
13055
|
-
const value = options.trapped?.has(hiddenInit(id)) ? null : inertValue(
|
|
13056
|
-
emitInertState(id, inner, value === null ? trap(
|
|
13055
|
+
const value = options.trapped?.has(hiddenInit(id)) ? null : inertValue(path66, /* @__PURE__ */ new Set(), []);
|
|
13056
|
+
emitInertState(id, inner, value === null ? trap(path66) : `self = ${value}`);
|
|
13057
13057
|
}
|
|
13058
13058
|
emit(`${indent2}}`);
|
|
13059
13059
|
return;
|
|
@@ -13062,14 +13062,14 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
13062
13062
|
const shape = header(symbol2, "protocol", indent2);
|
|
13063
13063
|
if (!shape)
|
|
13064
13064
|
return void skipped.push({
|
|
13065
|
-
path:
|
|
13065
|
+
path: path66,
|
|
13066
13066
|
reason: `unparsed protocol ${text(symbol2)}`
|
|
13067
13067
|
});
|
|
13068
13068
|
const native = nativeObjcProtocols.has(id);
|
|
13069
13069
|
const objcName = native ? /^c:objc\(pl\)(\w+)$/.exec(id)?.[1] : void 0;
|
|
13070
13070
|
if (native && !objcName)
|
|
13071
13071
|
return void skipped.push({
|
|
13072
|
-
path:
|
|
13072
|
+
path: path66,
|
|
13073
13073
|
reason: `unknown Objective-C protocol identity ${id}`
|
|
13074
13074
|
});
|
|
13075
13075
|
const list2 = [
|
|
@@ -13097,7 +13097,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
13097
13097
|
}
|
|
13098
13098
|
emit(`${indent2}}`);
|
|
13099
13099
|
if (defaults.length > 0) {
|
|
13100
|
-
emit(`${indent2}extension ${
|
|
13100
|
+
emit(`${indent2}extension ${path66} {`);
|
|
13101
13101
|
for (const member of defaults) {
|
|
13102
13102
|
const decl = text(member);
|
|
13103
13103
|
if (optional3.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
|
|
@@ -13189,7 +13189,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
13189
13189
|
};
|
|
13190
13190
|
const atWidth = (value, raw2) => (raw2 === "UInt" || raw2 === "Swift.UInt") && value === "18446744073709551615" ? "4294967295" : (raw2 === "Int" || raw2 === "Swift.Int") && value === "9223372036854775807" ? "2147483647" : (raw2 === "Int" || raw2 === "Swift.Int") && value === "-9223372036854775808" ? "-2147483648" : value;
|
|
13191
13191
|
const emitGlobal = scoped((symbol2) => {
|
|
13192
|
-
const
|
|
13192
|
+
const path66 = pathOf(symbol2);
|
|
13193
13193
|
const kind = symbol2.kind.identifier;
|
|
13194
13194
|
if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
|
|
13195
13195
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol2));
|
|
@@ -13198,20 +13198,20 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
13198
13198
|
if (leaf(symbol2).endsWith("(_:)") && !/^(?:prefix|infix|postfix)\b/.test(spelled2))
|
|
13199
13199
|
spelled2 = `prefix ${spelled2}`;
|
|
13200
13200
|
}
|
|
13201
|
-
const measured = behavior.get(
|
|
13202
|
-
if (measured) used.add(
|
|
13201
|
+
const measured = behavior.get(path66);
|
|
13202
|
+
if (measured) used.add(path66);
|
|
13203
13203
|
const overloadBody = /\basync\b/.test(spelled2) ? measured?.asyncBody : /\bResult</.test(spelled2) ? measured?.resultBody : void 0;
|
|
13204
13204
|
emit(
|
|
13205
|
-
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options.inert ? inertBody(symbol2) : trap(
|
|
13205
|
+
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path66))} }`
|
|
13206
13206
|
);
|
|
13207
13207
|
} else if (kind === "swift.var") {
|
|
13208
13208
|
const parsed = splitAccessors(text(symbol2).replace(/^let /, "var "));
|
|
13209
|
-
const measured = behavior.get(
|
|
13210
|
-
if (measured) used.add(
|
|
13209
|
+
const measured = behavior.get(path66);
|
|
13210
|
+
if (measured) used.add(path66);
|
|
13211
13211
|
emit(
|
|
13212
|
-
`public ${parsed.decl} { ${measured?.body ?? (options.inert ? inertBody(symbol2) : trap(
|
|
13212
|
+
`public ${parsed.decl} { ${measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path66))} }`
|
|
13213
13213
|
);
|
|
13214
|
-
} else skipped.push({ path:
|
|
13214
|
+
} else skipped.push({ path: path66, reason: `unhandled top-level ${kind}` });
|
|
13215
13215
|
});
|
|
13216
13216
|
const cExports = new Set(
|
|
13217
13217
|
[...byId.values()].flatMap((symbol2) => {
|
|
@@ -13228,7 +13228,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
13228
13228
|
return !name3 || !cExports.has(`${name3}|${text(symbol2)}`);
|
|
13229
13229
|
}).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
|
|
13230
13230
|
for (const symbol2 of roots) {
|
|
13231
|
-
const
|
|
13231
|
+
const path66 = pathOf(symbol2);
|
|
13232
13232
|
if (TYPE_KINDS.has(symbol2.kind.identifier)) emitType(symbol2, "");
|
|
13233
13233
|
else emitGlobal(symbol2);
|
|
13234
13234
|
}
|
|
@@ -13289,9 +13289,9 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
13289
13289
|
"#endif",
|
|
13290
13290
|
""
|
|
13291
13291
|
];
|
|
13292
|
-
for (const
|
|
13293
|
-
if (!used.has(
|
|
13294
|
-
skipped.push({ path:
|
|
13292
|
+
for (const path66 of behavior.keys())
|
|
13293
|
+
if (!used.has(path66))
|
|
13294
|
+
skipped.push({ path: path66, reason: "behavior names no emitted declaration" });
|
|
13295
13295
|
return {
|
|
13296
13296
|
source: `${[...banner, ...lines].join("\n")}
|
|
13297
13297
|
`,
|
|
@@ -15319,9 +15319,9 @@ var EXCERPT = /^(\s*)(\d+)( \| )(.*)$/;
|
|
|
15319
15319
|
var MARKER = /^(\s*)( \| )(.*)$/;
|
|
15320
15320
|
function designTimeDiagnostic(output2, files2) {
|
|
15321
15321
|
const rewritten = /* @__PURE__ */ new Map();
|
|
15322
|
-
const linesOf = (
|
|
15322
|
+
const linesOf = (path66) => {
|
|
15323
15323
|
const file = Object.keys(files2).find(
|
|
15324
|
-
(name3) => name3.endsWith(".swift") && (
|
|
15324
|
+
(name3) => name3.endsWith(".swift") && (path66 === name3 || path66.endsWith(`/${name3}`))
|
|
15325
15325
|
);
|
|
15326
15326
|
if (file === void 0) return null;
|
|
15327
15327
|
let lines = rewritten.get(file);
|
|
@@ -16818,8 +16818,8 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
16818
16818
|
}
|
|
16819
16819
|
for (const [name3, providers] of lazyProviders) {
|
|
16820
16820
|
if (!name3.startsWith("._OBJC_CLASS_")) continue;
|
|
16821
|
-
const
|
|
16822
|
-
if (!resourceReferences.some((bytes) => bytes.includes(
|
|
16821
|
+
const className2 = name3.slice("._OBJC_CLASS_".length);
|
|
16822
|
+
if (!resourceReferences.some((bytes) => bytes.includes(className2))) continue;
|
|
16823
16823
|
for (const provider of providers) {
|
|
16824
16824
|
eagerDynamicObjects.add(provider);
|
|
16825
16825
|
extractObject(provider);
|
|
@@ -20785,7 +20785,7 @@ async function compileGuestLink(options) {
|
|
|
20785
20785
|
{ stdio: "pipe" }
|
|
20786
20786
|
);
|
|
20787
20787
|
let prepared;
|
|
20788
|
-
let
|
|
20788
|
+
let reserved2;
|
|
20789
20789
|
let projectionObject = "";
|
|
20790
20790
|
let sourceObjects = [];
|
|
20791
20791
|
let identities = /* @__PURE__ */ new Map();
|
|
@@ -21011,7 +21011,7 @@ async function compileGuestLink(options) {
|
|
|
21011
21011
|
tableProtection: { initial: 5, maximum: 5 },
|
|
21012
21012
|
clangOptions,
|
|
21013
21013
|
onReserved: (value, object5) => {
|
|
21014
|
-
|
|
21014
|
+
reserved2 = value;
|
|
21015
21015
|
projectionObject = object5;
|
|
21016
21016
|
}
|
|
21017
21017
|
};
|
|
@@ -21076,7 +21076,7 @@ async function compileGuestLink(options) {
|
|
|
21076
21076
|
};
|
|
21077
21077
|
}
|
|
21078
21078
|
});
|
|
21079
|
-
if (!
|
|
21079
|
+
if (!reserved2 || !projectionObject) throw new Error("guest projection was not reserved");
|
|
21080
21080
|
await optimizeWasm(options.output, options.optimized, [
|
|
21081
21081
|
"duplicate-function-elimination"
|
|
21082
21082
|
]);
|
|
@@ -21089,7 +21089,7 @@ async function compileGuestLink(options) {
|
|
|
21089
21089
|
owners: result.owners,
|
|
21090
21090
|
sectionOwners: result.generatedSectionOwners,
|
|
21091
21091
|
projectionObject,
|
|
21092
|
-
reserved
|
|
21092
|
+
reserved: reserved2
|
|
21093
21093
|
});
|
|
21094
21094
|
(0, import_node_fs39.writeFileSync)(options.optimized, finalized.wasm);
|
|
21095
21095
|
}
|
|
@@ -22744,7 +22744,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
|
|
|
22744
22744
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
22745
22745
|
var MULTI_MANIFEST_VERSION = 68;
|
|
22746
22746
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
22747
|
-
var compilerSourceDigest = true ? "
|
|
22747
|
+
var compilerSourceDigest = true ? "49b49a3b4f72b519cda4a1310d169f7d233d4f0249b0bcff228d2c316fafd9e1" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
22748
22748
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
22749
22749
|
const hash = (0, import_node_crypto19.createHash)("sha256");
|
|
22750
22750
|
hash.update(`swift-compile
|
|
@@ -32191,9 +32191,9 @@ async function packageTreeDigest(root) {
|
|
|
32191
32191
|
(a, b) => a.name.localeCompare(b.name)
|
|
32192
32192
|
)) {
|
|
32193
32193
|
if (entry.name === "node_modules") continue;
|
|
32194
|
-
const
|
|
32195
|
-
if (entry.isDirectory()) walk3((0, import_node_path58.join)(directory, entry.name), `${
|
|
32196
|
-
else if (entry.isFile()) files2.push(
|
|
32194
|
+
const path66 = `${relative3}${entry.name}`;
|
|
32195
|
+
if (entry.isDirectory()) walk3((0, import_node_path58.join)(directory, entry.name), `${path66}/`);
|
|
32196
|
+
else if (entry.isFile()) files2.push(path66);
|
|
32197
32197
|
}
|
|
32198
32198
|
};
|
|
32199
32199
|
walk3(root, "");
|
|
@@ -32209,7 +32209,7 @@ async function packageTreeDigest(root) {
|
|
|
32209
32209
|
// src/expo-native-prebuilt.ts
|
|
32210
32210
|
var EXPO_NATIVE_ENTRY_NAME = "ios";
|
|
32211
32211
|
function expoNativeCompilerDigestValue() {
|
|
32212
|
-
return true ? "
|
|
32212
|
+
return true ? "ac42571af765c2d0124171549a0a6350da01f038cf184c0f638923a4932a5e8b" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
32213
32213
|
}
|
|
32214
32214
|
var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
|
|
32215
32215
|
function readSources(value) {
|
|
@@ -33378,7 +33378,7 @@ function resolveSwiftPackages(options) {
|
|
|
33378
33378
|
headers.set(name3, import_node_path63.default.relative(binary2.dir, dir));
|
|
33379
33379
|
};
|
|
33380
33380
|
visit3(pkg, binary2.target);
|
|
33381
|
-
binary2.headerDependencies = [...headers].map(([module2,
|
|
33381
|
+
binary2.headerDependencies = [...headers].map(([module2, path66]) => ({ module: module2, path: path66 }));
|
|
33382
33382
|
}
|
|
33383
33383
|
for (const owner of options.owners ?? []) {
|
|
33384
33384
|
const found = productClosure(owner.products);
|
|
@@ -37662,13 +37662,13 @@ function parseObjectiveCModules(sources) {
|
|
|
37662
37662
|
superclasses: /* @__PURE__ */ new Map(),
|
|
37663
37663
|
implementations: /* @__PURE__ */ new Map()
|
|
37664
37664
|
};
|
|
37665
|
-
const addMethod = (
|
|
37666
|
-
const methods = declarations.methods.get(
|
|
37665
|
+
const addMethod = (className2, method) => {
|
|
37666
|
+
const methods = declarations.methods.get(className2) ?? [];
|
|
37667
37667
|
methods.push(method);
|
|
37668
|
-
declarations.methods.set(
|
|
37668
|
+
declarations.methods.set(className2, methods);
|
|
37669
37669
|
};
|
|
37670
|
-
const addSelector = (
|
|
37671
|
-
declarations.implementations.get(
|
|
37670
|
+
const addSelector = (className2, selector) => {
|
|
37671
|
+
declarations.implementations.get(className2)?.add(selector);
|
|
37672
37672
|
};
|
|
37673
37673
|
for (const { file, text: text5 } of sources) {
|
|
37674
37674
|
const source = stripComments(text5);
|
|
@@ -37700,16 +37700,16 @@ function parseObjectiveCModules(sources) {
|
|
|
37700
37700
|
if (extern) {
|
|
37701
37701
|
const parsed2 = macroArguments(rest, extern[0].length - 1);
|
|
37702
37702
|
if (!parsed2) continue;
|
|
37703
|
-
const [jsName,
|
|
37704
|
-
if (!
|
|
37703
|
+
const [jsName, className2, superclass] = extern[1] === "RCT_EXTERN_MODULE" ? ["", ...parsed2.args] : parsed2.args;
|
|
37704
|
+
if (!className2) continue;
|
|
37705
37705
|
declarations.modules.push({
|
|
37706
|
-
className,
|
|
37706
|
+
className: className2,
|
|
37707
37707
|
jsName: jsName ?? "",
|
|
37708
37708
|
extern: true,
|
|
37709
37709
|
file
|
|
37710
37710
|
});
|
|
37711
|
-
if (superclass) declarations.superclasses.set(
|
|
37712
|
-
owner = { className, implementation: false, start: at };
|
|
37711
|
+
if (superclass) declarations.superclasses.set(className2, superclass);
|
|
37712
|
+
owner = { className: className2, implementation: false, start: at };
|
|
37713
37713
|
continue;
|
|
37714
37714
|
}
|
|
37715
37715
|
const named = /^\s*([A-Za-z_]\w*)\s*(?::\s*([A-Za-z_]\w*))?/.exec(rest);
|
|
@@ -37796,9 +37796,9 @@ function parseObjectiveCModules(sources) {
|
|
|
37796
37796
|
}
|
|
37797
37797
|
return declarations;
|
|
37798
37798
|
}
|
|
37799
|
-
function compiledSuperclass(
|
|
37799
|
+
function compiledSuperclass(className2, superclasses) {
|
|
37800
37800
|
const seen = /* @__PURE__ */ new Set();
|
|
37801
|
-
let current2 = superclasses.get(
|
|
37801
|
+
let current2 = superclasses.get(className2);
|
|
37802
37802
|
while (current2 && !seen.has(current2)) {
|
|
37803
37803
|
if (current2 === "RCTEventEmitter" || current2 === "NSObject") return current2;
|
|
37804
37804
|
seen.add(current2);
|
|
@@ -37884,21 +37884,21 @@ function collectBridgeModuleSources(appRoot, signal, installedWorkspace) {
|
|
|
37884
37884
|
);
|
|
37885
37885
|
const registered = new Set(declarations.modules.map((module2) => module2.className));
|
|
37886
37886
|
const cxxTurboModules = /* @__PURE__ */ new Set();
|
|
37887
|
-
for (const [
|
|
37887
|
+
for (const [className2, selectors] of declarations.implementations) {
|
|
37888
37888
|
signal?.throwIfAborted();
|
|
37889
37889
|
if (!selectors.has("getTurboModule:")) continue;
|
|
37890
|
-
const exported = (declarations.methods.get(
|
|
37891
|
-
if (registered.has(
|
|
37890
|
+
const exported = (declarations.methods.get(className2)?.length ?? 0) > 0 || selectors.has("constantsToExport");
|
|
37891
|
+
if (registered.has(className2) && exported) continue;
|
|
37892
37892
|
const file = objc.find(
|
|
37893
|
-
(candidate) => new RegExp(`@implementation\\s+${
|
|
37893
|
+
(candidate) => new RegExp(`@implementation\\s+${className2}\\b`).test(
|
|
37894
37894
|
import_node_fs72.default.readFileSync(candidate, "utf8")
|
|
37895
37895
|
)
|
|
37896
37896
|
) ?? objc[0];
|
|
37897
37897
|
failures.push({
|
|
37898
|
-
namespace: `${namespace}.${
|
|
37899
|
-
diagnostic: registered.has(
|
|
37898
|
+
namespace: `${namespace}.${className2}`,
|
|
37899
|
+
diagnostic: registered.has(className2) ? `${file}: ${className2} implements getTurboModule: and exports no methods or constants, so its surface is the C++ TurboModule it returns. Peach compiles legacy bridge modules registered with RCT_EXPORT_MODULE/RCT_EXTERN_MODULE and Expo Swift modules; it does not compile C++ or codegen TurboModule bodies.` : `${file}: ${className2} implements getTurboModule: with no RCT_EXPORT_MODULE or RCT_EXTERN_MODULE registration, so it is a React Native codegen TurboModule. Peach compiles legacy bridge modules registered with RCT_EXPORT_MODULE/RCT_EXTERN_MODULE and Expo Swift modules; it does not compile codegen TurboModule bodies.`
|
|
37900
37900
|
});
|
|
37901
|
-
cxxTurboModules.add(
|
|
37901
|
+
cxxTurboModules.add(className2);
|
|
37902
37902
|
}
|
|
37903
37903
|
if (declarations.modules.every((module2) => cxxTurboModules.has(module2.className)))
|
|
37904
37904
|
continue;
|
|
@@ -38149,7 +38149,7 @@ var import_node_fs73 = __toESM(require("node:fs"), 1);
|
|
|
38149
38149
|
var import_node_module7 = require("node:module");
|
|
38150
38150
|
var import_node_path70 = __toESM(require("node:path"), 1);
|
|
38151
38151
|
var import_node_util13 = require("node:util");
|
|
38152
|
-
var recipe = true ? "
|
|
38152
|
+
var recipe = true ? "ad88035f7f9d4bac52054fb8da3c9cce8606e49c7522c8c0556f8dc3cb900ebd" : reactNativeCoreDigest2(__sootsim_import_meta_dirname);
|
|
38153
38153
|
function reactNativeCoreFloor(reactNativeRoot) {
|
|
38154
38154
|
const helpers = import_node_fs73.default.readFileSync(
|
|
38155
38155
|
import_node_path70.default.join(reactNativeRoot, "scripts/cocoapods/helpers.rb"),
|
|
@@ -38248,9 +38248,9 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
38248
38248
|
var import_node_async_hooks = require("node:async_hooks");
|
|
38249
38249
|
var import_node_child_process40 = require("node:child_process");
|
|
38250
38250
|
var import_node_crypto39 = require("node:crypto");
|
|
38251
|
-
var
|
|
38251
|
+
var import_node_fs78 = __toESM(require("node:fs"), 1);
|
|
38252
38252
|
var import_node_os16 = __toESM(require("node:os"), 1);
|
|
38253
|
-
var
|
|
38253
|
+
var import_node_path75 = __toESM(require("node:path"), 1);
|
|
38254
38254
|
|
|
38255
38255
|
// ../sootsim-swift/src/bundleAssets.ts
|
|
38256
38256
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -38290,8 +38290,8 @@ function imagesetFiles(images) {
|
|
|
38290
38290
|
];
|
|
38291
38291
|
}).sort((a, b) => a.scale - b.scale);
|
|
38292
38292
|
}
|
|
38293
|
-
function flatScale(
|
|
38294
|
-
const match = /@([23])x\.[^./]+$/.exec(
|
|
38293
|
+
function flatScale(path66) {
|
|
38294
|
+
const match = /@([23])x\.[^./]+$/.exec(path66);
|
|
38295
38295
|
return match ? Number(match[1]) : 1;
|
|
38296
38296
|
}
|
|
38297
38297
|
function providesNamespace(text5) {
|
|
@@ -38318,8 +38318,8 @@ function catalogEntryName(contentsPath, kind, readText) {
|
|
|
38318
38318
|
}
|
|
38319
38319
|
return segments.join("/");
|
|
38320
38320
|
}
|
|
38321
|
-
function isFlatResourceImage(
|
|
38322
|
-
return
|
|
38321
|
+
function isFlatResourceImage(path66) {
|
|
38322
|
+
return path66.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path66));
|
|
38323
38323
|
}
|
|
38324
38324
|
function enumerateBundleImages(paths, readText, bundleForFile = () => ".") {
|
|
38325
38325
|
const table = [];
|
|
@@ -38332,7 +38332,7 @@ function enumerateBundleImages(paths, readText, bundleForFile = () => ".") {
|
|
|
38332
38332
|
seen.set(bundlePath, names);
|
|
38333
38333
|
return { bundlePath, names };
|
|
38334
38334
|
};
|
|
38335
|
-
const catalogs = paths.filter((
|
|
38335
|
+
const catalogs = paths.filter((path66) => baseOf(path66) === "Contents.json");
|
|
38336
38336
|
for (const contentsPath of catalogs) {
|
|
38337
38337
|
const name3 = catalogEntryName(contentsPath, ".imageset", readText);
|
|
38338
38338
|
if (name3 === null) continue;
|
|
@@ -38364,13 +38364,13 @@ function enumerateBundleImages(paths, readText, bundleForFile = () => ".") {
|
|
|
38364
38364
|
...intent === "template" || intent === "original" ? { renderingMode: intent } : {}
|
|
38365
38365
|
});
|
|
38366
38366
|
}
|
|
38367
|
-
for (const
|
|
38368
|
-
if (!isFlatResourceImage(
|
|
38369
|
-
const name3 = baseOf(
|
|
38370
|
-
const { bundlePath, names } = namesFor(
|
|
38367
|
+
for (const path66 of paths) {
|
|
38368
|
+
if (!isFlatResourceImage(path66)) continue;
|
|
38369
|
+
const name3 = baseOf(path66).slice(0, -extOf(path66).length);
|
|
38370
|
+
const { bundlePath, names } = namesFor(path66);
|
|
38371
38371
|
if (name3 === "" || names.has(name3)) continue;
|
|
38372
38372
|
names.add(name3);
|
|
38373
|
-
table.push({ name: name3, file:
|
|
38373
|
+
table.push({ name: name3, file: path66, scale: flatScale(path66), bundlePath });
|
|
38374
38374
|
}
|
|
38375
38375
|
return table;
|
|
38376
38376
|
}
|
|
@@ -38405,7 +38405,7 @@ function colorsetValue(color) {
|
|
|
38405
38405
|
}
|
|
38406
38406
|
function enumerateBundleColors(paths, readText) {
|
|
38407
38407
|
const table = {};
|
|
38408
|
-
for (const contentsPath of paths.filter((
|
|
38408
|
+
for (const contentsPath of paths.filter((path66) => baseOf(path66) === "Contents.json")) {
|
|
38409
38409
|
const name3 = catalogEntryName(contentsPath, ".colorset", readText);
|
|
38410
38410
|
if (name3 === null || name3 in table) continue;
|
|
38411
38411
|
let colors;
|
|
@@ -38486,8 +38486,8 @@ function axisExtremes(points) {
|
|
|
38486
38486
|
function pathBounds(d) {
|
|
38487
38487
|
const xs = [];
|
|
38488
38488
|
const ys = [];
|
|
38489
|
-
for (const
|
|
38490
|
-
(0, import_svgpath.default)(
|
|
38489
|
+
for (const path66 of d)
|
|
38490
|
+
(0, import_svgpath.default)(path66).abs().unshort().unarc().iterate((segment, _index, x, y) => {
|
|
38491
38491
|
const [command, ...args] = segment;
|
|
38492
38492
|
if (command === "M" || command === "L") {
|
|
38493
38493
|
xs.push(Number(args[0]));
|
|
@@ -38514,7 +38514,7 @@ function guide(svg, id, axis) {
|
|
|
38514
38514
|
}
|
|
38515
38515
|
function enumerateBundleSymbols(paths, readText, bundleForFile) {
|
|
38516
38516
|
const table = {};
|
|
38517
|
-
for (const contentsPath of paths.filter((
|
|
38517
|
+
for (const contentsPath of paths.filter((path66) => baseOf(path66) === "Contents.json")) {
|
|
38518
38518
|
const name3 = catalogEntryName(contentsPath, ".symbolset", readText);
|
|
38519
38519
|
if (name3 === null) continue;
|
|
38520
38520
|
const bundle = bundleForFile(contentsPath);
|
|
@@ -38573,8 +38573,8 @@ function enumerateBundleSymbols(paths, readText, bundleForFile) {
|
|
|
38573
38573
|
advance,
|
|
38574
38574
|
box: [12 - wide / 2, 12 - tall / 2, wide, tall],
|
|
38575
38575
|
...customLayout ? { customLayout } : {},
|
|
38576
|
-
layers: d.map((
|
|
38577
|
-
d: (0, import_svgpath.default)(
|
|
38576
|
+
layers: d.map((path66) => ({
|
|
38577
|
+
d: (0, import_svgpath.default)(path66).abs().scale(em).translate(translateX, translateY).round(3).toString()
|
|
38578
38578
|
}))
|
|
38579
38579
|
};
|
|
38580
38580
|
table[vectorKey] = vector;
|
|
@@ -38586,18 +38586,18 @@ function enumerateBundleSymbols(paths, readText, bundleForFile) {
|
|
|
38586
38586
|
return table;
|
|
38587
38587
|
}
|
|
38588
38588
|
var COMPILED_EXTENSIONS = /* @__PURE__ */ new Set([".swift", ".metal", ".storyboard", ".xib"]);
|
|
38589
|
-
function isCopiedResource(
|
|
38590
|
-
if (copiedBundle ||
|
|
38589
|
+
function isCopiedResource(path66, copiedBundle) {
|
|
38590
|
+
if (copiedBundle || path66.split("/").some((segment) => /\.(atlasc|bundle|storyboardc|nib)$/.test(segment)))
|
|
38591
38591
|
return true;
|
|
38592
|
-
const ext = extOf(
|
|
38592
|
+
const ext = extOf(path66);
|
|
38593
38593
|
if (ext === ".json" || ext === ".xcstrings") return true;
|
|
38594
|
-
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !
|
|
38594
|
+
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !path66.split("/").some((segment) => segment.endsWith(".xcassets"));
|
|
38595
38595
|
}
|
|
38596
38596
|
function enumerateBundleResources(paths, copiedBundle = false) {
|
|
38597
38597
|
const found = [];
|
|
38598
38598
|
const seen = /* @__PURE__ */ new Set();
|
|
38599
38599
|
const ordered = [...paths].filter(
|
|
38600
|
-
(
|
|
38600
|
+
(path66) => path66.split("/").includes("Resources") && path66.split("/").every((segment) => segment !== "" && segment !== "..") && isCopiedResource(path66, copiedBundle)
|
|
38601
38601
|
).sort((a, b) => {
|
|
38602
38602
|
const aDepth = a.split("/").length;
|
|
38603
38603
|
const bDepth = b.split("/").length;
|
|
@@ -38708,31 +38708,31 @@ function tokens(text5) {
|
|
|
38708
38708
|
}
|
|
38709
38709
|
return result;
|
|
38710
38710
|
}
|
|
38711
|
-
function qualified(language, key2,
|
|
38712
|
-
return `(${language}: ${key2}${
|
|
38711
|
+
function qualified(language, key2, path66) {
|
|
38712
|
+
return `(${language}: ${key2}${path66 === "" ? "" : "|==|" + path66})`;
|
|
38713
38713
|
}
|
|
38714
|
-
function requiresNumber(language, key2,
|
|
38714
|
+
function requiresNumber(language, key2, path66) {
|
|
38715
38715
|
return Error(
|
|
38716
|
-
"Plural variation requires referencing the number in the string. To maintain grammatical correctness for strings that do not reference the number of items, use separate top-level strings for one and greater than one. " + qualified(language, key2,
|
|
38716
|
+
"Plural variation requires referencing the number in the string. To maintain grammatical correctness for strings that do not reference the number of items, use separate top-level strings for one and greater than one. " + qualified(language, key2, path66)
|
|
38717
38717
|
);
|
|
38718
38718
|
}
|
|
38719
|
-
function moreThanOne(language, key2,
|
|
38719
|
+
function moreThanOne(language, key2, path66) {
|
|
38720
38720
|
return Error(
|
|
38721
|
-
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2,
|
|
38721
|
+
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path66)
|
|
38722
38722
|
);
|
|
38723
38723
|
}
|
|
38724
38724
|
function schemaPath(segments) {
|
|
38725
38725
|
return segments.map((segment) => `'${segment}'`).join(" -> ");
|
|
38726
38726
|
}
|
|
38727
|
-
function checkUnitShape(node,
|
|
38727
|
+
function checkUnitShape(node, path66) {
|
|
38728
38728
|
const raw2 = node.stringUnit;
|
|
38729
38729
|
if (raw2 === void 0)
|
|
38730
|
-
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(
|
|
38730
|
+
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path66)}`);
|
|
38731
38731
|
if (raw2 === null)
|
|
38732
|
-
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(
|
|
38732
|
+
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path66)}`);
|
|
38733
38733
|
if (!isRecord3(raw2))
|
|
38734
|
-
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(
|
|
38735
|
-
const unitPath = [...
|
|
38734
|
+
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path66)}`);
|
|
38735
|
+
const unitPath = [...path66, "stringUnit"];
|
|
38736
38736
|
if (!Object.hasOwn(raw2, "state"))
|
|
38737
38737
|
throw Error(`Missing required key 'state' inside ${schemaPath(unitPath)}`);
|
|
38738
38738
|
const state = raw2.state;
|
|
@@ -38749,38 +38749,38 @@ function checkUnitShape(node, path65) {
|
|
|
38749
38749
|
throw Error(`Expected string for key 'value' inside ${schemaPath(unitPath)}`);
|
|
38750
38750
|
return value;
|
|
38751
38751
|
}
|
|
38752
|
-
function checkPluralShape(node,
|
|
38752
|
+
function checkPluralShape(node, path66) {
|
|
38753
38753
|
for (const [category, raw2] of Object.entries(node)) {
|
|
38754
|
-
const categoryPath = [...
|
|
38754
|
+
const categoryPath = [...path66, category];
|
|
38755
38755
|
if (raw2 === null)
|
|
38756
38756
|
throw Error(
|
|
38757
|
-
`Missing required value for key '${category}' inside ${schemaPath(
|
|
38757
|
+
`Missing required value for key '${category}' inside ${schemaPath(path66)}`
|
|
38758
38758
|
);
|
|
38759
38759
|
if (!isRecord3(raw2))
|
|
38760
|
-
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(
|
|
38760
|
+
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path66)}`);
|
|
38761
38761
|
checkUnitShape(raw2, categoryPath);
|
|
38762
38762
|
}
|
|
38763
38763
|
}
|
|
38764
|
-
function checkLocalizationShape(node,
|
|
38764
|
+
function checkLocalizationShape(node, path66, deviceValue = false) {
|
|
38765
38765
|
if (node === null)
|
|
38766
38766
|
throw Error(
|
|
38767
|
-
`Missing required value for key '${
|
|
38767
|
+
`Missing required value for key '${path66[path66.length - 1]}' inside ${schemaPath(path66.slice(0, -1))}`
|
|
38768
38768
|
);
|
|
38769
38769
|
if (!isRecord3(node))
|
|
38770
38770
|
throw Error(
|
|
38771
|
-
`Expected dictionary for key '${
|
|
38771
|
+
`Expected dictionary for key '${path66[path66.length - 1]}' inside ${schemaPath(path66.slice(0, -1))}`
|
|
38772
38772
|
);
|
|
38773
|
-
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations,
|
|
38773
|
+
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path66);
|
|
38774
38774
|
if (!deviceValue && Object.hasOwn(node, "substitutions"))
|
|
38775
|
-
checkSubstitutionsShape(node.substitutions,
|
|
38776
|
-
if (!Object.hasOwn(node, "variations")) checkUnitShape(node,
|
|
38775
|
+
checkSubstitutionsShape(node.substitutions, path66);
|
|
38776
|
+
if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path66);
|
|
38777
38777
|
}
|
|
38778
|
-
function checkVariationsShape(variations,
|
|
38778
|
+
function checkVariationsShape(variations, path66) {
|
|
38779
38779
|
if (variations === null)
|
|
38780
|
-
throw Error(`Missing required value for key 'variations' inside ${schemaPath(
|
|
38780
|
+
throw Error(`Missing required value for key 'variations' inside ${schemaPath(path66)}`);
|
|
38781
38781
|
if (!isRecord3(variations))
|
|
38782
|
-
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(
|
|
38783
|
-
const variationsPath = [...
|
|
38782
|
+
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path66)}`);
|
|
38783
|
+
const variationsPath = [...path66, "variations"];
|
|
38784
38784
|
for (const [type, raw2] of Object.entries(variations)) {
|
|
38785
38785
|
if (raw2 === null)
|
|
38786
38786
|
throw Error(
|
|
@@ -38806,11 +38806,11 @@ function checkVariationsShape(variations, path65) {
|
|
|
38806
38806
|
}
|
|
38807
38807
|
}
|
|
38808
38808
|
}
|
|
38809
|
-
function checkSubstitutionsShape(substitutions,
|
|
38809
|
+
function checkSubstitutionsShape(substitutions, path66) {
|
|
38810
38810
|
if (substitutions === null) return;
|
|
38811
38811
|
if (!isRecord3(substitutions))
|
|
38812
|
-
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(
|
|
38813
|
-
const substitutionsPath = [...
|
|
38812
|
+
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path66)}`);
|
|
38813
|
+
const substitutionsPath = [...path66, "substitutions"];
|
|
38814
38814
|
for (const [name3, raw2] of Object.entries(substitutions)) {
|
|
38815
38815
|
const subPath = [...substitutionsPath, name3];
|
|
38816
38816
|
if (raw2 === null)
|
|
@@ -38852,10 +38852,10 @@ function scanSpecs(forms) {
|
|
|
38852
38852
|
}
|
|
38853
38853
|
return specs;
|
|
38854
38854
|
}
|
|
38855
|
-
function inferPlural(forms, language, key2,
|
|
38855
|
+
function inferPlural(forms, language, key2, path66) {
|
|
38856
38856
|
const specs = scanSpecs(forms);
|
|
38857
|
-
if (specs.size === 0) throw requiresNumber(language, key2,
|
|
38858
|
-
if (specs.size > 1) throw moreThanOne(language, key2,
|
|
38857
|
+
if (specs.size === 0) throw requiresNumber(language, key2, path66);
|
|
38858
|
+
if (specs.size > 1) throw moreThanOne(language, key2, path66);
|
|
38859
38859
|
return [...specs.values()][0] ?? { specifier: "", argument: 0 };
|
|
38860
38860
|
}
|
|
38861
38861
|
function unit(value) {
|
|
@@ -39687,13 +39687,269 @@ function plist4(value, depth) {
|
|
|
39687
39687
|
}
|
|
39688
39688
|
function compileStringCatalog(source, name3) {
|
|
39689
39689
|
return Object.fromEntries(
|
|
39690
|
-
Object.entries(compileCatalogTables(source, name3)).map(([
|
|
39691
|
-
|
|
39690
|
+
Object.entries(compileCatalogTables(source, name3)).map(([path66, table]) => [
|
|
39691
|
+
path66,
|
|
39692
39692
|
'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n' + plist4(table, 0) + "</plist>\n"
|
|
39693
39693
|
])
|
|
39694
39694
|
);
|
|
39695
39695
|
}
|
|
39696
39696
|
|
|
39697
|
+
// src/core-data-entity-classes.ts
|
|
39698
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
39699
|
+
var import_node_fs74 = require("node:fs");
|
|
39700
|
+
var import_node_path71 = __toESM(require("node:path"), 1);
|
|
39701
|
+
var unescapeXml = (value) => value.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
39702
|
+
function parseModel(xml) {
|
|
39703
|
+
const root = { name: "#root", attrs: {}, children: [] };
|
|
39704
|
+
const stack = [root];
|
|
39705
|
+
for (const match of xml.matchAll(
|
|
39706
|
+
/<(\/?)([A-Za-z][\w-]*)((?:\s+[\w:-]+="[^"]*")*)\s*(\/?)>/g
|
|
39707
|
+
)) {
|
|
39708
|
+
const [, closing, name3, attributes, selfClosing] = match;
|
|
39709
|
+
if (closing) {
|
|
39710
|
+
stack.pop();
|
|
39711
|
+
continue;
|
|
39712
|
+
}
|
|
39713
|
+
const attrs = {};
|
|
39714
|
+
for (const attribute of attributes.matchAll(/([\w:-]+)="([^"]*)"/g))
|
|
39715
|
+
attrs[attribute[1]] = unescapeXml(attribute[2]);
|
|
39716
|
+
const tag = { name: name3, attrs, children: [] };
|
|
39717
|
+
stack.at(-1).children.push(tag);
|
|
39718
|
+
if (!selfClosing) stack.push(tag);
|
|
39719
|
+
}
|
|
39720
|
+
return root;
|
|
39721
|
+
}
|
|
39722
|
+
var scalarTypes = {
|
|
39723
|
+
"Integer 16": ["Int16", "NSNumber"],
|
|
39724
|
+
"Integer 32": ["Int32", "NSNumber"],
|
|
39725
|
+
"Integer 64": ["Int64", "NSNumber"],
|
|
39726
|
+
Double: ["Double", "NSNumber"],
|
|
39727
|
+
Float: ["Float", "NSNumber"],
|
|
39728
|
+
Boolean: ["Bool", "NSNumber"]
|
|
39729
|
+
};
|
|
39730
|
+
var objectTypes = {
|
|
39731
|
+
Decimal: "NSDecimalNumber",
|
|
39732
|
+
String: "String",
|
|
39733
|
+
Date: "Date",
|
|
39734
|
+
Binary: "Data",
|
|
39735
|
+
UUID: "UUID",
|
|
39736
|
+
URI: "URL",
|
|
39737
|
+
Undefined: "NSObject"
|
|
39738
|
+
};
|
|
39739
|
+
var reserved = /* @__PURE__ */ new Set([
|
|
39740
|
+
"class",
|
|
39741
|
+
"in",
|
|
39742
|
+
"init",
|
|
39743
|
+
"self",
|
|
39744
|
+
"Type",
|
|
39745
|
+
"Protocol",
|
|
39746
|
+
"default",
|
|
39747
|
+
"repeat",
|
|
39748
|
+
"operator",
|
|
39749
|
+
"subscript"
|
|
39750
|
+
]);
|
|
39751
|
+
var identifier = (name3) => reserved.has(name3) ? `\`${name3}\`` : name3;
|
|
39752
|
+
var capitalized = (name3) => name3.charAt(0).toUpperCase() + name3.slice(1);
|
|
39753
|
+
var className = (represented) => {
|
|
39754
|
+
const at = represented.lastIndexOf(".");
|
|
39755
|
+
return at < 0 ? { name: represented, module: null } : { name: represented.slice(at + 1), module: represented.slice(0, at) };
|
|
39756
|
+
};
|
|
39757
|
+
function refuse2(model, reason) {
|
|
39758
|
+
throw new Error(`Core Data entity classes are unproven for ${model}: ${reason}`);
|
|
39759
|
+
}
|
|
39760
|
+
var generatedNotice = (file) => `//
|
|
39761
|
+
// ${file}
|
|
39762
|
+
//
|
|
39763
|
+
// This file was automatically generated and should not be edited.
|
|
39764
|
+
//
|
|
39765
|
+
`;
|
|
39766
|
+
function entityFiles(model, entity, entities) {
|
|
39767
|
+
const entityName = entity.attrs.name;
|
|
39768
|
+
const represented = className(entity.attrs.representedClassName);
|
|
39769
|
+
const codegen = entity.attrs.codeGenerationType;
|
|
39770
|
+
const parent = entity.attrs.parentEntity ? entities.get(entity.attrs.parentEntity) : void 0;
|
|
39771
|
+
if (entity.attrs.parentEntity && !parent)
|
|
39772
|
+
refuse2(
|
|
39773
|
+
model,
|
|
39774
|
+
`${entityName} names the missing parent entity ${entity.attrs.parentEntity}`
|
|
39775
|
+
);
|
|
39776
|
+
const files2 = {};
|
|
39777
|
+
const base = parent ? className(parent.attrs.representedClassName ?? parent.attrs.name).name : "NSManagedObject";
|
|
39778
|
+
if (codegen === "class") {
|
|
39779
|
+
const file2 = `${represented.name}+CoreDataClass.swift`;
|
|
39780
|
+
files2[file2] = `${generatedNotice(file2)}
|
|
39781
|
+
public import Foundation
|
|
39782
|
+
public import CoreData
|
|
39783
|
+
|
|
39784
|
+
public typealias ${represented.name}CoreDataClassSet = NSSet
|
|
39785
|
+
|
|
39786
|
+
${represented.module ? "\n" : `@objc(${represented.name})
|
|
39787
|
+
`}public class ${represented.name}: ${base} {
|
|
39788
|
+
|
|
39789
|
+
}
|
|
39790
|
+
`;
|
|
39791
|
+
}
|
|
39792
|
+
const imports2 = /* @__PURE__ */ new Set();
|
|
39793
|
+
const properties = [];
|
|
39794
|
+
const accessors = [];
|
|
39795
|
+
for (const member of entity.children) {
|
|
39796
|
+
const name3 = member.attrs.name;
|
|
39797
|
+
if (member.name === "attribute") {
|
|
39798
|
+
const type = member.attrs.attributeType;
|
|
39799
|
+
let swiftType;
|
|
39800
|
+
const scalar = scalarTypes[type];
|
|
39801
|
+
if (scalar)
|
|
39802
|
+
swiftType = member.attrs.usesScalarValueType === "NO" ? `${scalar[1]}?` : scalar[0];
|
|
39803
|
+
else if (type === "Transformable" && member.attrs.customClassName) {
|
|
39804
|
+
const custom = className(member.attrs.customClassName);
|
|
39805
|
+
if (custom.module) imports2.add(custom.module);
|
|
39806
|
+
swiftType = `${custom.name}?`;
|
|
39807
|
+
} else if (type === "Transformable") swiftType = "NSObject?";
|
|
39808
|
+
else if (objectTypes[type]) swiftType = `${objectTypes[type]}?`;
|
|
39809
|
+
else refuse2(model, `${entityName}.${name3} has the attribute type ${type}`);
|
|
39810
|
+
properties.push(
|
|
39811
|
+
` @NSManaged nonisolated public var ${identifier(name3)}: ${swiftType}`
|
|
39812
|
+
);
|
|
39813
|
+
} else if (member.name === "relationship") {
|
|
39814
|
+
const destination = entities.get(member.attrs.destinationEntity);
|
|
39815
|
+
if (!destination)
|
|
39816
|
+
refuse2(
|
|
39817
|
+
model,
|
|
39818
|
+
`${entityName}.${name3} names the missing entity ${member.attrs.destinationEntity}`
|
|
39819
|
+
);
|
|
39820
|
+
const target = className(
|
|
39821
|
+
destination.attrs.representedClassName ?? destination.attrs.name
|
|
39822
|
+
);
|
|
39823
|
+
if (target.module) imports2.add(target.module);
|
|
39824
|
+
if (member.attrs.toMany !== "YES") {
|
|
39825
|
+
properties.push(
|
|
39826
|
+
` @NSManaged nonisolated public var ${identifier(name3)}: ${target.name}?`
|
|
39827
|
+
);
|
|
39828
|
+
continue;
|
|
39829
|
+
}
|
|
39830
|
+
const cap = capitalized(name3);
|
|
39831
|
+
const ordered = member.attrs.ordered === "YES";
|
|
39832
|
+
properties.push(
|
|
39833
|
+
` @NSManaged nonisolated public var ${identifier(name3)}: ${ordered ? "NSOrderedSet" : "NSSet"}?`
|
|
39834
|
+
);
|
|
39835
|
+
const lines = [
|
|
39836
|
+
`// MARK: Generated accessors for ${name3}`,
|
|
39837
|
+
"extension " + represented.name + " {",
|
|
39838
|
+
""
|
|
39839
|
+
];
|
|
39840
|
+
const add = (selector, signature) => lines.push(
|
|
39841
|
+
` @objc(${selector})`,
|
|
39842
|
+
` @NSManaged nonisolated public func ${signature}`,
|
|
39843
|
+
""
|
|
39844
|
+
);
|
|
39845
|
+
if (ordered) {
|
|
39846
|
+
add(
|
|
39847
|
+
`insertObject:in${cap}AtIndex:`,
|
|
39848
|
+
`insertInto${cap}(_ value: ${target.name}, at idx: Int)`
|
|
39849
|
+
);
|
|
39850
|
+
add(`removeObjectFrom${cap}AtIndex:`, `removeFrom${cap}(at idx: Int)`);
|
|
39851
|
+
add(
|
|
39852
|
+
`insert${cap}:atIndexes:`,
|
|
39853
|
+
`insertInto${cap}(_ values: [${target.name}], at indexes: NSIndexSet)`
|
|
39854
|
+
);
|
|
39855
|
+
add(`remove${cap}AtIndexes:`, `removeFrom${cap}(at indexes: NSIndexSet)`);
|
|
39856
|
+
add(
|
|
39857
|
+
`replaceObjectIn${cap}AtIndex:withObject:`,
|
|
39858
|
+
`replace${cap}(at idx: Int, with value: ${target.name})`
|
|
39859
|
+
);
|
|
39860
|
+
add(
|
|
39861
|
+
`replace${cap}AtIndexes:with${cap}:`,
|
|
39862
|
+
`replace${cap}(at indexes: NSIndexSet, with values: [${target.name}])`
|
|
39863
|
+
);
|
|
39864
|
+
}
|
|
39865
|
+
add(`add${cap}Object:`, `addTo${cap}(_ value: ${target.name})`);
|
|
39866
|
+
add(`remove${cap}Object:`, `removeFrom${cap}(_ value: ${target.name})`);
|
|
39867
|
+
add(`add${cap}:`, `addTo${cap}(_ values: ${ordered ? "NSOrderedSet" : "NSSet"})`);
|
|
39868
|
+
add(
|
|
39869
|
+
`remove${cap}:`,
|
|
39870
|
+
`removeFrom${cap}(_ values: ${ordered ? "NSOrderedSet" : "NSSet"})`
|
|
39871
|
+
);
|
|
39872
|
+
lines.push("}", "");
|
|
39873
|
+
accessors.push(lines.join("\n"));
|
|
39874
|
+
} else if (["fetchedProperty", "compositeAttribute", "derivedAttribute"].includes(member.name))
|
|
39875
|
+
refuse2(model, `${entityName} declares a ${member.name}`);
|
|
39876
|
+
}
|
|
39877
|
+
const file = `${represented.name}+CoreDataProperties.swift`;
|
|
39878
|
+
files2[file] = `${generatedNotice(file)}
|
|
39879
|
+
public import Foundation
|
|
39880
|
+
public import CoreData
|
|
39881
|
+
${imports2.size > 0 ? [...imports2].sort().map((module2) => `import ${module2}
|
|
39882
|
+
`).join("") : "\n"}
|
|
39883
|
+
public typealias ${represented.name}CoreDataPropertiesSet = NSSet
|
|
39884
|
+
|
|
39885
|
+
extension ${represented.name} {
|
|
39886
|
+
|
|
39887
|
+
@nonobjc public class func fetchRequest() -> NSFetchRequest<${represented.name}> {
|
|
39888
|
+
return NSFetchRequest<${represented.name}>(entityName: "${entityName}")
|
|
39889
|
+
}
|
|
39890
|
+
|
|
39891
|
+
${properties.length > 0 ? `${properties.join("\n")}
|
|
39892
|
+
|
|
39893
|
+
` : "\n"}}
|
|
39894
|
+
|
|
39895
|
+
${accessors.map((block2) => `${block2}
|
|
39896
|
+
`).join("")}${parent ? "" : `extension ${represented.name} : Identifiable {
|
|
39897
|
+
|
|
39898
|
+
}
|
|
39899
|
+
`}`;
|
|
39900
|
+
return files2;
|
|
39901
|
+
}
|
|
39902
|
+
function coreDataEntityClasses(modelFile, model = import_node_path71.default.basename(import_node_path71.default.dirname(modelFile))) {
|
|
39903
|
+
const root = parseModel((0, import_node_fs74.readFileSync)(modelFile, "utf8"));
|
|
39904
|
+
const entities = /* @__PURE__ */ new Map();
|
|
39905
|
+
const modelTag = root.children.find((tag) => tag.name === "model");
|
|
39906
|
+
if (!modelTag) refuse2(model, "the contents file has no model element");
|
|
39907
|
+
for (const tag of modelTag.children)
|
|
39908
|
+
if (tag.name === "entity") entities.set(tag.attrs.name, tag);
|
|
39909
|
+
const files2 = {};
|
|
39910
|
+
for (const entity of entities.values()) {
|
|
39911
|
+
const codegen = entity.attrs.codeGenerationType;
|
|
39912
|
+
if (codegen !== "class" && codegen !== "category") continue;
|
|
39913
|
+
if (!entity.attrs.representedClassName) continue;
|
|
39914
|
+
Object.assign(files2, entityFiles(model, entity, entities));
|
|
39915
|
+
}
|
|
39916
|
+
return files2;
|
|
39917
|
+
}
|
|
39918
|
+
function currentModelContents(modelDirectory) {
|
|
39919
|
+
if (modelDirectory.endsWith(".xcdatamodel"))
|
|
39920
|
+
return import_node_path71.default.join(modelDirectory, "contents");
|
|
39921
|
+
const versionFile = import_node_path71.default.join(modelDirectory, ".xccurrentversion");
|
|
39922
|
+
const versions = (0, import_node_fs74.readdirSync)(modelDirectory).filter(
|
|
39923
|
+
(entry) => entry.endsWith(".xcdatamodel")
|
|
39924
|
+
);
|
|
39925
|
+
const named = (0, import_node_fs74.existsSync)(versionFile) ? parsePlistSource((0, import_node_fs74.readFileSync)(versionFile, "utf8")) : void 0;
|
|
39926
|
+
const current2 = typeof named === "object" && named !== null && "_XCCurrentVersionName" in named && typeof named._XCCurrentVersionName === "string" ? named._XCCurrentVersionName : !(0, import_node_fs74.existsSync)(versionFile) && versions.length === 1 ? versions[0] : void 0;
|
|
39927
|
+
if (current2 && versions.includes(current2))
|
|
39928
|
+
return import_node_path71.default.join(modelDirectory, current2, "contents");
|
|
39929
|
+
const generating = versions.filter(
|
|
39930
|
+
(version2) => /codeGenerationType="(?:class|category)"/.test(
|
|
39931
|
+
(0, import_node_fs74.readFileSync)(import_node_path71.default.join(modelDirectory, version2, "contents"), "utf8")
|
|
39932
|
+
)
|
|
39933
|
+
);
|
|
39934
|
+
if (generating.length > 0)
|
|
39935
|
+
refuse2(import_node_path71.default.basename(modelDirectory), "the current model version is not named");
|
|
39936
|
+
return null;
|
|
39937
|
+
}
|
|
39938
|
+
function coreDataSources(files2) {
|
|
39939
|
+
const models = /* @__PURE__ */ new Set();
|
|
39940
|
+
for (const file of files2) {
|
|
39941
|
+
const at = file.search(/\.xcdatamodeld(?:[\\/]|$)/);
|
|
39942
|
+
if (at >= 0) models.add(file.slice(0, at + ".xcdatamodeld".length));
|
|
39943
|
+
}
|
|
39944
|
+
const sources = {};
|
|
39945
|
+
for (const directory of [...models].sort()) {
|
|
39946
|
+
const contents = currentModelContents(directory);
|
|
39947
|
+
if (contents)
|
|
39948
|
+
Object.assign(sources, coreDataEntityClasses(contents, import_node_path71.default.basename(directory)));
|
|
39949
|
+
}
|
|
39950
|
+
return sources;
|
|
39951
|
+
}
|
|
39952
|
+
|
|
39697
39953
|
// src/ios-sdk-frameworks.json
|
|
39698
39954
|
var ios_sdk_frameworks_default = {
|
|
39699
39955
|
sdk: "iphonesimulator27.1",
|
|
@@ -39989,8 +40245,8 @@ var ios_sdk_frameworks_default = {
|
|
|
39989
40245
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
39990
40246
|
var import_node_child_process38 = require("node:child_process");
|
|
39991
40247
|
var import_node_crypto37 = require("node:crypto");
|
|
39992
|
-
var
|
|
39993
|
-
var
|
|
40248
|
+
var import_node_fs75 = __toESM(require("node:fs"), 1);
|
|
40249
|
+
var import_node_path72 = __toESM(require("node:path"), 1);
|
|
39994
40250
|
var cachedInputs = /* @__PURE__ */ new Map();
|
|
39995
40251
|
function cxxTrace(stderr) {
|
|
39996
40252
|
const files2 = [];
|
|
@@ -40028,7 +40284,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
40028
40284
|
);
|
|
40029
40285
|
for (const [file, bytes] of inputs.sources)
|
|
40030
40286
|
hash.update(file).update("\0").update(bytes).update("\0");
|
|
40031
|
-
const compiler =
|
|
40287
|
+
const compiler = import_node_fs75.default.statSync(clang);
|
|
40032
40288
|
hash.update(`${compiler.size}:${compiler.mtimeMs}`);
|
|
40033
40289
|
const key2 = hash.digest("hex");
|
|
40034
40290
|
const cached2 = cachedInputs.get(key2);
|
|
@@ -40043,7 +40299,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
40043
40299
|
if (!(error instanceof SwiftObjCCompilationError)) throw error;
|
|
40044
40300
|
receipt = error.receipt;
|
|
40045
40301
|
}
|
|
40046
|
-
const data = JSON.parse(
|
|
40302
|
+
const data = JSON.parse(import_node_fs75.default.readFileSync(receipt, "utf8"));
|
|
40047
40303
|
if (!isRecord(data) || typeof data.work !== "string" || !Array.isArray(data.commands) || !["prepared", "compile-failed"].includes(String(data.status)))
|
|
40048
40304
|
throw new Error("C++ header discovery requires completed original compiler inputs");
|
|
40049
40305
|
const work = data.work;
|
|
@@ -40068,7 +40324,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
40068
40324
|
const relative3 = relativeInside(checkouts, headers[0]);
|
|
40069
40325
|
if (relative3 === null) throw new Error("binary header staging escapes its checkout");
|
|
40070
40326
|
return {
|
|
40071
|
-
root:
|
|
40327
|
+
root: import_node_path72.default.join(work, "packages", relative3),
|
|
40072
40328
|
roots: /* @__PURE__ */ new Set(),
|
|
40073
40329
|
reached: /* @__PURE__ */ new Set(),
|
|
40074
40330
|
flags: /* @__PURE__ */ new Map(),
|
|
@@ -40119,7 +40375,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
40119
40375
|
if (!item) continue;
|
|
40120
40376
|
let found = false;
|
|
40121
40377
|
for (const file of reached) {
|
|
40122
|
-
const relative3 = relativeInside(item.root,
|
|
40378
|
+
const relative3 = relativeInside(item.root, import_node_path72.default.resolve(work, file));
|
|
40123
40379
|
if (relative3) {
|
|
40124
40380
|
item.reached.add(relative3);
|
|
40125
40381
|
found = true;
|
|
@@ -40140,7 +40396,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
40140
40396
|
if (!match) continue;
|
|
40141
40397
|
const depth = match[1].length;
|
|
40142
40398
|
stack.length = depth - 1;
|
|
40143
|
-
const file =
|
|
40399
|
+
const file = import_node_path72.default.resolve(work, match[2]);
|
|
40144
40400
|
const relative3 = relativeInside(item.root, file);
|
|
40145
40401
|
if (relative3 && !stack.some((ancestor) => relativeInside(item.root, ancestor) !== null))
|
|
40146
40402
|
item.roots.add(relative3);
|
|
@@ -40151,12 +40407,12 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
40151
40407
|
for (const item of used) item.errors.add(`${label}: ${cxxDiagnostic(stderr)}`);
|
|
40152
40408
|
};
|
|
40153
40409
|
const firstPass = (command) => {
|
|
40154
|
-
if (!command.log || !
|
|
40155
|
-
const stderr =
|
|
40156
|
-
if (command.status === 0 && command.dependencies &&
|
|
40410
|
+
if (!command.log || !import_node_fs75.default.existsSync(command.log)) return void 0;
|
|
40411
|
+
const stderr = import_node_fs75.default.readFileSync(command.log, "utf8");
|
|
40412
|
+
if (command.status === 0 && command.dependencies && import_node_fs75.default.existsSync(command.dependencies)) {
|
|
40157
40413
|
try {
|
|
40158
40414
|
return {
|
|
40159
|
-
reached: cxxDependencies(
|
|
40415
|
+
reached: cxxDependencies(import_node_fs75.default.readFileSync(command.dependencies, "utf8")),
|
|
40160
40416
|
stderr,
|
|
40161
40417
|
failed: false
|
|
40162
40418
|
};
|
|
@@ -40188,9 +40444,9 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
40188
40444
|
}
|
|
40189
40445
|
const original = command.args[command.args.indexOf("-c") + 1];
|
|
40190
40446
|
if (!original) throw new Error("original C++ compiler command has no source");
|
|
40191
|
-
const staged2 =
|
|
40192
|
-
const probe =
|
|
40193
|
-
|
|
40447
|
+
const staged2 = import_node_path72.default.join(work, "project", import_node_path72.default.relative(app.rootDir, bridge));
|
|
40448
|
+
const probe = import_node_path72.default.join(work, `peach-cxx-bridge-${target.moduleName}.mm`);
|
|
40449
|
+
import_node_fs75.default.writeFileSync(probe, `#include ${JSON.stringify(staged2)}
|
|
40194
40450
|
`);
|
|
40195
40451
|
try {
|
|
40196
40452
|
compile2(
|
|
@@ -40198,7 +40454,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
40198
40454
|
`${target.moduleName}: bridging header ${bridge}`
|
|
40199
40455
|
);
|
|
40200
40456
|
} finally {
|
|
40201
|
-
|
|
40457
|
+
import_node_fs75.default.rmSync(probe, { force: true });
|
|
40202
40458
|
}
|
|
40203
40459
|
}
|
|
40204
40460
|
const result = binaries.map((binary2, index) => {
|
|
@@ -40226,9 +40482,9 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
40226
40482
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
40227
40483
|
var import_node_child_process39 = require("node:child_process");
|
|
40228
40484
|
var import_node_crypto38 = require("node:crypto");
|
|
40229
|
-
var
|
|
40485
|
+
var import_node_fs77 = __toESM(require("node:fs"), 1);
|
|
40230
40486
|
var import_node_os15 = __toESM(require("node:os"), 1);
|
|
40231
|
-
var
|
|
40487
|
+
var import_node_path74 = __toESM(require("node:path"), 1);
|
|
40232
40488
|
|
|
40233
40489
|
// cli/internal-child-contract.ts
|
|
40234
40490
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -40243,8 +40499,8 @@ var RNX_INTERNAL_CHILDREN = {
|
|
|
40243
40499
|
|
|
40244
40500
|
// cli/self-invocation.ts
|
|
40245
40501
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
40246
|
-
var
|
|
40247
|
-
var
|
|
40502
|
+
var import_node_fs76 = require("node:fs");
|
|
40503
|
+
var import_node_path73 = require("node:path");
|
|
40248
40504
|
var import_node_url5 = require("node:url");
|
|
40249
40505
|
|
|
40250
40506
|
// cli/standalone.ts
|
|
@@ -40254,14 +40510,14 @@ var IS_STANDALONE = typeof __SOOTSIM_STANDALONE__ !== "undefined" && __SOOTSIM_S
|
|
|
40254
40510
|
// cli/self-invocation.ts
|
|
40255
40511
|
function sourceEntryPath() {
|
|
40256
40512
|
try {
|
|
40257
|
-
const candidate = (0,
|
|
40258
|
-
return (0,
|
|
40513
|
+
const candidate = (0, import_node_path73.join)((0, import_node_path73.dirname)((0, import_node_url5.fileURLToPath)(__sootsim_import_meta_url)), "bin.ts");
|
|
40514
|
+
return (0, import_node_fs76.existsSync)(candidate) ? candidate : null;
|
|
40259
40515
|
} catch {
|
|
40260
40516
|
return null;
|
|
40261
40517
|
}
|
|
40262
40518
|
}
|
|
40263
|
-
function isCliEntry(
|
|
40264
|
-
const name3 = (0,
|
|
40519
|
+
function isCliEntry(path66) {
|
|
40520
|
+
const name3 = (0, import_node_path73.basename)(path66);
|
|
40265
40521
|
return name3 === "bin.ts" || name3 === "bin.js";
|
|
40266
40522
|
}
|
|
40267
40523
|
function rnxSelfInvocation() {
|
|
@@ -40307,25 +40563,25 @@ guard CGImageDestinationFinalize(dest) else { exit(7) }
|
|
|
40307
40563
|
`;
|
|
40308
40564
|
function rasterBinary() {
|
|
40309
40565
|
const tag = (0, import_node_crypto38.createHash)("sha256").update(RASTER_SWIFT).digest("hex").slice(0, 16);
|
|
40310
|
-
const binary2 =
|
|
40566
|
+
const binary2 = import_node_path74.default.join(cacheDir(), `swift-pdf-raster-${tag}`);
|
|
40311
40567
|
try {
|
|
40312
|
-
|
|
40568
|
+
import_node_fs77.default.accessSync(binary2, import_node_fs77.default.constants.X_OK);
|
|
40313
40569
|
return binary2;
|
|
40314
40570
|
} catch {
|
|
40315
40571
|
}
|
|
40316
40572
|
try {
|
|
40317
|
-
|
|
40318
|
-
const source =
|
|
40319
|
-
|
|
40573
|
+
import_node_fs77.default.mkdirSync(cacheDir(), { recursive: true });
|
|
40574
|
+
const source = import_node_path74.default.join(
|
|
40575
|
+
import_node_fs77.default.mkdtempSync(import_node_path74.default.join(import_node_os15.default.tmpdir(), "swift-pdf-raster-")),
|
|
40320
40576
|
"raster.swift"
|
|
40321
40577
|
);
|
|
40322
|
-
|
|
40578
|
+
import_node_fs77.default.writeFileSync(source, RASTER_SWIFT);
|
|
40323
40579
|
try {
|
|
40324
40580
|
(0, import_node_child_process39.execFileSync)("xcrun", ["swiftc", "-o", binary2, source], { stdio: "pipe" });
|
|
40325
40581
|
} finally {
|
|
40326
|
-
|
|
40582
|
+
import_node_fs77.default.rmSync(import_node_path74.default.dirname(source), { recursive: true, force: true });
|
|
40327
40583
|
}
|
|
40328
|
-
|
|
40584
|
+
import_node_fs77.default.accessSync(binary2, import_node_fs77.default.constants.X_OK);
|
|
40329
40585
|
return binary2;
|
|
40330
40586
|
} catch (error) {
|
|
40331
40587
|
throw new Error(
|
|
@@ -40335,13 +40591,13 @@ function rasterBinary() {
|
|
|
40335
40591
|
}
|
|
40336
40592
|
function rasterizePdfFile(diskPath, pdfSha256) {
|
|
40337
40593
|
const renderer = process.platform === "darwin" ? (0, import_node_crypto38.createHash)("sha256").update(RASTER_SWIFT).digest("hex").slice(0, 16) : "pdfium-1";
|
|
40338
|
-
const cached2 =
|
|
40594
|
+
const cached2 = import_node_path74.default.join(cacheDir(), `swift-pdf-png-${renderer}-${pdfSha256}.png`);
|
|
40339
40595
|
try {
|
|
40340
|
-
return { bytes:
|
|
40596
|
+
return { bytes: import_node_fs77.default.readFileSync(cached2) };
|
|
40341
40597
|
} catch {
|
|
40342
40598
|
}
|
|
40343
|
-
const out =
|
|
40344
|
-
|
|
40599
|
+
const out = import_node_path74.default.join(
|
|
40600
|
+
import_node_fs77.default.mkdtempSync(import_node_path74.default.join(import_node_os15.default.tmpdir(), "swift-pdf-png-")),
|
|
40345
40601
|
"out.png"
|
|
40346
40602
|
);
|
|
40347
40603
|
try {
|
|
@@ -40362,10 +40618,10 @@ function rasterizePdfFile(diskPath, pdfSha256) {
|
|
|
40362
40618
|
{ stdio: "pipe" }
|
|
40363
40619
|
);
|
|
40364
40620
|
}
|
|
40365
|
-
const bytes =
|
|
40621
|
+
const bytes = import_node_fs77.default.readFileSync(out);
|
|
40366
40622
|
try {
|
|
40367
|
-
|
|
40368
|
-
|
|
40623
|
+
import_node_fs77.default.mkdirSync(cacheDir(), { recursive: true });
|
|
40624
|
+
import_node_fs77.default.copyFileSync(out, cached2);
|
|
40369
40625
|
} catch {
|
|
40370
40626
|
}
|
|
40371
40627
|
return { bytes: Buffer.from(bytes) };
|
|
@@ -40374,7 +40630,7 @@ function rasterizePdfFile(diskPath, pdfSha256) {
|
|
|
40374
40630
|
`swift pdf asset ${diskPath} did not rasterize (corrupt or oversize pdf, like actool distill failure): ${error instanceof Error ? error.message : String(error)}`
|
|
40375
40631
|
);
|
|
40376
40632
|
} finally {
|
|
40377
|
-
|
|
40633
|
+
import_node_fs77.default.rmSync(import_node_path74.default.dirname(out), { recursive: true, force: true });
|
|
40378
40634
|
}
|
|
40379
40635
|
}
|
|
40380
40636
|
|
|
@@ -40390,18 +40646,18 @@ var SKIP_ROOT_DIRS = /* @__PURE__ */ new Set(["dist", "types", "build", "ios", "
|
|
|
40390
40646
|
var NATIVE_DESCRIPTOR = ".one-native-source.json";
|
|
40391
40647
|
var NATIVE_GLUE = ".one-native-source.swift.txt";
|
|
40392
40648
|
function swiftPackageId(packagePath) {
|
|
40393
|
-
return
|
|
40649
|
+
return import_node_path75.default.basename(packagePath).replace(/[^A-Za-z0-9_]/g, "_").replace(/^(\d)/, "_$1");
|
|
40394
40650
|
}
|
|
40395
40651
|
function nativeSourceDescriptor(packagePath) {
|
|
40396
|
-
packagePath =
|
|
40652
|
+
packagePath = import_node_fs78.default.realpathSync(packagePath);
|
|
40397
40653
|
if (sourceEntries().has(packagePath)) return null;
|
|
40398
|
-
const file =
|
|
40399
|
-
if (!
|
|
40654
|
+
const file = import_node_path75.default.join(packagePath, NATIVE_DESCRIPTOR);
|
|
40655
|
+
if (!import_node_fs78.default.existsSync(file)) return null;
|
|
40400
40656
|
const value = JSON.parse(
|
|
40401
40657
|
readPackageFile2(packagePath, file, MAX_SWIFT_COMPILE_SOURCE_BYTES).toString("utf8")
|
|
40402
40658
|
);
|
|
40403
40659
|
const invalid = () => new Error(`${file}: invalid One native source descriptor; run one typegen`);
|
|
40404
|
-
if (!value || typeof value !== "object" || Reflect.get(value, "generatedBy") !== "one typegen" || !
|
|
40660
|
+
if (!value || typeof value !== "object" || Reflect.get(value, "generatedBy") !== "one typegen" || !import_node_fs78.default.existsSync(import_node_path75.default.join(packagePath, NATIVE_GLUE))) {
|
|
40405
40661
|
throw invalid();
|
|
40406
40662
|
}
|
|
40407
40663
|
if (!isSwiftNativeModules(value) || value.packageId !== swiftPackageId(packagePath)) {
|
|
@@ -40417,7 +40673,7 @@ var projects = () => projectScope.getStore()?.projects ?? sharedProjects;
|
|
|
40417
40673
|
var sharedSourceEntries = /* @__PURE__ */ new Map();
|
|
40418
40674
|
var sourceEntries = () => projectScope.getStore()?.sourceEntries ?? sharedSourceEntries;
|
|
40419
40675
|
function projectFor(packagePath, hosted, signal) {
|
|
40420
|
-
packagePath =
|
|
40676
|
+
packagePath = import_node_fs78.default.realpathSync(packagePath);
|
|
40421
40677
|
const existing = projects().get(packagePath);
|
|
40422
40678
|
if (existing) {
|
|
40423
40679
|
if (signal && existing.signal !== signal) {
|
|
@@ -40485,23 +40741,23 @@ function readXcodeAppTargetPrepared(input, target, configuration, options) {
|
|
|
40485
40741
|
});
|
|
40486
40742
|
const checkouts = remoteSwiftCheckouts(probe.rootDir);
|
|
40487
40743
|
for (const projectDir of probe.projectDirs) {
|
|
40488
|
-
const packages =
|
|
40489
|
-
|
|
40490
|
-
const link =
|
|
40744
|
+
const packages = import_node_path75.default.join(projectDir, ".build", "peach-xcode", "SourcePackages");
|
|
40745
|
+
import_node_fs78.default.mkdirSync(packages, { recursive: true });
|
|
40746
|
+
const link = import_node_path75.default.join(packages, "checkouts");
|
|
40491
40747
|
let linked = null;
|
|
40492
40748
|
try {
|
|
40493
|
-
linked =
|
|
40749
|
+
linked = import_node_fs78.default.lstatSync(link).isSymbolicLink() ? import_node_fs78.default.readlinkSync(link) : null;
|
|
40494
40750
|
} catch {
|
|
40495
40751
|
linked = null;
|
|
40496
40752
|
}
|
|
40497
40753
|
if (linked !== null) {
|
|
40498
|
-
if (
|
|
40499
|
-
|
|
40500
|
-
} else if (
|
|
40754
|
+
if (import_node_path75.default.resolve(packages, linked) === checkouts) continue;
|
|
40755
|
+
import_node_fs78.default.unlinkSync(link);
|
|
40756
|
+
} else if (import_node_fs78.default.existsSync(link)) continue;
|
|
40501
40757
|
try {
|
|
40502
|
-
|
|
40758
|
+
import_node_fs78.default.symlinkSync(checkouts, link);
|
|
40503
40759
|
} catch (error) {
|
|
40504
|
-
if (!(error instanceof Error && "code" in error && error.code === "EEXIST") ||
|
|
40760
|
+
if (!(error instanceof Error && "code" in error && error.code === "EEXIST") || import_node_path75.default.resolve(packages, import_node_fs78.default.readlinkSync(link)) !== checkouts)
|
|
40505
40761
|
throw error;
|
|
40506
40762
|
}
|
|
40507
40763
|
}
|
|
@@ -40532,7 +40788,7 @@ function openXcodeProject(xcodeproj, target, moduleRoot, configuration, interfac
|
|
|
40532
40788
|
return root;
|
|
40533
40789
|
}
|
|
40534
40790
|
async function swiftPackages(entry, app) {
|
|
40535
|
-
const stamp = (file) =>
|
|
40791
|
+
const stamp = (file) => import_node_fs78.default.existsSync(file) ? (0, import_node_crypto39.createHash)("sha256").update(import_node_fs78.default.readFileSync(file)).digest("hex") : null;
|
|
40536
40792
|
const owners = [...app.frameworks, app].map((target) => ({
|
|
40537
40793
|
module: target.moduleName,
|
|
40538
40794
|
products: target.packageProducts ?? []
|
|
@@ -40541,9 +40797,9 @@ async function swiftPackages(entry, app) {
|
|
|
40541
40797
|
app.linkedProducts,
|
|
40542
40798
|
owners,
|
|
40543
40799
|
app.packageResolved.map((file) => [file, stamp(file)]),
|
|
40544
|
-
app.localPackageDirs.map((dir) => stamp(
|
|
40800
|
+
app.localPackageDirs.map((dir) => stamp(import_node_path75.default.join(dir, "Package.swift"))),
|
|
40545
40801
|
app.linkedProducts.map(
|
|
40546
|
-
({ source }) => source.kind === "local" ? stamp(
|
|
40802
|
+
({ source }) => source.kind === "local" ? stamp(import_node_path75.default.join(source.dir, "Package.swift")) : 0
|
|
40547
40803
|
)
|
|
40548
40804
|
]);
|
|
40549
40805
|
let cached2 = entry.packages;
|
|
@@ -40593,7 +40849,7 @@ async function swiftPackages(entry, app) {
|
|
|
40593
40849
|
app,
|
|
40594
40850
|
reached,
|
|
40595
40851
|
entry.moduleRoot,
|
|
40596
|
-
|
|
40852
|
+
import_node_path75.default.join(resolved.toolchainBin, "clang++")
|
|
40597
40853
|
);
|
|
40598
40854
|
const cxxArtifacts = reached.filter(standinArtifact);
|
|
40599
40855
|
const generation = standinGenerationInputs(cxxArtifacts, toolchain, entry.behavior);
|
|
@@ -40651,13 +40907,13 @@ function xcodeInputKey(layout2, file, relative3) {
|
|
|
40651
40907
|
const input = file.endsWith(".swift") ? relative3.split("/").map(
|
|
40652
40908
|
(part) => part === "." || part === ".." ? part : part.replaceAll("%", "%25").replace(/^\./, "%2E")
|
|
40653
40909
|
).join("/") : relative3;
|
|
40654
|
-
return
|
|
40910
|
+
return import_node_path75.default.posix.join(owner, input);
|
|
40655
40911
|
}
|
|
40656
40912
|
const checkouts = layout2.checkouts;
|
|
40657
|
-
return file.startsWith(`${checkouts}${
|
|
40913
|
+
return file.startsWith(`${checkouts}${import_node_path75.default.sep}`) ? import_node_path75.default.posix.join(
|
|
40658
40914
|
XCODE_PACKAGES_DIR,
|
|
40659
|
-
|
|
40660
|
-
) : relative3 === ".." || relative3.startsWith("../") ?
|
|
40915
|
+
import_node_path75.default.relative(checkouts, file).split(import_node_path75.default.sep).join("/")
|
|
40916
|
+
) : relative3 === ".." || relative3.startsWith("../") ? import_node_path75.default.posix.join("external", file.split(import_node_path75.default.sep).join("/")) : relative3;
|
|
40661
40917
|
}
|
|
40662
40918
|
var layoutScope = new import_node_async_hooks.AsyncLocalStorage();
|
|
40663
40919
|
async function withXcodeLayout(root, run8) {
|
|
@@ -40727,17 +40983,22 @@ async function buildXcodeLayout(root) {
|
|
|
40727
40983
|
moduleOwners.set(framework.moduleName, framework);
|
|
40728
40984
|
}
|
|
40729
40985
|
const generatedSources = {};
|
|
40986
|
+
const coreDataClasses = (files3, dir) => {
|
|
40987
|
+
for (const [name3, text5] of Object.entries(coreDataSources(files3)))
|
|
40988
|
+
generatedSources[import_node_path75.default.posix.join(dir, "GeneratedCoreData", name3)] = text5;
|
|
40989
|
+
};
|
|
40730
40990
|
const targetAssetSymbols = (module2, dir) => {
|
|
40731
40991
|
const plan = planAssetSymbols(
|
|
40732
|
-
module2.resources.map((file) =>
|
|
40992
|
+
module2.resources.map((file) => import_node_path75.default.relative(root, file)),
|
|
40733
40993
|
root,
|
|
40734
40994
|
module2.assetSettings
|
|
40735
40995
|
);
|
|
40736
40996
|
if (plan.status === "unknown") throw new Error(`${module2.name}: ${plan.reason}`);
|
|
40737
40997
|
if (plan.status === "plan")
|
|
40738
|
-
generatedSources[
|
|
40998
|
+
generatedSources[import_node_path75.default.posix.join(dir, "GeneratedAssetSymbols.swift")] = assetSymbolText(plan.plan, root);
|
|
40739
40999
|
};
|
|
40740
41000
|
targetAssetSymbols(app, XCODE_APP_DIR);
|
|
41001
|
+
coreDataClasses(app.resources, XCODE_APP_DIR);
|
|
40741
41002
|
for (const framework of app.frameworks) {
|
|
40742
41003
|
if (framework.allSources.length === 0 && framework.resources.length === 0) continue;
|
|
40743
41004
|
let name3 = framework.moduleName;
|
|
@@ -40752,7 +41013,7 @@ async function buildXcodeLayout(root) {
|
|
|
40752
41013
|
usedNames.add(name3);
|
|
40753
41014
|
}
|
|
40754
41015
|
frameworkNames.set(framework, name3);
|
|
40755
|
-
const dir =
|
|
41016
|
+
const dir = import_node_path75.default.posix.join(XCODE_FRAMEWORKS_DIR, name3);
|
|
40756
41017
|
if (name3 === framework.moduleName)
|
|
40757
41018
|
resourceBundles.push({
|
|
40758
41019
|
target: name3,
|
|
@@ -40770,6 +41031,7 @@ async function buildXcodeLayout(root) {
|
|
|
40770
41031
|
files2.add(file);
|
|
40771
41032
|
}
|
|
40772
41033
|
targetAssetSymbols(framework, dir);
|
|
41034
|
+
coreDataClasses(framework.resources, dir);
|
|
40773
41035
|
targets.push({
|
|
40774
41036
|
name: name3,
|
|
40775
41037
|
path: dir,
|
|
@@ -40812,7 +41074,7 @@ async function buildXcodeLayout(root) {
|
|
|
40812
41074
|
}),
|
|
40813
41075
|
...(framework.packageProducts ?? []).flatMap(({ product, source }) => {
|
|
40814
41076
|
const native = packages.nativeProducts.find(
|
|
40815
|
-
({ name: name3, source: origin }) => name3 === product && (source.kind === "unnamed" || origin === (source.kind === "remote" ? source.url :
|
|
41077
|
+
({ name: name3, source: origin }) => name3 === product && (source.kind === "unnamed" || origin === (source.kind === "remote" ? source.url : import_node_path75.default.resolve(source.dir)))
|
|
40816
41078
|
);
|
|
40817
41079
|
return native ? [
|
|
40818
41080
|
{
|
|
@@ -40829,23 +41091,23 @@ async function buildXcodeLayout(root) {
|
|
|
40829
41091
|
let localPackageRoot = root;
|
|
40830
41092
|
for (const { manifest, remote } of packages.nativePackages) {
|
|
40831
41093
|
if (remote) continue;
|
|
40832
|
-
let relative4 =
|
|
40833
|
-
while (relative4 === ".." || relative4.startsWith(`..${
|
|
40834
|
-
localPackageRoot =
|
|
40835
|
-
relative4 =
|
|
41094
|
+
let relative4 = import_node_path75.default.relative(localPackageRoot, manifest.dir);
|
|
41095
|
+
while (relative4 === ".." || relative4.startsWith(`..${import_node_path75.default.sep}`)) {
|
|
41096
|
+
localPackageRoot = import_node_path75.default.dirname(localPackageRoot);
|
|
41097
|
+
relative4 = import_node_path75.default.relative(localPackageRoot, manifest.dir);
|
|
40836
41098
|
}
|
|
40837
41099
|
}
|
|
40838
41100
|
for (const { manifest, remote } of packages.nativePackages) {
|
|
40839
|
-
const directory = remote ?
|
|
41101
|
+
const directory = remote ? import_node_path75.default.posix.join(
|
|
40840
41102
|
XCODE_PACKAGES_DIR,
|
|
40841
|
-
|
|
40842
|
-
) :
|
|
41103
|
+
import_node_path75.default.relative(remoteSwiftCheckouts(root), manifest.dir).split(import_node_path75.default.sep).join("/")
|
|
41104
|
+
) : import_node_path75.default.posix.join(
|
|
40843
41105
|
SWIFT_LOCAL_PACKAGES_DIR,
|
|
40844
|
-
|
|
40845
|
-
|
|
41106
|
+
import_node_path75.default.basename(localPackageRoot),
|
|
41107
|
+
import_node_path75.default.relative(localPackageRoot, manifest.dir).split(import_node_path75.default.sep).join("/")
|
|
40846
41108
|
);
|
|
40847
41109
|
packagePaths.set(manifest.dir, directory);
|
|
40848
|
-
const manifests =
|
|
41110
|
+
const manifests = import_node_fs78.default.readdirSync(manifest.dir).filter((name3) => /^Package(@swift-[\d.]+)?\.swift$/.test(name3)).map((name3) => import_node_path75.default.join(manifest.dir, name3));
|
|
40849
41111
|
for (const file of /* @__PURE__ */ new Set([
|
|
40850
41112
|
...manifests,
|
|
40851
41113
|
...[...manifest.targets.values()].flatMap((target) => [
|
|
@@ -40855,9 +41117,9 @@ async function buildXcodeLayout(root) {
|
|
|
40855
41117
|
])) {
|
|
40856
41118
|
packageFiles2.set(
|
|
40857
41119
|
file,
|
|
40858
|
-
|
|
41120
|
+
import_node_path75.default.posix.join(
|
|
40859
41121
|
directory,
|
|
40860
|
-
|
|
41122
|
+
import_node_path75.default.relative(manifest.dir, file).split(import_node_path75.default.sep).join("/")
|
|
40861
41123
|
)
|
|
40862
41124
|
);
|
|
40863
41125
|
files2.add(file);
|
|
@@ -40867,7 +41129,7 @@ async function buildXcodeLayout(root) {
|
|
|
40867
41129
|
for (const standin of standins)
|
|
40868
41130
|
targets.push({
|
|
40869
41131
|
name: standin.module,
|
|
40870
|
-
path:
|
|
41132
|
+
path: import_node_path75.default.posix.join(SWIFT_STANDINS_DIR, standin.module),
|
|
40871
41133
|
publicHeadersPath: standin.publicHeadersPath,
|
|
40872
41134
|
dependencies: [
|
|
40873
41135
|
.../* @__PURE__ */ new Set([
|
|
@@ -40895,13 +41157,13 @@ async function buildXcodeLayout(root) {
|
|
|
40895
41157
|
});
|
|
40896
41158
|
const packageConfiguration = app.configuration === "Debug" ? "debug" : "release";
|
|
40897
41159
|
for (const target of packages.targets) {
|
|
40898
|
-
const relative4 =
|
|
41160
|
+
const relative4 = import_node_path75.default.relative(
|
|
40899
41161
|
target.remote ? remoteSwiftCheckouts(root) : root,
|
|
40900
41162
|
target.dir
|
|
40901
41163
|
);
|
|
40902
|
-
if (relative4 === ".." || relative4.startsWith(`..${
|
|
41164
|
+
if (relative4 === ".." || relative4.startsWith(`..${import_node_path75.default.sep}`) || import_node_path75.default.isAbsolute(relative4))
|
|
40903
41165
|
throw new Error(`swift input escapes the selected package: ${target.dir}`);
|
|
40904
|
-
const posix = relative4.split(
|
|
41166
|
+
const posix = relative4.split(import_node_path75.default.sep).join(import_node_path75.default.posix.sep);
|
|
40905
41167
|
const packageMacros = [
|
|
40906
41168
|
"SWIFT_PACKAGE=1",
|
|
40907
41169
|
...packageConfiguration === "debug" ? ["DEBUG=1"] : []
|
|
@@ -40913,7 +41175,7 @@ async function buildXcodeLayout(root) {
|
|
|
40913
41175
|
...target,
|
|
40914
41176
|
cDefines: packageMacros,
|
|
40915
41177
|
cxxDefines: packageMacros,
|
|
40916
|
-
path: target.remote ?
|
|
41178
|
+
path: target.remote ? import_node_path75.default.posix.join(XCODE_PACKAGES_DIR, posix) : posix,
|
|
40917
41179
|
exclude: target.exclude ?? [],
|
|
40918
41180
|
defines: [
|
|
40919
41181
|
...packageConfiguration === "debug" ? ["DEBUG"] : [],
|
|
@@ -40943,7 +41205,7 @@ async function buildXcodeLayout(root) {
|
|
|
40943
41205
|
return flags.length === 0 ? [] : flag === "-I" && directory !== void 0 && rest.length === 0 ? [
|
|
40944
41206
|
{
|
|
40945
41207
|
tool,
|
|
40946
|
-
headerSearchPath:
|
|
41208
|
+
headerSearchPath: import_node_path75.default.relative(target.dir, directory).split(import_node_path75.default.sep).join("/") || "."
|
|
40947
41209
|
}
|
|
40948
41210
|
] : [{ tool, flags }];
|
|
40949
41211
|
})
|
|
@@ -40951,16 +41213,16 @@ async function buildXcodeLayout(root) {
|
|
|
40951
41213
|
if (target.resources) {
|
|
40952
41214
|
resourceBundles.push({
|
|
40953
41215
|
target: target.name,
|
|
40954
|
-
sourcePath: target.remote ?
|
|
41216
|
+
sourcePath: target.remote ? import_node_path75.default.posix.join(XCODE_PACKAGES_DIR, posix) : posix,
|
|
40955
41217
|
path: `${swiftPackageManifest(target.packageDir).name}_${target.name}.bundle`
|
|
40956
41218
|
});
|
|
40957
41219
|
}
|
|
40958
|
-
if (!target.remote) files2.add(
|
|
41220
|
+
if (!target.remote) files2.add(import_node_path75.default.join(target.packageDir, "Package.swift"));
|
|
40959
41221
|
for (const file of target.files) files2.add(file);
|
|
40960
41222
|
const catalogs = [
|
|
40961
41223
|
...new Set(
|
|
40962
41224
|
target.files.flatMap((file) => {
|
|
40963
|
-
const at = file.indexOf(`.xcassets${
|
|
41225
|
+
const at = file.indexOf(`.xcassets${import_node_path75.default.sep}`);
|
|
40964
41226
|
return at >= 0 ? [file.slice(0, at + ".xcassets".length)] : [];
|
|
40965
41227
|
})
|
|
40966
41228
|
)
|
|
@@ -40970,11 +41232,15 @@ async function buildXcodeLayout(root) {
|
|
|
40970
41232
|
throw new Error(
|
|
40971
41233
|
`${target.name}: asset symbols for a package that declares no iOS platform are unproven`
|
|
40972
41234
|
);
|
|
40973
|
-
generatedSources[
|
|
40974
|
-
target.remote ?
|
|
41235
|
+
generatedSources[import_node_path75.default.posix.join(
|
|
41236
|
+
target.remote ? import_node_path75.default.posix.join(XCODE_PACKAGES_DIR, posix) : posix,
|
|
40975
41237
|
"GeneratedAssetSymbols.swift"
|
|
40976
41238
|
)] = generatePackageAssetSymbols(catalogs, target.packageDir, target.iosDeployment);
|
|
40977
41239
|
}
|
|
41240
|
+
coreDataClasses(
|
|
41241
|
+
target.files,
|
|
41242
|
+
target.remote ? import_node_path75.default.posix.join(XCODE_PACKAGES_DIR, posix) : posix
|
|
41243
|
+
);
|
|
40978
41244
|
}
|
|
40979
41245
|
for (const target of targets) {
|
|
40980
41246
|
target.exclude = [
|
|
@@ -40985,7 +41251,7 @@ async function buildXcodeLayout(root) {
|
|
|
40985
41251
|
const relative3 = (file) => xcodeInputKey(
|
|
40986
41252
|
{ checkouts, targetDirs },
|
|
40987
41253
|
file,
|
|
40988
|
-
|
|
41254
|
+
import_node_path75.default.relative(app.rootDir, file).split(import_node_path75.default.sep).join("/").replaceAll(app.rootDir, SWIFT_NATIVE_INPUT_ROOT) || "."
|
|
40989
41255
|
);
|
|
40990
41256
|
const nativeInputs = await xcodeObjCInputsAsync(
|
|
40991
41257
|
app,
|
|
@@ -41007,7 +41273,7 @@ async function buildXcodeLayout(root) {
|
|
|
41007
41273
|
nativeFiles.set(
|
|
41008
41274
|
file,
|
|
41009
41275
|
Buffer.from(
|
|
41010
|
-
`#include ${JSON.stringify(
|
|
41276
|
+
`#include ${JSON.stringify(import_node_path75.default.relative(import_node_path75.default.dirname(file), real).split(import_node_path75.default.sep).join("/"))}
|
|
41011
41277
|
`
|
|
41012
41278
|
)
|
|
41013
41279
|
);
|
|
@@ -41017,7 +41283,7 @@ async function buildXcodeLayout(root) {
|
|
|
41017
41283
|
(file) => /\.(?:h|hh|hpp|hxx|pch|inc|inl|modulemap)$/.test(file)
|
|
41018
41284
|
);
|
|
41019
41285
|
const nativePath = (file, directory = app.rootDir) => {
|
|
41020
|
-
const requested =
|
|
41286
|
+
const requested = import_node_path75.default.resolve(directory, file);
|
|
41021
41287
|
const absolute = app.moduleMapSources?.[requested] ?? requested;
|
|
41022
41288
|
return absolute === "/usr/include" || absolute.startsWith("/usr/include/") ? SWIFT_NATIVE_SDK_INCLUDE + absolute.slice("/usr/include".length) : `${SWIFT_NATIVE_INPUT_ROOT}/${relative3(absolute)}`;
|
|
41023
41289
|
};
|
|
@@ -41074,7 +41340,7 @@ async function buildXcodeLayout(root) {
|
|
|
41074
41340
|
headerMaps: settings.headerMaps.map((map2) => ({
|
|
41075
41341
|
flag: map2.flag,
|
|
41076
41342
|
entries: map2.entries.flatMap(
|
|
41077
|
-
([key2, file]) => !
|
|
41343
|
+
([key2, file]) => !import_node_path75.default.isAbsolute(file) ? [[key2, file]] : nativeFiles.has(file) ? [[key2, nativePath(file)]] : []
|
|
41078
41344
|
)
|
|
41079
41345
|
})),
|
|
41080
41346
|
productHeaders: Object.fromEntries(
|
|
@@ -41109,7 +41375,7 @@ async function buildXcodeLayout(root) {
|
|
|
41109
41375
|
]) : []
|
|
41110
41376
|
]),
|
|
41111
41377
|
sourceDirectories: Object.fromEntries(
|
|
41112
|
-
target.allSources.filter(isSwiftNativeTranslationUnit).map((file) => [relative3(file), relative3(
|
|
41378
|
+
target.allSources.filter(isSwiftNativeTranslationUnit).map((file) => [relative3(file), relative3(import_node_path75.default.dirname(file))])
|
|
41113
41379
|
)
|
|
41114
41380
|
}
|
|
41115
41381
|
];
|
|
@@ -41124,7 +41390,7 @@ async function buildXcodeLayout(root) {
|
|
|
41124
41390
|
deploymentTarget: settings.deploymentTarget,
|
|
41125
41391
|
headers: nativeHeaders.map(relative3),
|
|
41126
41392
|
publicHeaders: nativeHeaders.filter(
|
|
41127
|
-
(file) => file.startsWith(`${settings.publicHeaders}${
|
|
41393
|
+
(file) => file.startsWith(`${settings.publicHeaders}${import_node_path75.default.sep}`) && /\.(h|hh|hpp|hxx)$/.test(file)
|
|
41128
41394
|
).map(relative3),
|
|
41129
41395
|
flattensPublicHeaders: false,
|
|
41130
41396
|
bridgingHeader: null,
|
|
@@ -41143,7 +41409,7 @@ async function buildXcodeLayout(root) {
|
|
|
41143
41409
|
cxxFlags: nativeFlags(settings.cxxFlags, target.dir),
|
|
41144
41410
|
fileFlags: {},
|
|
41145
41411
|
sourceDirectories: Object.fromEntries(
|
|
41146
|
-
settings.files.map((file) => [relative3(file), relative3(
|
|
41412
|
+
settings.files.map((file) => [relative3(file), relative3(import_node_path75.default.dirname(file))])
|
|
41147
41413
|
)
|
|
41148
41414
|
});
|
|
41149
41415
|
}
|
|
@@ -41251,7 +41517,7 @@ function xcodeManifest(layout2) {
|
|
|
41251
41517
|
).join(", ");
|
|
41252
41518
|
const appProducts = layout2.app.linkedProducts.flatMap(({ product, source }) => {
|
|
41253
41519
|
const native = nativeProducts.find(
|
|
41254
|
-
({ name: name3, source: origin }) => name3 === product && (source.kind === "unnamed" || origin === (source.kind === "remote" ? source.url :
|
|
41520
|
+
({ name: name3, source: origin }) => name3 === product && (source.kind === "unnamed" || origin === (source.kind === "remote" ? source.url : import_node_path75.default.resolve(source.dir)))
|
|
41255
41521
|
);
|
|
41256
41522
|
return native ? [productDependency(native.name, native.packageDir)] : [];
|
|
41257
41523
|
});
|
|
@@ -41290,7 +41556,7 @@ function xcodeManifest(layout2) {
|
|
|
41290
41556
|
].join("\n");
|
|
41291
41557
|
}
|
|
41292
41558
|
function packageFiles(root, includeBuildInputs = true) {
|
|
41293
|
-
const canonicalRoot =
|
|
41559
|
+
const canonicalRoot = import_node_fs78.default.realpathSync(root);
|
|
41294
41560
|
const source = sourceEntries().get(canonicalRoot);
|
|
41295
41561
|
if (source) return [source];
|
|
41296
41562
|
const xcode = xcodeLayout(canonicalRoot);
|
|
@@ -41304,11 +41570,11 @@ function packageFiles(root, includeBuildInputs = true) {
|
|
|
41304
41570
|
function readPackageFile2(root, file, maxBytes) {
|
|
41305
41571
|
if (xcodeProjects().has(root)) {
|
|
41306
41572
|
const checkouts = remoteSwiftCheckouts(root);
|
|
41307
|
-
if (file.startsWith(`${checkouts}${
|
|
41308
|
-
const checkout =
|
|
41573
|
+
if (file.startsWith(`${checkouts}${import_node_path75.default.sep}`)) {
|
|
41574
|
+
const checkout = import_node_path75.default.relative(checkouts, file).split(import_node_path75.default.sep)[0];
|
|
41309
41575
|
if (!checkout || checkout === "..")
|
|
41310
41576
|
throw new Error(`swift input escapes the selected package: ${file}`);
|
|
41311
|
-
return readPackageFile(
|
|
41577
|
+
return readPackageFile(import_node_path75.default.join(checkouts, checkout), file, maxBytes);
|
|
41312
41578
|
}
|
|
41313
41579
|
}
|
|
41314
41580
|
return readPackageFile(root, file, maxBytes);
|
|
@@ -41321,12 +41587,12 @@ function sourceTreeFiles(dir, canonicalRoot) {
|
|
|
41321
41587
|
if (ancestors.has(realDirectory))
|
|
41322
41588
|
throw new Error(`swift input directory cycle: ${dir2}`);
|
|
41323
41589
|
ancestors.add(realDirectory);
|
|
41324
|
-
for (const entry of
|
|
41590
|
+
for (const entry of import_node_fs78.default.readdirSync(dir2, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
41325
41591
|
if (entry.name.startsWith(".") && entry.name !== NATIVE_DESCRIPTOR && entry.name !== NATIVE_GLUE || entry.name === "node_modules" || // platform project wrappers are excluded only at the package root;
|
|
41326
41592
|
// native target sources can contain upstream ios/android directories.
|
|
41327
41593
|
dir2 === canonicalRoot && SKIP_ROOT_DIRS.has(entry.name))
|
|
41328
41594
|
continue;
|
|
41329
|
-
const full =
|
|
41595
|
+
const full = import_node_path75.default.join(dir2, entry.name);
|
|
41330
41596
|
let real;
|
|
41331
41597
|
try {
|
|
41332
41598
|
real = packageInputPath(canonicalRoot, full);
|
|
@@ -41335,9 +41601,9 @@ function sourceTreeFiles(dir, canonicalRoot) {
|
|
|
41335
41601
|
continue;
|
|
41336
41602
|
throw error;
|
|
41337
41603
|
}
|
|
41338
|
-
const stat =
|
|
41604
|
+
const stat = import_node_fs78.default.statSync(real);
|
|
41339
41605
|
if (stat.isDirectory()) {
|
|
41340
|
-
if (
|
|
41606
|
+
if (import_node_fs78.default.existsSync(import_node_path75.default.join(full, "Package.swift"))) continue;
|
|
41341
41607
|
walk3(full);
|
|
41342
41608
|
} else if (stat.isFile()) {
|
|
41343
41609
|
found.push(full);
|
|
@@ -41345,7 +41611,7 @@ function sourceTreeFiles(dir, canonicalRoot) {
|
|
|
41345
41611
|
}
|
|
41346
41612
|
ancestors.delete(realDirectory);
|
|
41347
41613
|
};
|
|
41348
|
-
if (
|
|
41614
|
+
if (import_node_fs78.default.existsSync(dir)) walk3(packageInputPath(canonicalRoot, dir));
|
|
41349
41615
|
return found;
|
|
41350
41616
|
}
|
|
41351
41617
|
function isPackageSource(file) {
|
|
@@ -41357,7 +41623,7 @@ function sourceFiles(root) {
|
|
|
41357
41623
|
function resourceCandidateFiles(root) {
|
|
41358
41624
|
return packageFiles(root, false).filter(
|
|
41359
41625
|
(file) => !isPackageSource(file) && !file.endsWith(".xcconfig") && !["project.pbxproj", "project.xcproj", "Package.resolved"].includes(
|
|
41360
|
-
|
|
41626
|
+
import_node_path75.default.basename(file)
|
|
41361
41627
|
)
|
|
41362
41628
|
);
|
|
41363
41629
|
}
|
|
@@ -41370,17 +41636,17 @@ function swiftProjectAppInfo(packagePath) {
|
|
|
41370
41636
|
) : null;
|
|
41371
41637
|
const files2 = app?.resources ?? resourceCandidateFiles(packagePath);
|
|
41372
41638
|
const catalogs = files2.filter(
|
|
41373
|
-
(file) => file.endsWith(".appiconset/Contents.json") && (!app?.appIconName ||
|
|
41639
|
+
(file) => file.endsWith(".appiconset/Contents.json") && (!app?.appIconName || import_node_path75.default.basename(import_node_path75.default.dirname(file)) === `${app.appIconName}.appiconset`)
|
|
41374
41640
|
);
|
|
41375
41641
|
let icon = null;
|
|
41376
41642
|
for (const contents of catalogs) {
|
|
41377
|
-
const value = JSON.parse(
|
|
41643
|
+
const value = JSON.parse(import_node_fs78.default.readFileSync(contents, "utf8"));
|
|
41378
41644
|
if (!value || typeof value !== "object" || !("images" in value) || !Array.isArray(value.images))
|
|
41379
41645
|
continue;
|
|
41380
41646
|
const images = [];
|
|
41381
41647
|
const entries = value.images;
|
|
41382
41648
|
for (const image of entries) {
|
|
41383
|
-
if (!image || typeof image !== "object" || !("filename" in image) || typeof image.filename !== "string" ||
|
|
41649
|
+
if (!image || typeof image !== "object" || !("filename" in image) || typeof image.filename !== "string" || import_node_path75.default.basename(image.filename) !== image.filename || !/\.(png|jpe?g|webp)$/i.test(image.filename))
|
|
41384
41650
|
continue;
|
|
41385
41651
|
if ("idiom" in image && (typeof image.idiom !== "string" || !["iphone", "ios-marketing", "universal"].includes(image.idiom)))
|
|
41386
41652
|
continue;
|
|
@@ -41391,16 +41657,16 @@ function swiftProjectAppInfo(packagePath) {
|
|
|
41391
41657
|
}
|
|
41392
41658
|
const picked = images.sort((a, b) => b.pixels - a.pixels)[0];
|
|
41393
41659
|
if (!picked) continue;
|
|
41394
|
-
const file =
|
|
41660
|
+
const file = import_node_path75.default.join(import_node_path75.default.dirname(contents), picked.filename);
|
|
41395
41661
|
if (!files2.includes(file)) continue;
|
|
41396
41662
|
icon = {
|
|
41397
|
-
bytes:
|
|
41398
|
-
contentType: RESOURCE_CONTENT_TYPES[
|
|
41663
|
+
bytes: import_node_fs78.default.readFileSync(file),
|
|
41664
|
+
contentType: RESOURCE_CONTENT_TYPES[import_node_path75.default.extname(file).toLowerCase()] ?? "image/png"
|
|
41399
41665
|
};
|
|
41400
41666
|
break;
|
|
41401
41667
|
}
|
|
41402
41668
|
return {
|
|
41403
|
-
name: app?.name ??
|
|
41669
|
+
name: app?.name ?? import_node_path75.default.basename(sourceEntries().get(packagePath) ?? packagePath, ".swift"),
|
|
41404
41670
|
icon,
|
|
41405
41671
|
identity: app ? readNativeAppIdentityFromXcodeTarget(app) : null
|
|
41406
41672
|
};
|
|
@@ -41439,7 +41705,7 @@ function buildSwiftResourceTable(project, baseUrl, inputs) {
|
|
|
41439
41705
|
const limits = inputLimits(Boolean(project.hosted));
|
|
41440
41706
|
const absolute = resourceCandidateFiles(project.packagePath);
|
|
41441
41707
|
const relative3 = absolute.map(
|
|
41442
|
-
(file) =>
|
|
41708
|
+
(file) => import_node_path75.default.relative(project.packagePath, file).split(import_node_path75.default.sep).join(import_node_path75.default.posix.sep)
|
|
41443
41709
|
);
|
|
41444
41710
|
const byRelative = new Map(absolute.map((file, index) => [relative3[index], file]));
|
|
41445
41711
|
const readContents2 = (candidate) => {
|
|
@@ -41527,8 +41793,8 @@ function buildSwiftResourceTable(project, baseUrl, inputs) {
|
|
|
41527
41793
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
41528
41794
|
}
|
|
41529
41795
|
let bytes;
|
|
41530
|
-
let ext =
|
|
41531
|
-
let uploadName =
|
|
41796
|
+
let ext = import_node_path75.default.posix.extname(file).toLowerCase();
|
|
41797
|
+
let uploadName = import_node_path75.default.posix.basename(file);
|
|
41532
41798
|
if (ext === ".pdf") {
|
|
41533
41799
|
const pdfBytes = readPackageFile2(project.packagePath, disk, limits.imageBytes);
|
|
41534
41800
|
const pdfHash = (0, import_node_crypto39.createHash)("sha256").update(pdfBytes).digest("hex");
|
|
@@ -41538,9 +41804,9 @@ function buildSwiftResourceTable(project, baseUrl, inputs) {
|
|
|
41538
41804
|
throw new Error(`swift image ${file} raster exceeds the per-image cap`);
|
|
41539
41805
|
}
|
|
41540
41806
|
ext = ".png";
|
|
41541
|
-
uploadName = `${
|
|
41807
|
+
uploadName = `${import_node_path75.default.posix.basename(file, import_node_path75.default.posix.extname(file))}.png`;
|
|
41542
41808
|
} else {
|
|
41543
|
-
if (imageBytes +
|
|
41809
|
+
if (imageBytes + import_node_fs78.default.statSync(disk).size > limits.imageTotalBytes) {
|
|
41544
41810
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
41545
41811
|
}
|
|
41546
41812
|
bytes = readPackageFile2(project.packagePath, disk, limits.imageBytes);
|
|
@@ -41595,10 +41861,10 @@ function declaredAppFonts(infoPlist) {
|
|
|
41595
41861
|
return Array.isArray(declared) ? declared.filter((name3) => typeof name3 === "string") : [];
|
|
41596
41862
|
}
|
|
41597
41863
|
function buildSwiftBundleFiles(packagePath, hosted, inputs, resourceBundles) {
|
|
41598
|
-
packagePath =
|
|
41864
|
+
packagePath = import_node_fs78.default.realpathSync(packagePath);
|
|
41599
41865
|
const limits = inputLimits(hosted);
|
|
41600
41866
|
const relative3 = resourceCandidateFiles(packagePath).map(
|
|
41601
|
-
(file) =>
|
|
41867
|
+
(file) => import_node_path75.default.relative(packagePath, file).split(import_node_path75.default.sep).join(import_node_path75.default.posix.sep)
|
|
41602
41868
|
);
|
|
41603
41869
|
const files2 = {};
|
|
41604
41870
|
const watched = [];
|
|
@@ -41622,26 +41888,26 @@ function buildSwiftBundleFiles(packagePath, hosted, inputs, resourceBundles) {
|
|
|
41622
41888
|
addFile("Info.plist", bytes);
|
|
41623
41889
|
if (xcode.app.infoPlistFile)
|
|
41624
41890
|
watched.push(
|
|
41625
|
-
|
|
41891
|
+
import_node_path75.default.relative(packagePath, xcode.app.infoPlistFile).split(import_node_path75.default.sep).join("/")
|
|
41626
41892
|
);
|
|
41627
41893
|
const resourcesByName = new Map(
|
|
41628
|
-
xcode.app.resources.map((file) => [
|
|
41894
|
+
xcode.app.resources.map((file) => [import_node_path75.default.basename(file), file])
|
|
41629
41895
|
);
|
|
41630
41896
|
for (const declared of declaredAppFonts(xcode.app.infoPlist)) {
|
|
41631
|
-
const file = resourcesByName.get(
|
|
41897
|
+
const file = resourcesByName.get(import_node_path75.default.basename(declared));
|
|
41632
41898
|
if (!file) continue;
|
|
41633
|
-
const relative4 =
|
|
41634
|
-
if (relative4.startsWith("..") ||
|
|
41635
|
-
const key2 =
|
|
41899
|
+
const relative4 = import_node_path75.default.relative(packagePath, file);
|
|
41900
|
+
if (relative4.startsWith("..") || import_node_path75.default.isAbsolute(relative4)) continue;
|
|
41901
|
+
const key2 = import_node_path75.default.basename(declared);
|
|
41636
41902
|
if (Object.hasOwn(files2, key2)) continue;
|
|
41637
41903
|
addFile(key2, readPackageFile2(packagePath, file, limits.resourceBytes));
|
|
41638
|
-
watched.push(relative4.split(
|
|
41904
|
+
watched.push(relative4.split(import_node_path75.default.sep).join("/"));
|
|
41639
41905
|
}
|
|
41640
41906
|
}
|
|
41641
41907
|
const groups = /* @__PURE__ */ new Map();
|
|
41642
41908
|
const appResources = new Set(xcode?.app.resources ?? []);
|
|
41643
41909
|
for (const file of relative3) {
|
|
41644
|
-
const disk =
|
|
41910
|
+
const disk = import_node_path75.default.join(packagePath, ...file.split("/"));
|
|
41645
41911
|
const key2 = xcode ? xcodeInputKey(xcode, disk, file) : file;
|
|
41646
41912
|
const bundle = swiftResourceBundleForFile(bundles, key2);
|
|
41647
41913
|
const bundlePath = bundle?.path ?? ".";
|
|
@@ -41660,10 +41926,10 @@ function buildSwiftBundleFiles(packagePath, hosted, inputs, resourceBundles) {
|
|
|
41660
41926
|
for (const product of xcode?.app.resourceProducts ?? []) {
|
|
41661
41927
|
if ("sourceRoot" in product) {
|
|
41662
41928
|
for (const file of product.resources) {
|
|
41663
|
-
const relative4 =
|
|
41664
|
-
watched.push(
|
|
41929
|
+
const relative4 = import_node_path75.default.relative(product.sourceRoot, file);
|
|
41930
|
+
watched.push(import_node_path75.default.relative(packagePath, file).split(import_node_path75.default.sep).join("/"));
|
|
41665
41931
|
addFile(
|
|
41666
|
-
`${product.path}/${relative4.split(
|
|
41932
|
+
`${product.path}/${relative4.split(import_node_path75.default.sep).join("/")}`,
|
|
41667
41933
|
readPackageFile2(packagePath, file, limits.resourceBytes)
|
|
41668
41934
|
);
|
|
41669
41935
|
}
|
|
@@ -41675,7 +41941,7 @@ function buildSwiftBundleFiles(packagePath, hosted, inputs, resourceBundles) {
|
|
|
41675
41941
|
group.set(
|
|
41676
41942
|
// pod resources may live outside the preview package. the shared
|
|
41677
41943
|
// enumerator flattens ordinary files and preserves localized folders.
|
|
41678
|
-
`Resources/${
|
|
41944
|
+
`Resources/${import_node_path75.default.relative(import_node_path75.default.parse(file).root, file).split(import_node_path75.default.sep).join("/")}`,
|
|
41679
41945
|
file
|
|
41680
41946
|
);
|
|
41681
41947
|
groups.set(product.path, group);
|
|
@@ -41686,7 +41952,7 @@ function buildSwiftBundleFiles(packagePath, hosted, inputs, resourceBundles) {
|
|
|
41686
41952
|
bundlePath.endsWith(".bundle")
|
|
41687
41953
|
)) {
|
|
41688
41954
|
const disk = members2.get(file);
|
|
41689
|
-
watched.push(
|
|
41955
|
+
watched.push(import_node_path75.default.relative(packagePath, disk).split(import_node_path75.default.sep).join("/"));
|
|
41690
41956
|
const bytes = readPackageFile2(packagePath, disk, limits.resourceBytes);
|
|
41691
41957
|
addFile(bundlePath === "." ? base : `${bundlePath}/${base}`, bytes);
|
|
41692
41958
|
if (base.endsWith(".xcstrings")) {
|
|
@@ -41699,14 +41965,14 @@ function buildSwiftBundleFiles(packagePath, hosted, inputs, resourceBundles) {
|
|
|
41699
41965
|
}
|
|
41700
41966
|
}
|
|
41701
41967
|
if (xcode?.app.postBundleScripts.length) {
|
|
41702
|
-
const dir =
|
|
41703
|
-
const wrapper =
|
|
41704
|
-
const bundle =
|
|
41968
|
+
const dir = import_node_fs78.default.mkdtempSync(import_node_path75.default.join(import_node_os16.default.tmpdir(), "peach-xcode-bundle-"));
|
|
41969
|
+
const wrapper = import_node_path75.default.basename(xcode.app.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")) || `${xcode.app.name}.app`;
|
|
41970
|
+
const bundle = import_node_path75.default.join(dir, wrapper);
|
|
41705
41971
|
try {
|
|
41706
41972
|
for (const [name3, encoded] of Object.entries(files2)) {
|
|
41707
|
-
const destination =
|
|
41708
|
-
|
|
41709
|
-
|
|
41973
|
+
const destination = import_node_path75.default.join(bundle, name3);
|
|
41974
|
+
import_node_fs78.default.mkdirSync(import_node_path75.default.dirname(destination), { recursive: true });
|
|
41975
|
+
import_node_fs78.default.writeFileSync(destination, Buffer.from(encoded, "base64"));
|
|
41710
41976
|
}
|
|
41711
41977
|
for (const phase of xcode.app.postBundleScripts) {
|
|
41712
41978
|
const env = {
|
|
@@ -41741,33 +42007,33 @@ function buildSwiftBundleFiles(packagePath, hosted, inputs, resourceBundles) {
|
|
|
41741
42007
|
}
|
|
41742
42008
|
for (const key2 of Object.keys(files2)) delete files2[key2];
|
|
41743
42009
|
total = 0;
|
|
41744
|
-
for (const entry of
|
|
42010
|
+
for (const entry of import_node_fs78.default.readdirSync(bundle, {
|
|
41745
42011
|
recursive: true,
|
|
41746
42012
|
withFileTypes: true
|
|
41747
42013
|
})) {
|
|
41748
42014
|
if (!entry.isFile()) continue;
|
|
41749
|
-
const file =
|
|
41750
|
-
const name3 =
|
|
41751
|
-
if (
|
|
42015
|
+
const file = import_node_path75.default.join(entry.parentPath, entry.name);
|
|
42016
|
+
const name3 = import_node_path75.default.relative(bundle, file).split(import_node_path75.default.sep).join("/");
|
|
42017
|
+
if (import_node_fs78.default.statSync(file).size > limits.resourceBytes)
|
|
41752
42018
|
throw new Error(
|
|
41753
42019
|
`swift bundle resource ${name3} exceeds ${limits.resourceBytes} bytes`
|
|
41754
42020
|
);
|
|
41755
|
-
addFile(name3,
|
|
42021
|
+
addFile(name3, import_node_fs78.default.readFileSync(file));
|
|
41756
42022
|
}
|
|
41757
42023
|
} finally {
|
|
41758
|
-
|
|
42024
|
+
import_node_fs78.default.rmSync(dir, { recursive: true, force: true });
|
|
41759
42025
|
}
|
|
41760
42026
|
}
|
|
41761
42027
|
return { files: files2, bundles, watched };
|
|
41762
42028
|
}
|
|
41763
42029
|
function linkedModuleRoots(packagePath) {
|
|
41764
42030
|
if (privateSwiftDistributionRoot()) return [];
|
|
41765
|
-
packagePath =
|
|
42031
|
+
packagePath = import_node_fs78.default.realpathSync(packagePath);
|
|
41766
42032
|
let manifest;
|
|
41767
42033
|
try {
|
|
41768
42034
|
manifest = readPackageFile2(
|
|
41769
42035
|
packagePath,
|
|
41770
|
-
|
|
42036
|
+
import_node_path75.default.join(packagePath, "Package.swift"),
|
|
41771
42037
|
MAX_SWIFT_COMPILE_SOURCE_BYTES
|
|
41772
42038
|
).toString("utf8");
|
|
41773
42039
|
} catch {
|
|
@@ -41776,8 +42042,8 @@ function linkedModuleRoots(packagePath) {
|
|
|
41776
42042
|
const roots = /* @__PURE__ */ new Set();
|
|
41777
42043
|
const dependency = /\.package\(\s*path:\s*"([^"]+)"\s*\)/g;
|
|
41778
42044
|
for (const match of manifest.replace(/^\s*\/\/.*$/gm, "").matchAll(dependency)) {
|
|
41779
|
-
const root =
|
|
41780
|
-
if (
|
|
42045
|
+
const root = import_node_path75.default.resolve(packagePath, match[1]);
|
|
42046
|
+
if (import_node_fs78.default.existsSync(import_node_path75.default.join(root, "Package.swift"))) roots.add(root);
|
|
41781
42047
|
}
|
|
41782
42048
|
return [...roots].sort();
|
|
41783
42049
|
}
|
|
@@ -41798,8 +42064,8 @@ function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
|
|
|
41798
42064
|
hash.update(JSON.stringify(projects().get(packagePath)?.bundleFiles ?? null));
|
|
41799
42065
|
const projectInputs = new Set(packageFiles(packagePath));
|
|
41800
42066
|
for (const file of [...projectInputs].sort()) {
|
|
41801
|
-
hash.update(
|
|
41802
|
-
const stat =
|
|
42067
|
+
hash.update(import_node_path75.default.relative(packagePath, file));
|
|
42068
|
+
const stat = import_node_fs78.default.statSync(file);
|
|
41803
42069
|
hash.update(`${stat.mtimeMs}/${stat.ctimeMs}/${stat.size}`);
|
|
41804
42070
|
}
|
|
41805
42071
|
hash.update(moduleStamp(packagePath, moduleRootOverride, hosted));
|
|
@@ -41820,24 +42086,24 @@ function sourceContentStamp(packagePath, moduleRootOverride) {
|
|
|
41820
42086
|
hash.update(JSON.stringify(projects().get(packagePath)?.nativeFiles ?? {}));
|
|
41821
42087
|
hash.update(JSON.stringify(projects().get(packagePath)?.resourceBundles ?? []));
|
|
41822
42088
|
hash.update(JSON.stringify(projects().get(packagePath)?.bundleFiles ?? null));
|
|
41823
|
-
const root =
|
|
42089
|
+
const root = import_node_fs78.default.realpathSync(packagePath);
|
|
41824
42090
|
for (const file of [...new Set(packageFiles(packagePath))].sort()) {
|
|
41825
|
-
hash.update(
|
|
41826
|
-
hash.update(
|
|
42091
|
+
hash.update(import_node_path75.default.relative(root, file));
|
|
42092
|
+
hash.update(import_node_fs78.default.readFileSync(file));
|
|
41827
42093
|
}
|
|
41828
42094
|
hash.update(moduleStamp(packagePath, moduleRootOverride, false));
|
|
41829
42095
|
return hash.digest("hex").slice(0, 16);
|
|
41830
42096
|
}
|
|
41831
42097
|
function moduleStamp(packagePath, moduleRootOverride, hosted) {
|
|
41832
42098
|
const moduleRoot = hosted ? void 0 : moduleRootOverride ?? linkedModuleRoots(packagePath).find(
|
|
41833
|
-
(root) =>
|
|
42099
|
+
(root) => import_node_fs78.default.existsSync(import_node_path75.default.join(root, "toolchain.json"))
|
|
41834
42100
|
);
|
|
41835
42101
|
if (!moduleRoot) return "";
|
|
41836
42102
|
const hash = (0, import_node_crypto39.createHash)("sha256");
|
|
41837
42103
|
hash.update(moduleRoot);
|
|
41838
42104
|
for (const relative3 of swiftModuleInputFiles(moduleRoot)) {
|
|
41839
42105
|
hash.update(relative3);
|
|
41840
|
-
hash.update(String(
|
|
42106
|
+
hash.update(String(import_node_fs78.default.statSync(import_node_path75.default.join(moduleRoot, relative3)).mtimeMs));
|
|
41841
42107
|
}
|
|
41842
42108
|
return hash.digest("hex");
|
|
41843
42109
|
}
|
|
@@ -41854,10 +42120,10 @@ function standinLibraries(binaries, standins, rootDir, toolchain) {
|
|
|
41854
42120
|
if (!standin.prebuilt) continue;
|
|
41855
42121
|
const bytes = Buffer.from(standin.prebuilt.library, "base64");
|
|
41856
42122
|
const digest2 = (0, import_node_crypto39.createHash)("sha256").update(bytes).digest("hex");
|
|
41857
|
-
const dir =
|
|
41858
|
-
|
|
41859
|
-
const library =
|
|
41860
|
-
if (!
|
|
42123
|
+
const dir = import_node_path75.default.join(swiftCacheDir(), "native-archives", digest2);
|
|
42124
|
+
import_node_fs78.default.mkdirSync(dir, { recursive: true });
|
|
42125
|
+
const library = import_node_path75.default.join(dir, `lib${standin.module}.a`);
|
|
42126
|
+
if (!import_node_fs78.default.existsSync(library)) import_node_fs78.default.writeFileSync(library, bytes);
|
|
41861
42127
|
linked.set(library, [standin]);
|
|
41862
42128
|
}
|
|
41863
42129
|
for (const binary2 of binaries) {
|
|
@@ -41875,13 +42141,13 @@ function packageSources(packagePath, hosted = false, linked = /* @__PURE__ */ ne
|
|
|
41875
42141
|
const xcode = xcodeLayout(packagePath);
|
|
41876
42142
|
const manifests = new Set(
|
|
41877
42143
|
xcode?.packages.targets.map(
|
|
41878
|
-
(target) =>
|
|
42144
|
+
(target) => import_node_path75.default.join(target.packageDir, "Package.swift")
|
|
41879
42145
|
)
|
|
41880
42146
|
);
|
|
41881
42147
|
const files2 = {};
|
|
41882
42148
|
const limits = inputLimits(hosted);
|
|
41883
42149
|
for (const file of sourceFiles(packagePath)) {
|
|
41884
|
-
const relative3 =
|
|
42150
|
+
const relative3 = import_node_path75.default.relative(packagePath, file).split(import_node_path75.default.sep).join(import_node_path75.default.posix.sep);
|
|
41885
42151
|
if (manifests.has(file) || xcode?.packageFiles.has(file)) continue;
|
|
41886
42152
|
files2[xcode ? xcodeInputKey(xcode, file, relative3) : relative3] = (xcode?.nativeFiles.get(file) ?? readPackageFile2(packagePath, file, limits.sourceBytes)).toString("utf8");
|
|
41887
42153
|
}
|
|
@@ -41890,20 +42156,20 @@ function packageSources(packagePath, hosted = false, linked = /* @__PURE__ */ ne
|
|
|
41890
42156
|
files2[xcodeInputKey(
|
|
41891
42157
|
xcode,
|
|
41892
42158
|
file,
|
|
41893
|
-
|
|
42159
|
+
import_node_path75.default.relative(packagePath, file).split(import_node_path75.default.sep).join("/")
|
|
41894
42160
|
)] = contents.toString("utf8");
|
|
41895
42161
|
files2["Package.swift"] = xcodeManifest(xcode);
|
|
41896
42162
|
Object.assign(files2, xcode.generatedSources);
|
|
41897
42163
|
for (const standin of xcode.standins)
|
|
41898
42164
|
for (const [file, text5] of Object.entries(standin.files))
|
|
41899
|
-
files2[
|
|
42165
|
+
files2[import_node_path75.default.posix.join(SWIFT_STANDINS_DIR, standin.module, file)] = linked.has(standin) && (file === `${standin.module}.c` || file === `${standin.module}.cpp`) ? `// ${standin.target}'s WebAssembly library defines ${standin.module}'s functions.
|
|
41900
42166
|
` : text5;
|
|
41901
42167
|
}
|
|
41902
42168
|
return files2;
|
|
41903
42169
|
}
|
|
41904
42170
|
function packageSnapshot(project, entry, moduleRoot) {
|
|
41905
42171
|
const layout2 = xcodeLayout(project.packagePath);
|
|
41906
|
-
const pin2 = moduleRoot ? swiftDistributionAt(moduleRoot) ?? JSON.parse(
|
|
42172
|
+
const pin2 = moduleRoot ? swiftDistributionAt(moduleRoot) ?? JSON.parse(import_node_fs78.default.readFileSync(import_node_path75.default.join(moduleRoot, "toolchain.json"), "utf8")) : null;
|
|
41907
42173
|
const linked = layout2 ? standinLibraries(
|
|
41908
42174
|
layout2.binaries,
|
|
41909
42175
|
layout2.standins,
|
|
@@ -41925,10 +42191,10 @@ function packageSnapshot(project, entry, moduleRoot) {
|
|
|
41925
42191
|
};
|
|
41926
42192
|
const packageReals = /* @__PURE__ */ new Map();
|
|
41927
42193
|
for (const [file, relative3] of layout2?.packageFiles ?? [])
|
|
41928
|
-
if (!
|
|
41929
|
-
packageReals.set(
|
|
42194
|
+
if (!import_node_fs78.default.lstatSync(file).isSymbolicLink())
|
|
42195
|
+
packageReals.set(import_node_fs78.default.realpathSync(file), relative3);
|
|
41930
42196
|
for (const [file, relative3] of layout2?.packageFiles ?? []) {
|
|
41931
|
-
const real =
|
|
42197
|
+
const real = import_node_fs78.default.realpathSync(file);
|
|
41932
42198
|
const target = packageReals.get(real);
|
|
41933
42199
|
if (target !== void 0 && target !== relative3 && /\.(?:h|hh|hpp|hxx)$/.test(file))
|
|
41934
42200
|
headerAliases[relative3] = target;
|
|
@@ -41943,12 +42209,12 @@ function packageSnapshot(project, entry, moduleRoot) {
|
|
|
41943
42209
|
if (layout2 && !project.hosted) {
|
|
41944
42210
|
for (const file of layout2.files) {
|
|
41945
42211
|
if (!layout2.targetDirs.has(file) || packaged.has(file)) continue;
|
|
41946
|
-
const relative3 =
|
|
42212
|
+
const relative3 = import_node_path75.default.relative(project.packagePath, file).split(import_node_path75.default.sep).join("/");
|
|
41947
42213
|
if (swiftProjectFileProblem(relative3) !== void 0) continue;
|
|
41948
42214
|
const key2 = xcodeInputKey(layout2, file, relative3);
|
|
41949
42215
|
if (files2[key2] !== void 0) continue;
|
|
41950
|
-
const absolute =
|
|
41951
|
-
if (!
|
|
42216
|
+
const absolute = import_node_fs78.default.realpathSync(file);
|
|
42217
|
+
if (!import_node_fs78.default.statSync(absolute).isFile()) continue;
|
|
41952
42218
|
projectFiles[relative3] = readPackageFile2(
|
|
41953
42219
|
project.packagePath,
|
|
41954
42220
|
absolute,
|
|
@@ -41979,7 +42245,7 @@ function packageSnapshot(project, entry, moduleRoot) {
|
|
|
41979
42245
|
(layout2?.packages.nativePackages ?? []).flatMap(
|
|
41980
42246
|
({ manifest, guestTargets: targets }) => targets.filter((target) => target.type === "regular").flatMap(
|
|
41981
42247
|
(target) => swiftTargetFiles(manifest, target).filter((file) => file.endsWith(".swift")).flatMap(
|
|
41982
|
-
(file) => swiftImportNames(
|
|
42248
|
+
(file) => swiftImportNames(import_node_fs78.default.readFileSync(file, "utf8"))
|
|
41983
42249
|
)
|
|
41984
42250
|
)
|
|
41985
42251
|
)
|
|
@@ -41991,10 +42257,10 @@ function packageSnapshot(project, entry, moduleRoot) {
|
|
|
41991
42257
|
sourceLinkGraph: layout2.sourceLinkGraph,
|
|
41992
42258
|
defaultLocalization: layout2.app.developmentRegion
|
|
41993
42259
|
} : {},
|
|
41994
|
-
entry: layout2 ? xcodeInputKey(layout2,
|
|
42260
|
+
entry: layout2 ? xcodeInputKey(layout2, import_node_path75.default.resolve(project.packagePath, entry), entry) : entry,
|
|
41995
42261
|
resourcePaths: swiftImplicitResourcePaths(
|
|
41996
42262
|
resourceCandidateFiles(project.packagePath).map((file) => {
|
|
41997
|
-
const relative3 =
|
|
42263
|
+
const relative3 = import_node_path75.default.relative(project.packagePath, file).split(import_node_path75.default.sep).join(import_node_path75.default.posix.sep);
|
|
41998
42264
|
return layout2 ? xcodeInputKey(layout2, file, relative3) : relative3;
|
|
41999
42265
|
})
|
|
42000
42266
|
),
|
|
@@ -42014,7 +42280,7 @@ function packageSnapshot(project, entry, moduleRoot) {
|
|
|
42014
42280
|
...Object.fromEntries(
|
|
42015
42281
|
[...linked].map(([library, [first]]) => [
|
|
42016
42282
|
first.module,
|
|
42017
|
-
|
|
42283
|
+
import_node_fs78.default.readFileSync(library).toString("base64")
|
|
42018
42284
|
])
|
|
42019
42285
|
)
|
|
42020
42286
|
}
|
|
@@ -42022,7 +42288,7 @@ function packageSnapshot(project, entry, moduleRoot) {
|
|
|
42022
42288
|
...native ? {
|
|
42023
42289
|
glue: readPackageFile2(
|
|
42024
42290
|
project.packagePath,
|
|
42025
|
-
|
|
42291
|
+
import_node_path75.default.join(project.packagePath, NATIVE_GLUE),
|
|
42026
42292
|
inputLimits(Boolean(project.hosted)).sourceBytes
|
|
42027
42293
|
).toString("utf8")
|
|
42028
42294
|
} : {}
|
|
@@ -42058,7 +42324,7 @@ function installedWorkspaceInput(packagePath, entry, moduleRoot) {
|
|
|
42058
42324
|
const project = projectFor(packagePath);
|
|
42059
42325
|
return withXcodeLayout(project.packagePath, () => {
|
|
42060
42326
|
const input = snapshotCompileInput(packageSnapshot(project, entry, moduleRoot));
|
|
42061
|
-
const layout2 = xcodeLayout(
|
|
42327
|
+
const layout2 = xcodeLayout(import_node_fs78.default.realpathSync(packagePath));
|
|
42062
42328
|
const binaryFrameworks = (layout2?.app.binaryFrameworks ?? []).flatMap(
|
|
42063
42329
|
({ path: dir }) => dir ? [dir] : []
|
|
42064
42330
|
);
|
|
@@ -42068,7 +42334,7 @@ function installedWorkspaceInput(packagePath, entry, moduleRoot) {
|
|
|
42068
42334
|
const key2 = xcodeInputKey(
|
|
42069
42335
|
layout2,
|
|
42070
42336
|
file,
|
|
42071
|
-
|
|
42337
|
+
import_node_path75.default.relative(packagePath, file).split(import_node_path75.default.sep).join("/")
|
|
42072
42338
|
);
|
|
42073
42339
|
return input.files[key2] === void 0 ? [] : [[key2, file]];
|
|
42074
42340
|
}
|
|
@@ -42097,7 +42363,7 @@ async function compile(packagePath, stamp, moduleRootOverride, hosted, snapshot,
|
|
|
42097
42363
|
package: content
|
|
42098
42364
|
};
|
|
42099
42365
|
const moduleRoot = moduleRootOverride ?? linkedModuleRoots(packagePath).find(
|
|
42100
|
-
(root) =>
|
|
42366
|
+
(root) => import_node_fs78.default.existsSync(import_node_path75.default.join(root, "toolchain.json"))
|
|
42101
42367
|
) ?? await swiftDistributionRoot(signal);
|
|
42102
42368
|
const toolchain = swiftModuleToolchain(moduleRoot);
|
|
42103
42369
|
const input = snapshotCompileInput(snapshot);
|
|
@@ -42139,14 +42405,14 @@ async function compile(packagePath, stamp, moduleRootOverride, hosted, snapshot,
|
|
|
42139
42405
|
buildRoot: (() => {
|
|
42140
42406
|
if (process.env.CONTRAST_SWIFT_BUILD_ROOT)
|
|
42141
42407
|
return process.env.CONTRAST_SWIFT_BUILD_ROOT;
|
|
42142
|
-
const resolvedPath =
|
|
42143
|
-
const parts = resolvedPath.split(
|
|
42408
|
+
const resolvedPath = import_node_path75.default.resolve(packagePath);
|
|
42409
|
+
const parts = resolvedPath.split(import_node_path75.default.sep);
|
|
42144
42410
|
const scopedAt = Math.max(
|
|
42145
42411
|
parts.lastIndexOf("peach-expo-swift"),
|
|
42146
42412
|
parts.lastIndexOf("peach-nitro-swift")
|
|
42147
42413
|
);
|
|
42148
|
-
const buildKeyPath = scopedAt >= 0 && parts.length >= scopedAt + 3 ? parts.slice(0, scopedAt + 2).join(
|
|
42149
|
-
return
|
|
42414
|
+
const buildKeyPath = scopedAt >= 0 && parts.length >= scopedAt + 3 ? parts.slice(0, scopedAt + 2).join(import_node_path75.default.sep) : sourceEntries().get(resolvedPath) ?? resolvedPath;
|
|
42415
|
+
return import_node_path75.default.join(
|
|
42150
42416
|
swiftCacheDir(),
|
|
42151
42417
|
"swift-builds",
|
|
42152
42418
|
(0, import_node_crypto39.createHash)("sha256").update(`${moduleRoot}\0${buildKeyPath}`).digest("hex").slice(0, 16)
|
|
@@ -42276,10 +42542,10 @@ async function missingModulesMessage(packagePath, missing) {
|
|
|
42276
42542
|
`Peach does not provide ${missing.size} module${missing.size === 1 ? "" : "s"} this app imports:`,
|
|
42277
42543
|
...[...missing].map(([name3, files2]) => {
|
|
42278
42544
|
const gap = gaps.get(name3);
|
|
42279
|
-
return ` ${name3.padEnd(width)} ${files2.length} file${files2.length === 1 ? "" : "s"}${gap ? `, ${gap.source.includes("://") ? `package ${gap.source}` : gap.source.startsWith("/") ? `package ${
|
|
42545
|
+
return ` ${name3.padEnd(width)} ${files2.length} file${files2.length === 1 ? "" : "s"}${gap ? `, ${gap.source.includes("://") ? `package ${gap.source}` : gap.source.startsWith("/") ? `package ${import_node_path75.default.relative(packagePath, gap.source) || "."}` : gap.source} (${gap.reason})` : ""}`;
|
|
42280
42546
|
}),
|
|
42281
42547
|
...workspace ? [
|
|
42282
|
-
`${
|
|
42548
|
+
`${import_node_path75.default.basename(opened)} is part of ${import_node_path75.default.relative(process.cwd(), workspace)}, which holds its local packages and Package.resolved pins; pass the workspace to build what Xcode builds there.`
|
|
42283
42549
|
] : []
|
|
42284
42550
|
].join("\n");
|
|
42285
42551
|
}
|
|
@@ -42301,7 +42567,7 @@ async function compileRemote(packagePath, snapshot, hosted, ownerSignal) {
|
|
|
42301
42567
|
const bytes = sources.reduce((total2, text5) => total2 + Buffer.byteLength(text5), 0) + packageSources2.reduce((total2, encoded) => total2 + swiftPackageInputBytes(encoded), 0);
|
|
42302
42568
|
if (count > MAX_SWIFT_COMPILE_FILES || bytes > MAX_SWIFT_COMPILE_SOURCE_BYTES) {
|
|
42303
42569
|
throw new Error(
|
|
42304
|
-
`${
|
|
42570
|
+
`${import_node_path75.default.basename(packagePath)} has ${count} input files (${bytes} bytes; packages: ${swiftPackageInputNames(snapshot.packageFiles).join(", ") || "none"}), over Contrast's compile limits of ${MAX_SWIFT_COMPILE_FILES} files and ${MAX_SWIFT_COMPILE_SOURCE_BYTES} bytes; compile it on this machine with the Swift distribution instead`
|
|
42305
42571
|
);
|
|
42306
42572
|
}
|
|
42307
42573
|
const descriptor = snapshot.native;
|
|
@@ -42327,11 +42593,11 @@ async function compileRemote(packagePath, snapshot, hosted, ownerSignal) {
|
|
|
42327
42593
|
},
|
|
42328
42594
|
origin,
|
|
42329
42595
|
signal,
|
|
42330
|
-
(stage) => console.error(`Peach: compiling ${
|
|
42596
|
+
(stage) => console.error(`Peach: compiling ${import_node_path75.default.basename(packagePath)}: ${stage}`)
|
|
42331
42597
|
);
|
|
42332
42598
|
if (descriptor && address.native?.hash !== descriptor.hash) {
|
|
42333
42599
|
throw new Error(
|
|
42334
|
-
`${
|
|
42600
|
+
`${import_node_path75.default.basename(packagePath)}: Contrast compiled native contract ${address.native?.hash ?? "none"} but one typegen wrote ${descriptor.hash}; the app's One and the compile host's differ, or the compile host is older than this peachsim`
|
|
42335
42601
|
);
|
|
42336
42602
|
}
|
|
42337
42603
|
const response = await fetch(address.url, { signal });
|
|
@@ -42396,7 +42662,7 @@ function scopedArtifact(project, entry, moduleRoot, signal) {
|
|
|
42396
42662
|
});
|
|
42397
42663
|
}
|
|
42398
42664
|
const snapshotRoot = moduleRoot ?? xcodeProjects().get(project.packagePath)?.moduleRoot ?? linkedModuleRoots(project.packagePath).find(
|
|
42399
|
-
(root) =>
|
|
42665
|
+
(root) => import_node_fs78.default.existsSync(import_node_path75.default.join(root, "toolchain.json"))
|
|
42400
42666
|
);
|
|
42401
42667
|
const snapshot = packageSnapshot(project, entry, snapshotRoot);
|
|
42402
42668
|
const compiled = project.artifact?.compiled;
|
|
@@ -42488,16 +42754,16 @@ function mtimeNs(stat) {
|
|
|
42488
42754
|
}
|
|
42489
42755
|
function tracedPath(value) {
|
|
42490
42756
|
if (typeof value === "number" || value == null) return null;
|
|
42491
|
-
if (typeof value === "string") return value.length === 0 ? null :
|
|
42757
|
+
if (typeof value === "string") return value.length === 0 ? null : import_node_path76.default.resolve(value);
|
|
42492
42758
|
if (value instanceof URL)
|
|
42493
42759
|
return value.protocol === "file:" ? (0, import_node_url6.fileURLToPath)(value) : null;
|
|
42494
|
-
if (Buffer.isBuffer(value)) return
|
|
42760
|
+
if (Buffer.isBuffer(value)) return import_node_path76.default.resolve(value.toString());
|
|
42495
42761
|
return null;
|
|
42496
42762
|
}
|
|
42497
42763
|
function ignoredInput(file) {
|
|
42498
|
-
if (file.includes(`${
|
|
42764
|
+
if (file.includes(`${import_node_path76.default.sep}peach-expo-swift${import_node_path76.default.sep}`) || file.endsWith(`${import_node_path76.default.sep}peach-expo-swift`))
|
|
42499
42765
|
return true;
|
|
42500
|
-
const within2 = (root) => file === root || file.startsWith(`${root}${
|
|
42766
|
+
const within2 = (root) => file === root || file.startsWith(`${root}${import_node_path76.default.sep}`);
|
|
42501
42767
|
if (ignoredRoots.some(within2)) return true;
|
|
42502
42768
|
for (const root of ownTemporaryRoots) if (within2(root)) return true;
|
|
42503
42769
|
return false;
|
|
@@ -42558,7 +42824,7 @@ function noteListing(file, names) {
|
|
|
42558
42824
|
}
|
|
42559
42825
|
function noteChangedSince(file, startMs) {
|
|
42560
42826
|
const witness = traceStore.getStore();
|
|
42561
|
-
if (witness &&
|
|
42827
|
+
if (witness && import_node_fs79.default.statSync(file).mtimeMs >= startMs) witness.tainted = true;
|
|
42562
42828
|
}
|
|
42563
42829
|
function noteRead(target) {
|
|
42564
42830
|
const file = tracedPath(target);
|
|
@@ -42571,38 +42837,38 @@ function namesFromListing(dir, entries) {
|
|
|
42571
42837
|
const names = [];
|
|
42572
42838
|
for (const entry of entries) {
|
|
42573
42839
|
if (typeof entry === "string" || Buffer.isBuffer(entry)) {
|
|
42574
|
-
names.push(entry.toString().split(
|
|
42840
|
+
names.push(entry.toString().split(import_node_path76.default.sep).join("/"));
|
|
42575
42841
|
continue;
|
|
42576
42842
|
}
|
|
42577
42843
|
if (!entry || typeof entry !== "object" || !("name" in entry)) continue;
|
|
42578
42844
|
const name3 = String(Reflect.get(entry, "name"));
|
|
42579
42845
|
const parent = Reflect.get(entry, "parentPath");
|
|
42580
42846
|
const base = typeof parent === "string" && parent.length > 0 ? parent : dir;
|
|
42581
|
-
names.push(
|
|
42847
|
+
names.push(import_node_path76.default.relative(dir, import_node_path76.default.join(base, name3)).split(import_node_path76.default.sep).join("/"));
|
|
42582
42848
|
}
|
|
42583
42849
|
names.sort();
|
|
42584
42850
|
return names.join("\0");
|
|
42585
42851
|
}
|
|
42586
42852
|
function installSwiftInputTrace() {
|
|
42587
42853
|
if (savedFs) return;
|
|
42588
|
-
const realpathNative =
|
|
42854
|
+
const realpathNative = import_node_fs79.default.realpathSync.native;
|
|
42589
42855
|
const saved = {
|
|
42590
|
-
readFileSync:
|
|
42591
|
-
readdirSync:
|
|
42592
|
-
existsSync:
|
|
42593
|
-
statSync:
|
|
42594
|
-
lstatSync:
|
|
42595
|
-
realpathSync:
|
|
42856
|
+
readFileSync: import_node_fs79.default.readFileSync,
|
|
42857
|
+
readdirSync: import_node_fs79.default.readdirSync,
|
|
42858
|
+
existsSync: import_node_fs79.default.existsSync,
|
|
42859
|
+
statSync: import_node_fs79.default.statSync,
|
|
42860
|
+
lstatSync: import_node_fs79.default.lstatSync,
|
|
42861
|
+
realpathSync: import_node_fs79.default.realpathSync,
|
|
42596
42862
|
realpathNative,
|
|
42597
|
-
readlinkSync:
|
|
42863
|
+
readlinkSync: import_node_fs79.default.readlinkSync
|
|
42598
42864
|
};
|
|
42599
42865
|
savedFs = saved;
|
|
42600
42866
|
const prefixes = [
|
|
42601
|
-
|
|
42602
|
-
|
|
42603
|
-
|
|
42867
|
+
import_node_path76.default.join(cacheDir(), "swift-builds"),
|
|
42868
|
+
import_node_path76.default.join(swiftCacheDir(), "swift-builds"),
|
|
42869
|
+
import_node_path76.default.join(swiftCacheDir(), "swift-sdk-views"),
|
|
42604
42870
|
swiftRootLocksDir(),
|
|
42605
|
-
|
|
42871
|
+
import_node_path76.default.join(cacheDir(), "swift-tmp")
|
|
42606
42872
|
].filter((prefix, index, all) => all.indexOf(prefix) === index);
|
|
42607
42873
|
ignoredRoots = prefixes.flatMap((root) => {
|
|
42608
42874
|
try {
|
|
@@ -42618,22 +42884,22 @@ function installSwiftInputTrace() {
|
|
|
42618
42884
|
};
|
|
42619
42885
|
const realpath = traced(saved.realpathSync);
|
|
42620
42886
|
Reflect.set(realpath, "native", traced(saved.realpathNative));
|
|
42621
|
-
Reflect.set(
|
|
42622
|
-
Reflect.set(
|
|
42623
|
-
Reflect.set(
|
|
42624
|
-
Reflect.set(
|
|
42625
|
-
Reflect.set(
|
|
42626
|
-
const mkdtempSync4 =
|
|
42627
|
-
Reflect.set(
|
|
42887
|
+
Reflect.set(import_node_fs79.default, "readFileSync", traced(saved.readFileSync));
|
|
42888
|
+
Reflect.set(import_node_fs79.default, "statSync", traced(saved.statSync));
|
|
42889
|
+
Reflect.set(import_node_fs79.default, "lstatSync", traced(saved.lstatSync));
|
|
42890
|
+
Reflect.set(import_node_fs79.default, "readlinkSync", traced(saved.readlinkSync));
|
|
42891
|
+
Reflect.set(import_node_fs79.default, "realpathSync", realpath);
|
|
42892
|
+
const mkdtempSync4 = import_node_fs79.default.mkdtempSync;
|
|
42893
|
+
Reflect.set(import_node_fs79.default, "mkdtempSync", (...args) => {
|
|
42628
42894
|
const made = Reflect.apply(mkdtempSync4, void 0, args);
|
|
42629
42895
|
if (typeof made === "string" && traceStore.getStore()) {
|
|
42630
42896
|
for (const root of ownTemporaryRoots)
|
|
42631
42897
|
if (!saved.existsSync(root)) ownTemporaryRoots.delete(root);
|
|
42632
|
-
ownTemporaryRoots.add(
|
|
42898
|
+
ownTemporaryRoots.add(import_node_path76.default.resolve(made));
|
|
42633
42899
|
}
|
|
42634
42900
|
return made;
|
|
42635
42901
|
});
|
|
42636
|
-
Reflect.set(
|
|
42902
|
+
Reflect.set(import_node_fs79.default, "existsSync", (targetPath) => {
|
|
42637
42903
|
const file = tracedPath(targetPath);
|
|
42638
42904
|
const witness = traceStore.getStore();
|
|
42639
42905
|
if (!file || !witness || ignoredInput(file)) return saved.existsSync(targetPath);
|
|
@@ -42644,7 +42910,7 @@ function installSwiftInputTrace() {
|
|
|
42644
42910
|
witness.tainted = true;
|
|
42645
42911
|
return present;
|
|
42646
42912
|
});
|
|
42647
|
-
Reflect.set(
|
|
42913
|
+
Reflect.set(import_node_fs79.default, "readdirSync", (directory, options) => {
|
|
42648
42914
|
const file = tracedPath(directory);
|
|
42649
42915
|
if (file) notePresent(file);
|
|
42650
42916
|
try {
|
|
@@ -42661,7 +42927,7 @@ function installSwiftInputTrace() {
|
|
|
42661
42927
|
async function markMatches(file, mark) {
|
|
42662
42928
|
if ("missing" in mark) {
|
|
42663
42929
|
try {
|
|
42664
|
-
await
|
|
42930
|
+
await import_node_fs79.default.promises.lstat(file);
|
|
42665
42931
|
return false;
|
|
42666
42932
|
} catch {
|
|
42667
42933
|
return true;
|
|
@@ -42669,14 +42935,14 @@ async function markMatches(file, mark) {
|
|
|
42669
42935
|
}
|
|
42670
42936
|
let lstat;
|
|
42671
42937
|
try {
|
|
42672
|
-
lstat = await
|
|
42938
|
+
lstat = await import_node_fs79.default.promises.lstat(file);
|
|
42673
42939
|
} catch {
|
|
42674
42940
|
return false;
|
|
42675
42941
|
}
|
|
42676
42942
|
if (mtimeNs(lstat) !== mark.lstatMtimeNs || lstat.size !== mark.lstatSize) return false;
|
|
42677
42943
|
if (mark.names !== void 0) {
|
|
42678
42944
|
try {
|
|
42679
|
-
const listing = await
|
|
42945
|
+
const listing = await import_node_fs79.default.promises.readdir(file, {
|
|
42680
42946
|
withFileTypes: true,
|
|
42681
42947
|
recursive: true
|
|
42682
42948
|
});
|
|
@@ -42687,7 +42953,7 @@ async function markMatches(file, mark) {
|
|
|
42687
42953
|
}
|
|
42688
42954
|
if (!mark.link && !mark.dangling && !lstat.isSymbolicLink()) return true;
|
|
42689
42955
|
try {
|
|
42690
|
-
const stat = await
|
|
42956
|
+
const stat = await import_node_fs79.default.promises.stat(file);
|
|
42691
42957
|
if (mark.dangling) return false;
|
|
42692
42958
|
return mtimeNs(stat) === mark.statMtimeNs && stat.size === mark.statSize;
|
|
42693
42959
|
} catch (error) {
|
|
@@ -42712,7 +42978,7 @@ async function discoveryKey(root, installedWorkspace, prepareNative, iosTarget,
|
|
|
42712
42978
|
loadRNXAppConfig(resolveAppProject(root)),
|
|
42713
42979
|
readExpoConfigAsync(root)
|
|
42714
42980
|
]);
|
|
42715
|
-
return `${
|
|
42981
|
+
return `${import_node_fs79.default.realpathSync(root)}\0${installedWorkspace ?? ""}\0${iosTarget ?? ""}\0${moduleRoot ?? ""}\0${prepareNative ? "1" : "0"}\0${JSON.stringify(config)}\0${JSON.stringify(expoConfig)}`;
|
|
42716
42982
|
}
|
|
42717
42983
|
function cloneNativeTarget(target) {
|
|
42718
42984
|
return {
|
|
@@ -42739,15 +43005,15 @@ function cloneNativeTarget(target) {
|
|
|
42739
43005
|
function podSupportsIOS(pod) {
|
|
42740
43006
|
if (!isRecord(pod) || typeof pod.podName !== "string" || typeof pod.podspecDir !== "string")
|
|
42741
43007
|
throw new Error("invalid Expo autolinking pod");
|
|
42742
|
-
const base =
|
|
42743
|
-
if (
|
|
43008
|
+
const base = import_node_path76.default.join(pod.podspecDir, pod.podName);
|
|
43009
|
+
if (import_node_fs79.default.existsSync(`${base}.podspec.json`)) {
|
|
42744
43010
|
const platforms2 = JSON.parse(
|
|
42745
|
-
|
|
43011
|
+
import_node_fs79.default.readFileSync(`${base}.podspec.json`, "utf8")
|
|
42746
43012
|
).platforms;
|
|
42747
43013
|
return !isRecord(platforms2) || "ios" in platforms2;
|
|
42748
43014
|
}
|
|
42749
|
-
if (!
|
|
42750
|
-
const spec =
|
|
43015
|
+
if (!import_node_fs79.default.existsSync(`${base}.podspec`)) return true;
|
|
43016
|
+
const spec = import_node_fs79.default.readFileSync(`${base}.podspec`, "utf8");
|
|
42751
43017
|
const names = /* @__PURE__ */ new Set();
|
|
42752
43018
|
for (const [, hash] of spec.matchAll(/\.platforms\s*=\s*\{([^}]*)\}/g))
|
|
42753
43019
|
for (const [, a, b, c] of hash.matchAll(
|
|
@@ -42786,7 +43052,7 @@ function standinNativeTarget(standin, deploymentTarget) {
|
|
|
42786
43052
|
const modulemap = Object.keys(standin.files).find(
|
|
42787
43053
|
(file) => file === "module.modulemap" || file.endsWith("/module.modulemap")
|
|
42788
43054
|
);
|
|
42789
|
-
const headerDir = (modulemap ?
|
|
43055
|
+
const headerDir = (modulemap ? import_node_path76.default.posix.dirname(`${prefix}${modulemap}`) : null) ?? commonStandinHeaderDir(prefix, headers) ?? `${prefix}include`;
|
|
42790
43056
|
return {
|
|
42791
43057
|
...synthesizedNativeTarget(standin.module, deploymentTarget),
|
|
42792
43058
|
headers,
|
|
@@ -42796,11 +43062,11 @@ function standinNativeTarget(standin, deploymentTarget) {
|
|
|
42796
43062
|
}
|
|
42797
43063
|
function commonStandinHeaderDir(prefix, headers) {
|
|
42798
43064
|
if (headers.length === 0) return null;
|
|
42799
|
-
let common =
|
|
43065
|
+
let common = import_node_path76.default.posix.dirname(headers[0]);
|
|
42800
43066
|
for (const header of headers.slice(1)) {
|
|
42801
|
-
const dir =
|
|
43067
|
+
const dir = import_node_path76.default.posix.dirname(header);
|
|
42802
43068
|
while (dir !== common && !dir.startsWith(`${common}/`))
|
|
42803
|
-
common =
|
|
43069
|
+
common = import_node_path76.default.posix.dirname(common);
|
|
42804
43070
|
}
|
|
42805
43071
|
return common === prefix.slice(0, -1) || common.startsWith(prefix) ? common : null;
|
|
42806
43072
|
}
|
|
@@ -42865,10 +43131,10 @@ function retarget(cached2, base) {
|
|
|
42865
43131
|
}
|
|
42866
43132
|
return result;
|
|
42867
43133
|
}
|
|
42868
|
-
function configuredExpoSwiftModule(files2,
|
|
43134
|
+
function configuredExpoSwiftModule(files2, className2, registrationName, config) {
|
|
42869
43135
|
for (const source of Object.values(files2)) {
|
|
42870
43136
|
const code = swiftCodeMask(source);
|
|
42871
|
-
const declaration = new RegExp(`\\bclass\\s+${
|
|
43137
|
+
const declaration = new RegExp(`\\bclass\\s+${className2}\\b[^{}]*\\{`).exec(code);
|
|
42872
43138
|
if (!declaration) continue;
|
|
42873
43139
|
const start = declaration.index + declaration[0].length;
|
|
42874
43140
|
let depth = 1;
|
|
@@ -42910,19 +43176,19 @@ function enrichInstalledUnits(units, installed, namespaceGroups, provided, modul
|
|
|
42910
43176
|
installedTargets.map((target) => ({ ...target, dependencies: void 0 }))
|
|
42911
43177
|
);
|
|
42912
43178
|
const byPath = [...installedTargets].sort((a, b) => b.path.length - a.path.length);
|
|
42913
|
-
const reactNativeRoot =
|
|
42914
|
-
|
|
42915
|
-
(0, import_node_module8.createRequire)(
|
|
43179
|
+
const reactNativeRoot = import_node_fs79.default.realpathSync(
|
|
43180
|
+
import_node_path76.default.dirname(
|
|
43181
|
+
(0, import_node_module8.createRequire)(import_node_path76.default.join(appRoot, "package.json")).resolve(
|
|
42916
43182
|
"react-native/package.json"
|
|
42917
43183
|
)
|
|
42918
43184
|
)
|
|
42919
|
-
) +
|
|
43185
|
+
) + import_node_path76.default.sep;
|
|
42920
43186
|
const reactTargets = new Set(
|
|
42921
43187
|
(input.nativeTargets ?? []).flatMap((target) => {
|
|
42922
43188
|
const originals = Object.keys(target.sourceDirectories).flatMap(
|
|
42923
43189
|
(file) => installed.sourcePaths[file] ? [installed.sourcePaths[file]] : []
|
|
42924
43190
|
);
|
|
42925
|
-
return originals.some((file) =>
|
|
43191
|
+
return originals.some((file) => import_node_fs79.default.realpathSync(file).startsWith(reactNativeRoot)) ? [target.name] : [];
|
|
42926
43192
|
})
|
|
42927
43193
|
);
|
|
42928
43194
|
const requiresReact = (name3, seen = /* @__PURE__ */ new Set()) => {
|
|
@@ -42958,7 +43224,7 @@ function enrichInstalledUnits(units, installed, namespaceGroups, provided, modul
|
|
|
42958
43224
|
const bridge = bridgeNamespaces.has(unit2.namespace);
|
|
42959
43225
|
if (bridge)
|
|
42960
43226
|
for (const file of Object.keys(unit2.files)) {
|
|
42961
|
-
if (!
|
|
43227
|
+
if (!import_node_path76.default.posix.basename(file).startsWith(BRIDGE_MODULE_FILE_PREFIX))
|
|
42962
43228
|
delete unit2.files[file];
|
|
42963
43229
|
}
|
|
42964
43230
|
unit2.swiftLanguageMode = target.languageMode;
|
|
@@ -43092,13 +43358,13 @@ ${source}` : source;
|
|
|
43092
43358
|
for (const map3 of maps) {
|
|
43093
43359
|
if (!include.startsWith(`${map3.name}/`)) continue;
|
|
43094
43360
|
const header = include.slice(map3.name.length + 1);
|
|
43095
|
-
const candidate =
|
|
43361
|
+
const candidate = import_node_path76.default.posix.join(import_node_path76.default.posix.dirname(map3.file), include);
|
|
43096
43362
|
if (support[candidate] === void 0) continue;
|
|
43097
43363
|
map3.reached.add(header);
|
|
43098
43364
|
pending.push([candidate, support[candidate]]);
|
|
43099
43365
|
}
|
|
43100
|
-
const relative3 =
|
|
43101
|
-
|
|
43366
|
+
const relative3 = import_node_path76.default.posix.normalize(
|
|
43367
|
+
import_node_path76.default.posix.join(import_node_path76.default.posix.dirname(file), include)
|
|
43102
43368
|
);
|
|
43103
43369
|
if (support[relative3] !== void 0) pending.push([relative3, support[relative3]]);
|
|
43104
43370
|
}
|
|
@@ -43106,12 +43372,12 @@ ${source}` : source;
|
|
|
43106
43372
|
for (const map3 of maps) {
|
|
43107
43373
|
if (!map3.reached.size) continue;
|
|
43108
43374
|
const swift = swiftModuleInterface(moduleRoot, map3.name, interfaceRoot);
|
|
43109
|
-
const mapDirectory =
|
|
43375
|
+
const mapDirectory = import_node_path76.default.posix.dirname(map3.file);
|
|
43110
43376
|
if (swift) {
|
|
43111
43377
|
const header = `${map3.name}-Swift.h`;
|
|
43112
|
-
support[
|
|
43378
|
+
support[import_node_path76.default.posix.join(mapDirectory, map3.name, header)] = swift.header;
|
|
43113
43379
|
const queue = [...map3.reached].map(
|
|
43114
|
-
(file) =>
|
|
43380
|
+
(file) => import_node_path76.default.posix.join(mapDirectory, map3.name, file)
|
|
43115
43381
|
);
|
|
43116
43382
|
const seen = /* @__PURE__ */ new Set();
|
|
43117
43383
|
while (queue.length) {
|
|
@@ -43123,7 +43389,7 @@ ${source}` : source;
|
|
|
43123
43389
|
/#\s*(?:import|include)\s*[<"]([^>"]+)[>"]/g
|
|
43124
43390
|
)) {
|
|
43125
43391
|
const include = match[1];
|
|
43126
|
-
const next = include.startsWith(`${map3.name}/`) ?
|
|
43392
|
+
const next = include.startsWith(`${map3.name}/`) ? import_node_path76.default.posix.join(mapDirectory, include) : import_node_path76.default.posix.normalize(import_node_path76.default.posix.join(import_node_path76.default.posix.dirname(file), include));
|
|
43127
43393
|
if (support[next] !== void 0) queue.push(next);
|
|
43128
43394
|
}
|
|
43129
43395
|
const contents = withoutSwiftDeclarations(
|
|
@@ -43194,12 +43460,12 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
43194
43460
|
const started = performance.now();
|
|
43195
43461
|
const report = (message) => console.error(`[expo-swift ${Math.round(performance.now() - started)}ms] ${message}`);
|
|
43196
43462
|
signal?.throwIfAborted();
|
|
43197
|
-
appRoot =
|
|
43463
|
+
appRoot = import_node_fs79.default.realpathSync(appRoot);
|
|
43198
43464
|
const appConfig = await loadRNXAppConfig(resolveAppProject(appRoot));
|
|
43199
|
-
const appRequire = (0, import_node_module8.createRequire)(
|
|
43465
|
+
const appRequire = (0, import_node_module8.createRequire)(import_node_path76.default.join(appRoot, "package.json"));
|
|
43200
43466
|
let expoRoot;
|
|
43201
43467
|
try {
|
|
43202
|
-
expoRoot =
|
|
43468
|
+
expoRoot = import_node_path76.default.dirname(appRequire.resolve("expo/package.json"));
|
|
43203
43469
|
} catch (error) {
|
|
43204
43470
|
if (!error || typeof error !== "object" || Reflect.get(error, "code") !== "MODULE_NOT_FOUND")
|
|
43205
43471
|
throw error;
|
|
@@ -43215,20 +43481,20 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
43215
43481
|
throw error;
|
|
43216
43482
|
}
|
|
43217
43483
|
const autolinkerVersion = JSON.parse(
|
|
43218
|
-
|
|
43484
|
+
import_node_fs79.default.readFileSync(autolinker, "utf8")
|
|
43219
43485
|
).version;
|
|
43220
43486
|
if (typeof autolinkerVersion === "string" && Number.parseInt(autolinkerVersion, 10) < 1)
|
|
43221
43487
|
return null;
|
|
43222
|
-
const cli =
|
|
43488
|
+
const cli = import_node_path76.default.join(import_node_path76.default.dirname(autolinker), "bin/expo-modules-autolinking.js");
|
|
43223
43489
|
const flags = autolinkerAppleFlags(autolinker, appRoot);
|
|
43224
43490
|
const appManifest = JSON.parse(
|
|
43225
|
-
|
|
43491
|
+
import_node_fs79.default.readFileSync(import_node_path76.default.join(appRoot, "package.json"), "utf8")
|
|
43226
43492
|
);
|
|
43227
43493
|
const expoConfig = appManifest && typeof appManifest === "object" ? Reflect.get(appManifest, "expo") : null;
|
|
43228
43494
|
const autolinking = expoConfig && typeof expoConfig === "object" ? Reflect.get(expoConfig, "autolinking") : null;
|
|
43229
43495
|
const modulesDir = autolinking && typeof autolinking === "object" ? Reflect.get(autolinking, "nativeModulesDir") : null;
|
|
43230
|
-
|
|
43231
|
-
|
|
43496
|
+
import_node_fs79.default.existsSync(
|
|
43497
|
+
import_node_path76.default.resolve(appRoot, typeof modulesDir === "string" ? modulesDir : "modules")
|
|
43232
43498
|
);
|
|
43233
43499
|
const childStart = performance.timeOrigin + performance.now();
|
|
43234
43500
|
const [searched, resolvedModules] = await Promise.allSettled(
|
|
@@ -43254,7 +43520,7 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
43254
43520
|
const resolutions = resolved && typeof resolved === "object" ? Reflect.get(resolved, "modules") : null;
|
|
43255
43521
|
if (!Array.isArray(resolutions)) throw new Error("invalid Expo Apple resolution");
|
|
43256
43522
|
const scan2 = Reflect.get(
|
|
43257
|
-
appRequire(
|
|
43523
|
+
appRequire(import_node_path76.default.join(import_node_path76.default.dirname(autolinker), "build/platforms/apple")),
|
|
43258
43524
|
"scanNativeModulesAsync"
|
|
43259
43525
|
);
|
|
43260
43526
|
const scanned = typeof scan2 === "function" ? await scan2(search, "apple") : null;
|
|
@@ -43341,8 +43607,8 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
43341
43607
|
const sourceRoot = Reflect.get(entry, "path");
|
|
43342
43608
|
if (typeof sourceRoot !== "string")
|
|
43343
43609
|
throw new Error("Expo autolinking entry has no path");
|
|
43344
|
-
const canonical =
|
|
43345
|
-
const answered = canonical.split(
|
|
43610
|
+
const canonical = import_node_fs79.default.realpathSync(sourceRoot);
|
|
43611
|
+
const answered = canonical.split(import_node_path76.default.sep).includes("node_modules") && peachAnsweredNativePackages().has(packageName);
|
|
43346
43612
|
if (answered) {
|
|
43347
43613
|
answeredInstalled = true;
|
|
43348
43614
|
if (installed || prepareNative || metadataOnly) {
|
|
@@ -43351,9 +43617,9 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
43351
43617
|
}
|
|
43352
43618
|
}
|
|
43353
43619
|
for (const name3 of ["expo-module.config.json", "unimodule.json"]) {
|
|
43354
|
-
const descriptor =
|
|
43355
|
-
if (
|
|
43356
|
-
|
|
43620
|
+
const descriptor = import_node_path76.default.join(canonical, name3);
|
|
43621
|
+
if (import_node_fs79.default.existsSync(descriptor)) {
|
|
43622
|
+
import_node_fs79.default.readFileSync(descriptor);
|
|
43357
43623
|
noteChangedSince(descriptor, childStart);
|
|
43358
43624
|
}
|
|
43359
43625
|
}
|
|
@@ -43466,10 +43732,10 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
43466
43732
|
namespacesSeen.add(namespace);
|
|
43467
43733
|
const files2 = {};
|
|
43468
43734
|
const frameworks = /* @__PURE__ */ new Set();
|
|
43469
|
-
const ios =
|
|
43470
|
-
const appOwned = !canonical.split(
|
|
43471
|
-
const withinApp =
|
|
43472
|
-
const sourceBoundary = appOwned && withinApp !== ".." && !withinApp.startsWith(`..${
|
|
43735
|
+
const ios = import_node_path76.default.join(canonical, "ios");
|
|
43736
|
+
const appOwned = !canonical.split(import_node_path76.default.sep).includes("node_modules");
|
|
43737
|
+
const withinApp = import_node_path76.default.relative(appRoot, canonical);
|
|
43738
|
+
const sourceBoundary = appOwned && withinApp !== ".." && !withinApp.startsWith(`..${import_node_path76.default.sep}`) ? appRoot : canonical;
|
|
43473
43739
|
const boundaryName = sourceBoundary === appRoot ? "app root" : "module root";
|
|
43474
43740
|
const directories2 = /* @__PURE__ */ new Set();
|
|
43475
43741
|
const sources = /* @__PURE__ */ new Set();
|
|
@@ -43477,14 +43743,14 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
43477
43743
|
const resolveSource = (file) => {
|
|
43478
43744
|
let target;
|
|
43479
43745
|
try {
|
|
43480
|
-
target =
|
|
43746
|
+
target = import_node_fs79.default.realpathSync(file);
|
|
43481
43747
|
} catch (cause) {
|
|
43482
43748
|
throw new Error(`Cannot resolve Expo Swift source: ${file}`, {
|
|
43483
43749
|
cause
|
|
43484
43750
|
});
|
|
43485
43751
|
}
|
|
43486
|
-
const relative3 =
|
|
43487
|
-
if (relative3 === ".." || relative3.startsWith(`..${
|
|
43752
|
+
const relative3 = import_node_path76.default.relative(sourceBoundary, target);
|
|
43753
|
+
if (relative3 === ".." || relative3.startsWith(`..${import_node_path76.default.sep}`) || import_node_path76.default.isAbsolute(relative3))
|
|
43488
43754
|
throw new Error(
|
|
43489
43755
|
`Expo Swift source escapes ${boundaryName}: ${file} -> ${target}`
|
|
43490
43756
|
);
|
|
@@ -43495,10 +43761,10 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
43495
43761
|
const directory = resolveSource(dir);
|
|
43496
43762
|
if (directories2.has(directory)) return;
|
|
43497
43763
|
directories2.add(directory);
|
|
43498
|
-
for (const child of
|
|
43499
|
-
const file =
|
|
43764
|
+
for (const child of import_node_fs79.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
43765
|
+
const file = import_node_path76.default.join(dir, child.name);
|
|
43500
43766
|
const linked = child.isSymbolicLink() ? resolveSource(file) : null;
|
|
43501
|
-
const target = linked ?
|
|
43767
|
+
const target = linked ? import_node_fs79.default.statSync(linked) : child;
|
|
43502
43768
|
if (target.isDirectory()) {
|
|
43503
43769
|
const framework = /\.(xcframework|framework)$/.test(child.name);
|
|
43504
43770
|
if (framework && !binary2) frameworks.add(linked ?? resolveSource(file));
|
|
@@ -43508,24 +43774,24 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
43508
43774
|
}
|
|
43509
43775
|
if (!binary2 && target.isFile() && /\.(?:mm?|c|cc|cpp)$/.test(child.name)) {
|
|
43510
43776
|
const source2 = linked ?? resolveSource(file);
|
|
43511
|
-
if (
|
|
43512
|
-
|
|
43777
|
+
if (import_node_fs79.default.statSync(source2).size > 4096 || !/^(?:\s|\/\/[^\n]*|\/\*[\s\S]*?\*\/)*$/.test(
|
|
43778
|
+
import_node_fs79.default.readFileSync(source2, "utf8")
|
|
43513
43779
|
))
|
|
43514
|
-
nativeSources.add(
|
|
43780
|
+
nativeSources.add(import_node_path76.default.relative(ios, file));
|
|
43515
43781
|
}
|
|
43516
43782
|
if (!target.isFile() || !child.name.endsWith(".swift")) continue;
|
|
43517
43783
|
const source = linked ?? resolveSource(file);
|
|
43518
43784
|
if (sources.has(source)) continue;
|
|
43519
43785
|
sources.add(source);
|
|
43520
|
-
bytes +=
|
|
43786
|
+
bytes += import_node_fs79.default.statSync(source).size;
|
|
43521
43787
|
fileCount++;
|
|
43522
43788
|
if (!installedWorkspace && (fileCount > MAX_SWIFT_COMPILE_FILES - 2 || bytes > MAX_SWIFT_COMPILE_SOURCE_BYTES))
|
|
43523
43789
|
throw new Error("Expo Swift sources exceed compile service caps");
|
|
43524
|
-
files2[`Sources/${namespace}/${
|
|
43790
|
+
files2[`Sources/${namespace}/${import_node_path76.default.relative(ios, file).split(import_node_path76.default.sep).join("/")}`] = // CocoaPods' iOS umbrella header imports UIKit into every Swift file
|
|
43525
43791
|
// through the underlying module; these source units have no clang pod.
|
|
43526
43792
|
`import UIKit
|
|
43527
43793
|
#sourceLocation(file: ${JSON.stringify(file)}, line: 1)
|
|
43528
|
-
${
|
|
43794
|
+
${import_node_fs79.default.readFileSync(source, "utf8")}`;
|
|
43529
43795
|
}
|
|
43530
43796
|
};
|
|
43531
43797
|
const walkFrameworks = (dir) => {
|
|
@@ -43533,12 +43799,12 @@ ${import_node_fs78.default.readFileSync(source, "utf8")}`;
|
|
|
43533
43799
|
const directory = resolveSource(dir);
|
|
43534
43800
|
if (directories2.has(directory)) return;
|
|
43535
43801
|
directories2.add(directory);
|
|
43536
|
-
for (const child of
|
|
43802
|
+
for (const child of import_node_fs79.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
43537
43803
|
if (child.name.startsWith(".") || child.name === "build" || child.name === "node_modules" || child.name === "android" || child.name === "web" || child.name === "src")
|
|
43538
43804
|
continue;
|
|
43539
|
-
const file =
|
|
43805
|
+
const file = import_node_path76.default.join(dir, child.name);
|
|
43540
43806
|
const linked = child.isSymbolicLink() ? resolveSource(file) : null;
|
|
43541
|
-
const target = linked ?
|
|
43807
|
+
const target = linked ? import_node_fs79.default.statSync(linked) : child;
|
|
43542
43808
|
if (!target.isDirectory()) continue;
|
|
43543
43809
|
if (/\.(xcframework|framework)$/.test(child.name)) {
|
|
43544
43810
|
frameworks.add(linked ?? resolveSource(file));
|
|
@@ -43565,29 +43831,29 @@ ${import_node_fs78.default.readFileSync(source, "utf8")}`;
|
|
|
43565
43831
|
`${packageName}: ${namespace} has Objective-C or C sources (${[...nativeSources].sort()[0]}), which compile only from a CocoaPods workspace a Mac prepares; compiling its Swift alone`
|
|
43566
43832
|
);
|
|
43567
43833
|
}
|
|
43568
|
-
const podspec =
|
|
43834
|
+
const podspec = import_node_fs79.default.existsSync(ios) ? import_node_fs79.default.readdirSync(ios).find((name3) => name3.endsWith(".podspec")) : void 0;
|
|
43569
43835
|
const absentFrameworks = [];
|
|
43570
43836
|
if (podspec && !installed) {
|
|
43571
43837
|
const declared = [
|
|
43572
|
-
...
|
|
43838
|
+
...import_node_fs79.default.readFileSync(import_node_path76.default.join(ios, podspec), "utf8").matchAll(/\bvendored_frameworks\s*=\s*(\[[^\]]*\]|'[^'\n]*'|"[^"\n]*")/g)
|
|
43573
43839
|
].flatMap(
|
|
43574
43840
|
([, value]) => [...value.matchAll(/'([^'\n]*)'|"([^"\n#]*)"/g)].map(
|
|
43575
43841
|
(match) => match[1] ?? match[2]
|
|
43576
43842
|
)
|
|
43577
43843
|
);
|
|
43578
43844
|
for (const entry2 of declared) {
|
|
43579
|
-
const base =
|
|
43845
|
+
const base = import_node_path76.default.dirname(import_node_path76.default.resolve(ios, entry2));
|
|
43580
43846
|
const name3 = new RegExp(
|
|
43581
|
-
`^${
|
|
43847
|
+
`^${import_node_path76.default.basename(entry2).replace(/[.+^${}()|[\]\\]/g, "\\$&").replaceAll("*", "[^/]*")}$`
|
|
43582
43848
|
);
|
|
43583
|
-
const found =
|
|
43849
|
+
const found = import_node_fs79.default.existsSync(base) ? import_node_fs79.default.readdirSync(base).filter((child) => name3.test(child)) : [];
|
|
43584
43850
|
if (found.length === 0)
|
|
43585
|
-
absentFrameworks.push(
|
|
43586
|
-
for (const child of found) frameworks.add(resolveSource(
|
|
43851
|
+
absentFrameworks.push(import_node_path76.default.relative(appRoot, import_node_path76.default.resolve(ios, entry2)));
|
|
43852
|
+
for (const child of found) frameworks.add(resolveSource(import_node_path76.default.join(base, child)));
|
|
43587
43853
|
}
|
|
43588
43854
|
}
|
|
43589
43855
|
const podspecFloor = podspec ? /\.platforms\s*=\s*\{\s*:ios\s*=>\s*['"](\d+(?:\.\d+){0,2})['"]/.exec(
|
|
43590
|
-
|
|
43856
|
+
import_node_fs79.default.readFileSync(import_node_path76.default.join(ios, podspec), "utf8")
|
|
43591
43857
|
)?.[1] : void 0;
|
|
43592
43858
|
if (dependencyOnly && Object.keys(files2).length > 0) {
|
|
43593
43859
|
dependencyUnits.push({
|
|
@@ -43608,12 +43874,12 @@ ${import_node_fs78.default.readFileSync(source, "utf8")}`;
|
|
|
43608
43874
|
}
|
|
43609
43875
|
if (dependencyOnly) continue;
|
|
43610
43876
|
for (const declaration of declarations) {
|
|
43611
|
-
const
|
|
43612
|
-
const owner =
|
|
43613
|
-
if (
|
|
43877
|
+
const className2 = declaration.reference;
|
|
43878
|
+
const owner = className2.split(".")[0];
|
|
43879
|
+
if (className2.includes(".") && namespaces.includes(owner) && owner !== namespace)
|
|
43614
43880
|
continue;
|
|
43615
|
-
const name3 =
|
|
43616
|
-
const reference =
|
|
43881
|
+
const name3 = className2.split(".").pop();
|
|
43882
|
+
const reference = className2.includes(".") || className2 === namespace ? className2 : `${namespace}.${className2}`;
|
|
43617
43883
|
const module2 = {
|
|
43618
43884
|
name: name3,
|
|
43619
43885
|
nativeName: declaration.nativeName,
|
|
@@ -43623,9 +43889,9 @@ ${import_node_fs78.default.readFileSync(source, "utf8")}`;
|
|
|
43623
43889
|
};
|
|
43624
43890
|
const closure = swiftSourceClosure(files2, [module2.name]);
|
|
43625
43891
|
if (namespaces.length > 1 && Object.keys(closure).length === 0) continue;
|
|
43626
|
-
const classOwners = owners.get(
|
|
43892
|
+
const classOwners = owners.get(className2) ?? /* @__PURE__ */ new Set();
|
|
43627
43893
|
classOwners.add(namespace);
|
|
43628
|
-
owners.set(
|
|
43894
|
+
owners.set(className2, classOwners);
|
|
43629
43895
|
const configured = module2.registration !== null && configuredExpoSwiftModule(closure, module2.name, module2.nativeName, appConfig);
|
|
43630
43896
|
if (configured && !module2.subscriber && !module2.handler) continue;
|
|
43631
43897
|
if (Array.isArray(pods) && pods.length > 0) needsNativeWorkspace = true;
|
|
@@ -43701,7 +43967,7 @@ ${import_node_fs78.default.readFileSync(source, "utf8")}`;
|
|
|
43701
43967
|
if (directories !== void 0 && directories.length > 0) {
|
|
43702
43968
|
const scanInline = Reflect.get(
|
|
43703
43969
|
appRequire(
|
|
43704
|
-
|
|
43970
|
+
import_node_path76.default.join(import_node_path76.default.dirname(autolinker), "build/inlineModules/inlineModules.js")
|
|
43705
43971
|
),
|
|
43706
43972
|
"getMirrorStateObject"
|
|
43707
43973
|
);
|
|
@@ -43725,16 +43991,16 @@ ${import_node_fs78.default.readFileSync(source, "utf8")}`;
|
|
|
43725
43991
|
const file = entry && typeof entry === "object" ? Reflect.get(entry, "filePath") : null;
|
|
43726
43992
|
if (typeof file !== "string") throw new Error("invalid Expo inline source");
|
|
43727
43993
|
if (!file.endsWith(".swift")) continue;
|
|
43728
|
-
const relative3 =
|
|
43729
|
-
if (relative3 === ".." || relative3.startsWith(`..${
|
|
43994
|
+
const relative3 = import_node_path76.default.relative(appRoot, import_node_fs79.default.realpathSync(file));
|
|
43995
|
+
if (relative3 === ".." || relative3.startsWith(`..${import_node_path76.default.sep}`) || import_node_path76.default.isAbsolute(relative3))
|
|
43730
43996
|
throw new Error(`Expo inline source escapes app root: ${file}`);
|
|
43731
|
-
bytes +=
|
|
43997
|
+
bytes += import_node_fs79.default.statSync(file).size;
|
|
43732
43998
|
fileCount++;
|
|
43733
43999
|
if (fileCount > MAX_SWIFT_COMPILE_FILES - 2 || bytes > MAX_SWIFT_COMPILE_SOURCE_BYTES)
|
|
43734
44000
|
throw new Error("Expo Swift sources exceed compile service caps");
|
|
43735
|
-
appFiles[`Sources/PeachExpoApp/Inline/${relative3.split(
|
|
44001
|
+
appFiles[`Sources/PeachExpoApp/Inline/${relative3.split(import_node_path76.default.sep).join("/")}`] = `import UIKit
|
|
43736
44002
|
#sourceLocation(file: ${JSON.stringify(file)}, line: 1)
|
|
43737
|
-
${
|
|
44003
|
+
${import_node_fs79.default.readFileSync(file, "utf8")}`;
|
|
43738
44004
|
}
|
|
43739
44005
|
if (Object.keys(appFiles).length > 0) {
|
|
43740
44006
|
const inlineUnit = {
|
|
@@ -43972,18 +44238,18 @@ function expoUnitAppPaths(unit2) {
|
|
|
43972
44238
|
});
|
|
43973
44239
|
}
|
|
43974
44240
|
function expoSwiftPackage(appKey, name3) {
|
|
43975
|
-
return
|
|
44241
|
+
return import_node_path76.default.join(import_node_os17.default.tmpdir(), "peach-expo-swift", appKey, `p${process.pid}`, name3);
|
|
43976
44242
|
}
|
|
43977
44243
|
var ExpoSwiftLinkRefusal = class extends Error {
|
|
43978
44244
|
};
|
|
43979
44245
|
function failureRecordPath(packagePath) {
|
|
43980
|
-
const app =
|
|
43981
|
-
return
|
|
44246
|
+
const app = import_node_path76.default.dirname(import_node_path76.default.dirname(packagePath));
|
|
44247
|
+
return import_node_path76.default.join(app, `${import_node_path76.default.basename(packagePath)}.failed.json`);
|
|
43982
44248
|
}
|
|
43983
44249
|
function readFailedCompilation(packagePath) {
|
|
43984
44250
|
let record2;
|
|
43985
44251
|
try {
|
|
43986
|
-
record2 = JSON.parse(
|
|
44252
|
+
record2 = JSON.parse(import_node_fs79.default.readFileSync(failureRecordPath(packagePath), "utf8"));
|
|
43987
44253
|
} catch {
|
|
43988
44254
|
return null;
|
|
43989
44255
|
}
|
|
@@ -44093,7 +44359,7 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
44093
44359
|
packagePath,
|
|
44094
44360
|
new Map(
|
|
44095
44361
|
Object.entries(files2).map(([name3, source]) => [
|
|
44096
|
-
|
|
44362
|
+
import_node_path76.default.join(packagePath, name3),
|
|
44097
44363
|
source
|
|
44098
44364
|
])
|
|
44099
44365
|
)
|
|
@@ -44172,21 +44438,21 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
44172
44438
|
{ moduleRoot: options.moduleRoot }
|
|
44173
44439
|
);
|
|
44174
44440
|
signal.throwIfAborted();
|
|
44175
|
-
const ios =
|
|
44176
|
-
if ([ios,
|
|
44177
|
-
(dir) =>
|
|
44178
|
-
const project =
|
|
44179
|
-
return entry.endsWith(".xcodeproj") &&
|
|
44441
|
+
const ios = import_node_path76.default.join(root, "ios");
|
|
44442
|
+
if ([ios, import_node_path76.default.join(ios, "Pods")].some(
|
|
44443
|
+
(dir) => import_node_fs79.default.existsSync(dir) && import_node_fs79.default.readdirSync(dir).some((entry) => {
|
|
44444
|
+
const project = import_node_path76.default.join(dir, entry, "project.pbxproj");
|
|
44445
|
+
return entry.endsWith(".xcodeproj") && import_node_fs79.default.existsSync(project) && import_node_fs79.default.readFileSync(project, "utf8").includes("XCRemoteSwiftPackageReference");
|
|
44180
44446
|
})
|
|
44181
44447
|
))
|
|
44182
44448
|
await ensureSwiftToolchain(signal);
|
|
44183
|
-
let bridge = options.only ? null : collectBridgeModuleSources(
|
|
44184
|
-
if (nativeWorkspaceAvailable() &&
|
|
44449
|
+
let bridge = options.only ? null : collectBridgeModuleSources(import_node_fs79.default.realpathSync(root), signal);
|
|
44450
|
+
if (nativeWorkspaceAvailable() && import_node_fs79.default.existsSync(import_node_path76.default.join(root, "ios", "Podfile")) && bridge?.units.some(
|
|
44185
44451
|
(unit2) => unit2.nativeTargets?.some((target) => target.bridgingHeader)
|
|
44186
44452
|
)) {
|
|
44187
44453
|
const prepared = await prepareExpoNativeWorkspace(root, signal, options.iosTarget);
|
|
44188
44454
|
bridge = collectBridgeModuleSources(
|
|
44189
|
-
|
|
44455
|
+
import_node_fs79.default.realpathSync(prepared.app),
|
|
44190
44456
|
signal,
|
|
44191
44457
|
options.installedWorkspace ?? prepared.workspace
|
|
44192
44458
|
);
|
|
@@ -44259,9 +44525,9 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
44259
44525
|
const module2 = options.moduleRoot ? { root: options.moduleRoot, ...swiftModuleToolchain(options.moduleRoot) } : await resolveSwiftModule({ signal });
|
|
44260
44526
|
signal.throwIfAborted();
|
|
44261
44527
|
const reactProvider = units.some((unit2) => unit2.reactNativeProvider) ? await (async () => {
|
|
44262
|
-
const projectRoot = options.installedWorkspace ?
|
|
44263
|
-
const reactNativeRoot =
|
|
44264
|
-
(0, import_node_module8.createRequire)(
|
|
44528
|
+
const projectRoot = options.installedWorkspace ? import_node_path76.default.dirname(import_node_path76.default.dirname(options.installedWorkspace)) : (await prepareExpoNativeWorkspace(root, signal, options.iosTarget)).app;
|
|
44529
|
+
const reactNativeRoot = import_node_path76.default.dirname(
|
|
44530
|
+
(0, import_node_module8.createRequire)(import_node_path76.default.join(projectRoot, "package.json")).resolve(
|
|
44265
44531
|
"react-native/package.json"
|
|
44266
44532
|
)
|
|
44267
44533
|
);
|
|
@@ -44284,7 +44550,7 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
44284
44550
|
return provider;
|
|
44285
44551
|
})() : void 0;
|
|
44286
44552
|
const reactProviderStamp = reactProvider ? (0, import_node_crypto40.createHash)("sha256").update(JSON.stringify(reactProvider)).digest("hex") : "";
|
|
44287
|
-
const key2 = (0, import_node_crypto40.createHash)("sha256").update(
|
|
44553
|
+
const key2 = (0, import_node_crypto40.createHash)("sha256").update(import_node_fs79.default.realpathSync(root)).digest("hex");
|
|
44288
44554
|
const unitContentStamp = (unit2) => sourceContentStamp(expoSwiftPackage(key2, unit2.moduleId), module2.root) + (unit2.reactNativeProvider ? `:${reactProviderStamp}` : "");
|
|
44289
44555
|
const failures = /* @__PURE__ */ new Map();
|
|
44290
44556
|
const failureRecords = /* @__PURE__ */ new Map();
|
|
@@ -44298,7 +44564,7 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
44298
44564
|
[...new Set(units.flatMap((unit2) => unit2.frameworks))],
|
|
44299
44565
|
module2.root
|
|
44300
44566
|
);
|
|
44301
|
-
const sharedLibrary = firstSharedLibrary === void 0 ? void 0 :
|
|
44567
|
+
const sharedLibrary = firstSharedLibrary === void 0 ? void 0 : import_node_fs79.default.readFileSync(
|
|
44302
44568
|
combineNativeStaticLibraries(
|
|
44303
44569
|
[firstSharedLibrary, ...otherSharedLibraries],
|
|
44304
44570
|
module2.root
|
|
@@ -44321,7 +44587,7 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
44321
44587
|
const binaries = await Promise.all(
|
|
44322
44588
|
unit2.frameworks.map(async (dir) => {
|
|
44323
44589
|
const binary2 = {
|
|
44324
|
-
target:
|
|
44590
|
+
target: import_node_path76.default.basename(dir).replace(/\.(xcframework|framework)$/, ""),
|
|
44325
44591
|
source: dir,
|
|
44326
44592
|
url: null,
|
|
44327
44593
|
checksum: null,
|
|
@@ -44392,7 +44658,7 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
44392
44658
|
...Object.fromEntries(
|
|
44393
44659
|
[...linkedLibraries].map(([library, [first]]) => [
|
|
44394
44660
|
first.module,
|
|
44395
|
-
|
|
44661
|
+
import_node_fs79.default.readFileSync(library).toString("base64")
|
|
44396
44662
|
])
|
|
44397
44663
|
)
|
|
44398
44664
|
});
|
|
@@ -44416,7 +44682,7 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
44416
44682
|
failures.set(unit2.moduleId, failed.diagnostic);
|
|
44417
44683
|
continue;
|
|
44418
44684
|
}
|
|
44419
|
-
|
|
44685
|
+
import_node_fs79.default.rmSync(failureRecordPath(packagePath), { force: true });
|
|
44420
44686
|
stamps.set(unit2, stamp);
|
|
44421
44687
|
candidates.push(unit2);
|
|
44422
44688
|
}
|
|
@@ -44438,7 +44704,7 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
44438
44704
|
report("reusing recent link refusal");
|
|
44439
44705
|
throw new ExpoSwiftLinkRefusal(refused.diagnostic);
|
|
44440
44706
|
}
|
|
44441
|
-
|
|
44707
|
+
import_node_fs79.default.rmSync(failureRecordPath(packagePath), { force: true });
|
|
44442
44708
|
report(`linking ${linked2.map((unit2) => unit2.moduleId).join(", ")}`);
|
|
44443
44709
|
try {
|
|
44444
44710
|
return await artifactFor(
|
|
@@ -44455,7 +44721,7 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
44455
44721
|
))
|
|
44456
44722
|
throw error;
|
|
44457
44723
|
if (sourceContentStamp(packagePath, module2.root) === stamp)
|
|
44458
|
-
|
|
44724
|
+
import_node_fs79.default.writeFileSync(
|
|
44459
44725
|
failureRecordPath(packagePath),
|
|
44460
44726
|
JSON.stringify({ stamp, diagnostic, retryAt: Date.now() + 6e4 })
|
|
44461
44727
|
);
|
|
@@ -44598,7 +44864,7 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
44598
44864
|
}
|
|
44599
44865
|
signal.throwIfAborted();
|
|
44600
44866
|
for (const [packagePath, record2] of failureRecords)
|
|
44601
|
-
|
|
44867
|
+
import_node_fs79.default.writeFileSync(failureRecordPath(packagePath), JSON.stringify(record2));
|
|
44602
44868
|
report(
|
|
44603
44869
|
`ready: ${result.modules.length} artifact, ${result.failures.length} unavailable modules`
|
|
44604
44870
|
);
|