peachsim 0.1.2210 → 0.1.2215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/command-registry.ts +1 -0
- package/cli/commands/inspect/settling.ts +1 -1
- package/cli/commands/map.ts +576 -0
- package/cli/commands/runtime.ts +1 -1
- package/cli/main.ts +6 -0
- package/cli/outbound-endpoints.ts +11 -0
- 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 +31 -13
- 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 +6 -3
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +29 -11
- 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 +1019 -819
- package/dist-lib/host/fetch-proxy-handler.cjs +8 -5
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1956 -752
- 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 +1796 -593
- package/dist-lib/native-app-identity-project.cjs +6 -3
- package/dist-lib/native-app-identity-project.mjs +6 -3
- 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 +25 -24
- package/dist-lib/public-origins-lib.json +73 -53
- 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 +2 -2
- package/dist-lib/sdk.mjs +2 -2
- package/dist-lib/skills.cjs +1555 -1297
- 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 +21 -9
- package/dist-lib/vite.cjs +1520 -303
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +42 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes +35 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.h +8 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSAttributeDescription.h +30 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h +14 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSExpressionDescription.h +10 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchIndexDescription.h +13 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchIndexElementDescription.h +18 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h +11 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectContext.h +19 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectID.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectModel.h +3 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSMergePolicy.h +17 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStore.h +8 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreCoordinator.h +6 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPropertyDescription.h +13 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSRelationshipDescription.h +21 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIImage.h +1 -10
- package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +11 -0
- package/sdk/ios/wasm/include/fcntl.h +3 -0
- package/skills/contrast/SKILL.md +1 -0
- package/src/home-paths.ts +1 -1
- package/src/host/bridge-host.ts +101 -97
- package/src/metro-plugin.ts +4 -1
- package/src/react-native-coverage/native-source-ranges-file.ts +1 -1
- package/src/runtime-assets.ts +0 -1
- package/src/runtime-delivery.ts +1 -1
- package/src/runtime-packs.ts +212 -0
- package/src/swift-package-manifest.ts +7 -2
- package/src/swift-shipped-binaries.ts +1 -1
- package/src/swift-standin-config.ts +4 -2
- package/src/swift-standin-emit.ts +1 -1
- package/src/swift-standins.ts +10 -3
- package/src/vite-plugin-one.ts +4 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2215 | (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;
|
|
@@ -39,7 +39,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
39
39
|
var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
|
|
40
40
|
var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
|
|
41
41
|
"<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
|
|
42
|
-
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "
|
|
42
|
+
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "29c2661be4b952101c9b9b8fd861560e6ce63b25dd4464f47475aaf72024f4fe", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "25505683ca29a0b380413bf2a5026d4967eacf886e35bc11ece6e15317e5bb02", "home-paths.ts": "d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "86f79e98323ec065e0e5195324c75ca608f490efbd95dcc25c53d5aa0b9aecc9", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -903,6 +903,30 @@ var init_product = __esm({
|
|
|
903
903
|
}
|
|
904
904
|
});
|
|
905
905
|
|
|
906
|
+
// ../contrast-runtime-delivery/src/packs.ts
|
|
907
|
+
var RUNTIME_PACKS_FILE, RUNTIME_PACK_MARKER, RUNTIME_PACK_PREFIXES, RUNTIME_MERGE_PACK_DIR, RUNTIME_MERGE_PACK_INSTALL, RUNTIME_MERGE_PACK_MERGED;
|
|
908
|
+
var init_packs = __esm({
|
|
909
|
+
"../contrast-runtime-delivery/src/packs.ts"() {
|
|
910
|
+
"use strict";
|
|
911
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
912
|
+
RUNTIME_PACKS_FILE = "packs.json";
|
|
913
|
+
RUNTIME_PACK_MARKER = ".pack";
|
|
914
|
+
RUNTIME_PACK_PREFIXES = [
|
|
915
|
+
"engine/fonts/emoji/",
|
|
916
|
+
"engine/fonts/named/",
|
|
917
|
+
"engine/fonts/vector-icons/",
|
|
918
|
+
"engine/fonts/webview/",
|
|
919
|
+
"engine/kotlin/",
|
|
920
|
+
"engine/material-symbols/",
|
|
921
|
+
"engine/pdfjs/",
|
|
922
|
+
"three-mode/"
|
|
923
|
+
];
|
|
924
|
+
RUNTIME_MERGE_PACK_DIR = "engine-tenant/";
|
|
925
|
+
RUNTIME_MERGE_PACK_INSTALL = ".pack-prod";
|
|
926
|
+
RUNTIME_MERGE_PACK_MERGED = ".merged";
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
|
|
906
930
|
// ../contrast-runtime-delivery/src/index.ts
|
|
907
931
|
function createRuntimeDelivery(product) {
|
|
908
932
|
function readConfig() {
|
|
@@ -1007,8 +1031,12 @@ function createRuntimeDelivery(product) {
|
|
|
1007
1031
|
process.stderr.write(`${product.id}: downloading runtime ${version2}\u2026
|
|
1008
1032
|
`);
|
|
1009
1033
|
await installVerifiedTarball({
|
|
1010
|
-
url: entry.tarball || tarballUrl(version2, cdnOrigin),
|
|
1011
|
-
digest: {
|
|
1034
|
+
url: entry.base?.tarball || entry.tarball || tarballUrl(version2, cdnOrigin),
|
|
1035
|
+
digest: {
|
|
1036
|
+
algorithm: "sha256",
|
|
1037
|
+
encoding: "hex",
|
|
1038
|
+
value: entry.base?.sha256 ?? entry.sha256
|
|
1039
|
+
},
|
|
1012
1040
|
destDir,
|
|
1013
1041
|
installedMarker: product.installedMarker,
|
|
1014
1042
|
verify: product.verifyInstall,
|
|
@@ -1418,6 +1446,7 @@ var init_src = __esm({
|
|
|
1418
1446
|
import_node_zlib = __toESM(require("node:zlib"), 1);
|
|
1419
1447
|
init_process_group();
|
|
1420
1448
|
init_product();
|
|
1449
|
+
init_packs();
|
|
1421
1450
|
init_product();
|
|
1422
1451
|
DEFAULT_LOCAL_RUNTIME_RETENTION_COUNT = 2;
|
|
1423
1452
|
}
|
|
@@ -4642,17 +4671,17 @@ function visit(node, visitor) {
|
|
|
4642
4671
|
} else
|
|
4643
4672
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
4644
4673
|
}
|
|
4645
|
-
function visit_(key2, node, visitor,
|
|
4646
|
-
const ctrl = callVisitor(key2, node, visitor,
|
|
4674
|
+
function visit_(key2, node, visitor, path112) {
|
|
4675
|
+
const ctrl = callVisitor(key2, node, visitor, path112);
|
|
4647
4676
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
4648
|
-
replaceNode(key2,
|
|
4649
|
-
return visit_(key2, ctrl, visitor,
|
|
4677
|
+
replaceNode(key2, path112, ctrl);
|
|
4678
|
+
return visit_(key2, ctrl, visitor, path112);
|
|
4650
4679
|
}
|
|
4651
4680
|
if (typeof ctrl !== "symbol") {
|
|
4652
4681
|
if (isCollection(node)) {
|
|
4653
|
-
|
|
4682
|
+
path112 = Object.freeze(path112.concat(node));
|
|
4654
4683
|
for (let i = 0; i < node.items.length; ++i) {
|
|
4655
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
4684
|
+
const ci = visit_(i, node.items[i], visitor, path112);
|
|
4656
4685
|
if (typeof ci === "number")
|
|
4657
4686
|
i = ci - 1;
|
|
4658
4687
|
else if (ci === BREAK)
|
|
@@ -4663,13 +4692,13 @@ function visit_(key2, node, visitor, path111) {
|
|
|
4663
4692
|
}
|
|
4664
4693
|
}
|
|
4665
4694
|
} else if (isPair(node)) {
|
|
4666
|
-
|
|
4667
|
-
const ck = visit_("key", node.key, visitor,
|
|
4695
|
+
path112 = Object.freeze(path112.concat(node));
|
|
4696
|
+
const ck = visit_("key", node.key, visitor, path112);
|
|
4668
4697
|
if (ck === BREAK)
|
|
4669
4698
|
return BREAK;
|
|
4670
4699
|
else if (ck === REMOVE)
|
|
4671
4700
|
node.key = null;
|
|
4672
|
-
const cv = visit_("value", node.value, visitor,
|
|
4701
|
+
const cv = visit_("value", node.value, visitor, path112);
|
|
4673
4702
|
if (cv === BREAK)
|
|
4674
4703
|
return BREAK;
|
|
4675
4704
|
else if (cv === REMOVE)
|
|
@@ -4687,17 +4716,17 @@ async function visitAsync(node, visitor) {
|
|
|
4687
4716
|
} else
|
|
4688
4717
|
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
4689
4718
|
}
|
|
4690
|
-
async function visitAsync_(key2, node, visitor,
|
|
4691
|
-
const ctrl = await callVisitor(key2, node, visitor,
|
|
4719
|
+
async function visitAsync_(key2, node, visitor, path112) {
|
|
4720
|
+
const ctrl = await callVisitor(key2, node, visitor, path112);
|
|
4692
4721
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
4693
|
-
replaceNode(key2,
|
|
4694
|
-
return visitAsync_(key2, ctrl, visitor,
|
|
4722
|
+
replaceNode(key2, path112, ctrl);
|
|
4723
|
+
return visitAsync_(key2, ctrl, visitor, path112);
|
|
4695
4724
|
}
|
|
4696
4725
|
if (typeof ctrl !== "symbol") {
|
|
4697
4726
|
if (isCollection(node)) {
|
|
4698
|
-
|
|
4727
|
+
path112 = Object.freeze(path112.concat(node));
|
|
4699
4728
|
for (let i = 0; i < node.items.length; ++i) {
|
|
4700
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
4729
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path112);
|
|
4701
4730
|
if (typeof ci === "number")
|
|
4702
4731
|
i = ci - 1;
|
|
4703
4732
|
else if (ci === BREAK)
|
|
@@ -4708,13 +4737,13 @@ async function visitAsync_(key2, node, visitor, path111) {
|
|
|
4708
4737
|
}
|
|
4709
4738
|
}
|
|
4710
4739
|
} else if (isPair(node)) {
|
|
4711
|
-
|
|
4712
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
4740
|
+
path112 = Object.freeze(path112.concat(node));
|
|
4741
|
+
const ck = await visitAsync_("key", node.key, visitor, path112);
|
|
4713
4742
|
if (ck === BREAK)
|
|
4714
4743
|
return BREAK;
|
|
4715
4744
|
else if (ck === REMOVE)
|
|
4716
4745
|
node.key = null;
|
|
4717
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
4746
|
+
const cv = await visitAsync_("value", node.value, visitor, path112);
|
|
4718
4747
|
if (cv === BREAK)
|
|
4719
4748
|
return BREAK;
|
|
4720
4749
|
else if (cv === REMOVE)
|
|
@@ -4741,23 +4770,23 @@ function initVisitor(visitor) {
|
|
|
4741
4770
|
}
|
|
4742
4771
|
return visitor;
|
|
4743
4772
|
}
|
|
4744
|
-
function callVisitor(key2, node, visitor,
|
|
4773
|
+
function callVisitor(key2, node, visitor, path112) {
|
|
4745
4774
|
if (typeof visitor === "function")
|
|
4746
|
-
return visitor(key2, node,
|
|
4775
|
+
return visitor(key2, node, path112);
|
|
4747
4776
|
if (isMap(node))
|
|
4748
|
-
return visitor.Map?.(key2, node,
|
|
4777
|
+
return visitor.Map?.(key2, node, path112);
|
|
4749
4778
|
if (isSeq(node))
|
|
4750
|
-
return visitor.Seq?.(key2, node,
|
|
4779
|
+
return visitor.Seq?.(key2, node, path112);
|
|
4751
4780
|
if (isPair(node))
|
|
4752
|
-
return visitor.Pair?.(key2, node,
|
|
4781
|
+
return visitor.Pair?.(key2, node, path112);
|
|
4753
4782
|
if (isScalar(node))
|
|
4754
|
-
return visitor.Scalar?.(key2, node,
|
|
4783
|
+
return visitor.Scalar?.(key2, node, path112);
|
|
4755
4784
|
if (isAlias(node))
|
|
4756
|
-
return visitor.Alias?.(key2, node,
|
|
4785
|
+
return visitor.Alias?.(key2, node, path112);
|
|
4757
4786
|
return void 0;
|
|
4758
4787
|
}
|
|
4759
|
-
function replaceNode(key2,
|
|
4760
|
-
const parent =
|
|
4788
|
+
function replaceNode(key2, path112, node) {
|
|
4789
|
+
const parent = path112[path112.length - 1];
|
|
4761
4790
|
if (isCollection(parent)) {
|
|
4762
4791
|
parent.items[key2] = node;
|
|
4763
4792
|
} else if (isPair(parent)) {
|
|
@@ -5366,10 +5395,10 @@ var init_createNode = __esm({
|
|
|
5366
5395
|
});
|
|
5367
5396
|
|
|
5368
5397
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
5369
|
-
function collectionFromPath(schema4,
|
|
5398
|
+
function collectionFromPath(schema4, path112, value) {
|
|
5370
5399
|
let v6 = value;
|
|
5371
|
-
for (let i =
|
|
5372
|
-
const k =
|
|
5400
|
+
for (let i = path112.length - 1; i >= 0; --i) {
|
|
5401
|
+
const k = path112[i];
|
|
5373
5402
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
5374
5403
|
const a = [];
|
|
5375
5404
|
a[k] = v6;
|
|
@@ -5395,7 +5424,7 @@ var init_Collection = __esm({
|
|
|
5395
5424
|
init_createNode();
|
|
5396
5425
|
init_identity();
|
|
5397
5426
|
init_Node();
|
|
5398
|
-
isEmptyPath = (
|
|
5427
|
+
isEmptyPath = (path112) => path112 == null || typeof path112 === "object" && !!path112[Symbol.iterator]().next().done;
|
|
5399
5428
|
Collection = class extends NodeBase {
|
|
5400
5429
|
constructor(type, schema4) {
|
|
5401
5430
|
super(type);
|
|
@@ -5425,11 +5454,11 @@ var init_Collection = __esm({
|
|
|
5425
5454
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
5426
5455
|
* that already exists in the map.
|
|
5427
5456
|
*/
|
|
5428
|
-
addIn(
|
|
5429
|
-
if (isEmptyPath(
|
|
5457
|
+
addIn(path112, value) {
|
|
5458
|
+
if (isEmptyPath(path112))
|
|
5430
5459
|
this.add(value);
|
|
5431
5460
|
else {
|
|
5432
|
-
const [key2, ...rest] =
|
|
5461
|
+
const [key2, ...rest] = path112;
|
|
5433
5462
|
const node = this.get(key2, true);
|
|
5434
5463
|
if (isCollection(node))
|
|
5435
5464
|
node.addIn(rest, value);
|
|
@@ -5443,8 +5472,8 @@ var init_Collection = __esm({
|
|
|
5443
5472
|
* Removes a value from the collection.
|
|
5444
5473
|
* @returns `true` if the item was found and removed.
|
|
5445
5474
|
*/
|
|
5446
|
-
deleteIn(
|
|
5447
|
-
const [key2, ...rest] =
|
|
5475
|
+
deleteIn(path112) {
|
|
5476
|
+
const [key2, ...rest] = path112;
|
|
5448
5477
|
if (rest.length === 0)
|
|
5449
5478
|
return this.delete(key2);
|
|
5450
5479
|
const node = this.get(key2, true);
|
|
@@ -5458,8 +5487,8 @@ var init_Collection = __esm({
|
|
|
5458
5487
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
5459
5488
|
* `true` (collections are always returned intact).
|
|
5460
5489
|
*/
|
|
5461
|
-
getIn(
|
|
5462
|
-
const [key2, ...rest] =
|
|
5490
|
+
getIn(path112, keepScalar) {
|
|
5491
|
+
const [key2, ...rest] = path112;
|
|
5463
5492
|
const node = this.get(key2, true);
|
|
5464
5493
|
if (rest.length === 0)
|
|
5465
5494
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -5477,8 +5506,8 @@ var init_Collection = __esm({
|
|
|
5477
5506
|
/**
|
|
5478
5507
|
* Checks if the collection includes a value with the key `key`.
|
|
5479
5508
|
*/
|
|
5480
|
-
hasIn(
|
|
5481
|
-
const [key2, ...rest] =
|
|
5509
|
+
hasIn(path112) {
|
|
5510
|
+
const [key2, ...rest] = path112;
|
|
5482
5511
|
if (rest.length === 0)
|
|
5483
5512
|
return this.has(key2);
|
|
5484
5513
|
const node = this.get(key2, true);
|
|
@@ -5488,8 +5517,8 @@ var init_Collection = __esm({
|
|
|
5488
5517
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
5489
5518
|
* boolean to add/remove the item from the set.
|
|
5490
5519
|
*/
|
|
5491
|
-
setIn(
|
|
5492
|
-
const [key2, ...rest] =
|
|
5520
|
+
setIn(path112, value) {
|
|
5521
|
+
const [key2, ...rest] = path112;
|
|
5493
5522
|
if (rest.length === 0) {
|
|
5494
5523
|
this.set(key2, value);
|
|
5495
5524
|
} else {
|
|
@@ -7958,9 +7987,9 @@ var init_Document = __esm({
|
|
|
7958
7987
|
this.contents.add(value);
|
|
7959
7988
|
}
|
|
7960
7989
|
/** Adds a value to the document. */
|
|
7961
|
-
addIn(
|
|
7990
|
+
addIn(path112, value) {
|
|
7962
7991
|
if (assertCollection(this.contents))
|
|
7963
|
-
this.contents.addIn(
|
|
7992
|
+
this.contents.addIn(path112, value);
|
|
7964
7993
|
}
|
|
7965
7994
|
/**
|
|
7966
7995
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -8035,14 +8064,14 @@ var init_Document = __esm({
|
|
|
8035
8064
|
* Removes a value from the document.
|
|
8036
8065
|
* @returns `true` if the item was found and removed.
|
|
8037
8066
|
*/
|
|
8038
|
-
deleteIn(
|
|
8039
|
-
if (isEmptyPath(
|
|
8067
|
+
deleteIn(path112) {
|
|
8068
|
+
if (isEmptyPath(path112)) {
|
|
8040
8069
|
if (this.contents == null)
|
|
8041
8070
|
return false;
|
|
8042
8071
|
this.contents = null;
|
|
8043
8072
|
return true;
|
|
8044
8073
|
}
|
|
8045
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
8074
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path112) : false;
|
|
8046
8075
|
}
|
|
8047
8076
|
/**
|
|
8048
8077
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -8057,10 +8086,10 @@ var init_Document = __esm({
|
|
|
8057
8086
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
8058
8087
|
* `true` (collections are always returned intact).
|
|
8059
8088
|
*/
|
|
8060
|
-
getIn(
|
|
8061
|
-
if (isEmptyPath(
|
|
8089
|
+
getIn(path112, keepScalar) {
|
|
8090
|
+
if (isEmptyPath(path112))
|
|
8062
8091
|
return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
|
|
8063
|
-
return isCollection(this.contents) ? this.contents.getIn(
|
|
8092
|
+
return isCollection(this.contents) ? this.contents.getIn(path112, keepScalar) : void 0;
|
|
8064
8093
|
}
|
|
8065
8094
|
/**
|
|
8066
8095
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -8071,10 +8100,10 @@ var init_Document = __esm({
|
|
|
8071
8100
|
/**
|
|
8072
8101
|
* Checks if the document includes a value at `path`.
|
|
8073
8102
|
*/
|
|
8074
|
-
hasIn(
|
|
8075
|
-
if (isEmptyPath(
|
|
8103
|
+
hasIn(path112) {
|
|
8104
|
+
if (isEmptyPath(path112))
|
|
8076
8105
|
return this.contents !== void 0;
|
|
8077
|
-
return isCollection(this.contents) ? this.contents.hasIn(
|
|
8106
|
+
return isCollection(this.contents) ? this.contents.hasIn(path112) : false;
|
|
8078
8107
|
}
|
|
8079
8108
|
/**
|
|
8080
8109
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -8091,13 +8120,13 @@ var init_Document = __esm({
|
|
|
8091
8120
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
8092
8121
|
* boolean to add/remove the item from the set.
|
|
8093
8122
|
*/
|
|
8094
|
-
setIn(
|
|
8095
|
-
if (isEmptyPath(
|
|
8123
|
+
setIn(path112, value) {
|
|
8124
|
+
if (isEmptyPath(path112)) {
|
|
8096
8125
|
this.contents = value;
|
|
8097
8126
|
} else if (this.contents == null) {
|
|
8098
|
-
this.contents = collectionFromPath(this.schema, Array.from(
|
|
8127
|
+
this.contents = collectionFromPath(this.schema, Array.from(path112), value);
|
|
8099
8128
|
} else if (assertCollection(this.contents)) {
|
|
8100
|
-
this.contents.setIn(
|
|
8129
|
+
this.contents.setIn(path112, value);
|
|
8101
8130
|
}
|
|
8102
8131
|
}
|
|
8103
8132
|
/**
|
|
@@ -10021,15 +10050,15 @@ function visit2(cst, visitor) {
|
|
|
10021
10050
|
cst = { start: cst.start, value: cst.value };
|
|
10022
10051
|
_visit(Object.freeze([]), cst, visitor);
|
|
10023
10052
|
}
|
|
10024
|
-
function _visit(
|
|
10025
|
-
let ctrl = visitor(item,
|
|
10053
|
+
function _visit(path112, item, visitor) {
|
|
10054
|
+
let ctrl = visitor(item, path112);
|
|
10026
10055
|
if (typeof ctrl === "symbol")
|
|
10027
10056
|
return ctrl;
|
|
10028
10057
|
for (const field of ["key", "value"]) {
|
|
10029
10058
|
const token = item[field];
|
|
10030
10059
|
if (token && "items" in token) {
|
|
10031
10060
|
for (let i = 0; i < token.items.length; ++i) {
|
|
10032
|
-
const ci = _visit(Object.freeze(
|
|
10061
|
+
const ci = _visit(Object.freeze(path112.concat([[field, i]])), token.items[i], visitor);
|
|
10033
10062
|
if (typeof ci === "number")
|
|
10034
10063
|
i = ci - 1;
|
|
10035
10064
|
else if (ci === BREAK2)
|
|
@@ -10040,10 +10069,10 @@ function _visit(path111, item, visitor) {
|
|
|
10040
10069
|
}
|
|
10041
10070
|
}
|
|
10042
10071
|
if (typeof ctrl === "function" && field === "key")
|
|
10043
|
-
ctrl = ctrl(item,
|
|
10072
|
+
ctrl = ctrl(item, path112);
|
|
10044
10073
|
}
|
|
10045
10074
|
}
|
|
10046
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
10075
|
+
return typeof ctrl === "function" ? ctrl(item, path112) : ctrl;
|
|
10047
10076
|
}
|
|
10048
10077
|
var BREAK2, SKIP2, REMOVE2;
|
|
10049
10078
|
var init_cst_visit = __esm({
|
|
@@ -10055,9 +10084,9 @@ var init_cst_visit = __esm({
|
|
|
10055
10084
|
visit2.BREAK = BREAK2;
|
|
10056
10085
|
visit2.SKIP = SKIP2;
|
|
10057
10086
|
visit2.REMOVE = REMOVE2;
|
|
10058
|
-
visit2.itemAtPath = (cst,
|
|
10087
|
+
visit2.itemAtPath = (cst, path112) => {
|
|
10059
10088
|
let item = cst;
|
|
10060
|
-
for (const [field, index] of
|
|
10089
|
+
for (const [field, index] of path112) {
|
|
10061
10090
|
const tok = item?.[field];
|
|
10062
10091
|
if (tok && "items" in tok) {
|
|
10063
10092
|
item = tok.items[index];
|
|
@@ -10066,9 +10095,9 @@ var init_cst_visit = __esm({
|
|
|
10066
10095
|
}
|
|
10067
10096
|
return item;
|
|
10068
10097
|
};
|
|
10069
|
-
visit2.parentCollection = (cst,
|
|
10070
|
-
const parent = visit2.itemAtPath(cst,
|
|
10071
|
-
const field =
|
|
10098
|
+
visit2.parentCollection = (cst, path112) => {
|
|
10099
|
+
const parent = visit2.itemAtPath(cst, path112.slice(0, -1));
|
|
10100
|
+
const field = path112[path112.length - 1][0];
|
|
10072
10101
|
const coll = parent?.[field];
|
|
10073
10102
|
if (coll && "items" in coll)
|
|
10074
10103
|
return coll;
|
|
@@ -11375,14 +11404,14 @@ var init_parser = __esm({
|
|
|
11375
11404
|
case "scalar":
|
|
11376
11405
|
case "single-quoted-scalar":
|
|
11377
11406
|
case "double-quoted-scalar": {
|
|
11378
|
-
const
|
|
11407
|
+
const fs88 = this.flowScalar(this.type);
|
|
11379
11408
|
if (atNextItem || it.value) {
|
|
11380
|
-
map2.items.push({ start, key:
|
|
11409
|
+
map2.items.push({ start, key: fs88, sep: [] });
|
|
11381
11410
|
this.onKeyLine = true;
|
|
11382
11411
|
} else if (it.sep) {
|
|
11383
|
-
this.stack.push(
|
|
11412
|
+
this.stack.push(fs88);
|
|
11384
11413
|
} else {
|
|
11385
|
-
Object.assign(it, { key:
|
|
11414
|
+
Object.assign(it, { key: fs88, sep: [] });
|
|
11386
11415
|
this.onKeyLine = true;
|
|
11387
11416
|
}
|
|
11388
11417
|
return;
|
|
@@ -11510,13 +11539,13 @@ var init_parser = __esm({
|
|
|
11510
11539
|
case "scalar":
|
|
11511
11540
|
case "single-quoted-scalar":
|
|
11512
11541
|
case "double-quoted-scalar": {
|
|
11513
|
-
const
|
|
11542
|
+
const fs88 = this.flowScalar(this.type);
|
|
11514
11543
|
if (!it || it.value)
|
|
11515
|
-
fc.items.push({ start: [], key:
|
|
11544
|
+
fc.items.push({ start: [], key: fs88, sep: [] });
|
|
11516
11545
|
else if (it.sep)
|
|
11517
|
-
this.stack.push(
|
|
11546
|
+
this.stack.push(fs88);
|
|
11518
11547
|
else
|
|
11519
|
-
Object.assign(it, { key:
|
|
11548
|
+
Object.assign(it, { key: fs88, sep: [] });
|
|
11520
11549
|
return;
|
|
11521
11550
|
}
|
|
11522
11551
|
case "flow-map-end":
|
|
@@ -11960,8 +11989,8 @@ function metadataValue(value, key2) {
|
|
|
11960
11989
|
if (!value || typeof value !== "object") return void 0;
|
|
11961
11990
|
return Object.getOwnPropertyDescriptor(value, key2)?.value;
|
|
11962
11991
|
}
|
|
11963
|
-
function readProjectJson(
|
|
11964
|
-
const text6 = readProjectMetadata(
|
|
11992
|
+
function readProjectJson(path112, files2 = nodeRepoFileReader) {
|
|
11993
|
+
const text6 = readProjectMetadata(path112, files2);
|
|
11965
11994
|
if (text6 === null) return null;
|
|
11966
11995
|
try {
|
|
11967
11996
|
const value = JSON.parse(text6);
|
|
@@ -13279,8 +13308,8 @@ export *
|
|
|
13279
13308
|
}`;
|
|
13280
13309
|
}
|
|
13281
13310
|
function swiftPackageIdentity(url) {
|
|
13282
|
-
const
|
|
13283
|
-
return (
|
|
13311
|
+
const path112 = url.endsWith("/") ? url.slice(0, -1) : url;
|
|
13312
|
+
return (path112.split("/").pop() ?? path112).replace(/\.git$/, "").toLowerCase();
|
|
13284
13313
|
}
|
|
13285
13314
|
function clangSettingEntries(settings, tool) {
|
|
13286
13315
|
return (settings ?? []).flatMap(
|
|
@@ -13981,14 +14010,14 @@ function addAsset(into, asset) {
|
|
|
13981
14010
|
function checkStack(dir, type, devices2) {
|
|
13982
14011
|
const sets = (parent, allowed) => (0, import_node_fs28.readdirSync)(parent, { withFileTypes: true }).flatMap((entry) => {
|
|
13983
14012
|
if (entry.name.startsWith(".") || entry.isFile()) return [];
|
|
13984
|
-
const
|
|
14013
|
+
const path112 = (0, import_node_path25.join)(parent, entry.name);
|
|
13985
14014
|
const extension = (0, import_node_path25.extname)(entry.name);
|
|
13986
14015
|
if (!entry.isDirectory() || !allowed.includes(extension))
|
|
13987
14016
|
return refuse(
|
|
13988
|
-
|
|
14017
|
+
path112,
|
|
13989
14018
|
`image stack content other than ${allowed.join(", ")} is unproven`
|
|
13990
14019
|
);
|
|
13991
|
-
return [{ path:
|
|
14020
|
+
return [{ path: path112, extension }];
|
|
13992
14021
|
});
|
|
13993
14022
|
for (const layer of sets(dir, [`.${type}layer`, ".imageset", ".colorset"])) {
|
|
13994
14023
|
if (layer.extension !== `.${type}layer`) continue;
|
|
@@ -14000,37 +14029,37 @@ function checkStack(dir, type, devices2) {
|
|
|
14000
14029
|
function walk(dir, into, devices2, extensions) {
|
|
14001
14030
|
for (const entry of (0, import_node_fs28.readdirSync)(dir, { withFileTypes: true })) {
|
|
14002
14031
|
if (entry.name.startsWith(".") || entry.isFile()) continue;
|
|
14003
|
-
const
|
|
14004
|
-
if (!entry.isDirectory()) return refuse(
|
|
14032
|
+
const path112 = (0, import_node_path25.join)(dir, entry.name);
|
|
14033
|
+
if (!entry.isDirectory()) return refuse(path112, "it is neither a file nor a directory");
|
|
14005
14034
|
const extension = (0, import_node_path25.extname)(entry.name).slice(1);
|
|
14006
14035
|
const type = extension.toLowerCase();
|
|
14007
14036
|
const base = entry.name.slice(0, entry.name.length - extension.length - 1);
|
|
14008
14037
|
if (type !== extension && knownTypes.has(type))
|
|
14009
|
-
return refuse(
|
|
14038
|
+
return refuse(path112, "its type extension is not lowercase");
|
|
14010
14039
|
if (type === "colorset" || type === "imageset" || type === "symbolset") {
|
|
14011
14040
|
addAsset(into, {
|
|
14012
14041
|
kind: type === "colorset" ? "color" : "image",
|
|
14013
14042
|
name: base,
|
|
14014
|
-
...assetState(
|
|
14043
|
+
...assetState(path112, type, devices2),
|
|
14015
14044
|
extensions,
|
|
14016
|
-
source:
|
|
14045
|
+
source: path112
|
|
14017
14046
|
});
|
|
14018
14047
|
continue;
|
|
14019
14048
|
}
|
|
14020
14049
|
if (silentTypes.has(type)) continue;
|
|
14021
14050
|
if (stackTypes.has(type)) {
|
|
14022
|
-
checkStack(
|
|
14051
|
+
checkStack(path112, type, devices2);
|
|
14023
14052
|
continue;
|
|
14024
14053
|
}
|
|
14025
|
-
if (unprovenTypes.has(type)) return refuse(
|
|
14054
|
+
if (unprovenTypes.has(type)) return refuse(path112, `${type} assets are unproven`);
|
|
14026
14055
|
const name3 = type === "spriteatlas" ? base : entry.name;
|
|
14027
|
-
if (!folderProperties((0, import_node_path25.join)(
|
|
14028
|
-
walk(
|
|
14056
|
+
if (!folderProperties((0, import_node_path25.join)(path112, "Contents.json")).namespace) {
|
|
14057
|
+
walk(path112, into, devices2, extensions);
|
|
14029
14058
|
continue;
|
|
14030
14059
|
}
|
|
14031
|
-
const child = into.namespaces.get(name3) ?? scope(
|
|
14060
|
+
const child = into.namespaces.get(name3) ?? scope(path112);
|
|
14032
14061
|
into.namespaces.set(name3, child);
|
|
14033
|
-
walk(
|
|
14062
|
+
walk(path112, child, devices2, extensions);
|
|
14034
14063
|
}
|
|
14035
14064
|
}
|
|
14036
14065
|
function words(name3) {
|
|
@@ -14077,11 +14106,11 @@ function members(into, kind, prefix, extensions) {
|
|
|
14077
14106
|
const assets2 = /* @__PURE__ */ new Set();
|
|
14078
14107
|
const out = [];
|
|
14079
14108
|
for (const entry of entries) {
|
|
14080
|
-
const
|
|
14109
|
+
const path112 = `${prefix}${entry.name}`;
|
|
14081
14110
|
const source = entry.child ? entry.child.source : entry.asset.source;
|
|
14082
14111
|
if (Array.from(entry.name).some((char) => char.charCodeAt(0) > 127))
|
|
14083
14112
|
refuse(source, "its name is not ASCII");
|
|
14084
|
-
const named = (text7) => `The \\"${escape(
|
|
14113
|
+
const named = (text7) => `The \\"${escape(path112)}\\" ${text7}`;
|
|
14085
14114
|
if (entry.child) {
|
|
14086
14115
|
const text7 = symbol(entry.name, true);
|
|
14087
14116
|
if (!text7)
|
|
@@ -14104,9 +14133,9 @@ function members(into, kind, prefix, extensions) {
|
|
|
14104
14133
|
namespaces.add(text7);
|
|
14105
14134
|
out.push({
|
|
14106
14135
|
type: "namespace",
|
|
14107
|
-
path:
|
|
14136
|
+
path: path112,
|
|
14108
14137
|
symbol: spelled(text7),
|
|
14109
|
-
members: members(entry.child, kind, `${
|
|
14138
|
+
members: members(entry.child, kind, `${path112}/`, extensions)
|
|
14110
14139
|
});
|
|
14111
14140
|
}
|
|
14112
14141
|
continue;
|
|
@@ -14133,7 +14162,7 @@ function members(into, kind, prefix, extensions) {
|
|
|
14133
14162
|
else if (!omitted)
|
|
14134
14163
|
out.push({
|
|
14135
14164
|
type: "asset",
|
|
14136
|
-
path:
|
|
14165
|
+
path: path112,
|
|
14137
14166
|
name: entry.name,
|
|
14138
14167
|
symbol: spelled(text6),
|
|
14139
14168
|
thinnable: asset.thinnable,
|
|
@@ -14415,8 +14444,8 @@ var init_xcode_asset_symbols = __esm({
|
|
|
14415
14444
|
import_node_path25 = require("node:path");
|
|
14416
14445
|
Refusal = class extends Error {
|
|
14417
14446
|
};
|
|
14418
|
-
refuse = (
|
|
14419
|
-
throw new Refusal(`Generated asset symbols are unproven for ${
|
|
14447
|
+
refuse = (path112, reason) => {
|
|
14448
|
+
throw new Refusal(`Generated asset symbols are unproven for ${path112}: ${reason}`);
|
|
14420
14449
|
};
|
|
14421
14450
|
isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14422
14451
|
scope = (source) => ({
|
|
@@ -14862,11 +14891,11 @@ function catalogDigest(directory2) {
|
|
|
14862
14891
|
for (const entry of (0, import_node_fs29.readdirSync)(dir, { withFileTypes: true }).sort(
|
|
14863
14892
|
(a, b) => a.name.localeCompare(b.name)
|
|
14864
14893
|
)) {
|
|
14865
|
-
const
|
|
14866
|
-
if (entry.isDirectory()) walk3(
|
|
14867
|
-
else if (entry.isFile() && (0, import_node_fs29.statSync)(
|
|
14868
|
-
hashes.push([(0, import_node_path26.relative)(directory2,
|
|
14869
|
-
else throw new Error(`Unsupported asset catalog entry: ${
|
|
14894
|
+
const path112 = (0, import_node_path26.join)(dir, entry.name);
|
|
14895
|
+
if (entry.isDirectory()) walk3(path112);
|
|
14896
|
+
else if (entry.isFile() && (0, import_node_fs29.statSync)(path112).size <= 64 * 1024 * 1024)
|
|
14897
|
+
hashes.push([(0, import_node_path26.relative)(directory2, path112), sha2562((0, import_node_fs29.readFileSync)(path112))]);
|
|
14898
|
+
else throw new Error(`Unsupported asset catalog entry: ${path112}`);
|
|
14870
14899
|
}
|
|
14871
14900
|
};
|
|
14872
14901
|
walk3(directory2);
|
|
@@ -14877,7 +14906,7 @@ function symbolSource(plan, root) {
|
|
|
14877
14906
|
const known = symbolTexts.get(key2);
|
|
14878
14907
|
if (known !== void 0) return { status: "source", text: known };
|
|
14879
14908
|
const source = assetSymbolSource(
|
|
14880
|
-
plan.catalogs.map(({ path:
|
|
14909
|
+
plan.catalogs.map(({ path: path112 }) => (0, import_node_path26.join)(root, path112)),
|
|
14881
14910
|
plan.settings
|
|
14882
14911
|
);
|
|
14883
14912
|
if (source.status === "source") symbolTexts.set(key2, source.text);
|
|
@@ -14935,9 +14964,9 @@ function planAssetSymbols(resources, root, settings) {
|
|
|
14935
14964
|
`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}".`
|
|
14936
14965
|
);
|
|
14937
14966
|
const plan = {
|
|
14938
|
-
catalogs: catalogs.map((
|
|
14939
|
-
path:
|
|
14940
|
-
sha256: catalogDigest((0, import_node_path26.join)(root,
|
|
14967
|
+
catalogs: catalogs.map((path112) => ({
|
|
14968
|
+
path: path112,
|
|
14969
|
+
sha256: catalogDigest((0, import_node_path26.join)(root, path112))
|
|
14941
14970
|
})),
|
|
14942
14971
|
settings: { deployment: target, devices: devices2, extensions: extensions === "YES" }
|
|
14943
14972
|
};
|
|
@@ -17970,10 +17999,10 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
17970
17999
|
const enclosing = scopes.length > 0 ? scopes[scopes.length - 1].prefix : [];
|
|
17971
18000
|
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] !== "<") {
|
|
17972
18001
|
const name3 = scope2[4];
|
|
17973
|
-
const
|
|
17974
|
-
if (!byPath.has(
|
|
18002
|
+
const path112 = scopeOf(name3, enclosing, false);
|
|
18003
|
+
if (!byPath.has(path112.join(".")) && (path112.length === 1 || byPath.has(path112.slice(0, -1).join(".")))) {
|
|
17975
18004
|
const keptAttrs = [...(scope2[1] ?? "").matchAll(/@\w+(?:\([^)]*\))?/g)].map((attr) => attr[0]).filter((attr) => !attr.startsWith("@objc"));
|
|
17976
|
-
const id = `s:peach-synthesized-${module2}-${
|
|
18005
|
+
const id = `s:peach-synthesized-${module2}-${path112.join(".")}`;
|
|
17977
18006
|
const body = [];
|
|
17978
18007
|
let inner = 1;
|
|
17979
18008
|
let closed = false;
|
|
@@ -18028,15 +18057,15 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
18028
18057
|
symbols.push({
|
|
18029
18058
|
kind: { identifier: "swift.enum" },
|
|
18030
18059
|
identifier: { precise: id },
|
|
18031
|
-
pathComponents:
|
|
18060
|
+
pathComponents: path112,
|
|
18032
18061
|
declarationFragments: fragments,
|
|
18033
18062
|
accessLevel: "public"
|
|
18034
18063
|
});
|
|
18035
|
-
if (
|
|
18064
|
+
if (path112.length > 1)
|
|
18036
18065
|
relationships.push({
|
|
18037
18066
|
kind: "memberOf",
|
|
18038
18067
|
source: id,
|
|
18039
|
-
target: byPath.get(
|
|
18068
|
+
target: byPath.get(path112.slice(0, -1).join("."))
|
|
18040
18069
|
});
|
|
18041
18070
|
for (const kase of cases) {
|
|
18042
18071
|
const memberId = `${id}-${kase.leaf}`;
|
|
@@ -18045,7 +18074,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
18045
18074
|
symbols.push({
|
|
18046
18075
|
kind: { identifier: "swift.enum.case" },
|
|
18047
18076
|
identifier: { precise: memberId },
|
|
18048
|
-
pathComponents: [...
|
|
18077
|
+
pathComponents: [...path112, kase.leaf],
|
|
18049
18078
|
declarationFragments: [
|
|
18050
18079
|
{ kind: "keyword", spelling: "case" },
|
|
18051
18080
|
{ kind: "text", spelling: " " },
|
|
@@ -18061,7 +18090,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
18061
18090
|
symbols.push({
|
|
18062
18091
|
kind: { identifier: "swift.init" },
|
|
18063
18092
|
identifier: { precise: initId },
|
|
18064
|
-
pathComponents: [...
|
|
18093
|
+
pathComponents: [...path112, "init(rawValue:)"],
|
|
18065
18094
|
declarationFragments: [
|
|
18066
18095
|
{ kind: "keyword", spelling: "init" },
|
|
18067
18096
|
{ kind: "text", spelling: "?(" },
|
|
@@ -18130,7 +18159,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18130
18159
|
})
|
|
18131
18160
|
)
|
|
18132
18161
|
);
|
|
18133
|
-
const trap = (
|
|
18162
|
+
const trap = (path112) => `fatalError("${path112} is ${options.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
|
|
18134
18163
|
const skipped = [];
|
|
18135
18164
|
const behavior = options.behavior ?? /* @__PURE__ */ new Map();
|
|
18136
18165
|
const used = /* @__PURE__ */ new Set();
|
|
@@ -18480,34 +18509,34 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18480
18509
|
lines.push(...physical);
|
|
18481
18510
|
owners.push(...physical.map(() => current2));
|
|
18482
18511
|
};
|
|
18483
|
-
const emitAt = (
|
|
18484
|
-
if (omit.has(
|
|
18512
|
+
const emitAt = (path112, line) => {
|
|
18513
|
+
if (omit.has(path112)) return;
|
|
18485
18514
|
const previous = current2;
|
|
18486
|
-
current2 =
|
|
18515
|
+
current2 = path112;
|
|
18487
18516
|
emit(line);
|
|
18488
18517
|
current2 = previous;
|
|
18489
18518
|
};
|
|
18490
18519
|
const emitInertState = (id, indent2, build) => {
|
|
18491
|
-
const
|
|
18520
|
+
const path112 = pathOf(byId.get(id));
|
|
18492
18521
|
emitAt(hiddenInit(id), `${indent2}init(_peachInert: Void) { ${build} }`);
|
|
18493
18522
|
const list2 = conforms.get(id) ?? [];
|
|
18494
18523
|
const has = (name3) => (children.get(id) ?? []).some((member) => leaf(member) === name3);
|
|
18495
18524
|
if (list2.includes("Encodable") && !has("encode(to:)"))
|
|
18496
18525
|
emitAt(
|
|
18497
|
-
`${
|
|
18526
|
+
`${path112}.encode(to:)`,
|
|
18498
18527
|
`${indent2}public func encode(to encoder: Encoder) throws {}`
|
|
18499
18528
|
);
|
|
18500
18529
|
if (list2.includes("Decodable") && !has("init(from:)"))
|
|
18501
18530
|
emitAt(
|
|
18502
|
-
`${
|
|
18531
|
+
`${path112}.init(from:)`,
|
|
18503
18532
|
`${indent2}public init(from decoder: Decoder) throws { self.init(_peachInert: ()) }`
|
|
18504
18533
|
);
|
|
18505
18534
|
};
|
|
18506
18535
|
const scoped = (body) => (symbol2, ...rest) => {
|
|
18507
|
-
const
|
|
18508
|
-
if (omit.has(
|
|
18536
|
+
const path112 = pathOf(symbol2);
|
|
18537
|
+
if (omit.has(path112)) return void skipped.push({ path: path112, reason: omit.get(path112) });
|
|
18509
18538
|
const previous = current2;
|
|
18510
|
-
current2 =
|
|
18539
|
+
current2 = path112;
|
|
18511
18540
|
try {
|
|
18512
18541
|
body(symbol2, ...rest);
|
|
18513
18542
|
} finally {
|
|
@@ -18539,7 +18568,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18539
18568
|
};
|
|
18540
18569
|
const emitMember = scoped(
|
|
18541
18570
|
(member, indent2, context) => {
|
|
18542
|
-
const
|
|
18571
|
+
const path112 = pathOf(member);
|
|
18543
18572
|
if (TYPE_KINDS.has(member.kind.identifier)) {
|
|
18544
18573
|
const origin = origins.get(member.identifier.precise)?.split(".")[0];
|
|
18545
18574
|
const parent = owner.get(member.identifier.precise);
|
|
@@ -18556,7 +18585,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18556
18585
|
))
|
|
18557
18586
|
return;
|
|
18558
18587
|
if (!MEMBER_KINDS.has(member.kind.identifier)) {
|
|
18559
|
-
skipped.push({ path:
|
|
18588
|
+
skipped.push({ path: path112, reason: `unhandled ${member.kind.identifier}` });
|
|
18560
18589
|
return;
|
|
18561
18590
|
}
|
|
18562
18591
|
const { 1: spelledAttrs, 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
@@ -18564,15 +18593,15 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18564
18593
|
/@(\w+)(?:\([^)]*\))?\s*/g,
|
|
18565
18594
|
(attr, name3) => typeByPath.has(name3) ? "" : attr
|
|
18566
18595
|
) : spelledAttrs;
|
|
18567
|
-
const attrs = options.unobjc?.has(
|
|
18596
|
+
const attrs = options.unobjc?.has(path112) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : wrapped;
|
|
18568
18597
|
const modifiers = /^((?:(?:required|final|override|convenience|unowned(?:\(\w+\))?|weak|lazy|nonisolated|mutating|nonmutating) )*)(.*)$/s.exec(
|
|
18569
18598
|
rest
|
|
18570
18599
|
);
|
|
18571
18600
|
const flags = new Set(
|
|
18572
18601
|
modifiers[1].trim().split(/\s+/).filter(Boolean).map((flag) => flag.replace(/\(.*/, ""))
|
|
18573
18602
|
);
|
|
18574
|
-
const requiredInit = context.inClass && !!options.requiredInits?.has(
|
|
18575
|
-
const restatesRequired = context.inClass &&
|
|
18603
|
+
const requiredInit = context.inClass && !!options.requiredInits?.has(path112);
|
|
18604
|
+
const restatesRequired = context.inClass && path112.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
|
|
18576
18605
|
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
18577
18606
|
);
|
|
18578
18607
|
const protocolInit = member.kind.identifier === "swift.init" && /^c:objc\(pl\)\w+\(im\).*::SYNTHESIZED::c:objc\(cs\)/.test(
|
|
@@ -18582,12 +18611,12 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18582
18611
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
18583
18612
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
18584
18613
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
18585
|
-
const override = context.inClass && !options.plain?.has(
|
|
18614
|
+
const override = context.inClass && !options.plain?.has(path112) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path112) || isObjC(member) && path112.endsWith(".init()")) ? "override " : "";
|
|
18586
18615
|
const head = `${indent2}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
18587
|
-
const measured = behavior.get(
|
|
18588
|
-
if (measured) used.add(
|
|
18616
|
+
const measured = behavior.get(path112);
|
|
18617
|
+
if (measured) used.add(path112);
|
|
18589
18618
|
const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
|
|
18590
|
-
const body = overloadBody ?? measured?.body ?? (options.inert ? inertBody(member) : trap(
|
|
18619
|
+
const body = overloadBody ?? measured?.body ?? (options.inert ? inertBody(member) : trap(path112));
|
|
18591
18620
|
switch (member.kind.identifier) {
|
|
18592
18621
|
case "swift.property":
|
|
18593
18622
|
case "swift.type.property":
|
|
@@ -18600,13 +18629,13 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18600
18629
|
const parameter = !measured && !options.inert && !settable && /:\s*some\s/.test(decl) ? opaqueParameter(member) : void 0;
|
|
18601
18630
|
const getter = parameter ? `return ({ () -> ${parameter} in ${body} })()` : body;
|
|
18602
18631
|
const computed = decl.replace(/^((?:static |class )*)let /, "$1var ");
|
|
18603
|
-
const wrapper = options.projections?.get(
|
|
18632
|
+
const wrapper = options.projections?.get(path112);
|
|
18604
18633
|
if (wrapper) {
|
|
18605
18634
|
const type = /^var\s+`?\w+`?\s*:\s*(.+)$/s.exec(computed)?.[1];
|
|
18606
|
-
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [
|
|
18635
|
+
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path112]);
|
|
18607
18636
|
if (!initial)
|
|
18608
18637
|
return void skipped.push({
|
|
18609
|
-
path:
|
|
18638
|
+
path: path112,
|
|
18610
18639
|
reason: `wrapped by ${wrapper} with no inert initial value`
|
|
18611
18640
|
});
|
|
18612
18641
|
const own = new RegExp(
|
|
@@ -18627,7 +18656,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18627
18656
|
return;
|
|
18628
18657
|
}
|
|
18629
18658
|
emit(
|
|
18630
|
-
`${head}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options.inert ? "" : trap(
|
|
18659
|
+
`${head}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options.inert ? "" : trap(path112))} }` : ""} }`
|
|
18631
18660
|
);
|
|
18632
18661
|
return;
|
|
18633
18662
|
}
|
|
@@ -18686,7 +18715,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18686
18715
|
};
|
|
18687
18716
|
const emitType = scoped(
|
|
18688
18717
|
(symbol2, indent2) => {
|
|
18689
|
-
const
|
|
18718
|
+
const path112 = pathOf(symbol2);
|
|
18690
18719
|
const id = symbol2.identifier.precise;
|
|
18691
18720
|
const inner = `${indent2} `;
|
|
18692
18721
|
switch (symbol2.kind.identifier) {
|
|
@@ -18703,10 +18732,10 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18703
18732
|
case "swift.class": {
|
|
18704
18733
|
const shape = header(symbol2, "class", indent2);
|
|
18705
18734
|
if (!shape)
|
|
18706
|
-
return void skipped.push({ path:
|
|
18707
|
-
const parent = options.superclasses?.get(
|
|
18735
|
+
return void skipped.push({ path: path112, reason: `unparsed class ${text(symbol2)}` });
|
|
18736
|
+
const parent = options.superclasses?.get(path112) ?? superclass.get(id);
|
|
18708
18737
|
const blocked = classBlocked(id);
|
|
18709
|
-
if (blocked) return void skipped.push({ path:
|
|
18738
|
+
if (blocked) return void skipped.push({ path: path112, reason: blocked });
|
|
18710
18739
|
const ancestors = /* @__PURE__ */ new Set();
|
|
18711
18740
|
const inherited = /* @__PURE__ */ new Set();
|
|
18712
18741
|
for (let at = superId.get(id); at; at = superId.get(at)) {
|
|
@@ -18722,7 +18751,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18722
18751
|
"Equatable",
|
|
18723
18752
|
"CustomStringConvertible",
|
|
18724
18753
|
"CustomDebugStringConvertible"
|
|
18725
|
-
].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(
|
|
18754
|
+
].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(path112)?.has(name3)
|
|
18726
18755
|
)
|
|
18727
18756
|
].filter((name3, at, all2) => all2.indexOf(name3) === at);
|
|
18728
18757
|
const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
|
|
@@ -18734,9 +18763,9 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18734
18763
|
`${indent2}${shape.attrs}${objcName ? `@objc(${objcName}) ` : ""}${shape.final}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
|
|
18735
18764
|
);
|
|
18736
18765
|
const members2 = membersOf(id);
|
|
18737
|
-
const extra = options.behavior?.get(
|
|
18766
|
+
const extra = options.behavior?.get(path112)?.members;
|
|
18738
18767
|
if (extra) {
|
|
18739
|
-
used.add(
|
|
18768
|
+
used.add(path112);
|
|
18740
18769
|
emit(`${inner}${extra}`);
|
|
18741
18770
|
}
|
|
18742
18771
|
for (const member of members2)
|
|
@@ -18792,11 +18821,11 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18792
18821
|
if (protocol && member.kind.identifier === "swift.method" && leaf(member).endsWith("()") && have.has(`instance|leaf|${leaf(member).slice(0, -2)}`))
|
|
18793
18822
|
propertyWitnesses.push({
|
|
18794
18823
|
owner: current2,
|
|
18795
|
-
head: `extension ${pathOf(protocol)} where Self: ${
|
|
18824
|
+
head: `extension ${pathOf(protocol)} where Self: ${path112} {`,
|
|
18796
18825
|
member,
|
|
18797
|
-
path:
|
|
18826
|
+
path: path112
|
|
18798
18827
|
});
|
|
18799
|
-
else emitWitness(member, inner,
|
|
18828
|
+
else emitWitness(member, inner, path112, open && isObjC(member));
|
|
18800
18829
|
}
|
|
18801
18830
|
}
|
|
18802
18831
|
if (options.inert && designated2 && classBuild(id) === "hidden")
|
|
@@ -18804,13 +18833,13 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18804
18833
|
const coder = members2.some((member) => leaf(member) === "init(coder:)");
|
|
18805
18834
|
if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
18806
18835
|
emit(
|
|
18807
|
-
`${inner}public required init${options.coderNonfailable?.has(
|
|
18836
|
+
`${inner}public required init${options.coderNonfailable?.has(path112) ? "" : "?"}(coder: NSCoder) { ${options.inert && !options.coderNonfailable?.has(path112) ? "return nil" : trap(`${path112}.init(coder:)`)} }`
|
|
18808
18837
|
);
|
|
18809
18838
|
if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
|
|
18810
18839
|
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
18811
18840
|
))
|
|
18812
18841
|
emit(
|
|
18813
|
-
`${inner}public required init() { ${options.inert ? superInit(id) : trap(`${
|
|
18842
|
+
`${inner}public required init() { ${options.inert ? superInit(id) : trap(`${path112}.init()`)} }`
|
|
18814
18843
|
);
|
|
18815
18844
|
emit(`${indent2}}`);
|
|
18816
18845
|
return;
|
|
@@ -18818,7 +18847,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18818
18847
|
case "swift.struct": {
|
|
18819
18848
|
const shape = header(symbol2, "struct", indent2);
|
|
18820
18849
|
if (!shape)
|
|
18821
|
-
return void skipped.push({ path:
|
|
18850
|
+
return void skipped.push({ path: path112, reason: `unparsed struct ${text(symbol2)}` });
|
|
18822
18851
|
const members2 = membersOf(id);
|
|
18823
18852
|
const raw2 = rawType(members2);
|
|
18824
18853
|
const list2 = inheritance(id);
|
|
@@ -18859,7 +18888,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18859
18888
|
emitInertState(
|
|
18860
18889
|
id,
|
|
18861
18890
|
inner,
|
|
18862
|
-
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [
|
|
18891
|
+
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path112]) ?? "0"}` : ""
|
|
18863
18892
|
);
|
|
18864
18893
|
emit(`${indent2}}`);
|
|
18865
18894
|
return;
|
|
@@ -18867,7 +18896,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18867
18896
|
case "swift.enum": {
|
|
18868
18897
|
const shape = header(symbol2, "enum", indent2);
|
|
18869
18898
|
if (!shape)
|
|
18870
|
-
return void skipped.push({ path:
|
|
18899
|
+
return void skipped.push({ path: path112, reason: `unparsed enum ${text(symbol2)}` });
|
|
18871
18900
|
const members2 = membersOf(id);
|
|
18872
18901
|
const cases = members2.filter(
|
|
18873
18902
|
(member) => member.kind.identifier === "swift.enum.case"
|
|
@@ -18877,7 +18906,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18877
18906
|
const missing2 = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
|
|
18878
18907
|
if (raw2 && (isObjC(symbol2) || /^c:@C?M@[^@]+@E@/.test(id)) && missing2.length > 0)
|
|
18879
18908
|
return void skipped.push({
|
|
18880
|
-
path:
|
|
18909
|
+
path: path112,
|
|
18881
18910
|
reason: `no header value for ${missing2.map(leaf).join(", ")}`
|
|
18882
18911
|
});
|
|
18883
18912
|
const list2 = inheritance(id, raw2 ?? void 0).filter(
|
|
@@ -18917,8 +18946,8 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18917
18946
|
});
|
|
18918
18947
|
}
|
|
18919
18948
|
if (options.inert) {
|
|
18920
|
-
const value = options.trapped?.has(hiddenInit(id)) ? null : inertValue(
|
|
18921
|
-
emitInertState(id, inner, value === null ? trap(
|
|
18949
|
+
const value = options.trapped?.has(hiddenInit(id)) ? null : inertValue(path112, /* @__PURE__ */ new Set(), []);
|
|
18950
|
+
emitInertState(id, inner, value === null ? trap(path112) : `self = ${value}`);
|
|
18922
18951
|
}
|
|
18923
18952
|
emit(`${indent2}}`);
|
|
18924
18953
|
return;
|
|
@@ -18927,14 +18956,14 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18927
18956
|
const shape = header(symbol2, "protocol", indent2);
|
|
18928
18957
|
if (!shape)
|
|
18929
18958
|
return void skipped.push({
|
|
18930
|
-
path:
|
|
18959
|
+
path: path112,
|
|
18931
18960
|
reason: `unparsed protocol ${text(symbol2)}`
|
|
18932
18961
|
});
|
|
18933
18962
|
const native = nativeObjcProtocols.has(id);
|
|
18934
18963
|
const objcName = native ? /^c:objc\(pl\)(\w+)$/.exec(id)?.[1] : void 0;
|
|
18935
18964
|
if (native && !objcName)
|
|
18936
18965
|
return void skipped.push({
|
|
18937
|
-
path:
|
|
18966
|
+
path: path112,
|
|
18938
18967
|
reason: `unknown Objective-C protocol identity ${id}`
|
|
18939
18968
|
});
|
|
18940
18969
|
const list2 = [
|
|
@@ -18962,7 +18991,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
18962
18991
|
}
|
|
18963
18992
|
emit(`${indent2}}`);
|
|
18964
18993
|
if (defaults.length > 0) {
|
|
18965
|
-
emit(`${indent2}extension ${
|
|
18994
|
+
emit(`${indent2}extension ${path112} {`);
|
|
18966
18995
|
for (const member of defaults) {
|
|
18967
18996
|
const decl = text(member);
|
|
18968
18997
|
if (optional3.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
|
|
@@ -19057,7 +19086,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
19057
19086
|
};
|
|
19058
19087
|
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;
|
|
19059
19088
|
const emitGlobal = scoped((symbol2) => {
|
|
19060
|
-
const
|
|
19089
|
+
const path112 = pathOf(symbol2);
|
|
19061
19090
|
const kind = symbol2.kind.identifier;
|
|
19062
19091
|
if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
|
|
19063
19092
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol2));
|
|
@@ -19066,20 +19095,20 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
19066
19095
|
if (leaf(symbol2).endsWith("(_:)") && !/^(?:prefix|infix|postfix)\b/.test(spelled2))
|
|
19067
19096
|
spelled2 = `prefix ${spelled2}`;
|
|
19068
19097
|
}
|
|
19069
|
-
const measured = behavior.get(
|
|
19070
|
-
if (measured) used.add(
|
|
19098
|
+
const measured = behavior.get(path112);
|
|
19099
|
+
if (measured) used.add(path112);
|
|
19071
19100
|
const overloadBody = /\basync\b/.test(spelled2) ? measured?.asyncBody : /\bResult</.test(spelled2) ? measured?.resultBody : void 0;
|
|
19072
19101
|
emit(
|
|
19073
|
-
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options.inert ? inertBody(symbol2) : trap(
|
|
19102
|
+
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path112))} }`
|
|
19074
19103
|
);
|
|
19075
19104
|
} else if (kind === "swift.var") {
|
|
19076
19105
|
const parsed = splitAccessors(text(symbol2).replace(/^let /, "var "));
|
|
19077
|
-
const measured = behavior.get(
|
|
19078
|
-
if (measured) used.add(
|
|
19106
|
+
const measured = behavior.get(path112);
|
|
19107
|
+
if (measured) used.add(path112);
|
|
19079
19108
|
emit(
|
|
19080
|
-
`public ${parsed.decl} { ${measured?.body ?? (options.inert ? inertBody(symbol2) : trap(
|
|
19109
|
+
`public ${parsed.decl} { ${measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path112))} }`
|
|
19081
19110
|
);
|
|
19082
|
-
} else skipped.push({ path:
|
|
19111
|
+
} else skipped.push({ path: path112, reason: `unhandled top-level ${kind}` });
|
|
19083
19112
|
});
|
|
19084
19113
|
const cExports = new Set(
|
|
19085
19114
|
[...byId.values()].flatMap((symbol2) => {
|
|
@@ -19096,7 +19125,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
19096
19125
|
return !name3 || !cExports.has(`${name3}|${text(symbol2)}`);
|
|
19097
19126
|
}).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
|
|
19098
19127
|
for (const symbol2 of roots) {
|
|
19099
|
-
const
|
|
19128
|
+
const path112 = pathOf(symbol2);
|
|
19100
19129
|
if (TYPE_KINDS.has(symbol2.kind.identifier)) emitType(symbol2, "");
|
|
19101
19130
|
else emitGlobal(symbol2);
|
|
19102
19131
|
}
|
|
@@ -19157,9 +19186,9 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
19157
19186
|
"#endif",
|
|
19158
19187
|
""
|
|
19159
19188
|
];
|
|
19160
|
-
for (const
|
|
19161
|
-
if (!used.has(
|
|
19162
|
-
skipped.push({ path:
|
|
19189
|
+
for (const path112 of behavior.keys())
|
|
19190
|
+
if (!used.has(path112))
|
|
19191
|
+
skipped.push({ path: path112, reason: "behavior names no emitted declaration" });
|
|
19163
19192
|
return {
|
|
19164
19193
|
source: `${[...banner, ...lines].join("\n")}
|
|
19165
19194
|
`,
|
|
@@ -21362,9 +21391,9 @@ function originalColumn(line, column) {
|
|
|
21362
21391
|
}
|
|
21363
21392
|
function designTimeDiagnostic(output2, files2) {
|
|
21364
21393
|
const rewritten = /* @__PURE__ */ new Map();
|
|
21365
|
-
const linesOf = (
|
|
21394
|
+
const linesOf = (path112) => {
|
|
21366
21395
|
const file = Object.keys(files2).find(
|
|
21367
|
-
(name3) => name3.endsWith(".swift") && (
|
|
21396
|
+
(name3) => name3.endsWith(".swift") && (path112 === name3 || path112.endsWith(`/${name3}`))
|
|
21368
21397
|
);
|
|
21369
21398
|
if (file === void 0) return null;
|
|
21370
21399
|
let lines = rewritten.get(file);
|
|
@@ -33014,7 +33043,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
33014
33043
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
33015
33044
|
MULTI_MANIFEST_VERSION = 68;
|
|
33016
33045
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
33017
|
-
compilerSourceDigest = true ? "
|
|
33046
|
+
compilerSourceDigest = true ? "94960e7e108c556e2184ef22baae1e061ca63c08c954c6ad0f677b524be5e117" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
33018
33047
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
33019
33048
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
33020
33049
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -34510,8 +34539,10 @@ function swiftPackageManifest(dir, platform2 = GUEST_PLATFORMS, requirePrepared
|
|
|
34510
34539
|
name: name4,
|
|
34511
34540
|
type: kind,
|
|
34512
34541
|
dir: targetDir,
|
|
34513
|
-
|
|
34514
|
-
|
|
34542
|
+
// swiftpm resolves these as normalized relative paths, so a directory
|
|
34543
|
+
// written with a trailing slash selects its contents
|
|
34544
|
+
sources: target.sources == null ? null : array3(target.sources).flatMap((file) => targetRelative(string4(file))),
|
|
34545
|
+
exclude: array3(target.exclude).flatMap((file) => targetRelative(string4(file))),
|
|
34515
34546
|
dependencies,
|
|
34516
34547
|
languageMode,
|
|
34517
34548
|
mainActorIsolation,
|
|
@@ -34678,7 +34709,7 @@ function swiftTargetFiles(manifest, target) {
|
|
|
34678
34709
|
}
|
|
34679
34710
|
return [...new Set(files2)].sort();
|
|
34680
34711
|
}
|
|
34681
|
-
var import_node_child_process29, import_node_crypto25, import_node_fs56, import_node_os13, import_node_path54, import_node_util8, TARGET_TYPES, isTargetType, record, array3, string4, cacheDir3, evaluated, execFileAsync, cachedToolchain, SwiftManifestPreparationRequired, manifestPreparations, GUEST_PLATFORMS, within, requirementClause;
|
|
34712
|
+
var import_node_child_process29, import_node_crypto25, import_node_fs56, import_node_os13, import_node_path54, import_node_util8, TARGET_TYPES, targetRelative, isTargetType, record, array3, string4, cacheDir3, evaluated, execFileAsync, cachedToolchain, SwiftManifestPreparationRequired, manifestPreparations, GUEST_PLATFORMS, within, requirementClause;
|
|
34682
34713
|
var init_swift_package_manifest = __esm({
|
|
34683
34714
|
"src/swift-package-manifest.ts"() {
|
|
34684
34715
|
"use strict";
|
|
@@ -34703,6 +34734,7 @@ var init_swift_package_manifest = __esm({
|
|
|
34703
34734
|
"macro",
|
|
34704
34735
|
"plugin"
|
|
34705
34736
|
];
|
|
34737
|
+
targetRelative = (file) => file === void 0 ? [] : [import_node_path54.default.posix.normalize(file).replace(/(?<=.)\/+$/, "")];
|
|
34706
34738
|
isTargetType = (value) => TARGET_TYPES.some((type) => type === value);
|
|
34707
34739
|
record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
34708
34740
|
array3 = (value) => Array.isArray(value) ? value : [];
|
|
@@ -37475,7 +37507,7 @@ var init_swift_standin_digest = __esm({
|
|
|
37475
37507
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
37476
37508
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
37477
37509
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
37478
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
37510
|
+
STANDIN_SOURCE_DIGEST = true ? "11f82a07cd8d59c1bfcf554927b6e5a2d9b01d6846fd7107ca7c0f6f30519538" : standinSourceDigest();
|
|
37479
37511
|
}
|
|
37480
37512
|
});
|
|
37481
37513
|
|
|
@@ -37747,9 +37779,9 @@ async function packageTreeDigest(root) {
|
|
|
37747
37779
|
(a, b) => a.name.localeCompare(b.name)
|
|
37748
37780
|
)) {
|
|
37749
37781
|
if (entry.name === "node_modules") continue;
|
|
37750
|
-
const
|
|
37751
|
-
if (entry.isDirectory()) walk3((0, import_node_path66.join)(directory2, entry.name), `${
|
|
37752
|
-
else if (entry.isFile()) files2.push(
|
|
37782
|
+
const path112 = `${relative4}${entry.name}`;
|
|
37783
|
+
if (entry.isDirectory()) walk3((0, import_node_path66.join)(directory2, entry.name), `${path112}/`);
|
|
37784
|
+
else if (entry.isFile()) files2.push(path112);
|
|
37753
37785
|
}
|
|
37754
37786
|
};
|
|
37755
37787
|
walk3(root, "");
|
|
@@ -38817,7 +38849,7 @@ function resolveSwiftPackages(options) {
|
|
|
38817
38849
|
headers.set(name3, import_node_path71.default.relative(binary2.dir, dir));
|
|
38818
38850
|
};
|
|
38819
38851
|
visit3(pkg, binary2.target);
|
|
38820
|
-
binary2.headerDependencies = [...headers].map(([module2,
|
|
38852
|
+
binary2.headerDependencies = [...headers].map(([module2, path112]) => ({ module: module2, path: path112 }));
|
|
38821
38853
|
}
|
|
38822
38854
|
for (const owner of options.owners ?? []) {
|
|
38823
38855
|
const found = productClosure(owner.products);
|
|
@@ -39551,8 +39583,8 @@ function withBuiltinStandinBehavior(behavior) {
|
|
|
39551
39583
|
for (const [module2, members2] of Object.entries(BUILTIN_STANDIN_BEHAVIOR))
|
|
39552
39584
|
merged[module2] = {
|
|
39553
39585
|
...Object.fromEntries(
|
|
39554
|
-
Object.entries(members2).map(([
|
|
39555
|
-
|
|
39586
|
+
Object.entries(members2).map(([path112, entry]) => [
|
|
39587
|
+
path112,
|
|
39556
39588
|
{ ...entry, builtin: true }
|
|
39557
39589
|
])
|
|
39558
39590
|
),
|
|
@@ -40774,10 +40806,12 @@ function objcStandin(surface, binary2, toolchain, work, behavior, frameworks, si
|
|
|
40774
40806
|
null,
|
|
40775
40807
|
/* @__PURE__ */ new Map(),
|
|
40776
40808
|
/* @__PURE__ */ new Map(),
|
|
40777
|
-
dependencyGraphs
|
|
40809
|
+
dependencyGraphs,
|
|
40810
|
+
"",
|
|
40811
|
+
view.imports.filter((name3) => provided.has(name3) || siblings.has(name3))
|
|
40778
40812
|
);
|
|
40779
40813
|
}
|
|
40780
|
-
function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, requiredInits2, declared, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = [], trailer = "") {
|
|
40814
|
+
function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, requiredInits2, declared, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = [], trailer = "", reexported = []) {
|
|
40781
40815
|
const paths = new Set(
|
|
40782
40816
|
graphs.flatMap(
|
|
40783
40817
|
(graph) => graph.symbols.map((symbol2) => symbol2.pathComponents.join("."))
|
|
@@ -40851,7 +40885,11 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
40851
40885
|
inheritedConformances,
|
|
40852
40886
|
projections,
|
|
40853
40887
|
dependencyGraphs,
|
|
40854
|
-
|
|
40888
|
+
exported: [
|
|
40889
|
+
...placeholder?.exported ?? [],
|
|
40890
|
+
...reexported.map((name3) => `@_exported import ${name3}`)
|
|
40891
|
+
],
|
|
40892
|
+
...placeholder ? { placeholder: binary2.placeholder.gap } : {}
|
|
40855
40893
|
});
|
|
40856
40894
|
for (const entry of skipped) {
|
|
40857
40895
|
if (swiftPaths.has(entry.path))
|
|
@@ -43642,8 +43680,8 @@ function imagesetFiles(images) {
|
|
|
43642
43680
|
];
|
|
43643
43681
|
}).sort((a, b) => a.scale - b.scale);
|
|
43644
43682
|
}
|
|
43645
|
-
function flatScale(
|
|
43646
|
-
const match = /@([23])x\.[^./]+$/.exec(
|
|
43683
|
+
function flatScale(path112) {
|
|
43684
|
+
const match = /@([23])x\.[^./]+$/.exec(path112);
|
|
43647
43685
|
return match ? Number(match[1]) : 1;
|
|
43648
43686
|
}
|
|
43649
43687
|
function providesNamespace(text6) {
|
|
@@ -43670,8 +43708,8 @@ function catalogEntryName(contentsPath, kind, readText) {
|
|
|
43670
43708
|
}
|
|
43671
43709
|
return segments.join("/");
|
|
43672
43710
|
}
|
|
43673
|
-
function isFlatResourceImage(
|
|
43674
|
-
return
|
|
43711
|
+
function isFlatResourceImage(path112) {
|
|
43712
|
+
return path112.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path112));
|
|
43675
43713
|
}
|
|
43676
43714
|
function enumerateBundleImages(paths, readText, bundleForFile = () => ".") {
|
|
43677
43715
|
const table = [];
|
|
@@ -43684,7 +43722,7 @@ function enumerateBundleImages(paths, readText, bundleForFile = () => ".") {
|
|
|
43684
43722
|
seen.set(bundlePath, names);
|
|
43685
43723
|
return { bundlePath, names };
|
|
43686
43724
|
};
|
|
43687
|
-
const catalogs = paths.filter((
|
|
43725
|
+
const catalogs = paths.filter((path112) => baseOf(path112) === "Contents.json");
|
|
43688
43726
|
for (const contentsPath of catalogs) {
|
|
43689
43727
|
const name3 = catalogEntryName(contentsPath, ".imageset", readText);
|
|
43690
43728
|
if (name3 === null) continue;
|
|
@@ -43716,13 +43754,13 @@ function enumerateBundleImages(paths, readText, bundleForFile = () => ".") {
|
|
|
43716
43754
|
...intent === "template" || intent === "original" ? { renderingMode: intent } : {}
|
|
43717
43755
|
});
|
|
43718
43756
|
}
|
|
43719
|
-
for (const
|
|
43720
|
-
if (!isFlatResourceImage(
|
|
43721
|
-
const name3 = baseOf(
|
|
43722
|
-
const { bundlePath, names } = namesFor(
|
|
43757
|
+
for (const path112 of paths) {
|
|
43758
|
+
if (!isFlatResourceImage(path112)) continue;
|
|
43759
|
+
const name3 = baseOf(path112).slice(0, -extOf(path112).length);
|
|
43760
|
+
const { bundlePath, names } = namesFor(path112);
|
|
43723
43761
|
if (name3 === "" || names.has(name3)) continue;
|
|
43724
43762
|
names.add(name3);
|
|
43725
|
-
table.push({ name: name3, file:
|
|
43763
|
+
table.push({ name: name3, file: path112, scale: flatScale(path112), bundlePath });
|
|
43726
43764
|
}
|
|
43727
43765
|
return table;
|
|
43728
43766
|
}
|
|
@@ -43757,7 +43795,7 @@ function colorsetValue(color) {
|
|
|
43757
43795
|
}
|
|
43758
43796
|
function enumerateBundleColors(paths, readText) {
|
|
43759
43797
|
const table = {};
|
|
43760
|
-
for (const contentsPath of paths.filter((
|
|
43798
|
+
for (const contentsPath of paths.filter((path112) => baseOf(path112) === "Contents.json")) {
|
|
43761
43799
|
const name3 = catalogEntryName(contentsPath, ".colorset", readText);
|
|
43762
43800
|
if (name3 === null || name3 in table) continue;
|
|
43763
43801
|
let colors;
|
|
@@ -43821,8 +43859,8 @@ function axisExtremes(points) {
|
|
|
43821
43859
|
function pathBounds(d) {
|
|
43822
43860
|
const xs = [];
|
|
43823
43861
|
const ys = [];
|
|
43824
|
-
for (const
|
|
43825
|
-
(0, import_svgpath.default)(
|
|
43862
|
+
for (const path112 of d)
|
|
43863
|
+
(0, import_svgpath.default)(path112).abs().unshort().unarc().iterate((segment, _index, x, y) => {
|
|
43826
43864
|
const [command, ...args] = segment;
|
|
43827
43865
|
if (command === "M" || command === "L") {
|
|
43828
43866
|
xs.push(Number(args[0]));
|
|
@@ -43849,7 +43887,7 @@ function guide(svg, id, axis) {
|
|
|
43849
43887
|
}
|
|
43850
43888
|
function enumerateBundleSymbols(paths, readText, bundleForFile) {
|
|
43851
43889
|
const table = {};
|
|
43852
|
-
for (const contentsPath of paths.filter((
|
|
43890
|
+
for (const contentsPath of paths.filter((path112) => baseOf(path112) === "Contents.json")) {
|
|
43853
43891
|
const name3 = catalogEntryName(contentsPath, ".symbolset", readText);
|
|
43854
43892
|
if (name3 === null) continue;
|
|
43855
43893
|
const bundle = bundleForFile(contentsPath);
|
|
@@ -43908,8 +43946,8 @@ function enumerateBundleSymbols(paths, readText, bundleForFile) {
|
|
|
43908
43946
|
advance,
|
|
43909
43947
|
box: [12 - wide / 2, 12 - tall / 2, wide, tall],
|
|
43910
43948
|
...customLayout ? { customLayout } : {},
|
|
43911
|
-
layers: d.map((
|
|
43912
|
-
d: (0, import_svgpath.default)(
|
|
43949
|
+
layers: d.map((path112) => ({
|
|
43950
|
+
d: (0, import_svgpath.default)(path112).abs().scale(em).translate(translateX, translateY).round(3).toString()
|
|
43913
43951
|
}))
|
|
43914
43952
|
};
|
|
43915
43953
|
table[vectorKey] = vector;
|
|
@@ -43920,18 +43958,18 @@ function enumerateBundleSymbols(paths, readText, bundleForFile) {
|
|
|
43920
43958
|
}
|
|
43921
43959
|
return table;
|
|
43922
43960
|
}
|
|
43923
|
-
function isCopiedResource(
|
|
43924
|
-
if (copiedBundle ||
|
|
43961
|
+
function isCopiedResource(path112, copiedBundle) {
|
|
43962
|
+
if (copiedBundle || path112.split("/").some((segment) => /\.(atlasc|bundle|storyboardc|nib)$/.test(segment)))
|
|
43925
43963
|
return true;
|
|
43926
|
-
const ext = extOf(
|
|
43964
|
+
const ext = extOf(path112);
|
|
43927
43965
|
if (ext === ".json" || ext === ".xcstrings") return true;
|
|
43928
|
-
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !
|
|
43966
|
+
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !path112.split("/").some((segment) => segment.endsWith(".xcassets"));
|
|
43929
43967
|
}
|
|
43930
43968
|
function enumerateBundleResources(paths, copiedBundle = false) {
|
|
43931
43969
|
const found = [];
|
|
43932
43970
|
const seen = /* @__PURE__ */ new Set();
|
|
43933
43971
|
const ordered = [...paths].filter(
|
|
43934
|
-
(
|
|
43972
|
+
(path112) => path112.split("/").includes("Resources") && path112.split("/").every((segment) => segment !== "" && segment !== "..") && isCopiedResource(path112, copiedBundle)
|
|
43935
43973
|
).sort((a, b) => {
|
|
43936
43974
|
const aDepth = a.split("/").length;
|
|
43937
43975
|
const bDepth = b.split("/").length;
|
|
@@ -44077,31 +44115,31 @@ function tokens(text6) {
|
|
|
44077
44115
|
}
|
|
44078
44116
|
return result;
|
|
44079
44117
|
}
|
|
44080
|
-
function qualified(language, key2,
|
|
44081
|
-
return `(${language}: ${key2}${
|
|
44118
|
+
function qualified(language, key2, path112) {
|
|
44119
|
+
return `(${language}: ${key2}${path112 === "" ? "" : "|==|" + path112})`;
|
|
44082
44120
|
}
|
|
44083
|
-
function requiresNumber(language, key2,
|
|
44121
|
+
function requiresNumber(language, key2, path112) {
|
|
44084
44122
|
return Error(
|
|
44085
|
-
"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,
|
|
44123
|
+
"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, path112)
|
|
44086
44124
|
);
|
|
44087
44125
|
}
|
|
44088
|
-
function moreThanOne(language, key2,
|
|
44126
|
+
function moreThanOne(language, key2, path112) {
|
|
44089
44127
|
return Error(
|
|
44090
|
-
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2,
|
|
44128
|
+
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path112)
|
|
44091
44129
|
);
|
|
44092
44130
|
}
|
|
44093
44131
|
function schemaPath(segments) {
|
|
44094
44132
|
return segments.map((segment) => `'${segment}'`).join(" -> ");
|
|
44095
44133
|
}
|
|
44096
|
-
function checkUnitShape(node,
|
|
44134
|
+
function checkUnitShape(node, path112) {
|
|
44097
44135
|
const raw2 = node.stringUnit;
|
|
44098
44136
|
if (raw2 === void 0)
|
|
44099
|
-
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(
|
|
44137
|
+
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path112)}`);
|
|
44100
44138
|
if (raw2 === null)
|
|
44101
|
-
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(
|
|
44139
|
+
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path112)}`);
|
|
44102
44140
|
if (!isRecord3(raw2))
|
|
44103
|
-
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(
|
|
44104
|
-
const unitPath = [...
|
|
44141
|
+
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path112)}`);
|
|
44142
|
+
const unitPath = [...path112, "stringUnit"];
|
|
44105
44143
|
if (!Object.hasOwn(raw2, "state"))
|
|
44106
44144
|
throw Error(`Missing required key 'state' inside ${schemaPath(unitPath)}`);
|
|
44107
44145
|
const state = raw2.state;
|
|
@@ -44118,38 +44156,38 @@ function checkUnitShape(node, path111) {
|
|
|
44118
44156
|
throw Error(`Expected string for key 'value' inside ${schemaPath(unitPath)}`);
|
|
44119
44157
|
return value;
|
|
44120
44158
|
}
|
|
44121
|
-
function checkPluralShape(node,
|
|
44159
|
+
function checkPluralShape(node, path112) {
|
|
44122
44160
|
for (const [category, raw2] of Object.entries(node)) {
|
|
44123
|
-
const categoryPath = [...
|
|
44161
|
+
const categoryPath = [...path112, category];
|
|
44124
44162
|
if (raw2 === null)
|
|
44125
44163
|
throw Error(
|
|
44126
|
-
`Missing required value for key '${category}' inside ${schemaPath(
|
|
44164
|
+
`Missing required value for key '${category}' inside ${schemaPath(path112)}`
|
|
44127
44165
|
);
|
|
44128
44166
|
if (!isRecord3(raw2))
|
|
44129
|
-
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(
|
|
44167
|
+
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path112)}`);
|
|
44130
44168
|
checkUnitShape(raw2, categoryPath);
|
|
44131
44169
|
}
|
|
44132
44170
|
}
|
|
44133
|
-
function checkLocalizationShape(node,
|
|
44171
|
+
function checkLocalizationShape(node, path112, deviceValue = false) {
|
|
44134
44172
|
if (node === null)
|
|
44135
44173
|
throw Error(
|
|
44136
|
-
`Missing required value for key '${
|
|
44174
|
+
`Missing required value for key '${path112[path112.length - 1]}' inside ${schemaPath(path112.slice(0, -1))}`
|
|
44137
44175
|
);
|
|
44138
44176
|
if (!isRecord3(node))
|
|
44139
44177
|
throw Error(
|
|
44140
|
-
`Expected dictionary for key '${
|
|
44178
|
+
`Expected dictionary for key '${path112[path112.length - 1]}' inside ${schemaPath(path112.slice(0, -1))}`
|
|
44141
44179
|
);
|
|
44142
|
-
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations,
|
|
44180
|
+
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path112);
|
|
44143
44181
|
if (!deviceValue && Object.hasOwn(node, "substitutions"))
|
|
44144
|
-
checkSubstitutionsShape(node.substitutions,
|
|
44145
|
-
if (!Object.hasOwn(node, "variations")) checkUnitShape(node,
|
|
44182
|
+
checkSubstitutionsShape(node.substitutions, path112);
|
|
44183
|
+
if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path112);
|
|
44146
44184
|
}
|
|
44147
|
-
function checkVariationsShape(variations,
|
|
44185
|
+
function checkVariationsShape(variations, path112) {
|
|
44148
44186
|
if (variations === null)
|
|
44149
|
-
throw Error(`Missing required value for key 'variations' inside ${schemaPath(
|
|
44187
|
+
throw Error(`Missing required value for key 'variations' inside ${schemaPath(path112)}`);
|
|
44150
44188
|
if (!isRecord3(variations))
|
|
44151
|
-
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(
|
|
44152
|
-
const variationsPath = [...
|
|
44189
|
+
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path112)}`);
|
|
44190
|
+
const variationsPath = [...path112, "variations"];
|
|
44153
44191
|
for (const [type, raw2] of Object.entries(variations)) {
|
|
44154
44192
|
if (raw2 === null)
|
|
44155
44193
|
throw Error(
|
|
@@ -44175,11 +44213,11 @@ function checkVariationsShape(variations, path111) {
|
|
|
44175
44213
|
}
|
|
44176
44214
|
}
|
|
44177
44215
|
}
|
|
44178
|
-
function checkSubstitutionsShape(substitutions,
|
|
44216
|
+
function checkSubstitutionsShape(substitutions, path112) {
|
|
44179
44217
|
if (substitutions === null) return;
|
|
44180
44218
|
if (!isRecord3(substitutions))
|
|
44181
|
-
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(
|
|
44182
|
-
const substitutionsPath = [...
|
|
44219
|
+
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path112)}`);
|
|
44220
|
+
const substitutionsPath = [...path112, "substitutions"];
|
|
44183
44221
|
for (const [name3, raw2] of Object.entries(substitutions)) {
|
|
44184
44222
|
const subPath = [...substitutionsPath, name3];
|
|
44185
44223
|
if (raw2 === null)
|
|
@@ -44221,10 +44259,10 @@ function scanSpecs(forms) {
|
|
|
44221
44259
|
}
|
|
44222
44260
|
return specs;
|
|
44223
44261
|
}
|
|
44224
|
-
function inferPlural(forms, language, key2,
|
|
44262
|
+
function inferPlural(forms, language, key2, path112) {
|
|
44225
44263
|
const specs = scanSpecs(forms);
|
|
44226
|
-
if (specs.size === 0) throw requiresNumber(language, key2,
|
|
44227
|
-
if (specs.size > 1) throw moreThanOne(language, key2,
|
|
44264
|
+
if (specs.size === 0) throw requiresNumber(language, key2, path112);
|
|
44265
|
+
if (specs.size > 1) throw moreThanOne(language, key2, path112);
|
|
44228
44266
|
return [...specs.values()][0] ?? { specifier: "", argument: 0 };
|
|
44229
44267
|
}
|
|
44230
44268
|
function unit(value) {
|
|
@@ -44693,8 +44731,8 @@ function plist4(value, depth) {
|
|
|
44693
44731
|
}
|
|
44694
44732
|
function compileStringCatalog(source, name3) {
|
|
44695
44733
|
return Object.fromEntries(
|
|
44696
|
-
Object.entries(compileCatalogTables(source, name3)).map(([
|
|
44697
|
-
|
|
44734
|
+
Object.entries(compileCatalogTables(source, name3)).map(([path112, table]) => [
|
|
44735
|
+
path112,
|
|
44698
44736
|
'<?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"
|
|
44699
44737
|
])
|
|
44700
44738
|
);
|
|
@@ -45918,8 +45956,8 @@ function sourceEntryPath() {
|
|
|
45918
45956
|
return null;
|
|
45919
45957
|
}
|
|
45920
45958
|
}
|
|
45921
|
-
function isCliEntry(
|
|
45922
|
-
const name3 = (0, import_node_path81.basename)(
|
|
45959
|
+
function isCliEntry(path112) {
|
|
45960
|
+
const name3 = (0, import_node_path81.basename)(path112);
|
|
45923
45961
|
return name3 === "bin.ts" || name3 === "bin.js";
|
|
45924
45962
|
}
|
|
45925
45963
|
function rnxSelfInvocation() {
|
|
@@ -50860,11 +50898,11 @@ function stringList(value) {
|
|
|
50860
50898
|
function externalSpecMembers(root, requested) {
|
|
50861
50899
|
const children = (spec) => Array.isArray(spec.subspecs) ? spec.subspecs.filter(object5) : [];
|
|
50862
50900
|
const chains = /* @__PURE__ */ new Map();
|
|
50863
|
-
const select = (
|
|
50864
|
-
const key2 =
|
|
50901
|
+
const select = (path112) => {
|
|
50902
|
+
const key2 = path112.join("/");
|
|
50865
50903
|
if (chains.has(key2)) return;
|
|
50866
50904
|
const chain = [root];
|
|
50867
|
-
for (const part of
|
|
50905
|
+
for (const part of path112) {
|
|
50868
50906
|
const child = children(chain.at(-1)).find((sub) => sub.name === part);
|
|
50869
50907
|
if (!child) throw new Error(`${String(root.name)} has no subspec ${key2}`);
|
|
50870
50908
|
chain.push(child);
|
|
@@ -50873,7 +50911,7 @@ function externalSpecMembers(root, requested) {
|
|
|
50873
50911
|
const spec = chain.at(-1);
|
|
50874
50912
|
const defaults = stringList(spec.default_subspecs ?? spec.default_subspec);
|
|
50875
50913
|
const activated = defaults[0] === "none" ? [] : defaults.length > 0 ? defaults : children(spec).map((sub) => String(sub.name));
|
|
50876
|
-
for (const name3 of activated) select([...
|
|
50914
|
+
for (const name3 of activated) select([...path112, ...name3.split("/")]);
|
|
50877
50915
|
for (const member of chain)
|
|
50878
50916
|
for (const dependencies of [member.dependencies, iosOf(member)?.dependencies])
|
|
50879
50917
|
for (const dependency of object5(dependencies) ? Object.keys(dependencies) : []) {
|
|
@@ -53898,7 +53936,7 @@ var init_nitro_superset = __esm({
|
|
|
53898
53936
|
init_nitroContract();
|
|
53899
53937
|
init_swift_standin_digest();
|
|
53900
53938
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
53901
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
53939
|
+
NITRO_COMPILER_DIGEST = true ? "67d36ef1a7735c3503ac4e8ac0980024161469a9ab1c261acc9bfdf89cd148a6" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
53902
53940
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
53903
53941
|
nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
|
|
53904
53942
|
published2 = /* @__PURE__ */ new Map();
|
|
@@ -53919,7 +53957,7 @@ var init_nitro_superset = __esm({
|
|
|
53919
53957
|
var runtime_companion_default;
|
|
53920
53958
|
var init_runtime_companion = __esm({
|
|
53921
53959
|
"runtime-companion.json"() {
|
|
53922
|
-
runtime_companion_default = { abi: 1, sha256: "
|
|
53960
|
+
runtime_companion_default = { abi: 1, sha256: "2e4d78c7cfb64a492abbe3734e69a59408c00041b36d1a05a2d7fdfcbf6adb7b", file: "node/cli-2e4d78c7cfb64a492abbe3734e69a59408c00041b36d1a05a2d7fdfcbf6adb7b.cjs" };
|
|
53923
53961
|
}
|
|
53924
53962
|
});
|
|
53925
53963
|
|
|
@@ -54115,10 +54153,10 @@ __export(optional_demo_registry_exports, {
|
|
|
54115
54153
|
function findInternalDemoRegistry(startDir) {
|
|
54116
54154
|
let dir = startDir;
|
|
54117
54155
|
for (let step = 0; step < MAX_ANCESTOR_STEPS; step++) {
|
|
54118
|
-
if ((0,
|
|
54119
|
-
const candidate = (0,
|
|
54120
|
-
if ((0,
|
|
54121
|
-
const parent = (0,
|
|
54156
|
+
if ((0, import_node_path105.basename)(dir) === "node_modules") return null;
|
|
54157
|
+
const candidate = (0, import_node_path105.join)(dir, REGISTRY_REPO_PATH);
|
|
54158
|
+
if ((0, import_node_fs104.existsSync)(candidate)) return candidate;
|
|
54159
|
+
const parent = (0, import_node_path105.dirname)(dir);
|
|
54122
54160
|
if (parent === dir) return null;
|
|
54123
54161
|
dir = parent;
|
|
54124
54162
|
}
|
|
@@ -54126,7 +54164,7 @@ function findInternalDemoRegistry(startDir) {
|
|
|
54126
54164
|
}
|
|
54127
54165
|
async function loadOptionalDemoApps() {
|
|
54128
54166
|
if (cached2) return cached2;
|
|
54129
|
-
const registryPath = findInternalDemoRegistry((0,
|
|
54167
|
+
const registryPath = findInternalDemoRegistry((0, import_node_path105.dirname)((0, import_node_url7.fileURLToPath)(__sootsim_import_meta_url)));
|
|
54130
54168
|
if (!registryPath) {
|
|
54131
54169
|
cached2 = [];
|
|
54132
54170
|
return cached2;
|
|
@@ -54145,13 +54183,13 @@ async function loadOptionalDemoApps() {
|
|
|
54145
54183
|
function optionalDemoAppsSync() {
|
|
54146
54184
|
return cached2 ?? [];
|
|
54147
54185
|
}
|
|
54148
|
-
var
|
|
54186
|
+
var import_node_fs104, import_node_path105, import_node_url7, REGISTRY_REPO_PATH, MAX_ANCESTOR_STEPS, cached2;
|
|
54149
54187
|
var init_optional_demo_registry = __esm({
|
|
54150
54188
|
"scripts/optional-demo-registry.ts"() {
|
|
54151
54189
|
"use strict";
|
|
54152
54190
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
54153
|
-
|
|
54154
|
-
|
|
54191
|
+
import_node_fs104 = require("node:fs");
|
|
54192
|
+
import_node_path105 = require("node:path");
|
|
54155
54193
|
import_node_url7 = require("node:url");
|
|
54156
54194
|
REGISTRY_REPO_PATH = "packages/peachsim/scripts/demo-app-registry.ts";
|
|
54157
54195
|
MAX_ANCESTOR_STEPS = 8;
|
|
@@ -54240,7 +54278,7 @@ var init_androidAutolinkingContract = __esm({
|
|
|
54240
54278
|
|
|
54241
54279
|
// src/android-autolinking.ts
|
|
54242
54280
|
async function resolveExpoAndroidAutolinking(appRoot) {
|
|
54243
|
-
const root =
|
|
54281
|
+
const root = import_node_fs115.default.realpathSync(appRoot);
|
|
54244
54282
|
const existing = resolving.get(root);
|
|
54245
54283
|
if (existing) return existing;
|
|
54246
54284
|
const pending = resolveAndroidModules(root);
|
|
@@ -54254,7 +54292,7 @@ async function resolveExpoAndroidAutolinking(appRoot) {
|
|
|
54254
54292
|
async function resolveAndroidModules(appRoot) {
|
|
54255
54293
|
let autolinker;
|
|
54256
54294
|
try {
|
|
54257
|
-
autolinker = (0, import_node_module18.createRequire)(
|
|
54295
|
+
autolinker = (0, import_node_module18.createRequire)(import_node_path117.default.join(appRoot, "package.json")).resolve(
|
|
54258
54296
|
"expo-modules-autolinking/package.json"
|
|
54259
54297
|
);
|
|
54260
54298
|
} catch (error) {
|
|
@@ -54264,7 +54302,7 @@ async function resolveAndroidModules(appRoot) {
|
|
|
54264
54302
|
const { stdout } = await run8(
|
|
54265
54303
|
process.execPath,
|
|
54266
54304
|
[
|
|
54267
|
-
|
|
54305
|
+
import_node_path117.default.join(import_node_path117.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
|
|
54268
54306
|
"resolve",
|
|
54269
54307
|
"--platform",
|
|
54270
54308
|
"android",
|
|
@@ -54317,15 +54355,15 @@ async function resolveReactNativeAndroidAutolinking(appRoot) {
|
|
|
54317
54355
|
}
|
|
54318
54356
|
return linked;
|
|
54319
54357
|
}
|
|
54320
|
-
var import_node_child_process51,
|
|
54358
|
+
var import_node_child_process51, import_node_fs115, import_node_module18, import_node_path117, import_node_util18, run8, resolving;
|
|
54321
54359
|
var init_android_autolinking = __esm({
|
|
54322
54360
|
"src/android-autolinking.ts"() {
|
|
54323
54361
|
"use strict";
|
|
54324
54362
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
54325
54363
|
import_node_child_process51 = require("node:child_process");
|
|
54326
|
-
|
|
54364
|
+
import_node_fs115 = __toESM(require("node:fs"), 1);
|
|
54327
54365
|
import_node_module18 = require("node:module");
|
|
54328
|
-
|
|
54366
|
+
import_node_path117 = __toESM(require("node:path"), 1);
|
|
54329
54367
|
import_node_util18 = require("node:util");
|
|
54330
54368
|
init_androidAutolinkingContract();
|
|
54331
54369
|
init_forked_script_contract();
|
|
@@ -54345,25 +54383,25 @@ async function resolveAndroidGradleSources(request) {
|
|
|
54345
54383
|
let { root } = request;
|
|
54346
54384
|
const { projects: projectDirs, variant: variant2 } = request;
|
|
54347
54385
|
if (projectDirs.length === 0) return [];
|
|
54348
|
-
if (!
|
|
54386
|
+
if (!import_node_path118.default.isAbsolute(root) || projectDirs.some((dir) => !import_node_path118.default.isAbsolute(dir)))
|
|
54349
54387
|
throw new Error("Android Gradle source selection requires absolute project paths");
|
|
54350
54388
|
if (!variant2) throw new Error("Android Gradle source selection requires a variant");
|
|
54351
|
-
root =
|
|
54352
|
-
const projects2 = [...new Set(projectDirs.map((dir) =>
|
|
54353
|
-
const parent =
|
|
54354
|
-
|
|
54355
|
-
const work =
|
|
54389
|
+
root = import_node_fs116.default.realpathSync(root);
|
|
54390
|
+
const projects2 = [...new Set(projectDirs.map((dir) => import_node_fs116.default.realpathSync(dir)))];
|
|
54391
|
+
const parent = import_node_path118.default.join(kotlinHome(), "gradle-sources");
|
|
54392
|
+
import_node_fs116.default.mkdirSync(parent, { recursive: true });
|
|
54393
|
+
const work = import_node_fs116.default.mkdtempSync(import_node_path118.default.join(parent, ".query-"));
|
|
54356
54394
|
const task = `peachAndroidSources${(0, import_node_crypto59.randomBytes)(8).toString("hex")}`;
|
|
54357
|
-
const script =
|
|
54395
|
+
const script = import_node_path118.default.join(work, "sources.gradle");
|
|
54358
54396
|
const encoded = Buffer.from(
|
|
54359
54397
|
JSON.stringify({ root, projects: projects2, variant: variant2, output: work, task })
|
|
54360
54398
|
).toString("base64");
|
|
54361
|
-
|
|
54399
|
+
import_node_fs116.default.writeFileSync(script, modelQuery.replace("__PEACH_REQUEST__", encoded));
|
|
54362
54400
|
try {
|
|
54363
54401
|
await run9(
|
|
54364
54402
|
"bash",
|
|
54365
54403
|
[
|
|
54366
|
-
|
|
54404
|
+
import_node_path118.default.join(root, "gradlew"),
|
|
54367
54405
|
"--init-script",
|
|
54368
54406
|
script,
|
|
54369
54407
|
`${task}All`,
|
|
@@ -54382,13 +54420,13 @@ async function resolveAndroidGradleSources(request) {
|
|
|
54382
54420
|
);
|
|
54383
54421
|
return projects2.map((projectDir, index) => {
|
|
54384
54422
|
const value = JSON.parse(
|
|
54385
|
-
|
|
54423
|
+
import_node_fs116.default.readFileSync(import_node_path118.default.join(work, `${index}.json`), "utf8")
|
|
54386
54424
|
);
|
|
54387
54425
|
if (!isRecord(value) || value.projectDir !== projectDir || value.variant !== variant2 || typeof value.projectPath !== "string" || value.applicationId !== null && typeof value.applicationId !== "string" || typeof value.namespace !== "string" || !value.namespace || value.targetSdk !== null && (typeof value.targetSdk !== "number" || !Number.isInteger(value.targetSdk) || value.targetSdk <= 0))
|
|
54388
54426
|
throw new Error("Gradle printed an invalid Android project source model");
|
|
54389
54427
|
const sources = (field) => {
|
|
54390
54428
|
const list2 = value[field];
|
|
54391
|
-
if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" &&
|
|
54429
|
+
if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" && import_node_path118.default.isAbsolute(file)))
|
|
54392
54430
|
throw new Error(`Gradle printed invalid Android ${field} source paths`);
|
|
54393
54431
|
return list2.map(String);
|
|
54394
54432
|
};
|
|
@@ -54423,18 +54461,18 @@ async function resolveAndroidGradleSources(request) {
|
|
|
54423
54461
|
};
|
|
54424
54462
|
});
|
|
54425
54463
|
} finally {
|
|
54426
|
-
|
|
54464
|
+
import_node_fs116.default.rmSync(work, { recursive: true, force: true });
|
|
54427
54465
|
}
|
|
54428
54466
|
}
|
|
54429
|
-
var import_node_child_process52, import_node_crypto59,
|
|
54467
|
+
var import_node_child_process52, import_node_crypto59, import_node_fs116, import_node_path118, import_node_util19, run9, modelQuery;
|
|
54430
54468
|
var init_android_gradle_sources = __esm({
|
|
54431
54469
|
"src/android-gradle-sources.ts"() {
|
|
54432
54470
|
"use strict";
|
|
54433
54471
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
54434
54472
|
import_node_child_process52 = require("node:child_process");
|
|
54435
54473
|
import_node_crypto59 = require("node:crypto");
|
|
54436
|
-
|
|
54437
|
-
|
|
54474
|
+
import_node_fs116 = __toESM(require("node:fs"), 1);
|
|
54475
|
+
import_node_path118 = __toESM(require("node:path"), 1);
|
|
54438
54476
|
import_node_util19 = require("node:util");
|
|
54439
54477
|
init_forked_script_contract();
|
|
54440
54478
|
init_is_record();
|
|
@@ -54574,27 +54612,27 @@ function readBridgeFiles(output2) {
|
|
|
54574
54612
|
});
|
|
54575
54613
|
}
|
|
54576
54614
|
function androidAppSources(appRoot) {
|
|
54577
|
-
const moduleDir =
|
|
54578
|
-
const gradle = ["build.gradle", "build.gradle.kts"].map((name3) =>
|
|
54615
|
+
const moduleDir = import_node_path119.default.join(appRoot, "android", "app");
|
|
54616
|
+
const gradle = ["build.gradle", "build.gradle.kts"].map((name3) => import_node_path119.default.join(moduleDir, name3)).find((file) => import_node_fs117.default.existsSync(file));
|
|
54579
54617
|
if (!gradle) return null;
|
|
54580
54618
|
const id = /\bapplicationId\s*=?\s*["']([^"']+)["']/.exec(
|
|
54581
|
-
|
|
54619
|
+
import_node_fs117.default.readFileSync(gradle, "utf8")
|
|
54582
54620
|
);
|
|
54583
54621
|
if (!id) throw new Error(`${gradle}: no applicationId`);
|
|
54584
54622
|
const kotlin = [];
|
|
54585
54623
|
const java = [];
|
|
54586
54624
|
const walk3 = (dir) => {
|
|
54587
|
-
if (!
|
|
54588
|
-
for (const child of
|
|
54589
|
-
const file =
|
|
54625
|
+
if (!import_node_fs117.default.existsSync(dir)) return;
|
|
54626
|
+
for (const child of import_node_fs117.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
54627
|
+
const file = import_node_path119.default.join(dir, child.name);
|
|
54590
54628
|
if (child.isSymbolicLink()) throw new Error(`Android source is a symlink: ${file}`);
|
|
54591
54629
|
if (child.isDirectory()) walk3(file);
|
|
54592
54630
|
else if (child.name.endsWith(".kt")) kotlin.push(file);
|
|
54593
54631
|
else if (child.name.endsWith(".java")) java.push(file);
|
|
54594
54632
|
}
|
|
54595
54633
|
};
|
|
54596
|
-
walk3(
|
|
54597
|
-
walk3(
|
|
54634
|
+
walk3(import_node_path119.default.join(moduleDir, "src", "main", "java"));
|
|
54635
|
+
walk3(import_node_path119.default.join(moduleDir, "src", "main", "kotlin"));
|
|
54598
54636
|
return { applicationId: id[1], kotlin, java };
|
|
54599
54637
|
}
|
|
54600
54638
|
function declares(source, owner, name3) {
|
|
@@ -54603,7 +54641,7 @@ function declares(source, owner, name3) {
|
|
|
54603
54641
|
}
|
|
54604
54642
|
function selectBridgePackages(applicationId, files2, javaFiles) {
|
|
54605
54643
|
const texts = new Map(
|
|
54606
|
-
files2.map((file) => [file.file,
|
|
54644
|
+
files2.map((file) => [file.file, import_node_fs117.default.readFileSync(file.file, "utf8")])
|
|
54607
54645
|
);
|
|
54608
54646
|
const owners = /* @__PURE__ */ new Map();
|
|
54609
54647
|
for (const file of files2)
|
|
@@ -54611,8 +54649,8 @@ function selectBridgePackages(applicationId, files2, javaFiles) {
|
|
|
54611
54649
|
owners.set(name3, [...owners.get(name3) ?? [], file]);
|
|
54612
54650
|
const javaDeclarations = javaFiles.map((file) => ({
|
|
54613
54651
|
file,
|
|
54614
|
-
package: /^\s*package\s+([\w.]+)\s*;/m.exec(
|
|
54615
|
-
name:
|
|
54652
|
+
package: /^\s*package\s+([\w.]+)\s*;/m.exec(import_node_fs117.default.readFileSync(file, "utf8"))?.[1] ?? "",
|
|
54653
|
+
name: import_node_path119.default.basename(file, ".java")
|
|
54616
54654
|
}));
|
|
54617
54655
|
const closure = (root) => {
|
|
54618
54656
|
const seen = /* @__PURE__ */ new Set([root]);
|
|
@@ -54685,13 +54723,13 @@ function moduleName(text6, className2) {
|
|
|
54685
54723
|
);
|
|
54686
54724
|
return match ? match[1] : null;
|
|
54687
54725
|
}
|
|
54688
|
-
var
|
|
54726
|
+
var import_node_fs117, import_node_path119, qualified2;
|
|
54689
54727
|
var init_android_bridge_packages = __esm({
|
|
54690
54728
|
"src/android-bridge-packages.ts"() {
|
|
54691
54729
|
"use strict";
|
|
54692
54730
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
54693
|
-
|
|
54694
|
-
|
|
54731
|
+
import_node_fs117 = __toESM(require("node:fs"), 1);
|
|
54732
|
+
import_node_path119 = __toESM(require("node:path"), 1);
|
|
54695
54733
|
init_is_record();
|
|
54696
54734
|
qualified2 = (file, name3) => file.package ? `${file.package}.${name3}` : name3;
|
|
54697
54735
|
}
|
|
@@ -54700,28 +54738,28 @@ var init_android_bridge_packages = __esm({
|
|
|
54700
54738
|
// src/java-module-abi.ts
|
|
54701
54739
|
async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
|
|
54702
54740
|
const digest3 = (0, import_node_crypto60.createHash)("sha256");
|
|
54703
|
-
const parent =
|
|
54704
|
-
|
|
54705
|
-
const work =
|
|
54741
|
+
const parent = import_node_path120.default.join(kotlinHome(), "java-specs");
|
|
54742
|
+
import_node_fs118.default.mkdirSync(parent, { recursive: true });
|
|
54743
|
+
const work = import_node_fs118.default.mkdtempSync(import_node_path120.default.join(parent, ".read-"));
|
|
54706
54744
|
try {
|
|
54707
54745
|
const origins = /* @__PURE__ */ new Map();
|
|
54708
54746
|
for (const [index, file] of files2.entries()) {
|
|
54709
|
-
const bytes =
|
|
54747
|
+
const bytes = import_node_fs118.default.readFileSync(file);
|
|
54710
54748
|
digest3.update(file).update("\0").update(bytes).update("\0");
|
|
54711
|
-
const target =
|
|
54712
|
-
|
|
54713
|
-
|
|
54749
|
+
const target = import_node_path120.default.join(work, String(index), import_node_path120.default.basename(file));
|
|
54750
|
+
import_node_fs118.default.mkdirSync(import_node_path120.default.dirname(target));
|
|
54751
|
+
import_node_fs118.default.writeFileSync(target, bytes);
|
|
54714
54752
|
origins.set(target, file);
|
|
54715
54753
|
}
|
|
54716
54754
|
const { stdout } = await run10(
|
|
54717
|
-
|
|
54755
|
+
import_node_path120.default.join(toolchain.javaHome, "bin", "java"),
|
|
54718
54756
|
[
|
|
54719
54757
|
"-cp",
|
|
54720
54758
|
[
|
|
54721
|
-
|
|
54722
|
-
|
|
54723
|
-
|
|
54724
|
-
].join(
|
|
54759
|
+
import_node_path120.default.join(sdkRoot, "tools.jar"),
|
|
54760
|
+
import_node_path120.default.resolve(import_node_path120.default.dirname(toolchain.kotlinc), "../lib/kotlin-compiler.jar"),
|
|
54761
|
+
import_node_path120.default.resolve(import_node_path120.default.dirname(toolchain.kotlinc), "../lib/kotlin-stdlib.jar")
|
|
54762
|
+
].join(import_node_path120.default.delimiter),
|
|
54725
54763
|
"dev.peach.tools.javaabi.JavaModuleSpecsKt",
|
|
54726
54764
|
...origins.keys()
|
|
54727
54765
|
],
|
|
@@ -54751,20 +54789,20 @@ ${diagnostic.trim()}`, { cause });
|
|
|
54751
54789
|
});
|
|
54752
54790
|
return { sha256: digest3.digest("hex"), specs };
|
|
54753
54791
|
} finally {
|
|
54754
|
-
|
|
54792
|
+
import_node_fs118.default.rmSync(work, { recursive: true, force: true });
|
|
54755
54793
|
}
|
|
54756
54794
|
}
|
|
54757
54795
|
async function compileJavaModuleAbi(input) {
|
|
54758
54796
|
const { specs, work, hash, toolchain, libraries, sdkRoot, sdkLibrary, language } = input;
|
|
54759
|
-
const directory2 =
|
|
54760
|
-
|
|
54797
|
+
const directory2 = import_node_path120.default.join(work, "java-abi");
|
|
54798
|
+
import_node_fs118.default.mkdirSync(directory2);
|
|
54761
54799
|
const sources = specs.specs.map((spec, index) => {
|
|
54762
|
-
const target =
|
|
54763
|
-
|
|
54800
|
+
const target = import_node_path120.default.join(directory2, `Spec${index}.kt`);
|
|
54801
|
+
import_node_fs118.default.writeFileSync(target, spec.source);
|
|
54764
54802
|
return target;
|
|
54765
54803
|
});
|
|
54766
|
-
const initializer =
|
|
54767
|
-
|
|
54804
|
+
const initializer = import_node_path120.default.join(directory2, "Bindings.kt");
|
|
54805
|
+
import_node_fs118.default.writeFileSync(
|
|
54768
54806
|
initializer,
|
|
54769
54807
|
[
|
|
54770
54808
|
"package dev.peach.jni",
|
|
@@ -54778,8 +54816,8 @@ async function compileJavaModuleAbi(input) {
|
|
|
54778
54816
|
"-J-Xmx2g",
|
|
54779
54817
|
"-Xwasm-target=js",
|
|
54780
54818
|
"-libraries",
|
|
54781
|
-
libraries.join(
|
|
54782
|
-
`-Xplugin=${
|
|
54819
|
+
libraries.join(import_node_path120.default.delimiter),
|
|
54820
|
+
`-Xplugin=${import_node_path120.default.join(sdkRoot, "plugin.jar")}`,
|
|
54783
54821
|
`-Xfriend-modules=${sdkLibrary}`,
|
|
54784
54822
|
"-language-version",
|
|
54785
54823
|
language,
|
|
@@ -54795,33 +54833,33 @@ async function compileJavaModuleAbi(input) {
|
|
|
54795
54833
|
],
|
|
54796
54834
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
54797
54835
|
);
|
|
54798
|
-
const library =
|
|
54836
|
+
const library = import_node_path120.default.join(directory2, "java-abi.klib");
|
|
54799
54837
|
await run10(
|
|
54800
|
-
|
|
54838
|
+
import_node_path120.default.join(toolchain.javaHome, "bin", "java"),
|
|
54801
54839
|
[
|
|
54802
54840
|
"-cp",
|
|
54803
54841
|
[
|
|
54804
|
-
|
|
54805
|
-
|
|
54806
|
-
|
|
54807
|
-
].join(
|
|
54842
|
+
import_node_path120.default.join(sdkRoot, "tools.jar"),
|
|
54843
|
+
import_node_path120.default.resolve(import_node_path120.default.dirname(toolchain.kotlinc), "../lib/kotlin-compiler.jar"),
|
|
54844
|
+
import_node_path120.default.resolve(import_node_path120.default.dirname(toolchain.kotlinc), "../lib/kotlin-stdlib.jar")
|
|
54845
|
+
].join(import_node_path120.default.delimiter),
|
|
54808
54846
|
"dev.peach.tools.platform.JavaPlatformTypesKt",
|
|
54809
|
-
|
|
54847
|
+
import_node_path120.default.join(directory2, `${name3}.klib`),
|
|
54810
54848
|
library
|
|
54811
54849
|
],
|
|
54812
54850
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
54813
54851
|
);
|
|
54814
54852
|
return library;
|
|
54815
54853
|
}
|
|
54816
|
-
var import_node_child_process53, import_node_crypto60,
|
|
54854
|
+
var import_node_child_process53, import_node_crypto60, import_node_fs118, import_node_path120, import_node_util20, run10, JAVA_BINDINGS_INITIALIZER;
|
|
54817
54855
|
var init_java_module_abi = __esm({
|
|
54818
54856
|
"src/java-module-abi.ts"() {
|
|
54819
54857
|
"use strict";
|
|
54820
54858
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
54821
54859
|
import_node_child_process53 = require("node:child_process");
|
|
54822
54860
|
import_node_crypto60 = require("node:crypto");
|
|
54823
|
-
|
|
54824
|
-
|
|
54861
|
+
import_node_fs118 = __toESM(require("node:fs"), 1);
|
|
54862
|
+
import_node_path120 = __toESM(require("node:path"), 1);
|
|
54825
54863
|
import_node_util20 = require("node:util");
|
|
54826
54864
|
init_android_bridge_packages();
|
|
54827
54865
|
init_is_record();
|
|
@@ -54909,22 +54947,22 @@ var init_kotlinSdkContract = __esm({
|
|
|
54909
54947
|
// src/kotlin-sdk.ts
|
|
54910
54948
|
function verifyKotlinSdkDirectory(root, compilerSha256) {
|
|
54911
54949
|
const expectedNames = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
54912
|
-
const names =
|
|
54950
|
+
const names = import_node_fs119.default.readdirSync(root);
|
|
54913
54951
|
if (names.length !== expectedNames.length || names.some((name3) => !expectedNames.includes(name3)))
|
|
54914
54952
|
throw new Error("Kotlin SDK directory contains unexpected inputs");
|
|
54915
|
-
const manifestStat =
|
|
54953
|
+
const manifestStat = import_node_fs119.default.lstatSync(import_node_path121.default.join(root, "manifest.json"));
|
|
54916
54954
|
if (!manifestStat.isFile() || manifestStat.nlink !== 1)
|
|
54917
54955
|
throw new Error("Kotlin SDK manifest is not a regular file");
|
|
54918
54956
|
const manifest = readKotlinSdkManifest(
|
|
54919
|
-
|
|
54957
|
+
import_node_fs119.default.readFileSync(import_node_path121.default.join(root, "manifest.json"), "utf8"),
|
|
54920
54958
|
compilerSha256
|
|
54921
54959
|
);
|
|
54922
54960
|
for (const [name3, expected] of Object.entries(manifest.files)) {
|
|
54923
|
-
const target =
|
|
54924
|
-
const stat2 =
|
|
54961
|
+
const target = import_node_path121.default.join(root, name3);
|
|
54962
|
+
const stat2 = import_node_fs119.default.lstatSync(target);
|
|
54925
54963
|
if (!stat2.isFile() || stat2.nlink !== 1)
|
|
54926
54964
|
throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
|
|
54927
|
-
const bytes =
|
|
54965
|
+
const bytes = import_node_fs119.default.readFileSync(target);
|
|
54928
54966
|
if (bytes.length !== expected.bytes || (0, import_node_crypto61.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
|
|
54929
54967
|
throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
|
|
54930
54968
|
}
|
|
@@ -54932,43 +54970,43 @@ function verifyKotlinSdkDirectory(root, compilerSha256) {
|
|
|
54932
54970
|
}
|
|
54933
54971
|
async function installKotlinSdkArchive(archive, compilerSha256) {
|
|
54934
54972
|
const sha2564 = (0, import_node_crypto61.createHash)("sha256").update(archive).digest("hex");
|
|
54935
|
-
const parent =
|
|
54936
|
-
const root =
|
|
54937
|
-
if (
|
|
54973
|
+
const parent = import_node_path121.default.join(kotlinHome(), "sdk");
|
|
54974
|
+
const root = import_node_path121.default.join(parent, sha2564);
|
|
54975
|
+
if (import_node_fs119.default.existsSync(root))
|
|
54938
54976
|
return { root, sha256: sha2564, manifest: verifyKotlinSdkDirectory(root, compilerSha256) };
|
|
54939
|
-
|
|
54940
|
-
const work =
|
|
54977
|
+
import_node_fs119.default.mkdirSync(parent, { recursive: true });
|
|
54978
|
+
const work = import_node_fs119.default.mkdtempSync(import_node_path121.default.join(parent, ".install-"));
|
|
54941
54979
|
try {
|
|
54942
|
-
const packed =
|
|
54943
|
-
|
|
54980
|
+
const packed = import_node_path121.default.join(work, "sdk.tar.gz");
|
|
54981
|
+
import_node_fs119.default.writeFileSync(packed, archive);
|
|
54944
54982
|
const { stdout } = await run11("tar", ["-tzf", packed]);
|
|
54945
54983
|
const names = stdout.trim().split("\n");
|
|
54946
54984
|
const expected = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
54947
54985
|
if (names.length !== expected.length || new Set(names).size !== names.length || names.some((name3) => !expected.includes(name3)))
|
|
54948
54986
|
throw new Error("Kotlin SDK archive contains unexpected inputs");
|
|
54949
54987
|
await run11("tar", ["-xzf", packed, "-C", work, "--", ...expected]);
|
|
54950
|
-
|
|
54988
|
+
import_node_fs119.default.rmSync(packed);
|
|
54951
54989
|
const manifest = verifyKotlinSdkDirectory(work, compilerSha256);
|
|
54952
54990
|
try {
|
|
54953
|
-
|
|
54991
|
+
import_node_fs119.default.renameSync(work, root);
|
|
54954
54992
|
} catch (error) {
|
|
54955
|
-
if (!
|
|
54993
|
+
if (!import_node_fs119.default.existsSync(root)) throw error;
|
|
54956
54994
|
verifyKotlinSdkDirectory(root, compilerSha256);
|
|
54957
54995
|
}
|
|
54958
54996
|
return { root, sha256: sha2564, manifest };
|
|
54959
54997
|
} finally {
|
|
54960
|
-
|
|
54998
|
+
import_node_fs119.default.rmSync(work, { recursive: true, force: true });
|
|
54961
54999
|
}
|
|
54962
55000
|
}
|
|
54963
|
-
var import_node_child_process54, import_node_crypto61,
|
|
55001
|
+
var import_node_child_process54, import_node_crypto61, import_node_fs119, import_node_path121, import_node_util21, run11;
|
|
54964
55002
|
var init_kotlin_sdk = __esm({
|
|
54965
55003
|
"src/kotlin-sdk.ts"() {
|
|
54966
55004
|
"use strict";
|
|
54967
55005
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
54968
55006
|
import_node_child_process54 = require("node:child_process");
|
|
54969
55007
|
import_node_crypto61 = require("node:crypto");
|
|
54970
|
-
|
|
54971
|
-
|
|
55008
|
+
import_node_fs119 = __toESM(require("node:fs"), 1);
|
|
55009
|
+
import_node_path121 = __toESM(require("node:path"), 1);
|
|
54972
55010
|
import_node_util21 = require("node:util");
|
|
54973
55011
|
init_kotlin_toolchain();
|
|
54974
55012
|
init_kotlinSdkContract();
|
|
@@ -54978,8 +55016,8 @@ var init_kotlin_sdk = __esm({
|
|
|
54978
55016
|
|
|
54979
55017
|
// src/android-bridge-dependencies.ts
|
|
54980
55018
|
async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
54981
|
-
const root =
|
|
54982
|
-
if (!
|
|
55019
|
+
const root = import_node_path122.default.join(appRoot, "android");
|
|
55020
|
+
if (!import_node_fs120.default.existsSync(import_node_path122.default.join(root, "gradlew"))) return null;
|
|
54983
55021
|
const dependencies = (await resolveReactNativeAndroidAutolinking(appRoot)).flatMap(
|
|
54984
55022
|
(dependency) => dependency.sourceDir === null || dependency.packageInstance === null ? [] : [
|
|
54985
55023
|
{
|
|
@@ -54993,7 +55031,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
54993
55031
|
const models = await resolveAndroidGradleSources({
|
|
54994
55032
|
root,
|
|
54995
55033
|
projects: [
|
|
54996
|
-
|
|
55034
|
+
import_node_path122.default.join(root, "app"),
|
|
54997
55035
|
...dependencies.map((dependency) => dependency.sourceDir)
|
|
54998
55036
|
],
|
|
54999
55037
|
variant: "debug"
|
|
@@ -55003,7 +55041,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
55003
55041
|
const toolchain = readToolchain(moduleRoot);
|
|
55004
55042
|
const [sdk, ready] = await Promise.all([
|
|
55005
55043
|
installKotlinSdkArchive(
|
|
55006
|
-
|
|
55044
|
+
import_node_fs120.default.readFileSync(import_node_path122.default.join(moduleRoot, "sdk.tar.gz")),
|
|
55007
55045
|
toolchain.compiler.sha256
|
|
55008
55046
|
),
|
|
55009
55047
|
ensureToolchain(toolchain)
|
|
@@ -55011,7 +55049,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
55011
55049
|
const packages = [];
|
|
55012
55050
|
for (const dependency of dependencies) {
|
|
55013
55051
|
const model = models.find(
|
|
55014
|
-
(entry) => entry.projectDir ===
|
|
55052
|
+
(entry) => entry.projectDir === import_node_fs120.default.realpathSync(dependency.sourceDir)
|
|
55015
55053
|
);
|
|
55016
55054
|
try {
|
|
55017
55055
|
const className2 = /^import\s+([\w.]+)\s*;$/.exec(
|
|
@@ -55050,13 +55088,13 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
55050
55088
|
}
|
|
55051
55089
|
return packages.length ? { applicationId, packages } : null;
|
|
55052
55090
|
}
|
|
55053
|
-
var
|
|
55091
|
+
var import_node_fs120, import_node_path122;
|
|
55054
55092
|
var init_android_bridge_dependencies = __esm({
|
|
55055
55093
|
"src/android-bridge-dependencies.ts"() {
|
|
55056
55094
|
"use strict";
|
|
55057
55095
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
55058
|
-
|
|
55059
|
-
|
|
55096
|
+
import_node_fs120 = __toESM(require("node:fs"), 1);
|
|
55097
|
+
import_node_path122 = __toESM(require("node:path"), 1);
|
|
55060
55098
|
init_android_autolinking();
|
|
55061
55099
|
init_android_gradle_sources();
|
|
55062
55100
|
init_java_module_abi();
|
|
@@ -55068,46 +55106,46 @@ var init_android_bridge_dependencies = __esm({
|
|
|
55068
55106
|
// src/kotlin-module.ts
|
|
55069
55107
|
function peachKotlinModuleRoot() {
|
|
55070
55108
|
if (!IS_STANDALONE)
|
|
55071
|
-
return
|
|
55109
|
+
return import_node_path123.default.resolve(import_node_path123.default.dirname((0, import_node_url9.fileURLToPath)(__sootsim_import_meta_url)), "..", "kotlin");
|
|
55072
55110
|
if (installedRoot) return installedRoot;
|
|
55073
55111
|
const files2 = __PEACH_BUNDLED_KOTLIN__;
|
|
55074
55112
|
const digest3 = (0, import_node_crypto62.createHash)("sha256").update(JSON.stringify(files2)).digest("hex");
|
|
55075
|
-
const parent =
|
|
55076
|
-
const root =
|
|
55077
|
-
|
|
55078
|
-
if (!
|
|
55079
|
-
const pending =
|
|
55113
|
+
const parent = import_node_path123.default.join(rnxHomeDir(), "kotlin", "modules");
|
|
55114
|
+
const root = import_node_path123.default.join(parent, digest3);
|
|
55115
|
+
import_node_fs121.default.mkdirSync(parent, { recursive: true });
|
|
55116
|
+
if (!import_node_fs121.default.existsSync(root)) {
|
|
55117
|
+
const pending = import_node_fs121.default.mkdtempSync(import_node_path123.default.join(parent, ".install-"));
|
|
55080
55118
|
try {
|
|
55081
55119
|
for (const [name3, contents] of Object.entries(files2)) {
|
|
55082
|
-
const file =
|
|
55083
|
-
|
|
55084
|
-
|
|
55120
|
+
const file = import_node_path123.default.join(pending, name3);
|
|
55121
|
+
import_node_fs121.default.mkdirSync(import_node_path123.default.dirname(file), { recursive: true });
|
|
55122
|
+
import_node_fs121.default.writeFileSync(file, Buffer.from(contents, "base64"));
|
|
55085
55123
|
}
|
|
55086
55124
|
try {
|
|
55087
|
-
|
|
55125
|
+
import_node_fs121.default.renameSync(pending, root);
|
|
55088
55126
|
} catch (error) {
|
|
55089
55127
|
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY")
|
|
55090
55128
|
throw error;
|
|
55091
55129
|
}
|
|
55092
55130
|
} finally {
|
|
55093
|
-
|
|
55131
|
+
import_node_fs121.default.rmSync(pending, { recursive: true, force: true });
|
|
55094
55132
|
}
|
|
55095
55133
|
}
|
|
55096
55134
|
for (const [name3, contents] of Object.entries(files2)) {
|
|
55097
|
-
if (!
|
|
55135
|
+
if (!import_node_fs121.default.readFileSync(import_node_path123.default.join(root, name3)).equals(Buffer.from(contents, "base64")))
|
|
55098
55136
|
throw new Error(`packaged Kotlin module differs from this CLI: ${name3}`);
|
|
55099
55137
|
}
|
|
55100
55138
|
installedRoot = root;
|
|
55101
55139
|
return root;
|
|
55102
55140
|
}
|
|
55103
|
-
var import_node_crypto62,
|
|
55141
|
+
var import_node_crypto62, import_node_fs121, import_node_path123, import_node_url9, installedRoot;
|
|
55104
55142
|
var init_kotlin_module = __esm({
|
|
55105
55143
|
"src/kotlin-module.ts"() {
|
|
55106
55144
|
"use strict";
|
|
55107
55145
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
55108
55146
|
import_node_crypto62 = require("node:crypto");
|
|
55109
|
-
|
|
55110
|
-
|
|
55147
|
+
import_node_fs121 = __toESM(require("node:fs"), 1);
|
|
55148
|
+
import_node_path123 = __toESM(require("node:path"), 1);
|
|
55111
55149
|
import_node_url9 = require("node:url");
|
|
55112
55150
|
init_standalone();
|
|
55113
55151
|
init_home_paths();
|
|
@@ -55365,16 +55403,16 @@ __export(kotlin_host_exports, {
|
|
|
55365
55403
|
});
|
|
55366
55404
|
function loadKotlinSdk(moduleRoot, toolchain) {
|
|
55367
55405
|
return installKotlinSdkArchive(
|
|
55368
|
-
|
|
55406
|
+
import_node_fs122.default.readFileSync(import_node_path124.default.join(moduleRoot, "sdk.tar.gz")),
|
|
55369
55407
|
toolchain.compiler.sha256
|
|
55370
55408
|
);
|
|
55371
55409
|
}
|
|
55372
55410
|
function appKotlinLanguage(root) {
|
|
55373
|
-
const reactNative =
|
|
55374
|
-
(0, import_node_module19.createRequire)(
|
|
55411
|
+
const reactNative = import_node_path124.default.dirname(
|
|
55412
|
+
(0, import_node_module19.createRequire)(import_node_path124.default.join(root, "package.json")).resolve("react-native/package.json")
|
|
55375
55413
|
);
|
|
55376
|
-
const versions =
|
|
55377
|
-
|
|
55414
|
+
const versions = import_node_fs122.default.readFileSync(
|
|
55415
|
+
import_node_path124.default.join(reactNative, "gradle", "libs.versions.toml"),
|
|
55378
55416
|
"utf8"
|
|
55379
55417
|
);
|
|
55380
55418
|
const match = /^kotlin\s*=\s*"(\d+)\.(\d+)/m.exec(versions);
|
|
@@ -55385,9 +55423,9 @@ function appKotlinLanguage(root) {
|
|
|
55385
55423
|
function kotlinSources(root, skip = SKIP_DIRS) {
|
|
55386
55424
|
const sources = [];
|
|
55387
55425
|
const walk3 = (dir) => {
|
|
55388
|
-
for (const entry of
|
|
55426
|
+
for (const entry of import_node_fs122.default.readdirSync(dir, { withFileTypes: true })) {
|
|
55389
55427
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
55390
|
-
const full =
|
|
55428
|
+
const full = import_node_path124.default.join(dir, entry.name);
|
|
55391
55429
|
if (entry.isDirectory()) walk3(full);
|
|
55392
55430
|
else if (entry.isFile() && entry.name.endsWith(".kt")) sources.push(full);
|
|
55393
55431
|
}
|
|
@@ -55449,7 +55487,7 @@ function entrySource(ids) {
|
|
|
55449
55487
|
].join("\n");
|
|
55450
55488
|
}
|
|
55451
55489
|
function buildsDir() {
|
|
55452
|
-
return
|
|
55490
|
+
return import_node_path124.default.join(kotlinHome(), "builds");
|
|
55453
55491
|
}
|
|
55454
55492
|
async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
|
|
55455
55493
|
const { kotlinSourceId, nativeSourceContract, renderKotlinSourceGlue } = await import("vxrn/native-source-contract");
|
|
@@ -55462,7 +55500,7 @@ async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
|
|
|
55462
55500
|
const viewIds = [];
|
|
55463
55501
|
let usesCompose = false;
|
|
55464
55502
|
for (const file of sources) {
|
|
55465
|
-
const source =
|
|
55503
|
+
const source = import_node_fs122.default.readFileSync(file, "utf8");
|
|
55466
55504
|
if (/\bandroidx\.compose\./.test(source)) usesCompose = true;
|
|
55467
55505
|
const contract = nativeSourceContract(file, source);
|
|
55468
55506
|
if (contract.modules.length === 0 && contract.views.length === 0) continue;
|
|
@@ -55553,22 +55591,22 @@ function readExpoTypes(output2) {
|
|
|
55553
55591
|
async function scanSources(tool, parse11, toolchain, moduleRoot, files2) {
|
|
55554
55592
|
const digest3 = (0, import_node_crypto63.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
|
|
55555
55593
|
const sdk = await loadKotlinSdk(moduleRoot, toolchain);
|
|
55556
|
-
digest3.update(
|
|
55594
|
+
digest3.update(import_node_fs122.default.readFileSync(import_node_path124.default.join(moduleRoot, "sdk.tar.gz")));
|
|
55557
55595
|
digest3.update(tool);
|
|
55558
|
-
for (const file of files2) digest3.update(`${file}\0${
|
|
55596
|
+
for (const file of files2) digest3.update(`${file}\0${import_node_fs122.default.readFileSync(file, "utf8")}\0`);
|
|
55559
55597
|
const key2 = digest3.digest("hex");
|
|
55560
55598
|
let scan2 = toolScans.get(key2);
|
|
55561
55599
|
if (!scan2) {
|
|
55562
55600
|
scan2 = (async () => {
|
|
55563
55601
|
const { kotlinc } = await ensureToolchain(toolchain);
|
|
55564
55602
|
const { stdout } = await run12(
|
|
55565
|
-
|
|
55603
|
+
import_node_path124.default.join(import_node_path124.default.dirname(kotlinc), "kotlin"),
|
|
55566
55604
|
[
|
|
55567
55605
|
"-cp",
|
|
55568
55606
|
[
|
|
55569
|
-
|
|
55570
|
-
|
|
55571
|
-
].join(
|
|
55607
|
+
import_node_path124.default.resolve(import_node_path124.default.dirname(kotlinc), "../lib/kotlin-compiler.jar"),
|
|
55608
|
+
import_node_path124.default.join(sdk.root, "tools.jar")
|
|
55609
|
+
].join(import_node_path124.default.delimiter),
|
|
55572
55610
|
tool,
|
|
55573
55611
|
...files2
|
|
55574
55612
|
],
|
|
@@ -55586,7 +55624,7 @@ async function scanSources(tool, parse11, toolchain, moduleRoot, files2) {
|
|
|
55586
55624
|
async function scanExpoTypes(toolchain, moduleRoot, sources) {
|
|
55587
55625
|
const candidates = sources.filter(
|
|
55588
55626
|
(file) => /\bRecord\b|\benum\s+class\b|\bExpoComposeView\b|\bExpoView\b|\bComposeProps\b|:\s*(?:[A-Za-z0-9_.]+\.)?(?:View|FrameLayout|LinearLayout|ViewGroup)\b/.test(
|
|
55589
|
-
|
|
55627
|
+
import_node_fs122.default.readFileSync(file, "utf8")
|
|
55590
55628
|
)
|
|
55591
55629
|
);
|
|
55592
55630
|
if (candidates.length === 0) return [];
|
|
@@ -55730,7 +55768,7 @@ function expoTypeSources(files2) {
|
|
|
55730
55768
|
)
|
|
55731
55769
|
];
|
|
55732
55770
|
if (edits.length > 0 || views.length > 0) {
|
|
55733
|
-
let text6 =
|
|
55771
|
+
let text6 = import_node_fs122.default.readFileSync(file.file, "utf8").replaceAll("\r\n", "\n");
|
|
55734
55772
|
for (const { range: range2, owner, field } of edits.sort((a, b) => b.range[0] - a.range[0]))
|
|
55735
55773
|
text6 = `${text6.slice(0, range2[0])}dev.peach.expo.PeachExpoTypes.initial(${owner}::class, ${literal2(field.key)}, ${field.required}) { ${text6.slice(range2[0], range2[1])} }${text6.slice(range2[1])}`;
|
|
55736
55774
|
if (views.length > 0) {
|
|
@@ -55746,7 +55784,7 @@ function expoTypeSources(files2) {
|
|
|
55746
55784
|
`${file.package ? `${file.package}.` : ""}peachExpoViews${index}()`
|
|
55747
55785
|
);
|
|
55748
55786
|
}
|
|
55749
|
-
const name3 = `PeachExpoSource_${index}_${
|
|
55787
|
+
const name3 = `PeachExpoSource_${index}_${import_node_path124.default.basename(file.file)}`;
|
|
55750
55788
|
generated[name3] = text6;
|
|
55751
55789
|
origins[name3] = file.file;
|
|
55752
55790
|
}
|
|
@@ -55788,7 +55826,7 @@ async function expoKotlinArtifact(root, moduleRoot, origin, modules) {
|
|
|
55788
55826
|
const language = appKotlinLanguage(root);
|
|
55789
55827
|
const scanned = await scanExpoTypes(toolchain, moduleRoot, modules.sources);
|
|
55790
55828
|
const usesCompose = scanned.some((file) => file.views.length > 0) || modules.sources.some(
|
|
55791
|
-
(file) => /\bandroidx\.compose\./.test(
|
|
55829
|
+
(file) => /\bandroidx\.compose\./.test(import_node_fs122.default.readFileSync(file, "utf8"))
|
|
55792
55830
|
);
|
|
55793
55831
|
const types = expoTypeSources(scanned);
|
|
55794
55832
|
const rewritten = new Set(Object.values(types.origins));
|
|
@@ -56009,7 +56047,7 @@ function appResourceSources(app) {
|
|
|
56009
56047
|
entries: app.drawables.map((drawable) => ({
|
|
56010
56048
|
name: drawable.name,
|
|
56011
56049
|
init: `listOf(
|
|
56012
|
-
${drawable.files.map((file) => drawableInit(file,
|
|
56050
|
+
${drawable.files.map((file) => drawableInit(file, import_node_path124.default.relative(app.moduleDir, file.file))).join(",\n")}
|
|
56013
56051
|
)`
|
|
56014
56052
|
}))
|
|
56015
56053
|
},
|
|
@@ -56133,7 +56171,7 @@ function drawableInit(drawable, file) {
|
|
|
56133
56171
|
if (drawable.kind === "xml") return `PeachDrawable.Xml(${where})`;
|
|
56134
56172
|
if (drawable.kind === "bitmap")
|
|
56135
56173
|
return `PeachDrawable.Bitmap(${where}, ${drawable.ninePatch}, ${literal2(
|
|
56136
|
-
|
|
56174
|
+
import_node_fs122.default.readFileSync(drawable.file).toString("base64")
|
|
56137
56175
|
)})`;
|
|
56138
56176
|
const vector = drawable.vector;
|
|
56139
56177
|
const float3 = (value) => `${value}f`;
|
|
@@ -56197,8 +56235,8 @@ async function compileKotlin(input, origin) {
|
|
|
56197
56235
|
javaSpecs = []
|
|
56198
56236
|
} = input;
|
|
56199
56237
|
const sdk = await loadKotlinSdk(moduleRoot, toolchain);
|
|
56200
|
-
const plugin =
|
|
56201
|
-
const sdkLibrary =
|
|
56238
|
+
const plugin = import_node_path124.default.join(sdk.root, "plugin.jar");
|
|
56239
|
+
const sdkLibrary = import_node_path124.default.join(sdk.root, `${sdkProfile}.klib`);
|
|
56202
56240
|
const javaRead = javaSpecs.length ? await readJavaModuleSpecs(javaSpecs, sdk.root, await ensureToolchain(toolchain)) : null;
|
|
56203
56241
|
const java = javaRead && javaRead.specs.some((spec) => !spec.application) ? { ...javaRead, specs: javaRead.specs.filter((spec) => !spec.application) } : null;
|
|
56204
56242
|
const applicationJava = javaRead?.specs.filter((spec) => spec.application) ?? [];
|
|
@@ -56226,7 +56264,7 @@ async function compileKotlin(input, origin) {
|
|
|
56226
56264
|
};
|
|
56227
56265
|
const inputs = sources.map((file) => ({
|
|
56228
56266
|
file,
|
|
56229
|
-
bytes:
|
|
56267
|
+
bytes: import_node_fs122.default.readFileSync(file)
|
|
56230
56268
|
}));
|
|
56231
56269
|
const digest3 = (0, import_node_crypto63.createHash)("sha256");
|
|
56232
56270
|
digest3.update(
|
|
@@ -56241,7 +56279,7 @@ async function compileKotlin(input, origin) {
|
|
|
56241
56279
|
})
|
|
56242
56280
|
);
|
|
56243
56281
|
for (const { file, bytes } of inputs)
|
|
56244
|
-
digest3.update(
|
|
56282
|
+
digest3.update(import_node_path124.default.relative(root, file)).update("\0").update(bytes).update("\0");
|
|
56245
56283
|
if (viewModels) digest3.update(viewModels.toolClass);
|
|
56246
56284
|
for (const [name3, text6] of Object.entries(generated))
|
|
56247
56285
|
digest3.update(`${name3}\0${text6}\0`);
|
|
@@ -56250,39 +56288,39 @@ async function compileKotlin(input, origin) {
|
|
|
56250
56288
|
url: `${origin}${KOTLIN_ARTIFACT_PREFIX}${hash}/app.mjs`,
|
|
56251
56289
|
hash
|
|
56252
56290
|
};
|
|
56253
|
-
const out =
|
|
56254
|
-
if (
|
|
56291
|
+
const out = import_node_path124.default.join(buildsDir(), hash);
|
|
56292
|
+
if (import_node_fs122.default.existsSync(import_node_path124.default.join(out, "js", "app.wasm"))) return artifact;
|
|
56255
56293
|
const pending = builds.get(hash);
|
|
56256
56294
|
if (pending) return pending;
|
|
56257
56295
|
const build = (async () => {
|
|
56258
56296
|
const ready = await ensureToolchain(toolchain);
|
|
56259
56297
|
const { kotlinc } = ready;
|
|
56260
56298
|
const libraries = [...ready.libraries, sdkLibrary];
|
|
56261
|
-
const composeRuntime =
|
|
56299
|
+
const composeRuntime = import_node_path124.default.join(
|
|
56262
56300
|
kotlinHome(),
|
|
56263
56301
|
toolchain.compiler.version,
|
|
56264
56302
|
toolchain.composeRuntime.name
|
|
56265
56303
|
);
|
|
56266
56304
|
if (usesCompose) {
|
|
56267
56305
|
for (const library of toolchain.composeLibraries) {
|
|
56268
|
-
const target =
|
|
56306
|
+
const target = import_node_path124.default.join(kotlinHome(), toolchain.compiler.version, library.name);
|
|
56269
56307
|
await fetchVerified(library, target);
|
|
56270
56308
|
libraries.push(target);
|
|
56271
56309
|
}
|
|
56272
56310
|
await fetchVerified(toolchain.composeRuntime, composeRuntime);
|
|
56273
56311
|
}
|
|
56274
|
-
|
|
56275
|
-
const work =
|
|
56276
|
-
const javaLibrary = java ?
|
|
56312
|
+
import_node_fs122.default.mkdirSync(buildsDir(), { recursive: true });
|
|
56313
|
+
const work = import_node_fs122.default.mkdtempSync(import_node_path124.default.join(buildsDir(), `${hash}-`));
|
|
56314
|
+
const javaLibrary = java ? import_node_path124.default.join(work, "java-abi", "java-abi.klib") : null;
|
|
56277
56315
|
if (javaLibrary) libraries.push(javaLibrary);
|
|
56278
|
-
const generatedDir =
|
|
56279
|
-
|
|
56316
|
+
const generatedDir = import_node_path124.default.join(work, "generated");
|
|
56317
|
+
import_node_fs122.default.mkdirSync(generatedDir);
|
|
56280
56318
|
for (const [name3, text6] of Object.entries(generated))
|
|
56281
|
-
|
|
56319
|
+
import_node_fs122.default.writeFileSync(import_node_path124.default.join(generatedDir, name3), text6);
|
|
56282
56320
|
const compiledSources = inputs.map(({ file, bytes }, index) => {
|
|
56283
|
-
const target =
|
|
56284
|
-
|
|
56285
|
-
|
|
56321
|
+
const target = import_node_path124.default.join(work, "sources", String(index), import_node_path124.default.basename(file));
|
|
56322
|
+
import_node_fs122.default.mkdirSync(import_node_path124.default.dirname(target), { recursive: true });
|
|
56323
|
+
import_node_fs122.default.writeFileSync(target, bytes);
|
|
56286
56324
|
return { file, target };
|
|
56287
56325
|
});
|
|
56288
56326
|
const common = [
|
|
@@ -56291,19 +56329,19 @@ async function compileKotlin(input, origin) {
|
|
|
56291
56329
|
"-Xallow-kotlin-package",
|
|
56292
56330
|
"-Xwasm-target=js",
|
|
56293
56331
|
"-libraries",
|
|
56294
|
-
libraries.join(
|
|
56332
|
+
libraries.join(import_node_path124.default.delimiter)
|
|
56295
56333
|
];
|
|
56296
56334
|
const compileKlib = (outputDir) => run12(
|
|
56297
56335
|
kotlinc,
|
|
56298
56336
|
[
|
|
56299
56337
|
...common,
|
|
56300
56338
|
`-Xplugin=${plugin}`,
|
|
56301
|
-
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(
|
|
56339
|
+
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path124.default.delimiter)}`,
|
|
56302
56340
|
...usesCompose ? [
|
|
56303
|
-
`-Xplugin=${
|
|
56341
|
+
`-Xplugin=${import_node_path124.default.resolve(import_node_path124.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
|
|
56304
56342
|
] : [],
|
|
56305
56343
|
...usesSerialization ? [
|
|
56306
|
-
`-Xplugin=${
|
|
56344
|
+
`-Xplugin=${import_node_path124.default.resolve(import_node_path124.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
|
|
56307
56345
|
] : [],
|
|
56308
56346
|
"-language-version",
|
|
56309
56347
|
language,
|
|
@@ -56316,7 +56354,7 @@ async function compileKotlin(input, origin) {
|
|
|
56316
56354
|
"-ir-output-name",
|
|
56317
56355
|
"app",
|
|
56318
56356
|
...compiledSources.map(({ target }) => target),
|
|
56319
|
-
...Object.keys(generated).map((name3) =>
|
|
56357
|
+
...Object.keys(generated).map((name3) => import_node_path124.default.join(generatedDir, name3))
|
|
56320
56358
|
],
|
|
56321
56359
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
56322
56360
|
);
|
|
@@ -56335,36 +56373,36 @@ async function compileKotlin(input, origin) {
|
|
|
56335
56373
|
if (viewModels && inputs.some(
|
|
56336
56374
|
({ file, bytes }) => sources.includes(file) && bytes.includes("ViewModel")
|
|
56337
56375
|
)) {
|
|
56338
|
-
await compileKlib(
|
|
56376
|
+
await compileKlib(import_node_path124.default.join(work, "abi"));
|
|
56339
56377
|
const { stdout } = await run12(
|
|
56340
|
-
|
|
56378
|
+
import_node_path124.default.join(import_node_path124.default.dirname(kotlinc), "kotlin"),
|
|
56341
56379
|
[
|
|
56342
56380
|
"-cp",
|
|
56343
56381
|
[
|
|
56344
|
-
|
|
56345
|
-
|
|
56346
|
-
].join(
|
|
56382
|
+
import_node_path124.default.resolve(import_node_path124.default.dirname(kotlinc), "../lib/kotlin-compiler.jar"),
|
|
56383
|
+
import_node_path124.default.join(sdk.root, "tools.jar")
|
|
56384
|
+
].join(import_node_path124.default.delimiter),
|
|
56347
56385
|
viewModels.toolClass,
|
|
56348
|
-
|
|
56386
|
+
import_node_path124.default.join(work, "abi")
|
|
56349
56387
|
],
|
|
56350
56388
|
{ maxBuffer: 64 * 1024 * 1024 }
|
|
56351
56389
|
);
|
|
56352
|
-
|
|
56353
|
-
|
|
56390
|
+
import_node_fs122.default.writeFileSync(
|
|
56391
|
+
import_node_path124.default.join(generatedDir, viewModels.file),
|
|
56354
56392
|
viewModels.render(viewModelClasses(readAbiClasses(stdout)))
|
|
56355
56393
|
);
|
|
56356
56394
|
}
|
|
56357
|
-
await compileKlib(
|
|
56395
|
+
await compileKlib(import_node_path124.default.join(work, "klib"));
|
|
56358
56396
|
await run12(
|
|
56359
56397
|
kotlinc,
|
|
56360
56398
|
[
|
|
56361
56399
|
...common,
|
|
56362
56400
|
"-nowarn",
|
|
56363
56401
|
"-Xpartial-linkage-loglevel=error",
|
|
56364
|
-
`-Xinclude=${
|
|
56402
|
+
`-Xinclude=${import_node_path124.default.join(work, "klib")}`,
|
|
56365
56403
|
"-Xir-produce-js",
|
|
56366
56404
|
"-ir-output-dir",
|
|
56367
|
-
|
|
56405
|
+
import_node_path124.default.join(work, "js"),
|
|
56368
56406
|
"-ir-output-name",
|
|
56369
56407
|
"app"
|
|
56370
56408
|
],
|
|
@@ -56377,10 +56415,10 @@ async function compileKotlin(input, origin) {
|
|
|
56377
56415
|
composeRuntime,
|
|
56378
56416
|
"skiko.mjs",
|
|
56379
56417
|
"-d",
|
|
56380
|
-
|
|
56418
|
+
import_node_path124.default.join(work, "js")
|
|
56381
56419
|
]);
|
|
56382
|
-
const skikoPath =
|
|
56383
|
-
const upstream = (0, import_acorn3.parse)(
|
|
56420
|
+
const skikoPath = import_node_path124.default.join(work, "js", "skiko.mjs");
|
|
56421
|
+
const upstream = (0, import_acorn3.parse)(import_node_fs122.default.readFileSync(skikoPath, "utf8"), {
|
|
56384
56422
|
ecmaVersion: "latest",
|
|
56385
56423
|
sourceType: "module"
|
|
56386
56424
|
});
|
|
@@ -56403,7 +56441,7 @@ async function compileKotlin(input, origin) {
|
|
|
56403
56441
|
"GL",
|
|
56404
56442
|
...bindings
|
|
56405
56443
|
];
|
|
56406
|
-
|
|
56444
|
+
import_node_fs122.default.writeFileSync(
|
|
56407
56445
|
skikoPath,
|
|
56408
56446
|
[
|
|
56409
56447
|
"const runtime = globalThis.__peachKotlinSkiko;",
|
|
@@ -56417,10 +56455,10 @@ async function compileKotlin(input, origin) {
|
|
|
56417
56455
|
if (usesCompose) {
|
|
56418
56456
|
for (const library of toolchain.composeJsLibraries) {
|
|
56419
56457
|
let imported = false;
|
|
56420
|
-
for (const file of
|
|
56458
|
+
for (const file of import_node_fs122.default.readdirSync(import_node_path124.default.join(work, "js"))) {
|
|
56421
56459
|
if (!file.endsWith(".mjs")) continue;
|
|
56422
|
-
const target =
|
|
56423
|
-
const source =
|
|
56460
|
+
const target = import_node_path124.default.join(work, "js", file);
|
|
56461
|
+
const source = import_node_fs122.default.readFileSync(target, "utf8");
|
|
56424
56462
|
let next = source;
|
|
56425
56463
|
for (const quote of ["'", '"'])
|
|
56426
56464
|
next = next.replaceAll(
|
|
@@ -56428,11 +56466,11 @@ async function compileKotlin(input, origin) {
|
|
|
56428
56466
|
`from ${quote}./${library.file}${quote}`
|
|
56429
56467
|
);
|
|
56430
56468
|
if (next === source) continue;
|
|
56431
|
-
|
|
56469
|
+
import_node_fs122.default.writeFileSync(target, next);
|
|
56432
56470
|
imported = true;
|
|
56433
56471
|
}
|
|
56434
56472
|
if (!imported) continue;
|
|
56435
|
-
const archive =
|
|
56473
|
+
const archive = import_node_path124.default.join(
|
|
56436
56474
|
kotlinHome(),
|
|
56437
56475
|
toolchain.compiler.version,
|
|
56438
56476
|
library.name
|
|
@@ -56441,24 +56479,24 @@ async function compileKotlin(input, origin) {
|
|
|
56441
56479
|
const { stdout } = await run12("tar", ["-xOf", archive, library.archiveEntry], {
|
|
56442
56480
|
maxBuffer: 16 * 1024 * 1024
|
|
56443
56481
|
});
|
|
56444
|
-
|
|
56482
|
+
import_node_fs122.default.writeFileSync(import_node_path124.default.join(work, "js", library.file), stdout);
|
|
56445
56483
|
}
|
|
56446
56484
|
}
|
|
56447
56485
|
} catch (error) {
|
|
56448
|
-
|
|
56486
|
+
import_node_fs122.default.rmSync(work, { recursive: true, force: true });
|
|
56449
56487
|
let output2 = isRecord(error) ? `${String(error.stderr ?? "")}${String(error.stdout ?? "")}` : "";
|
|
56450
56488
|
for (const [name3, source] of Object.entries(origins))
|
|
56451
|
-
output2 = output2.replaceAll(
|
|
56489
|
+
output2 = output2.replaceAll(import_node_path124.default.join(generatedDir, name3), source);
|
|
56452
56490
|
for (const [index, spec] of applicationJava.entries())
|
|
56453
56491
|
output2 = output2.replaceAll(
|
|
56454
|
-
|
|
56492
|
+
import_node_path124.default.join(generatedDir, `JavaApplication${index}.kt`),
|
|
56455
56493
|
spec.file
|
|
56456
56494
|
);
|
|
56457
56495
|
for (const { file, target } of compiledSources)
|
|
56458
|
-
output2 = output2.replaceAll(target, file).replaceAll(
|
|
56496
|
+
output2 = output2.replaceAll(target, file).replaceAll(import_node_path124.default.relative(process.cwd(), target), file);
|
|
56459
56497
|
for (const [index, spec] of (java?.specs ?? []).entries())
|
|
56460
56498
|
output2 = output2.replaceAll(
|
|
56461
|
-
|
|
56499
|
+
import_node_path124.default.join(work, "java-abi", `Spec${index}.kt`),
|
|
56462
56500
|
spec.file
|
|
56463
56501
|
);
|
|
56464
56502
|
output2 = output2.replace(
|
|
@@ -56473,9 +56511,9 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
56473
56511
|
const seams = [
|
|
56474
56512
|
["process.release.name", "process.release?.name"]
|
|
56475
56513
|
];
|
|
56476
|
-
const js =
|
|
56514
|
+
const js = import_node_fs122.default.readdirSync(import_node_path124.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
|
|
56477
56515
|
if (js.some(
|
|
56478
|
-
(file) =>
|
|
56516
|
+
(file) => import_node_fs122.default.readFileSync(import_node_path124.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
|
|
56479
56517
|
))
|
|
56480
56518
|
seams.push([
|
|
56481
56519
|
"(typeof(window) !== 'undefined' && window != null && typeof(window.addEventListener) === 'function') ? window : null",
|
|
@@ -56484,12 +56522,12 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
56484
56522
|
for (const [from, to] of seams) {
|
|
56485
56523
|
let patched = 0;
|
|
56486
56524
|
for (const file of js) {
|
|
56487
|
-
const target =
|
|
56488
|
-
const text6 =
|
|
56525
|
+
const target = import_node_path124.default.join(work, "js", file);
|
|
56526
|
+
const text6 = import_node_fs122.default.readFileSync(target, "utf8");
|
|
56489
56527
|
const next = text6.replaceAll(from, to);
|
|
56490
56528
|
if (next !== text6) {
|
|
56491
56529
|
patched++;
|
|
56492
|
-
|
|
56530
|
+
import_node_fs122.default.writeFileSync(target, next);
|
|
56493
56531
|
}
|
|
56494
56532
|
}
|
|
56495
56533
|
if (patched === 0)
|
|
@@ -56497,11 +56535,11 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
56497
56535
|
`kotlin output no longer contains ${from}; recheck how it detects its host in Peach`
|
|
56498
56536
|
);
|
|
56499
56537
|
}
|
|
56500
|
-
const entry =
|
|
56501
|
-
const entrySource2 =
|
|
56502
|
-
const importsPath =
|
|
56538
|
+
const entry = import_node_path124.default.join(work, "js/app.mjs");
|
|
56539
|
+
const entrySource2 = import_node_fs122.default.readFileSync(entry, "utf8");
|
|
56540
|
+
const importsPath = import_node_path124.default.join(work, "js/app.import-object.mjs");
|
|
56503
56541
|
const importsFactory = kotlinInstanceSource(
|
|
56504
|
-
|
|
56542
|
+
import_node_fs122.default.readFileSync(importsPath, "utf8"),
|
|
56505
56543
|
"createKotlinImportObject"
|
|
56506
56544
|
);
|
|
56507
56545
|
const runtimeFactory = kotlinInstanceSource(
|
|
@@ -56509,9 +56547,9 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
56509
56547
|
"createKotlinInstance",
|
|
56510
56548
|
/* @__PURE__ */ new Map([["./app.import-object.mjs", "createKotlinImportObject"]])
|
|
56511
56549
|
);
|
|
56512
|
-
|
|
56513
|
-
|
|
56514
|
-
|
|
56550
|
+
import_node_fs122.default.writeFileSync(importsPath, importsFactory.source);
|
|
56551
|
+
import_node_fs122.default.writeFileSync(import_node_path124.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
|
|
56552
|
+
import_node_fs122.default.writeFileSync(
|
|
56515
56553
|
entry,
|
|
56516
56554
|
[
|
|
56517
56555
|
"import { createKotlinInstance } from './app-runtime.mjs';",
|
|
@@ -56524,10 +56562,10 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
56524
56562
|
].join("\n")
|
|
56525
56563
|
);
|
|
56526
56564
|
try {
|
|
56527
|
-
|
|
56565
|
+
import_node_fs122.default.renameSync(work, out);
|
|
56528
56566
|
} catch (error) {
|
|
56529
|
-
if (!
|
|
56530
|
-
|
|
56567
|
+
if (!import_node_fs122.default.existsSync(import_node_path124.default.join(out, "js", "app.wasm"))) throw error;
|
|
56568
|
+
import_node_fs122.default.rmSync(work, { recursive: true, force: true });
|
|
56531
56569
|
}
|
|
56532
56570
|
return artifact;
|
|
56533
56571
|
})().finally(() => builds.delete(hash));
|
|
@@ -56535,24 +56573,24 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
56535
56573
|
return build;
|
|
56536
56574
|
}
|
|
56537
56575
|
function kotlinArtifactFiles(hash) {
|
|
56538
|
-
const dir =
|
|
56539
|
-
return
|
|
56540
|
-
const contentType2 = CONTENT_TYPES[
|
|
56576
|
+
const dir = import_node_path124.default.join(buildsDir(), hash, "js");
|
|
56577
|
+
return import_node_fs122.default.readdirSync(dir).sort().map((name3) => {
|
|
56578
|
+
const contentType2 = CONTENT_TYPES[import_node_path124.default.extname(name3)];
|
|
56541
56579
|
if (!contentType2) throw new Error(`unexpected kotlin artifact file ${name3}`);
|
|
56542
|
-
return { name: name3, bytes:
|
|
56580
|
+
return { name: name3, bytes: import_node_fs122.default.readFileSync(import_node_path124.default.join(dir, name3)), contentType: contentType2 };
|
|
56543
56581
|
});
|
|
56544
56582
|
}
|
|
56545
56583
|
function serveKotlinArtifact(pathname, res) {
|
|
56546
56584
|
if (!pathname.startsWith(KOTLIN_ARTIFACT_PREFIX)) return false;
|
|
56547
56585
|
const [hash, file, ...rest] = pathname.slice(KOTLIN_ARTIFACT_PREFIX.length).split("/");
|
|
56548
|
-
const type = file ? CONTENT_TYPES[
|
|
56586
|
+
const type = file ? CONTENT_TYPES[import_node_path124.default.extname(file)] : void 0;
|
|
56549
56587
|
if (!hash || !/^[0-9a-f]+$/.test(hash) || !file || rest.length > 0 || !type || file.includes("..")) {
|
|
56550
56588
|
res.statusCode = 404;
|
|
56551
56589
|
res.end("not a kotlin artifact");
|
|
56552
56590
|
return true;
|
|
56553
56591
|
}
|
|
56554
|
-
const target =
|
|
56555
|
-
if (!
|
|
56592
|
+
const target = import_node_path124.default.join(buildsDir(), hash, "js", file);
|
|
56593
|
+
if (!import_node_fs122.default.existsSync(target)) {
|
|
56556
56594
|
res.statusCode = 404;
|
|
56557
56595
|
res.end(`kotlin artifact ${hash}/${file} was not built`);
|
|
56558
56596
|
return true;
|
|
@@ -56560,7 +56598,7 @@ function serveKotlinArtifact(pathname, res) {
|
|
|
56560
56598
|
res.setHeader("access-control-allow-origin", "*");
|
|
56561
56599
|
res.setHeader("content-type", type);
|
|
56562
56600
|
res.setHeader("cache-control", "public, max-age=31536000, immutable");
|
|
56563
|
-
res.end(
|
|
56601
|
+
res.end(import_node_fs122.default.readFileSync(target));
|
|
56564
56602
|
return true;
|
|
56565
56603
|
}
|
|
56566
56604
|
async function serveKotlinRequest(pathname, res, app) {
|
|
@@ -56577,16 +56615,16 @@ async function serveKotlinRequest(pathname, res, app) {
|
|
|
56577
56615
|
}
|
|
56578
56616
|
return true;
|
|
56579
56617
|
}
|
|
56580
|
-
var import_node_child_process55, import_node_crypto63,
|
|
56618
|
+
var import_node_child_process55, import_node_crypto63, import_node_fs122, import_node_module19, import_node_path124, import_node_util22, import_acorn3, run12, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal2, CONTENT_TYPES, KOTLIN_PACKAGE_PATH;
|
|
56581
56619
|
var init_kotlin_host = __esm({
|
|
56582
56620
|
"src/kotlin-host.ts"() {
|
|
56583
56621
|
"use strict";
|
|
56584
56622
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
56585
56623
|
import_node_child_process55 = require("node:child_process");
|
|
56586
56624
|
import_node_crypto63 = require("node:crypto");
|
|
56587
|
-
|
|
56625
|
+
import_node_fs122 = __toESM(require("node:fs"), 1);
|
|
56588
56626
|
import_node_module19 = require("node:module");
|
|
56589
|
-
|
|
56627
|
+
import_node_path124 = __toESM(require("node:path"), 1);
|
|
56590
56628
|
import_node_util22 = require("node:util");
|
|
56591
56629
|
import_acorn3 = require("acorn");
|
|
56592
56630
|
init_android_bridge_packages();
|
|
@@ -56699,8 +56737,8 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
56699
56737
|
for (const project2 of entry.projects) {
|
|
56700
56738
|
if (!isRecord(project2) || typeof project2.sourceDir !== "string" || !Array.isArray(project2.modules))
|
|
56701
56739
|
throw new Error("invalid Expo Android project");
|
|
56702
|
-
const sourceDir =
|
|
56703
|
-
const installed = sourceDir.split(
|
|
56740
|
+
const sourceDir = import_node_fs123.default.realpathSync(project2.sourceDir);
|
|
56741
|
+
const installed = sourceDir.split(import_node_path125.default.sep).includes("node_modules");
|
|
56704
56742
|
if (installed) {
|
|
56705
56743
|
if (typeof entry.packageName !== "string") continue;
|
|
56706
56744
|
if (peachAnsweredNativePackages().has(entry.packageName)) {
|
|
@@ -56727,9 +56765,9 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
56727
56765
|
group.unsupported ??= reason;
|
|
56728
56766
|
};
|
|
56729
56767
|
const walk3 = (dir) => {
|
|
56730
|
-
if (!
|
|
56731
|
-
for (const child of
|
|
56732
|
-
const file =
|
|
56768
|
+
if (!import_node_fs123.default.existsSync(dir)) return;
|
|
56769
|
+
for (const child of import_node_fs123.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
56770
|
+
const file = import_node_path125.default.join(dir, child.name);
|
|
56733
56771
|
if (child.isSymbolicLink()) reject(`Expo Kotlin source is a symlink: ${file}`);
|
|
56734
56772
|
else if (child.isDirectory()) walk3(file);
|
|
56735
56773
|
else if (child.name.endsWith(".java"))
|
|
@@ -56737,8 +56775,8 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
56737
56775
|
else if (child.name.endsWith(".kt")) group.sources.push(file);
|
|
56738
56776
|
}
|
|
56739
56777
|
};
|
|
56740
|
-
walk3(
|
|
56741
|
-
walk3(
|
|
56778
|
+
walk3(import_node_path125.default.join(sourceDir, "src", "main", "java"));
|
|
56779
|
+
walk3(import_node_path125.default.join(sourceDir, "src", "main", "kotlin"));
|
|
56742
56780
|
result.push(group);
|
|
56743
56781
|
}
|
|
56744
56782
|
}
|
|
@@ -56751,7 +56789,7 @@ async function collectBridgePackages(appRoot) {
|
|
|
56751
56789
|
);
|
|
56752
56790
|
const app = androidAppSources(appRoot);
|
|
56753
56791
|
if (!app || !app.kotlin.some(
|
|
56754
|
-
(file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(
|
|
56792
|
+
(file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(import_node_fs123.default.readFileSync(file, "utf8"))
|
|
56755
56793
|
))
|
|
56756
56794
|
return dependencies;
|
|
56757
56795
|
const { scanBridgeFiles: scanBridgeFiles2 } = await Promise.resolve().then(() => (init_kotlin_host(), kotlin_host_exports));
|
|
@@ -56866,7 +56904,7 @@ async function handleExpoKotlinRequest(req, res) {
|
|
|
56866
56904
|
return true;
|
|
56867
56905
|
}
|
|
56868
56906
|
const root = url.searchParams.get("root");
|
|
56869
|
-
if (!root || !
|
|
56907
|
+
if (!root || !import_node_path125.default.isAbsolute(root)) {
|
|
56870
56908
|
res.writeHead(400);
|
|
56871
56909
|
res.end("missing absolute app root");
|
|
56872
56910
|
return true;
|
|
@@ -56897,13 +56935,13 @@ async function handleExpoKotlinRequest(req, res) {
|
|
|
56897
56935
|
}
|
|
56898
56936
|
return true;
|
|
56899
56937
|
}
|
|
56900
|
-
var
|
|
56938
|
+
var import_node_fs123, import_node_path125, EXPO_KOTLIN_ROUTE, compiling2;
|
|
56901
56939
|
var init_expo_kotlin_host = __esm({
|
|
56902
56940
|
"src/expo-kotlin-host.ts"() {
|
|
56903
56941
|
"use strict";
|
|
56904
56942
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
56905
|
-
|
|
56906
|
-
|
|
56943
|
+
import_node_fs123 = __toESM(require("node:fs"), 1);
|
|
56944
|
+
import_node_path125 = __toESM(require("node:path"), 1);
|
|
56907
56945
|
init_android_autolinking();
|
|
56908
56946
|
init_android_bridge_dependencies();
|
|
56909
56947
|
init_android_bridge_packages();
|
|
@@ -56926,14 +56964,14 @@ function sharedDesktopAuthAccounts(user) {
|
|
|
56926
56964
|
function getBaseDir() {
|
|
56927
56965
|
const explicit = process.env[SESSION_FILE_ENV];
|
|
56928
56966
|
if (explicit?.trim()) {
|
|
56929
|
-
return (0,
|
|
56967
|
+
return (0, import_node_path126.dirname)((0, import_node_path126.resolve)(explicit));
|
|
56930
56968
|
}
|
|
56931
56969
|
return electronUserDataDir();
|
|
56932
56970
|
}
|
|
56933
56971
|
function getSharedDesktopAuthFilePath() {
|
|
56934
56972
|
const explicit = process.env[SESSION_FILE_ENV];
|
|
56935
|
-
if (explicit?.trim()) return (0,
|
|
56936
|
-
return (0,
|
|
56973
|
+
if (explicit?.trim()) return (0, import_node_path126.resolve)(explicit);
|
|
56974
|
+
return (0, import_node_path126.join)(getBaseDir(), "desktop-auth.json");
|
|
56937
56975
|
}
|
|
56938
56976
|
function normalizeUser(input) {
|
|
56939
56977
|
if (!input || typeof input !== "object") return null;
|
|
@@ -56983,27 +57021,27 @@ function normalizeSession(input) {
|
|
|
56983
57021
|
}
|
|
56984
57022
|
function readSharedDesktopAuthSession() {
|
|
56985
57023
|
const filepath = getSharedDesktopAuthFilePath();
|
|
56986
|
-
if (!(0,
|
|
57024
|
+
if (!(0, import_node_fs124.existsSync)(filepath)) return null;
|
|
56987
57025
|
try {
|
|
56988
|
-
const parsed = JSON.parse((0,
|
|
57026
|
+
const parsed = JSON.parse((0, import_node_fs124.readFileSync)(filepath, "utf8"));
|
|
56989
57027
|
const normalized = normalizeSession(parsed);
|
|
56990
57028
|
if (!normalized) {
|
|
56991
|
-
(0,
|
|
57029
|
+
(0, import_node_fs124.rmSync)(filepath, { force: true });
|
|
56992
57030
|
return null;
|
|
56993
57031
|
}
|
|
56994
57032
|
return normalized;
|
|
56995
57033
|
} catch {
|
|
56996
|
-
(0,
|
|
57034
|
+
(0, import_node_fs124.rmSync)(filepath, { force: true });
|
|
56997
57035
|
return null;
|
|
56998
57036
|
}
|
|
56999
57037
|
}
|
|
57000
|
-
var
|
|
57038
|
+
var import_node_fs124, import_node_path126, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
|
|
57001
57039
|
var init_shared_session = __esm({
|
|
57002
57040
|
"src/auth/shared-session.ts"() {
|
|
57003
57041
|
"use strict";
|
|
57004
57042
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
57005
|
-
|
|
57006
|
-
|
|
57043
|
+
import_node_fs124 = require("node:fs");
|
|
57044
|
+
import_node_path126 = require("node:path");
|
|
57007
57045
|
init_home_paths();
|
|
57008
57046
|
init_public_brand();
|
|
57009
57047
|
SESSION_VERSION = 1;
|
|
@@ -57039,32 +57077,32 @@ var init_run_rnx = __esm({
|
|
|
57039
57077
|
|
|
57040
57078
|
// cli/secure-file.ts
|
|
57041
57079
|
function writeSecureJsonAtomic(filepath, value) {
|
|
57042
|
-
(0,
|
|
57080
|
+
(0, import_node_fs125.mkdirSync)((0, import_node_path127.dirname)(filepath), { recursive: true });
|
|
57043
57081
|
const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto64.randomUUID)()}`;
|
|
57044
57082
|
let descriptor = null;
|
|
57045
57083
|
try {
|
|
57046
|
-
descriptor = (0,
|
|
57047
|
-
(0,
|
|
57048
|
-
(0,
|
|
57084
|
+
descriptor = (0, import_node_fs125.openSync)(temporary, "wx", 384);
|
|
57085
|
+
(0, import_node_fs125.fchmodSync)(descriptor, 384);
|
|
57086
|
+
(0, import_node_fs125.writeFileSync)(descriptor, `${JSON.stringify(value, null, 2)}
|
|
57049
57087
|
`);
|
|
57050
|
-
(0,
|
|
57051
|
-
(0,
|
|
57088
|
+
(0, import_node_fs125.fsyncSync)(descriptor);
|
|
57089
|
+
(0, import_node_fs125.closeSync)(descriptor);
|
|
57052
57090
|
descriptor = null;
|
|
57053
|
-
(0,
|
|
57091
|
+
(0, import_node_fs125.renameSync)(temporary, filepath);
|
|
57054
57092
|
} catch (error) {
|
|
57055
|
-
if (descriptor !== null) (0,
|
|
57056
|
-
(0,
|
|
57093
|
+
if (descriptor !== null) (0, import_node_fs125.closeSync)(descriptor);
|
|
57094
|
+
(0, import_node_fs125.rmSync)(temporary, { force: true });
|
|
57057
57095
|
throw error;
|
|
57058
57096
|
}
|
|
57059
57097
|
}
|
|
57060
|
-
var import_node_crypto64,
|
|
57098
|
+
var import_node_crypto64, import_node_fs125, import_node_path127;
|
|
57061
57099
|
var init_secure_file = __esm({
|
|
57062
57100
|
"cli/secure-file.ts"() {
|
|
57063
57101
|
"use strict";
|
|
57064
57102
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
57065
57103
|
import_node_crypto64 = require("node:crypto");
|
|
57066
|
-
|
|
57067
|
-
|
|
57104
|
+
import_node_fs125 = require("node:fs");
|
|
57105
|
+
import_node_path127 = require("node:path");
|
|
57068
57106
|
}
|
|
57069
57107
|
});
|
|
57070
57108
|
|
|
@@ -57113,25 +57151,25 @@ function isCliApiKeySecret(secret) {
|
|
|
57113
57151
|
return secret.startsWith("sk_rnx_");
|
|
57114
57152
|
}
|
|
57115
57153
|
function savedApiKeyFile() {
|
|
57116
|
-
return
|
|
57154
|
+
return import_node_path128.default.join(rnxHomeDir(), "api-key.json");
|
|
57117
57155
|
}
|
|
57118
57156
|
function readApiKeyFile(file) {
|
|
57119
|
-
if (!(0,
|
|
57120
|
-
const secret = (0,
|
|
57157
|
+
if (!(0, import_node_fs126.existsSync)(file)) return null;
|
|
57158
|
+
const secret = (0, import_node_fs126.readFileSync)(file, "utf8").trim();
|
|
57121
57159
|
return isCliApiKeySecret(secret) ? secret : null;
|
|
57122
57160
|
}
|
|
57123
57161
|
function saveApiKey(secret) {
|
|
57124
57162
|
writeSecureJsonAtomic(savedApiKeyFile(), { secret });
|
|
57125
57163
|
}
|
|
57126
57164
|
function forgetApiKey() {
|
|
57127
|
-
if (!(0,
|
|
57128
|
-
(0,
|
|
57165
|
+
if (!(0, import_node_fs126.existsSync)(savedApiKeyFile())) return false;
|
|
57166
|
+
(0, import_node_fs126.rmSync)(savedApiKeyFile());
|
|
57129
57167
|
return true;
|
|
57130
57168
|
}
|
|
57131
57169
|
function readSavedApiKey() {
|
|
57132
|
-
if (!(0,
|
|
57170
|
+
if (!(0, import_node_fs126.existsSync)(savedApiKeyFile())) return null;
|
|
57133
57171
|
const saved = savedKeySchema.safeParse(
|
|
57134
|
-
JSON.parse((0,
|
|
57172
|
+
JSON.parse((0, import_node_fs126.readFileSync)(savedApiKeyFile(), "utf8"))
|
|
57135
57173
|
);
|
|
57136
57174
|
return saved.success && isCliApiKeySecret(saved.data.secret) ? saved.data.secret : null;
|
|
57137
57175
|
}
|
|
@@ -57191,13 +57229,13 @@ function authHeaderOrExit(commandLabel) {
|
|
|
57191
57229
|
);
|
|
57192
57230
|
rnxExit(1);
|
|
57193
57231
|
}
|
|
57194
|
-
var
|
|
57232
|
+
var import_node_fs126, import_node_path128, import_zod, GITHUB_TOKEN_PREFIXES, DOWNLOADED_API_KEY_FILE, savedKeySchema, CHOOSE_ACCOUNT_HINT;
|
|
57195
57233
|
var init_auth = __esm({
|
|
57196
57234
|
"cli/auth.ts"() {
|
|
57197
57235
|
"use strict";
|
|
57198
57236
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
57199
|
-
|
|
57200
|
-
|
|
57237
|
+
import_node_fs126 = require("node:fs");
|
|
57238
|
+
import_node_path128 = __toESM(require("node:path"), 1);
|
|
57201
57239
|
import_zod = require("zod");
|
|
57202
57240
|
init_shared_session();
|
|
57203
57241
|
init_home_paths();
|
|
@@ -58855,8 +58893,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
|
|
|
58855
58893
|
}
|
|
58856
58894
|
const out = [];
|
|
58857
58895
|
for (const dir of dirs) {
|
|
58858
|
-
const
|
|
58859
|
-
if (!out.includes(
|
|
58896
|
+
const path112 = `${dir}/${filename}`;
|
|
58897
|
+
if (!out.includes(path112)) out.push(path112);
|
|
58860
58898
|
}
|
|
58861
58899
|
if (!out.includes(filename)) out.push(filename);
|
|
58862
58900
|
return out;
|
|
@@ -59561,27 +59599,27 @@ function resolveCloudOrigin(value) {
|
|
|
59561
59599
|
return normalizeCloudOrigin(source);
|
|
59562
59600
|
}
|
|
59563
59601
|
function readImmutableBundleSource(bundlePath, command) {
|
|
59564
|
-
const filepath = (0,
|
|
59565
|
-
if ((0,
|
|
59602
|
+
const filepath = (0, import_node_path129.resolve)(bundlePath);
|
|
59603
|
+
if ((0, import_node_path129.extname)(filepath) === ".hbc") {
|
|
59566
59604
|
const platform2 = filepath.includes("/android/") ? "android" : "ios";
|
|
59567
59605
|
throw new Error(
|
|
59568
59606
|
`${command} cannot preview Hermes bytecode (${bundlePath}). Export plain JavaScript with \`npx expo export --platform ${platform2} --no-bytecode\` and preview the .js bundle instead.`
|
|
59569
59607
|
);
|
|
59570
59608
|
}
|
|
59571
|
-
if ((0,
|
|
59609
|
+
if ((0, import_node_path129.extname)(filepath) !== ".js") {
|
|
59572
59610
|
throw new Error(`${command} requires one local .js bundle`);
|
|
59573
59611
|
}
|
|
59574
|
-
const descriptor = (0,
|
|
59612
|
+
const descriptor = (0, import_node_fs127.openSync)(filepath, "r");
|
|
59575
59613
|
try {
|
|
59576
|
-
const before = (0,
|
|
59614
|
+
const before = (0, import_node_fs127.fstatSync)(descriptor, { bigint: true });
|
|
59577
59615
|
if (!before.isFile()) {
|
|
59578
59616
|
throw new Error(`${command} bundle must be a regular local file`);
|
|
59579
59617
|
}
|
|
59580
59618
|
if (before.size <= 0n) {
|
|
59581
59619
|
throw new Error(`${command} bundle is empty`);
|
|
59582
59620
|
}
|
|
59583
|
-
const bytes = (0,
|
|
59584
|
-
const after = (0,
|
|
59621
|
+
const bytes = (0, import_node_fs127.readFileSync)(descriptor);
|
|
59622
|
+
const after = (0, import_node_fs127.fstatSync)(descriptor, { bigint: true });
|
|
59585
59623
|
if (before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeNs !== after.mtimeNs || bytes.length !== Number(before.size)) {
|
|
59586
59624
|
throw new Error(`${command} bundle changed while it was being read`);
|
|
59587
59625
|
}
|
|
@@ -59593,7 +59631,7 @@ function readImmutableBundleSource(bundlePath, command) {
|
|
|
59593
59631
|
}
|
|
59594
59632
|
return source;
|
|
59595
59633
|
} finally {
|
|
59596
|
-
(0,
|
|
59634
|
+
(0, import_node_fs127.closeSync)(descriptor);
|
|
59597
59635
|
}
|
|
59598
59636
|
}
|
|
59599
59637
|
async function fetchBundleSource(bundleUrl, command) {
|
|
@@ -59647,15 +59685,15 @@ async function loadBundleSource(bundleInput, command) {
|
|
|
59647
59685
|
return source;
|
|
59648
59686
|
}
|
|
59649
59687
|
function listMetroAssetDest(assetsPath) {
|
|
59650
|
-
const directory2 = (0,
|
|
59651
|
-
if (!(0,
|
|
59652
|
-
const skipNested = (0,
|
|
59688
|
+
const directory2 = (0, import_node_path129.resolve)(assetsPath);
|
|
59689
|
+
if (!(0, import_node_fs127.existsSync)(directory2)) return { directory: directory2, files: [], truncated: false };
|
|
59690
|
+
const skipNested = (0, import_node_fs127.existsSync)((0, import_node_path129.join)(directory2, "package.json"));
|
|
59653
59691
|
const files2 = [];
|
|
59654
59692
|
let truncated = false;
|
|
59655
59693
|
const walk3 = (dir, prefix) => {
|
|
59656
59694
|
let entries;
|
|
59657
59695
|
try {
|
|
59658
|
-
entries = (0,
|
|
59696
|
+
entries = (0, import_node_fs127.readdirSync)(dir, { withFileTypes: true });
|
|
59659
59697
|
} catch {
|
|
59660
59698
|
return;
|
|
59661
59699
|
}
|
|
@@ -59667,7 +59705,7 @@ function listMetroAssetDest(assetsPath) {
|
|
|
59667
59705
|
if (entry.isDirectory()) {
|
|
59668
59706
|
if (entry.name === ".git") continue;
|
|
59669
59707
|
if (skipNested && PROJECT_ONLY_DIRECTORIES.has(entry.name)) continue;
|
|
59670
|
-
walk3((0,
|
|
59708
|
+
walk3((0, import_node_path129.join)(dir, entry.name), prefix ? `${prefix}/${entry.name}` : entry.name);
|
|
59671
59709
|
} else if (entry.isFile()) {
|
|
59672
59710
|
files2.push(prefix ? `${prefix}/${entry.name}` : entry.name);
|
|
59673
59711
|
}
|
|
@@ -59702,7 +59740,7 @@ function distinctByContent(directory2, options) {
|
|
|
59702
59740
|
for (const relative4 of options) {
|
|
59703
59741
|
let bytes;
|
|
59704
59742
|
try {
|
|
59705
|
-
bytes = (0,
|
|
59743
|
+
bytes = (0, import_node_fs127.readFileSync)((0, import_node_path129.join)(directory2, relative4));
|
|
59706
59744
|
} catch {
|
|
59707
59745
|
continue;
|
|
59708
59746
|
}
|
|
@@ -59747,7 +59785,7 @@ function placeMetroDescriptor(listing, descriptor) {
|
|
|
59747
59785
|
let bytes;
|
|
59748
59786
|
try {
|
|
59749
59787
|
bytes = combination.map(
|
|
59750
|
-
(relative4) => (0,
|
|
59788
|
+
(relative4) => (0, import_node_fs127.readFileSync)((0, import_node_path129.join)(listing.directory, relative4))
|
|
59751
59789
|
);
|
|
59752
59790
|
} catch {
|
|
59753
59791
|
continue;
|
|
@@ -59775,10 +59813,10 @@ function unverifiedContentKey(dest, fileDigests) {
|
|
|
59775
59813
|
return JSON.stringify(
|
|
59776
59814
|
dest.placements.map(
|
|
59777
59815
|
(placement) => placement.verified ? null : [...placement.files].map(([scale, relative4]) => {
|
|
59778
|
-
const file = (0,
|
|
59816
|
+
const file = (0, import_node_path129.join)(dest.directory, relative4);
|
|
59779
59817
|
let digest3 = fileDigests.get(file);
|
|
59780
59818
|
if (digest3 === void 0) {
|
|
59781
|
-
digest3 = (0, import_node_crypto65.createHash)("sha256").update((0,
|
|
59819
|
+
digest3 = (0, import_node_crypto65.createHash)("sha256").update((0, import_node_fs127.readFileSync)(file)).digest("hex");
|
|
59782
59820
|
fileDigests.set(file, digest3);
|
|
59783
59821
|
}
|
|
59784
59822
|
return [scale, digest3];
|
|
@@ -59787,42 +59825,42 @@ function unverifiedContentKey(dest, fileDigests) {
|
|
|
59787
59825
|
);
|
|
59788
59826
|
}
|
|
59789
59827
|
function findExpoExportRoot(bundleDirectory) {
|
|
59790
|
-
let directory2 = (0,
|
|
59828
|
+
let directory2 = (0, import_node_path129.resolve)(bundleDirectory);
|
|
59791
59829
|
for (let depth = 0; depth < 6; depth++) {
|
|
59792
|
-
const metadata = (0,
|
|
59793
|
-
if ((0,
|
|
59830
|
+
const metadata = (0, import_node_path129.join)(directory2, "metadata.json");
|
|
59831
|
+
if ((0, import_node_fs127.existsSync)(metadata) && (0, import_node_fs127.existsSync)((0, import_node_path129.join)(directory2, "assets"))) {
|
|
59794
59832
|
try {
|
|
59795
|
-
if ((0,
|
|
59833
|
+
if ((0, import_node_fs127.readFileSync)(metadata, "utf8").includes('"fileMetadata"')) {
|
|
59796
59834
|
return directory2;
|
|
59797
59835
|
}
|
|
59798
59836
|
} catch {
|
|
59799
59837
|
}
|
|
59800
59838
|
}
|
|
59801
|
-
const parent = (0,
|
|
59839
|
+
const parent = (0, import_node_path129.dirname)(directory2);
|
|
59802
59840
|
if (parent === directory2) return null;
|
|
59803
59841
|
directory2 = parent;
|
|
59804
59842
|
}
|
|
59805
59843
|
return null;
|
|
59806
59844
|
}
|
|
59807
59845
|
function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory) {
|
|
59808
|
-
const bundleDirectory = (0,
|
|
59846
|
+
const bundleDirectory = (0, import_node_path129.dirname)((0, import_node_path129.resolve)(bundlePath));
|
|
59809
59847
|
const expoRoot = assetsDirectory || isRemoteBundleInput(bundlePath) ? null : findExpoExportRoot(bundleDirectory);
|
|
59810
|
-
const candidates = assetsDirectory ? [(0,
|
|
59811
|
-
...expoRoot ? [(0,
|
|
59812
|
-
(0,
|
|
59848
|
+
const candidates = assetsDirectory ? [(0, import_node_path129.resolve)(assetsDirectory)] : [
|
|
59849
|
+
...expoRoot ? [(0, import_node_path129.join)(expoRoot, "assets")] : [],
|
|
59850
|
+
(0, import_node_path129.join)(bundleDirectory, "assets"),
|
|
59813
59851
|
bundleDirectory,
|
|
59814
|
-
(0,
|
|
59852
|
+
(0, import_node_path129.resolve)(bundleDirectory, "..", "assets")
|
|
59815
59853
|
];
|
|
59816
59854
|
const cwd = process.cwd();
|
|
59817
59855
|
let projectDirectory = null;
|
|
59818
59856
|
for (const start of assetsDirectory ? [] : [bundleDirectory, cwd]) {
|
|
59819
|
-
let directory2 = (0,
|
|
59857
|
+
let directory2 = (0, import_node_path129.resolve)(start);
|
|
59820
59858
|
while (true) {
|
|
59821
59859
|
if (detectProject(directory2)?.hasMetroConfig) {
|
|
59822
59860
|
projectDirectory = directory2;
|
|
59823
59861
|
break;
|
|
59824
59862
|
}
|
|
59825
|
-
const parent = (0,
|
|
59863
|
+
const parent = (0, import_node_path129.dirname)(directory2);
|
|
59826
59864
|
if (parent === directory2) break;
|
|
59827
59865
|
directory2 = parent;
|
|
59828
59866
|
}
|
|
@@ -59830,11 +59868,11 @@ function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory)
|
|
|
59830
59868
|
}
|
|
59831
59869
|
if (projectDirectory) {
|
|
59832
59870
|
candidates.push(
|
|
59833
|
-
(0,
|
|
59834
|
-
(0,
|
|
59835
|
-
(0,
|
|
59836
|
-
(0,
|
|
59837
|
-
(0,
|
|
59871
|
+
(0, import_node_path129.join)(projectDirectory, "assets"),
|
|
59872
|
+
(0, import_node_path129.join)(projectDirectory, "dist"),
|
|
59873
|
+
(0, import_node_path129.join)(projectDirectory, "dist", "assets"),
|
|
59874
|
+
(0, import_node_path129.join)(projectDirectory, "build"),
|
|
59875
|
+
(0, import_node_path129.join)(projectDirectory, "build", "assets")
|
|
59838
59876
|
);
|
|
59839
59877
|
}
|
|
59840
59878
|
const searched = [];
|
|
@@ -59842,7 +59880,7 @@ function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory)
|
|
|
59842
59880
|
const stale = [];
|
|
59843
59881
|
let truncated = false;
|
|
59844
59882
|
for (const candidate of candidates) {
|
|
59845
|
-
const directory2 = (0,
|
|
59883
|
+
const directory2 = (0, import_node_path129.resolve)(candidate);
|
|
59846
59884
|
if (searched.includes(directory2)) continue;
|
|
59847
59885
|
searched.push(directory2);
|
|
59848
59886
|
const listing = listMetroAssetDest(directory2);
|
|
@@ -59952,7 +59990,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy, assetsDirecto
|
|
|
59952
59990
|
);
|
|
59953
59991
|
}
|
|
59954
59992
|
const relative4 = placement?.files.get(variant2.scale);
|
|
59955
|
-
if (relative4 && dest) return (0,
|
|
59993
|
+
if (relative4 && dest) return (0, import_node_fs127.readFileSync)((0, import_node_path129.join)(dest.directory, relative4));
|
|
59956
59994
|
if (placement && placement.files.size > 0) return null;
|
|
59957
59995
|
if (placement && placement.ambiguous.length > 0 && dest) {
|
|
59958
59996
|
throw new Error(
|
|
@@ -59981,7 +60019,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy, assetsDirecto
|
|
|
59981
60019
|
);
|
|
59982
60020
|
const classic = metroIosAssetDestRelatives(variant2.descriptor.httpServerLocation, filename)[0] ?? filename;
|
|
59983
60021
|
throw new Error(
|
|
59984
|
-
`${command} could not read ${(0,
|
|
60022
|
+
`${command} could not read ${(0, import_node_path129.join)(dest?.directory ?? ".", classic)} for ${variant2.descriptor.name}.${variant2.descriptor.type} at scale ${variant2.scale}, and has no stand-in for a .${variant2.descriptor.type} asset. Rebuild with \`react-native bundle --assets-dest\`.`
|
|
59985
60023
|
);
|
|
59986
60024
|
});
|
|
59987
60025
|
return {
|
|
@@ -60127,14 +60165,14 @@ async function createCloudBox(options) {
|
|
|
60127
60165
|
warnings: artifact.warnings
|
|
60128
60166
|
};
|
|
60129
60167
|
}
|
|
60130
|
-
var import_node_crypto65,
|
|
60168
|
+
var import_node_crypto65, import_node_fs127, import_node_path129, import_node_vm, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, PREVIEW_COMMAND, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS;
|
|
60131
60169
|
var init_cloud_client = __esm({
|
|
60132
60170
|
"cli/cloud-client.ts"() {
|
|
60133
60171
|
"use strict";
|
|
60134
60172
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60135
60173
|
import_node_crypto65 = require("node:crypto");
|
|
60136
|
-
|
|
60137
|
-
|
|
60174
|
+
import_node_fs127 = require("node:fs");
|
|
60175
|
+
import_node_path129 = require("node:path");
|
|
60138
60176
|
import_node_vm = require("node:vm");
|
|
60139
60177
|
init_metroAssetArtifact();
|
|
60140
60178
|
init_metroCloudArtifact();
|
|
@@ -60300,12 +60338,12 @@ function commandWritesSim(msg) {
|
|
|
60300
60338
|
// src/chromium-admission.ts
|
|
60301
60339
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60302
60340
|
function readChromiumQueue(deps, verified2, own) {
|
|
60303
|
-
const { fs:
|
|
60304
|
-
const dir =
|
|
60341
|
+
const { fs: fs88, os: os17, path: path112, childProcess: childProcess2 } = deps;
|
|
60342
|
+
const dir = path112.join(
|
|
60305
60343
|
process.platform === "win32" ? os17.tmpdir() : "/tmp",
|
|
60306
60344
|
"chromium-admission"
|
|
60307
60345
|
);
|
|
60308
|
-
|
|
60346
|
+
fs88.mkdirSync(dir, { recursive: true });
|
|
60309
60347
|
const limit = Math.max(2, Math.floor(os17.cpus().length / 2));
|
|
60310
60348
|
const live = (entry) => {
|
|
60311
60349
|
const match = /^(\d+)-(\d+)-/.exec(entry);
|
|
@@ -60333,10 +60371,10 @@ function readChromiumQueue(deps, verified2, own) {
|
|
|
60333
60371
|
return same;
|
|
60334
60372
|
};
|
|
60335
60373
|
const tickets = [];
|
|
60336
|
-
for (const entry of
|
|
60374
|
+
for (const entry of fs88.readdirSync(dir)) {
|
|
60337
60375
|
if (entry !== own && !live(entry)) {
|
|
60338
60376
|
try {
|
|
60339
|
-
|
|
60377
|
+
fs88.unlinkSync(path112.join(dir, entry));
|
|
60340
60378
|
} catch {
|
|
60341
60379
|
}
|
|
60342
60380
|
continue;
|
|
@@ -60344,7 +60382,7 @@ function readChromiumQueue(deps, verified2, own) {
|
|
|
60344
60382
|
try {
|
|
60345
60383
|
tickets.push({
|
|
60346
60384
|
entry,
|
|
60347
|
-
created:
|
|
60385
|
+
created: fs88.statSync(path112.join(dir, entry), { bigint: true }).ctimeNs
|
|
60348
60386
|
});
|
|
60349
60387
|
} catch {
|
|
60350
60388
|
}
|
|
@@ -61479,7 +61517,7 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
|
|
|
61479
61517
|
expoModule: moduleDir ? (0, import_node_path14.relative)(appDir, moduleDir) || "." : null,
|
|
61480
61518
|
optional: optional3,
|
|
61481
61519
|
swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
|
|
61482
|
-
(
|
|
61520
|
+
(path112) => path112.endsWith(".swift") && [...(readSmallFile(path112) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
|
|
61483
61521
|
(match) => match[1] === name3
|
|
61484
61522
|
)
|
|
61485
61523
|
) : false,
|
|
@@ -63325,7 +63363,7 @@ init_swift_native_pin();
|
|
|
63325
63363
|
init_xcode_project();
|
|
63326
63364
|
var EXPO_NATIVE_ENTRY_NAME = "ios";
|
|
63327
63365
|
function expoNativeCompilerDigestValue() {
|
|
63328
|
-
return true ? "
|
|
63366
|
+
return true ? "a1caac6e554ff18ecb9954c73f8c6c5dfefe5f660a6ad15ac8c78cb415a579db" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
63329
63367
|
}
|
|
63330
63368
|
var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
|
|
63331
63369
|
function readSources(value) {
|
|
@@ -68190,7 +68228,7 @@ var RNX_RUNTIME_PRODUCT = {
|
|
|
68190
68228
|
id: "peach",
|
|
68191
68229
|
defaultCdnOrigin: DEFAULT_RUNTIME_CDN_ORIGIN,
|
|
68192
68230
|
manifestPath: "/runtimes/manifest.json",
|
|
68193
|
-
tarballPath: (version2) => `/runtimes/sootsim-runtime-${version2}.tar.
|
|
68231
|
+
tarballPath: (version2) => `/runtimes/sootsim-runtime-${version2}.tar.zst`,
|
|
68194
68232
|
// the engine runtime is a static SPA: shell at the root, engine/ and
|
|
68195
68233
|
// engine-tenant/ beneath it. index.html is what the daemon and the
|
|
68196
68234
|
// vite/metro plugins serve, so its absence means the tarball is not one.
|
|
@@ -68210,10 +68248,170 @@ var RNX_RUNTIME_PRODUCT = {
|
|
|
68210
68248
|
};
|
|
68211
68249
|
var rnxRuntime = createRuntimeDelivery(RNX_RUNTIME_PRODUCT);
|
|
68212
68250
|
|
|
68251
|
+
// src/runtime-packs.ts
|
|
68252
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
68253
|
+
var import_node_fs103 = __toESM(require("node:fs"), 1);
|
|
68254
|
+
var import_node_path102 = __toESM(require("node:path"), 1);
|
|
68255
|
+
var import_node_timers2 = require("node:timers");
|
|
68256
|
+
init_src();
|
|
68257
|
+
var inflight = /* @__PURE__ */ new Map();
|
|
68258
|
+
var packsByRoot = /* @__PURE__ */ new Map();
|
|
68259
|
+
var listedByRoot = /* @__PURE__ */ new Map();
|
|
68260
|
+
function listedFiles(runtimeRoot) {
|
|
68261
|
+
let listed = listedByRoot.get(runtimeRoot);
|
|
68262
|
+
if (listed) return listed;
|
|
68263
|
+
listed = /* @__PURE__ */ new Map();
|
|
68264
|
+
for (const [pack, entry] of Object.entries(readPacks(runtimeRoot) ?? {}))
|
|
68265
|
+
for (const file of entry.files ?? []) {
|
|
68266
|
+
const name3 = import_node_path102.default.posix.basename(file);
|
|
68267
|
+
listed.set(name3, [...listed.get(name3) ?? [], { file, pack }]);
|
|
68268
|
+
}
|
|
68269
|
+
listedByRoot.set(runtimeRoot, listed);
|
|
68270
|
+
return listed;
|
|
68271
|
+
}
|
|
68272
|
+
function readPacks(runtimeRoot) {
|
|
68273
|
+
const cached3 = packsByRoot.get(runtimeRoot);
|
|
68274
|
+
if (cached3 !== void 0) return cached3;
|
|
68275
|
+
const file = import_node_path102.default.join(runtimeRoot, RUNTIME_PACKS_FILE);
|
|
68276
|
+
if (!import_node_fs103.default.existsSync(file)) {
|
|
68277
|
+
packsByRoot.set(runtimeRoot, null);
|
|
68278
|
+
return null;
|
|
68279
|
+
}
|
|
68280
|
+
const parsed = JSON.parse(import_node_fs103.default.readFileSync(file, "utf8"));
|
|
68281
|
+
const packs = {};
|
|
68282
|
+
if (typeof parsed !== "object" || parsed === null)
|
|
68283
|
+
throw new Error(`${file} is not an object`);
|
|
68284
|
+
for (const [prefix, entry] of Object.entries(parsed)) {
|
|
68285
|
+
if (typeof entry?.file !== "string" || typeof entry?.sha256 !== "string")
|
|
68286
|
+
throw new Error(`${file} entry ${prefix} lacks file and sha256`);
|
|
68287
|
+
const files2 = entry.files;
|
|
68288
|
+
if (files2 !== void 0 && !(Array.isArray(files2) && files2.every((f) => typeof f === "string")))
|
|
68289
|
+
throw new Error(`${file} entry ${prefix} has files that are not paths`);
|
|
68290
|
+
packs[prefix] = {
|
|
68291
|
+
file: entry.file,
|
|
68292
|
+
sha256: entry.sha256,
|
|
68293
|
+
...files2 ? { files: files2 } : {}
|
|
68294
|
+
};
|
|
68295
|
+
}
|
|
68296
|
+
packsByRoot.set(runtimeRoot, packs);
|
|
68297
|
+
return packs;
|
|
68298
|
+
}
|
|
68299
|
+
async function ensureRuntimePackFor(runtimeRoot, pathname) {
|
|
68300
|
+
warmRuntimePacks(runtimeRoot);
|
|
68301
|
+
const prefix = RUNTIME_PACK_PREFIXES.find(
|
|
68302
|
+
(candidate) => pathname.includes(`/${candidate}`)
|
|
68303
|
+
);
|
|
68304
|
+
if (prefix) {
|
|
68305
|
+
await installNamedPack(runtimeRoot, prefix);
|
|
68306
|
+
return;
|
|
68307
|
+
}
|
|
68308
|
+
const listed = listedFiles(runtimeRoot).get(import_node_path102.default.posix.basename(pathname))?.find(({ file }) => pathname.endsWith(`/${file}`));
|
|
68309
|
+
if (listed) {
|
|
68310
|
+
if (!import_node_fs103.default.existsSync(import_node_path102.default.join(runtimeRoot, listed.file)))
|
|
68311
|
+
await installNamedPack(runtimeRoot, listed.pack);
|
|
68312
|
+
return;
|
|
68313
|
+
}
|
|
68314
|
+
const at = pathname.indexOf(`/${RUNTIME_MERGE_PACK_DIR}`);
|
|
68315
|
+
if (at === -1) return;
|
|
68316
|
+
const tenantDir = import_node_path102.default.join(runtimeRoot, RUNTIME_MERGE_PACK_DIR);
|
|
68317
|
+
const rel = pathname.slice(at + RUNTIME_MERGE_PACK_DIR.length + 1);
|
|
68318
|
+
if (!/\.m?js$/.test(rel) || import_node_fs103.default.existsSync(import_node_path102.default.join(tenantDir, rel))) return;
|
|
68319
|
+
await installNamedPack(runtimeRoot, RUNTIME_MERGE_PACK_DIR);
|
|
68320
|
+
}
|
|
68321
|
+
function installNamedPack(runtimeRoot, name3) {
|
|
68322
|
+
if (name3 === RUNTIME_MERGE_PACK_DIR) {
|
|
68323
|
+
const tenantDir = import_node_path102.default.join(runtimeRoot, RUNTIME_MERGE_PACK_DIR);
|
|
68324
|
+
return mergePack(
|
|
68325
|
+
runtimeRoot,
|
|
68326
|
+
name3,
|
|
68327
|
+
import_node_path102.default.join(tenantDir, RUNTIME_MERGE_PACK_INSTALL),
|
|
68328
|
+
tenantDir
|
|
68329
|
+
);
|
|
68330
|
+
}
|
|
68331
|
+
if (readPacks(runtimeRoot)?.[name3]?.files)
|
|
68332
|
+
return mergePack(
|
|
68333
|
+
runtimeRoot,
|
|
68334
|
+
name3,
|
|
68335
|
+
import_node_path102.default.join(runtimeRoot, `.pack-${name3}`),
|
|
68336
|
+
runtimeRoot
|
|
68337
|
+
);
|
|
68338
|
+
return installPack(runtimeRoot, name3, import_node_path102.default.join(runtimeRoot, name3.slice(0, -1)));
|
|
68339
|
+
}
|
|
68340
|
+
var WARM_DELAY_MS = 3e4;
|
|
68341
|
+
var warming = /* @__PURE__ */ new Set();
|
|
68342
|
+
function warmRuntimePacks(runtimeRoot) {
|
|
68343
|
+
if (warming.has(runtimeRoot)) return;
|
|
68344
|
+
warming.add(runtimeRoot);
|
|
68345
|
+
const warm = async () => {
|
|
68346
|
+
for (const name3 of Object.keys(readPacks(runtimeRoot) ?? {}))
|
|
68347
|
+
if (!await installNamedPack(runtimeRoot, name3)) return;
|
|
68348
|
+
};
|
|
68349
|
+
const schedule = import_node_timers2.setTimeout;
|
|
68350
|
+
schedule(() => void warm(), WARM_DELAY_MS).unref();
|
|
68351
|
+
}
|
|
68352
|
+
async function mergePack(runtimeRoot, name3, installDir, targetDir) {
|
|
68353
|
+
if (import_node_fs103.default.existsSync(import_node_path102.default.join(installDir, RUNTIME_MERGE_PACK_MERGED))) return true;
|
|
68354
|
+
if (!await installPack(runtimeRoot, name3, installDir)) return false;
|
|
68355
|
+
const link = (sub) => {
|
|
68356
|
+
for (const entry of import_node_fs103.default.readdirSync(import_node_path102.default.join(installDir, sub), {
|
|
68357
|
+
withFileTypes: true
|
|
68358
|
+
})) {
|
|
68359
|
+
const child = import_node_path102.default.join(sub, entry.name);
|
|
68360
|
+
if (entry.isDirectory()) {
|
|
68361
|
+
import_node_fs103.default.mkdirSync(import_node_path102.default.join(targetDir, child), { recursive: true });
|
|
68362
|
+
link(child);
|
|
68363
|
+
} else if (entry.name !== RUNTIME_PACK_MARKER) {
|
|
68364
|
+
try {
|
|
68365
|
+
import_node_fs103.default.linkSync(import_node_path102.default.join(installDir, child), import_node_path102.default.join(targetDir, child));
|
|
68366
|
+
} catch (error) {
|
|
68367
|
+
if (!(error instanceof Error && "code" in error && error.code === "EEXIST"))
|
|
68368
|
+
throw error;
|
|
68369
|
+
}
|
|
68370
|
+
}
|
|
68371
|
+
}
|
|
68372
|
+
};
|
|
68373
|
+
try {
|
|
68374
|
+
link("");
|
|
68375
|
+
import_node_fs103.default.writeFileSync(import_node_path102.default.join(installDir, RUNTIME_MERGE_PACK_MERGED), "");
|
|
68376
|
+
return true;
|
|
68377
|
+
} catch (error) {
|
|
68378
|
+
console.error(
|
|
68379
|
+
`[peach] ${name3} pack merge failed: ${error instanceof Error ? error.message : String(error)}`
|
|
68380
|
+
);
|
|
68381
|
+
return false;
|
|
68382
|
+
}
|
|
68383
|
+
}
|
|
68384
|
+
async function installPack(runtimeRoot, prefix, destDir) {
|
|
68385
|
+
const marker = import_node_path102.default.join(destDir, RUNTIME_PACK_MARKER);
|
|
68386
|
+
if (import_node_fs103.default.existsSync(marker)) return true;
|
|
68387
|
+
const pack = readPacks(runtimeRoot)?.[prefix];
|
|
68388
|
+
if (!pack) return true;
|
|
68389
|
+
let install = inflight.get(destDir);
|
|
68390
|
+
if (!install) {
|
|
68391
|
+
const version2 = import_node_path102.default.basename(runtimeRoot);
|
|
68392
|
+
const url = new URL(pack.file, rnxRuntime.tarballUrl(version2));
|
|
68393
|
+
url.searchParams.set("sha256", pack.sha256);
|
|
68394
|
+
install = installVerifiedTarball({
|
|
68395
|
+
url: url.toString(),
|
|
68396
|
+
digest: { algorithm: "sha256", encoding: "hex", value: pack.sha256 },
|
|
68397
|
+
destDir,
|
|
68398
|
+
installedMarker: RUNTIME_PACK_MARKER,
|
|
68399
|
+
label: `peach runtime ${version2} pack ${prefix}`
|
|
68400
|
+
}).catch((error) => {
|
|
68401
|
+
console.error(
|
|
68402
|
+
`[peach] ${prefix} pack download failed: ${error instanceof Error ? error.message : String(error)}`
|
|
68403
|
+
);
|
|
68404
|
+
}).finally(() => inflight.delete(destDir));
|
|
68405
|
+
inflight.set(destDir, install);
|
|
68406
|
+
}
|
|
68407
|
+
await install;
|
|
68408
|
+
return import_node_fs103.default.existsSync(marker);
|
|
68409
|
+
}
|
|
68410
|
+
|
|
68213
68411
|
// src/turbo-bundle.ts
|
|
68214
68412
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
68215
68413
|
var import_node_module17 = require("node:module");
|
|
68216
|
-
var
|
|
68414
|
+
var import_node_path103 = __toESM(require("node:path"), 1);
|
|
68217
68415
|
init_installed_native_libraries();
|
|
68218
68416
|
init_swift_distribution();
|
|
68219
68417
|
init_swift_host();
|
|
@@ -68265,8 +68463,8 @@ async function compileTurboApp(appRoot, origin, moduleRoot, iosTarget, prepareRe
|
|
|
68265
68463
|
}
|
|
68266
68464
|
const { artifact, collection } = await compileTurboModule({
|
|
68267
68465
|
appRoot,
|
|
68268
|
-
reactNativeRoot:
|
|
68269
|
-
(0, import_node_module17.createRequire)(
|
|
68466
|
+
reactNativeRoot: import_node_path103.default.dirname(
|
|
68467
|
+
(0, import_node_module17.createRequire)(import_node_path103.default.join(projectRoot, "package.json")).resolve(
|
|
68270
68468
|
"react-native/package.json"
|
|
68271
68469
|
)
|
|
68272
68470
|
),
|
|
@@ -68298,8 +68496,8 @@ var handleTurboRequest = compiledModuleRequestHandler(
|
|
|
68298
68496
|
// src/host/agent-host.ts
|
|
68299
68497
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
68300
68498
|
var import_node_crypto57 = require("node:crypto");
|
|
68301
|
-
var
|
|
68302
|
-
var
|
|
68499
|
+
var import_node_fs108 = __toESM(require("node:fs"), 1);
|
|
68500
|
+
var import_node_path109 = __toESM(require("node:path"), 1);
|
|
68303
68501
|
|
|
68304
68502
|
// scripts/dev-server-scanner.ts
|
|
68305
68503
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -68307,9 +68505,9 @@ var import_child_process = require("child_process");
|
|
|
68307
68505
|
var import_promises11 = require("fs/promises");
|
|
68308
68506
|
var import_http = __toESM(require("http"), 1);
|
|
68309
68507
|
var import_net = __toESM(require("net"), 1);
|
|
68310
|
-
var
|
|
68508
|
+
var import_node_fs105 = require("node:fs");
|
|
68311
68509
|
var import_node_os21 = require("node:os");
|
|
68312
|
-
var
|
|
68510
|
+
var import_node_path106 = require("node:path");
|
|
68313
68511
|
init_backend_origin();
|
|
68314
68512
|
|
|
68315
68513
|
// src/dev-bundle-resolution.ts
|
|
@@ -68577,7 +68775,7 @@ function configuredWidgetFromScan(value, bundleUrl) {
|
|
|
68577
68775
|
// src/settings-bundle.ts
|
|
68578
68776
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
68579
68777
|
var import_promises10 = require("node:fs/promises");
|
|
68580
|
-
var
|
|
68778
|
+
var import_node_path104 = require("node:path");
|
|
68581
68779
|
init_is_record();
|
|
68582
68780
|
init_plist();
|
|
68583
68781
|
var MAX_PLIST_BYTES = 1048576;
|
|
@@ -68658,9 +68856,9 @@ function safeChildPlistName(value) {
|
|
|
68658
68856
|
name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
|
|
68659
68857
|
};
|
|
68660
68858
|
}
|
|
68661
|
-
async function readableSettingsBundle(
|
|
68859
|
+
async function readableSettingsBundle(path112) {
|
|
68662
68860
|
try {
|
|
68663
|
-
const root = await (0, import_promises10.stat)((0,
|
|
68861
|
+
const root = await (0, import_promises10.stat)((0, import_node_path104.join)(path112, "Root.plist"));
|
|
68664
68862
|
return root.isFile() && root.size <= MAX_PLIST_BYTES;
|
|
68665
68863
|
} catch {
|
|
68666
68864
|
return false;
|
|
@@ -68668,18 +68866,18 @@ async function readableSettingsBundle(path111) {
|
|
|
68668
68866
|
}
|
|
68669
68867
|
async function findSettingsBundle(projectRoot) {
|
|
68670
68868
|
const directCandidates = [
|
|
68671
|
-
(0,
|
|
68672
|
-
(0,
|
|
68869
|
+
(0, import_node_path104.join)(projectRoot, "Settings.bundle"),
|
|
68870
|
+
(0, import_node_path104.join)(projectRoot, "ios", "Settings.bundle")
|
|
68673
68871
|
];
|
|
68674
68872
|
for (const candidate of directCandidates) {
|
|
68675
68873
|
if (await readableSettingsBundle(candidate)) return candidate;
|
|
68676
68874
|
}
|
|
68677
68875
|
try {
|
|
68678
|
-
const iosRoot = (0,
|
|
68876
|
+
const iosRoot = (0, import_node_path104.join)(projectRoot, "ios");
|
|
68679
68877
|
const children = await (0, import_promises10.readdir)(iosRoot, { withFileTypes: true });
|
|
68680
68878
|
const candidates = children.filter(
|
|
68681
68879
|
(entry) => entry.isDirectory() && entry.name !== "Pods" && entry.name !== "build" && !entry.name.startsWith(".")
|
|
68682
|
-
).map((entry) => (0,
|
|
68880
|
+
).map((entry) => (0, import_node_path104.join)(iosRoot, entry.name, "Settings.bundle")).sort();
|
|
68683
68881
|
for (const candidate of candidates) {
|
|
68684
68882
|
if (await readableSettingsBundle(candidate)) return candidate;
|
|
68685
68883
|
}
|
|
@@ -68694,7 +68892,7 @@ async function settingsBundleFingerprint(bundlePath) {
|
|
|
68694
68892
|
if (names.length === 0 || names.length > MAX_PLIST_FILES) return null;
|
|
68695
68893
|
const parts = await Promise.all(
|
|
68696
68894
|
names.map(async (name3) => {
|
|
68697
|
-
const metadata = await (0, import_promises10.stat)((0,
|
|
68895
|
+
const metadata = await (0, import_promises10.stat)((0, import_node_path104.join)(bundlePath, name3));
|
|
68698
68896
|
if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
|
|
68699
68897
|
return `${name3}:${metadata.size}:${metadata.mtimeMs}:${metadata.ctimeMs}`;
|
|
68700
68898
|
})
|
|
@@ -68705,11 +68903,11 @@ async function settingsBundleFingerprint(bundlePath) {
|
|
|
68705
68903
|
return null;
|
|
68706
68904
|
}
|
|
68707
68905
|
}
|
|
68708
|
-
async function parsePlistRecord(
|
|
68906
|
+
async function parsePlistRecord(path112) {
|
|
68709
68907
|
try {
|
|
68710
|
-
const metadata = await (0, import_promises10.stat)(
|
|
68908
|
+
const metadata = await (0, import_promises10.stat)(path112);
|
|
68711
68909
|
if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
|
|
68712
|
-
const source = await (0, import_promises10.readFile)(
|
|
68910
|
+
const source = await (0, import_promises10.readFile)(path112, "utf8");
|
|
68713
68911
|
const parsed = parsePlistSource(source);
|
|
68714
68912
|
return isRecord(parsed) ? parsed : null;
|
|
68715
68913
|
} catch {
|
|
@@ -68858,7 +69056,7 @@ async function parseSpecifierFile(fileName, context) {
|
|
|
68858
69056
|
return null;
|
|
68859
69057
|
}
|
|
68860
69058
|
context.budget.files += 1;
|
|
68861
|
-
const root = await parsePlistRecord((0,
|
|
69059
|
+
const root = await parsePlistRecord((0, import_node_path104.join)(context.bundlePath, fileName));
|
|
68862
69060
|
if (!root || !Array.isArray(root.PreferenceSpecifiers)) {
|
|
68863
69061
|
context.fileCache.set(fileName, null);
|
|
68864
69062
|
return null;
|
|
@@ -68912,8 +69110,8 @@ function parseSwiftHostDiscovery(value) {
|
|
|
68912
69110
|
|
|
68913
69111
|
// scripts/dev-server-scanner.ts
|
|
68914
69112
|
init_optional_demo_registry();
|
|
68915
|
-
var LISTENER_LOCK_PATH = (0,
|
|
68916
|
-
var LISTENER_RESULT_PATH = (0,
|
|
69113
|
+
var LISTENER_LOCK_PATH = (0, import_node_path106.join)((0, import_node_os21.tmpdir)(), "peach-listener-scan.lock");
|
|
69114
|
+
var LISTENER_RESULT_PATH = (0, import_node_path106.join)((0, import_node_os21.tmpdir)(), "peach-listener-scan.result");
|
|
68917
69115
|
var LISTENER_LOCK_STALE_MS = 25e3;
|
|
68918
69116
|
var LISTENER_LOCK_WAIT_MS = 8e3;
|
|
68919
69117
|
function sleep3(ms) {
|
|
@@ -68931,8 +69129,8 @@ function pidIsAlive(pid) {
|
|
|
68931
69129
|
}
|
|
68932
69130
|
function readLockOwner() {
|
|
68933
69131
|
try {
|
|
68934
|
-
const raw2 = (0,
|
|
68935
|
-
const mtimeMs = (0,
|
|
69132
|
+
const raw2 = (0, import_node_fs105.readFileSync)(LISTENER_LOCK_PATH, "utf8");
|
|
69133
|
+
const mtimeMs = (0, import_node_fs105.statSync)(LISTENER_LOCK_PATH).mtimeMs;
|
|
68936
69134
|
const pid = Number(raw2.split("-")[0]);
|
|
68937
69135
|
return { raw: raw2, pid: Number.isInteger(pid) ? pid : -1, mtimeMs };
|
|
68938
69136
|
} catch {
|
|
@@ -68945,15 +69143,15 @@ function lockIsAbandoned(owner) {
|
|
|
68945
69143
|
}
|
|
68946
69144
|
function clearLock(raw2) {
|
|
68947
69145
|
try {
|
|
68948
|
-
if ((0,
|
|
68949
|
-
(0,
|
|
69146
|
+
if ((0, import_node_fs105.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw2) return;
|
|
69147
|
+
(0, import_node_fs105.unlinkSync)(LISTENER_LOCK_PATH);
|
|
68950
69148
|
} catch {
|
|
68951
69149
|
}
|
|
68952
69150
|
}
|
|
68953
69151
|
function readResult() {
|
|
68954
69152
|
try {
|
|
68955
69153
|
const parsed = JSON.parse(
|
|
68956
|
-
(0,
|
|
69154
|
+
(0, import_node_fs105.readFileSync)(LISTENER_RESULT_PATH, "utf8")
|
|
68957
69155
|
);
|
|
68958
69156
|
if (!parsed || typeof parsed.token !== "string" || typeof parsed.key !== "string")
|
|
68959
69157
|
return null;
|
|
@@ -68964,8 +69162,8 @@ function readResult() {
|
|
|
68964
69162
|
}
|
|
68965
69163
|
function publishResult(payload) {
|
|
68966
69164
|
const tmp = `${LISTENER_RESULT_PATH}.${process.pid}.tmp`;
|
|
68967
|
-
(0,
|
|
68968
|
-
(0,
|
|
69165
|
+
(0, import_node_fs105.writeFileSync)(tmp, JSON.stringify(payload));
|
|
69166
|
+
(0, import_node_fs105.renameSync)(tmp, LISTENER_RESULT_PATH);
|
|
68969
69167
|
}
|
|
68970
69168
|
function throwPublished(payload) {
|
|
68971
69169
|
throw Object.assign(new Error(payload.message || "listener scan failed"), {
|
|
@@ -69008,7 +69206,7 @@ async function withListenerLock(key2, body) {
|
|
|
69008
69206
|
for (; ; ) {
|
|
69009
69207
|
let fd = null;
|
|
69010
69208
|
try {
|
|
69011
|
-
fd = (0,
|
|
69209
|
+
fd = (0, import_node_fs105.openSync)(LISTENER_LOCK_PATH, "wx");
|
|
69012
69210
|
} catch (error) {
|
|
69013
69211
|
const code = error instanceof Error && "code" in error ? error.code : "";
|
|
69014
69212
|
if (code !== "EEXIST") throw error;
|
|
@@ -69017,7 +69215,7 @@ async function withListenerLock(key2, body) {
|
|
|
69017
69215
|
if (owner) clearLock(owner.raw);
|
|
69018
69216
|
else {
|
|
69019
69217
|
try {
|
|
69020
|
-
(0,
|
|
69218
|
+
(0, import_node_fs105.unlinkSync)(LISTENER_LOCK_PATH);
|
|
69021
69219
|
} catch {
|
|
69022
69220
|
}
|
|
69023
69221
|
}
|
|
@@ -69033,7 +69231,7 @@ async function withListenerLock(key2, body) {
|
|
|
69033
69231
|
}
|
|
69034
69232
|
if (fd === null) continue;
|
|
69035
69233
|
try {
|
|
69036
|
-
(0,
|
|
69234
|
+
(0, import_node_fs105.writeSync)(fd, token);
|
|
69037
69235
|
try {
|
|
69038
69236
|
const value = await body();
|
|
69039
69237
|
publishResult({ token, key: key2, ok: true, value });
|
|
@@ -69050,7 +69248,7 @@ async function withListenerLock(key2, body) {
|
|
|
69050
69248
|
}
|
|
69051
69249
|
} finally {
|
|
69052
69250
|
try {
|
|
69053
|
-
(0,
|
|
69251
|
+
(0, import_node_fs105.closeSync)(fd);
|
|
69054
69252
|
} catch {
|
|
69055
69253
|
}
|
|
69056
69254
|
clearLock(token);
|
|
@@ -69148,7 +69346,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
|
69148
69346
|
return null;
|
|
69149
69347
|
}
|
|
69150
69348
|
}
|
|
69151
|
-
function httpGet(hostname, port,
|
|
69349
|
+
function httpGet(hostname, port, path112, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
69152
69350
|
return new Promise((resolve7) => {
|
|
69153
69351
|
let settled = false;
|
|
69154
69352
|
let killing = false;
|
|
@@ -69157,7 +69355,7 @@ function httpGet(hostname, port, path111, method = "GET", timeout = TIMEOUT_MS,
|
|
|
69157
69355
|
settled = true;
|
|
69158
69356
|
resolve7(value);
|
|
69159
69357
|
};
|
|
69160
|
-
const req = import_http.default.request({ hostname, port, path:
|
|
69358
|
+
const req = import_http.default.request({ hostname, port, path: path112, method, headers }, (res) => {
|
|
69161
69359
|
let body = "";
|
|
69162
69360
|
res.on("data", (c) => body += c.toString());
|
|
69163
69361
|
const contentType2 = (() => {
|
|
@@ -69474,16 +69672,16 @@ function resolveProcessCwd(pid) {
|
|
|
69474
69672
|
});
|
|
69475
69673
|
}
|
|
69476
69674
|
function nativeBundleRoot(projectCwd) {
|
|
69477
|
-
const ios = projectCwd && (0,
|
|
69478
|
-
if (!ios || !(0,
|
|
69675
|
+
const ios = projectCwd && (0, import_node_path106.join)(projectCwd, "ios");
|
|
69676
|
+
if (!ios || !(0, import_node_fs105.existsSync)(ios)) return "index";
|
|
69479
69677
|
const delegates = [
|
|
69480
69678
|
ios,
|
|
69481
|
-
...(0,
|
|
69679
|
+
...(0, import_node_fs105.readdirSync)(ios, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name !== "Pods").map((entry) => (0, import_node_path106.join)(ios, entry.name))
|
|
69482
69680
|
].flatMap(
|
|
69483
|
-
(directory2) => ["AppDelegate.swift", "AppDelegate.mm", "AppDelegate.m"].map((name3) => (0,
|
|
69681
|
+
(directory2) => ["AppDelegate.swift", "AppDelegate.mm", "AppDelegate.m"].map((name3) => (0, import_node_path106.join)(directory2, name3)).filter((file) => (0, import_node_fs105.existsSync)(file))
|
|
69484
69682
|
);
|
|
69485
69683
|
for (const file of delegates) {
|
|
69486
|
-
const root = /BundleRoot:\s*@?"([^"]+)"/.exec((0,
|
|
69684
|
+
const root = /BundleRoot:\s*@?"([^"]+)"/.exec((0, import_node_fs105.readFileSync)(file, "utf8"))?.[1];
|
|
69487
69685
|
if (root) return root;
|
|
69488
69686
|
}
|
|
69489
69687
|
return "index";
|
|
@@ -69507,13 +69705,13 @@ function withRuntimeConfig(port, bundleUrl, projectCwd) {
|
|
|
69507
69705
|
let physicalProjectCwd;
|
|
69508
69706
|
if (projectCwd && demoApps.length > 0) {
|
|
69509
69707
|
try {
|
|
69510
|
-
physicalProjectCwd = (0,
|
|
69708
|
+
physicalProjectCwd = (0, import_node_fs105.realpathSync)((0, import_node_path106.resolve)(projectCwd));
|
|
69511
69709
|
} catch {
|
|
69512
69710
|
}
|
|
69513
69711
|
}
|
|
69514
69712
|
const knownApps = physicalProjectCwd ? demoApps.filter((app) => {
|
|
69515
69713
|
try {
|
|
69516
|
-
return (0,
|
|
69714
|
+
return (0, import_node_fs105.realpathSync)((0, import_node_path106.resolve)(app.dir)) === physicalProjectCwd;
|
|
69517
69715
|
} catch {
|
|
69518
69716
|
return false;
|
|
69519
69717
|
}
|
|
@@ -70020,8 +70218,8 @@ async function scanDevServers(opts = {}) {
|
|
|
70020
70218
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
70021
70219
|
var import_node_child_process49 = require("node:child_process");
|
|
70022
70220
|
var import_node_crypto56 = require("node:crypto");
|
|
70023
|
-
var
|
|
70024
|
-
var
|
|
70221
|
+
var import_node_fs107 = __toESM(require("node:fs"), 1);
|
|
70222
|
+
var import_node_path108 = __toESM(require("node:path"), 1);
|
|
70025
70223
|
var import_node_readline = __toESM(require("node:readline"), 1);
|
|
70026
70224
|
init_self_invocation();
|
|
70027
70225
|
init_standalone();
|
|
@@ -70070,8 +70268,8 @@ function encodeAgentPromptEnvelope(input) {
|
|
|
70070
70268
|
// src/attached-projects.ts
|
|
70071
70269
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
70072
70270
|
var import_node_crypto55 = require("node:crypto");
|
|
70073
|
-
var
|
|
70074
|
-
var
|
|
70271
|
+
var import_node_fs106 = __toESM(require("node:fs"), 1);
|
|
70272
|
+
var import_node_path107 = __toESM(require("node:path"), 1);
|
|
70075
70273
|
init_home_paths();
|
|
70076
70274
|
var overrideDir = null;
|
|
70077
70275
|
function userDataDir() {
|
|
@@ -70084,7 +70282,7 @@ function getUserDataDir() {
|
|
|
70084
70282
|
return userDataDir();
|
|
70085
70283
|
}
|
|
70086
70284
|
function storeFile() {
|
|
70087
|
-
return
|
|
70285
|
+
return import_node_path107.default.join(userDataDir(), "attached-projects.json");
|
|
70088
70286
|
}
|
|
70089
70287
|
function cloneEmpty() {
|
|
70090
70288
|
return {
|
|
@@ -70098,7 +70296,7 @@ function loadStore() {
|
|
|
70098
70296
|
const file = storeFile();
|
|
70099
70297
|
let raw2;
|
|
70100
70298
|
try {
|
|
70101
|
-
raw2 =
|
|
70299
|
+
raw2 = import_node_fs106.default.readFileSync(file, "utf8");
|
|
70102
70300
|
} catch (err) {
|
|
70103
70301
|
if (err.code === "ENOENT") return cloneEmpty();
|
|
70104
70302
|
throw err;
|
|
@@ -70115,7 +70313,7 @@ function loadStore() {
|
|
|
70115
70313
|
} catch (err) {
|
|
70116
70314
|
const quarantine = `${file}.corrupt-${Date.now()}`;
|
|
70117
70315
|
try {
|
|
70118
|
-
|
|
70316
|
+
import_node_fs106.default.renameSync(file, quarantine);
|
|
70119
70317
|
console.warn(
|
|
70120
70318
|
`[sootsim] attached-projects.json was unparseable; quarantined to ${quarantine}. original error: ${err.message}`
|
|
70121
70319
|
);
|
|
@@ -70126,16 +70324,16 @@ function loadStore() {
|
|
|
70126
70324
|
}
|
|
70127
70325
|
function writeStore(store) {
|
|
70128
70326
|
const file = storeFile();
|
|
70129
|
-
|
|
70327
|
+
import_node_fs106.default.mkdirSync(import_node_path107.default.dirname(file), { recursive: true });
|
|
70130
70328
|
const tmp = `${file}.tmp-${process.pid}-${Date.now()}`;
|
|
70131
|
-
const fd =
|
|
70329
|
+
const fd = import_node_fs106.default.openSync(tmp, "w", 384);
|
|
70132
70330
|
try {
|
|
70133
|
-
|
|
70134
|
-
|
|
70331
|
+
import_node_fs106.default.writeFileSync(fd, JSON.stringify(store, null, 2));
|
|
70332
|
+
import_node_fs106.default.fsyncSync(fd);
|
|
70135
70333
|
} finally {
|
|
70136
|
-
|
|
70334
|
+
import_node_fs106.default.closeSync(fd);
|
|
70137
70335
|
}
|
|
70138
|
-
|
|
70336
|
+
import_node_fs106.default.renameSync(tmp, file);
|
|
70139
70337
|
}
|
|
70140
70338
|
function mutateStore(fn) {
|
|
70141
70339
|
const store = loadStore();
|
|
@@ -70144,13 +70342,13 @@ function mutateStore(fn) {
|
|
|
70144
70342
|
return store;
|
|
70145
70343
|
}
|
|
70146
70344
|
function projectIdForCwd(cwd) {
|
|
70147
|
-
return (0, import_node_crypto55.createHash)("sha256").update(
|
|
70345
|
+
return (0, import_node_crypto55.createHash)("sha256").update(import_node_path107.default.resolve(cwd)).digest("hex").slice(0, 16);
|
|
70148
70346
|
}
|
|
70149
70347
|
function newSessionId() {
|
|
70150
70348
|
return `s_${(0, import_node_crypto55.randomBytes)(10).toString("hex")}`;
|
|
70151
70349
|
}
|
|
70152
70350
|
function upsertProject(input) {
|
|
70153
|
-
const cwd =
|
|
70351
|
+
const cwd = import_node_path107.default.resolve(input.cwd);
|
|
70154
70352
|
const id = projectIdForCwd(cwd);
|
|
70155
70353
|
let result;
|
|
70156
70354
|
mutateStore((store) => {
|
|
@@ -70176,7 +70374,7 @@ function upsertProject(input) {
|
|
|
70176
70374
|
const now = Date.now();
|
|
70177
70375
|
const created = {
|
|
70178
70376
|
id,
|
|
70179
|
-
name: input.name ??
|
|
70377
|
+
name: input.name ?? import_node_path107.default.basename(cwd),
|
|
70180
70378
|
cwd,
|
|
70181
70379
|
repoRoot: input.repoRoot,
|
|
70182
70380
|
sourceRoots: input.sourceRoots ?? [cwd],
|
|
@@ -70322,8 +70520,8 @@ async function seedFromDemoAppRegistry() {
|
|
|
70322
70520
|
if (apps.length === 0) return;
|
|
70323
70521
|
mutateStore((store) => {
|
|
70324
70522
|
for (const app of apps) {
|
|
70325
|
-
if (!
|
|
70326
|
-
const cwd =
|
|
70523
|
+
if (!import_node_fs106.default.existsSync(app.dir)) continue;
|
|
70524
|
+
const cwd = import_node_path107.default.resolve(app.dir);
|
|
70327
70525
|
const id = projectIdForCwd(cwd);
|
|
70328
70526
|
if (store.attachedProjects.some((p) => p.id === id)) continue;
|
|
70329
70527
|
const now = Date.now();
|
|
@@ -70348,16 +70546,16 @@ async function seedFromDemoAppRegistry() {
|
|
|
70348
70546
|
// src/agent-sessions.ts
|
|
70349
70547
|
init_public_brand();
|
|
70350
70548
|
function sessionDir(sessionId) {
|
|
70351
|
-
return
|
|
70549
|
+
return import_node_path108.default.join(getUserDataDir(), "sessions", sessionId);
|
|
70352
70550
|
}
|
|
70353
70551
|
function promptFifoPath(sessionId) {
|
|
70354
|
-
return
|
|
70552
|
+
return import_node_path108.default.join(sessionDir(sessionId), "prompt.in");
|
|
70355
70553
|
}
|
|
70356
70554
|
function eventsFifoPath(sessionId) {
|
|
70357
|
-
return
|
|
70555
|
+
return import_node_path108.default.join(sessionDir(sessionId), "events.out");
|
|
70358
70556
|
}
|
|
70359
70557
|
function transcriptPath(sessionId) {
|
|
70360
|
-
return
|
|
70558
|
+
return import_node_path108.default.join(getUserDataDir(), "transcripts", `${sessionId}.log`);
|
|
70361
70559
|
}
|
|
70362
70560
|
function pidIsAlive2(pid, sessionId) {
|
|
70363
70561
|
if (!pid) return false;
|
|
@@ -70367,7 +70565,7 @@ function pidIsAlive2(pid, sessionId) {
|
|
|
70367
70565
|
return false;
|
|
70368
70566
|
}
|
|
70369
70567
|
if (sessionId) {
|
|
70370
|
-
if (!
|
|
70568
|
+
if (!import_node_fs107.default.existsSync(sessionDir(sessionId))) return false;
|
|
70371
70569
|
}
|
|
70372
70570
|
return true;
|
|
70373
70571
|
}
|
|
@@ -70380,11 +70578,11 @@ function resolveSootsimInvocation() {
|
|
|
70380
70578
|
const resourcesPath = process.resourcesPath;
|
|
70381
70579
|
if (resourcesPath) {
|
|
70382
70580
|
const candidates = [
|
|
70383
|
-
|
|
70384
|
-
|
|
70581
|
+
import_node_path108.default.join(resourcesPath, "bin", "sootsim"),
|
|
70582
|
+
import_node_path108.default.join(resourcesPath, "bin", `sootsim-${process.platform}-${process.arch}`)
|
|
70385
70583
|
];
|
|
70386
70584
|
for (const c of candidates) {
|
|
70387
|
-
if (
|
|
70585
|
+
if (import_node_fs107.default.existsSync(c)) return { executable: c, prefixArgs: [] };
|
|
70388
70586
|
}
|
|
70389
70587
|
}
|
|
70390
70588
|
}
|
|
@@ -70403,15 +70601,15 @@ function tryWorkspaceSootsim() {
|
|
|
70403
70601
|
const sootsimDir = resolveSootsimPackageDir();
|
|
70404
70602
|
if (!sootsimDir) return null;
|
|
70405
70603
|
const binaryName = `peach-${process.platform === "win32" ? "windows" : process.platform}-${process.arch}${process.platform === "win32" ? ".exe" : ""}`;
|
|
70406
|
-
const distBinary =
|
|
70407
|
-
if (
|
|
70408
|
-
const distBin =
|
|
70409
|
-
if (
|
|
70604
|
+
const distBinary = import_node_path108.default.join(sootsimDir, "dist-bin", binaryName);
|
|
70605
|
+
if (import_node_fs107.default.existsSync(distBinary)) return { executable: distBinary, prefixArgs: [] };
|
|
70606
|
+
const distBin = import_node_path108.default.join(sootsimDir, "dist-cli", "bin.js");
|
|
70607
|
+
if (import_node_fs107.default.existsSync(distBin)) {
|
|
70410
70608
|
try {
|
|
70411
|
-
const src =
|
|
70412
|
-
if (
|
|
70413
|
-
const srcMtime =
|
|
70414
|
-
const buildMtime =
|
|
70609
|
+
const src = import_node_path108.default.join(sootsimDir, "cli", "commands", "agent-wrapper.ts");
|
|
70610
|
+
if (import_node_fs107.default.existsSync(src)) {
|
|
70611
|
+
const srcMtime = import_node_fs107.default.statSync(src).mtimeMs;
|
|
70612
|
+
const buildMtime = import_node_fs107.default.statSync(distBin).mtimeMs;
|
|
70415
70613
|
if (buildMtime < srcMtime) {
|
|
70416
70614
|
console.warn(
|
|
70417
70615
|
`[peach] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with \`bun run --cwd packages/peachsim build:cli\`.`
|
|
@@ -70430,22 +70628,22 @@ function tryWorkspaceSootsim() {
|
|
|
70430
70628
|
function resolveSootsimPackageDir() {
|
|
70431
70629
|
try {
|
|
70432
70630
|
const resolved = require.resolve(`${rnxPublicBrand.packageName}/package.json`);
|
|
70433
|
-
return
|
|
70631
|
+
return import_node_path108.default.dirname(resolved);
|
|
70434
70632
|
} catch {
|
|
70435
70633
|
}
|
|
70436
70634
|
const here = fileFromImportMeta();
|
|
70437
70635
|
if (!here) return null;
|
|
70438
|
-
let cur =
|
|
70636
|
+
let cur = import_node_path108.default.dirname(here);
|
|
70439
70637
|
for (let i = 0; i < 8; i++) {
|
|
70440
|
-
const pkg =
|
|
70638
|
+
const pkg = import_node_path108.default.join(cur, "package.json");
|
|
70441
70639
|
try {
|
|
70442
|
-
if (
|
|
70443
|
-
const parsed = JSON.parse(
|
|
70640
|
+
if (import_node_fs107.default.existsSync(pkg)) {
|
|
70641
|
+
const parsed = JSON.parse(import_node_fs107.default.readFileSync(pkg, "utf8"));
|
|
70444
70642
|
if (parsed.name === rnxPublicBrand.packageName) return cur;
|
|
70445
70643
|
}
|
|
70446
70644
|
} catch {
|
|
70447
70645
|
}
|
|
70448
|
-
const parent =
|
|
70646
|
+
const parent = import_node_path108.default.dirname(cur);
|
|
70449
70647
|
if (parent === cur) break;
|
|
70450
70648
|
cur = parent;
|
|
70451
70649
|
}
|
|
@@ -70461,28 +70659,28 @@ function fileFromImportMeta() {
|
|
|
70461
70659
|
}
|
|
70462
70660
|
}
|
|
70463
70661
|
async function withStartLock(projectId, provider, fn) {
|
|
70464
|
-
const lockDir =
|
|
70465
|
-
|
|
70662
|
+
const lockDir = import_node_path108.default.join(getUserDataDir(), "locks");
|
|
70663
|
+
import_node_fs107.default.mkdirSync(lockDir, { recursive: true });
|
|
70466
70664
|
try {
|
|
70467
|
-
|
|
70665
|
+
import_node_fs107.default.chmodSync(lockDir, 448);
|
|
70468
70666
|
} catch {
|
|
70469
70667
|
}
|
|
70470
|
-
const lockPath =
|
|
70668
|
+
const lockPath = import_node_path108.default.join(lockDir, `start-${projectId}-${provider}.lock`);
|
|
70471
70669
|
const deadline = Date.now() + 4e3;
|
|
70472
70670
|
let fd = null;
|
|
70473
70671
|
while (fd === null) {
|
|
70474
70672
|
try {
|
|
70475
|
-
fd =
|
|
70673
|
+
fd = import_node_fs107.default.openSync(
|
|
70476
70674
|
lockPath,
|
|
70477
|
-
|
|
70675
|
+
import_node_fs107.constants.O_WRONLY | import_node_fs107.constants.O_CREAT | import_node_fs107.constants.O_EXCL,
|
|
70478
70676
|
384
|
|
70479
70677
|
);
|
|
70480
70678
|
} catch (err) {
|
|
70481
70679
|
if (err.code !== "EEXIST") throw err;
|
|
70482
70680
|
try {
|
|
70483
|
-
const stale = Number(
|
|
70681
|
+
const stale = Number(import_node_fs107.default.readFileSync(lockPath, "utf8").trim());
|
|
70484
70682
|
if (stale && !isProcessAlive(stale)) {
|
|
70485
|
-
|
|
70683
|
+
import_node_fs107.default.unlinkSync(lockPath);
|
|
70486
70684
|
continue;
|
|
70487
70685
|
}
|
|
70488
70686
|
} catch {
|
|
@@ -70496,15 +70694,15 @@ async function withStartLock(projectId, provider, fn) {
|
|
|
70496
70694
|
}
|
|
70497
70695
|
}
|
|
70498
70696
|
try {
|
|
70499
|
-
|
|
70697
|
+
import_node_fs107.default.writeFileSync(fd, String(process.pid));
|
|
70500
70698
|
return await fn();
|
|
70501
70699
|
} finally {
|
|
70502
70700
|
try {
|
|
70503
|
-
|
|
70701
|
+
import_node_fs107.default.closeSync(fd);
|
|
70504
70702
|
} catch {
|
|
70505
70703
|
}
|
|
70506
70704
|
try {
|
|
70507
|
-
|
|
70705
|
+
import_node_fs107.default.unlinkSync(lockPath);
|
|
70508
70706
|
} catch {
|
|
70509
70707
|
}
|
|
70510
70708
|
}
|
|
@@ -70518,25 +70716,25 @@ function isProcessAlive(pid) {
|
|
|
70518
70716
|
}
|
|
70519
70717
|
}
|
|
70520
70718
|
function mkfifoSync(p) {
|
|
70521
|
-
const parent =
|
|
70522
|
-
|
|
70719
|
+
const parent = import_node_path108.default.dirname(p);
|
|
70720
|
+
import_node_fs107.default.mkdirSync(parent, { recursive: true });
|
|
70523
70721
|
try {
|
|
70524
|
-
|
|
70722
|
+
import_node_fs107.default.chmodSync(parent, 448);
|
|
70525
70723
|
} catch {
|
|
70526
70724
|
}
|
|
70527
|
-
if (
|
|
70725
|
+
if (import_node_fs107.default.existsSync(p)) {
|
|
70528
70726
|
try {
|
|
70529
|
-
const stat2 =
|
|
70727
|
+
const stat2 = import_node_fs107.default.statSync(p);
|
|
70530
70728
|
if (stat2.isFIFO()) {
|
|
70531
70729
|
try {
|
|
70532
|
-
|
|
70730
|
+
import_node_fs107.default.chmodSync(p, 384);
|
|
70533
70731
|
} catch {
|
|
70534
70732
|
}
|
|
70535
70733
|
return;
|
|
70536
70734
|
}
|
|
70537
|
-
|
|
70735
|
+
import_node_fs107.default.unlinkSync(p);
|
|
70538
70736
|
} catch {
|
|
70539
|
-
|
|
70737
|
+
import_node_fs107.default.unlinkSync(p);
|
|
70540
70738
|
}
|
|
70541
70739
|
}
|
|
70542
70740
|
const result = (0, import_node_child_process49.spawnSync)("mkfifo", ["-m", "600", p]);
|
|
@@ -70583,10 +70781,10 @@ async function startSession(opts) {
|
|
|
70583
70781
|
const transcript = transcriptPath(session.id);
|
|
70584
70782
|
mkfifoSync(promptIn);
|
|
70585
70783
|
mkfifoSync(eventsOut);
|
|
70586
|
-
const transcriptDir =
|
|
70587
|
-
|
|
70784
|
+
const transcriptDir = import_node_path108.default.dirname(transcript);
|
|
70785
|
+
import_node_fs107.default.mkdirSync(transcriptDir, { recursive: true });
|
|
70588
70786
|
try {
|
|
70589
|
-
|
|
70787
|
+
import_node_fs107.default.chmodSync(transcriptDir, 448);
|
|
70590
70788
|
} catch {
|
|
70591
70789
|
}
|
|
70592
70790
|
const { executable, prefixArgs } = resolveSootsimInvocation();
|
|
@@ -70637,7 +70835,7 @@ async function startSession(opts) {
|
|
|
70637
70835
|
}
|
|
70638
70836
|
}
|
|
70639
70837
|
try {
|
|
70640
|
-
|
|
70838
|
+
import_node_fs107.default.rmSync(sessionDir(session.id), { recursive: true, force: true });
|
|
70641
70839
|
} catch {
|
|
70642
70840
|
}
|
|
70643
70841
|
updateSessionStatus(session.id, { status: "ended" });
|
|
@@ -70665,18 +70863,18 @@ async function sendPrompt(sessionId, prompt) {
|
|
|
70665
70863
|
);
|
|
70666
70864
|
}
|
|
70667
70865
|
const fifo = promptFifoPath(sessionId);
|
|
70668
|
-
if (!
|
|
70866
|
+
if (!import_node_fs107.default.existsSync(fifo)) {
|
|
70669
70867
|
throw new AgentSessionError("NO_FIFO", `prompt FIFO missing: ${fifo}`);
|
|
70670
70868
|
}
|
|
70671
|
-
const fd =
|
|
70869
|
+
const fd = import_node_fs107.default.openSync(fifo, import_node_fs107.constants.O_WRONLY);
|
|
70672
70870
|
try {
|
|
70673
70871
|
const wireText = encodeAgentPromptEnvelope(prompt);
|
|
70674
70872
|
if (!wireText) {
|
|
70675
70873
|
throw new AgentSessionError("EMPTY_PROMPT", "prompt text is empty");
|
|
70676
70874
|
}
|
|
70677
|
-
|
|
70875
|
+
import_node_fs107.default.writeSync(fd, wireText + "\n");
|
|
70678
70876
|
} finally {
|
|
70679
|
-
|
|
70877
|
+
import_node_fs107.default.closeSync(fd);
|
|
70680
70878
|
}
|
|
70681
70879
|
updateSessionStatus(sessionId, {
|
|
70682
70880
|
lastPrompt: prompt.displayText ?? prompt.text,
|
|
@@ -70698,7 +70896,7 @@ async function endSession(sessionId) {
|
|
|
70698
70896
|
const base = getUserDataDir();
|
|
70699
70897
|
if (dir.startsWith(base)) {
|
|
70700
70898
|
try {
|
|
70701
|
-
|
|
70899
|
+
import_node_fs107.default.rmSync(dir, { recursive: true, force: true });
|
|
70702
70900
|
} catch {
|
|
70703
70901
|
}
|
|
70704
70902
|
}
|
|
@@ -70706,11 +70904,11 @@ async function endSession(sessionId) {
|
|
|
70706
70904
|
}
|
|
70707
70905
|
function subscribeEvents(sessionId, onEvent) {
|
|
70708
70906
|
const fifo = eventsFifoPath(sessionId);
|
|
70709
|
-
if (!
|
|
70907
|
+
if (!import_node_fs107.default.existsSync(fifo)) {
|
|
70710
70908
|
throw new AgentSessionError("NO_FIFO", `events FIFO missing: ${fifo}`);
|
|
70711
70909
|
}
|
|
70712
|
-
const fd =
|
|
70713
|
-
const stream =
|
|
70910
|
+
const fd = import_node_fs107.default.openSync(fifo, import_node_fs107.constants.O_RDWR);
|
|
70911
|
+
const stream = import_node_fs107.default.createReadStream("", { fd, autoClose: true });
|
|
70714
70912
|
const rl = import_node_readline.default.createInterface({ input: stream, crlfDelay: Infinity });
|
|
70715
70913
|
rl.on("line", (line) => {
|
|
70716
70914
|
const event = parseAgentEventLine(line);
|
|
@@ -70721,7 +70919,7 @@ function subscribeEvents(sessionId, onEvent) {
|
|
|
70721
70919
|
if (closed) return;
|
|
70722
70920
|
closed = true;
|
|
70723
70921
|
try {
|
|
70724
|
-
|
|
70922
|
+
import_node_fs107.default.writeSync(fd, "\n");
|
|
70725
70923
|
} catch {
|
|
70726
70924
|
}
|
|
70727
70925
|
try {
|
|
@@ -70735,7 +70933,7 @@ function subscribeEvents(sessionId, onEvent) {
|
|
|
70735
70933
|
};
|
|
70736
70934
|
}
|
|
70737
70935
|
async function waitForFirstEvent(fifo, predicate, timeoutMs) {
|
|
70738
|
-
const fd =
|
|
70936
|
+
const fd = import_node_fs107.default.openSync(fifo, import_node_fs107.constants.O_RDWR | import_node_fs107.constants.O_NONBLOCK);
|
|
70739
70937
|
const buf = Buffer.alloc(8192);
|
|
70740
70938
|
let leftover = "";
|
|
70741
70939
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -70743,7 +70941,7 @@ async function waitForFirstEvent(fifo, predicate, timeoutMs) {
|
|
|
70743
70941
|
while (Date.now() < deadline) {
|
|
70744
70942
|
let n = 0;
|
|
70745
70943
|
try {
|
|
70746
|
-
n =
|
|
70944
|
+
n = import_node_fs107.default.readSync(fd, buf, 0, buf.length, null);
|
|
70747
70945
|
} catch (err) {
|
|
70748
70946
|
if (err.code !== "EAGAIN") throw err;
|
|
70749
70947
|
n = 0;
|
|
@@ -70763,7 +70961,7 @@ async function waitForFirstEvent(fifo, predicate, timeoutMs) {
|
|
|
70763
70961
|
}
|
|
70764
70962
|
return null;
|
|
70765
70963
|
} finally {
|
|
70766
|
-
|
|
70964
|
+
import_node_fs107.default.closeSync(fd);
|
|
70767
70965
|
}
|
|
70768
70966
|
}
|
|
70769
70967
|
|
|
@@ -71017,7 +71215,7 @@ var AgentHost = class {
|
|
|
71017
71215
|
);
|
|
71018
71216
|
const project2 = upsertProject({
|
|
71019
71217
|
cwd: match.cwd,
|
|
71020
|
-
name: match.projectName ??
|
|
71218
|
+
name: match.projectName ?? import_node_path109.default.basename(match.cwd),
|
|
71021
71219
|
preferredProvider: input.provider ?? existing?.preferredProvider,
|
|
71022
71220
|
sourceRoots: existing?.sourceRoots ?? [match.cwd],
|
|
71023
71221
|
knownBundleUrls,
|
|
@@ -71028,18 +71226,18 @@ var AgentHost = class {
|
|
|
71028
71226
|
}
|
|
71029
71227
|
getTranscript(sessionId) {
|
|
71030
71228
|
const p = transcriptPath(sessionId);
|
|
71031
|
-
if (!
|
|
71229
|
+
if (!import_node_fs108.default.existsSync(p)) {
|
|
71032
71230
|
return { error: "transcript not found", code: "NO_TRANSCRIPT" };
|
|
71033
71231
|
}
|
|
71034
|
-
return
|
|
71232
|
+
return import_node_fs108.default.readFileSync(p, "utf8");
|
|
71035
71233
|
}
|
|
71036
71234
|
getPaths() {
|
|
71037
71235
|
const dir = getUserDataDir();
|
|
71038
71236
|
return {
|
|
71039
71237
|
userDataDir: dir,
|
|
71040
|
-
storeFile:
|
|
71041
|
-
sessionsDir:
|
|
71042
|
-
transcriptsDir:
|
|
71238
|
+
storeFile: import_node_path109.default.join(dir, "attached-projects.json"),
|
|
71239
|
+
sessionsDir: import_node_path109.default.join(dir, "sessions"),
|
|
71240
|
+
transcriptsDir: import_node_path109.default.join(dir, "transcripts")
|
|
71043
71241
|
};
|
|
71044
71242
|
}
|
|
71045
71243
|
// --- subscription management ---
|
|
@@ -71337,19 +71535,19 @@ function mapFrameworkToProjectFramework(fw) {
|
|
|
71337
71535
|
|
|
71338
71536
|
// src/host/app-package-handler.ts
|
|
71339
71537
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
71340
|
-
var
|
|
71341
|
-
var
|
|
71538
|
+
var import_node_fs109 = __toESM(require("node:fs"), 1);
|
|
71539
|
+
var import_node_path110 = __toESM(require("node:path"), 1);
|
|
71342
71540
|
init_home_paths();
|
|
71343
71541
|
init_is_record();
|
|
71344
71542
|
function readRoutes() {
|
|
71345
71543
|
const file = process.env.PEACH_APP_MANIFEST;
|
|
71346
71544
|
const routes2 = /* @__PURE__ */ new Map();
|
|
71347
71545
|
if (!file) return routes2;
|
|
71348
|
-
const manifest = JSON.parse(
|
|
71546
|
+
const manifest = JSON.parse(import_node_fs109.default.readFileSync(file, "utf8"));
|
|
71349
71547
|
if (!isRecord(manifest) || manifest.schemaVersion !== 1 || !isRecord(manifest.routes))
|
|
71350
71548
|
throw new Error("invalid packaged app manifest");
|
|
71351
71549
|
for (const [route, resource] of Object.entries(manifest.routes)) {
|
|
71352
|
-
if (!route.startsWith("/") || !isRecord(resource) || typeof resource.file !== "string" || !resource.file ||
|
|
71550
|
+
if (!route.startsWith("/") || !isRecord(resource) || typeof resource.file !== "string" || !resource.file || import_node_path110.default.basename(resource.file) !== resource.file || [".", ".."].includes(resource.file) || typeof resource.contentType !== "string" || /[\r\n]/.test(resource.contentType))
|
|
71353
71551
|
throw new Error(`invalid packaged app resource: ${route}`);
|
|
71354
71552
|
routes2.set(route, { file: resource.file, contentType: resource.contentType });
|
|
71355
71553
|
}
|
|
@@ -71360,7 +71558,7 @@ function serveAppPackageResource(req, res) {
|
|
|
71360
71558
|
const resource = routes.get(new URL(req.url ?? "/", "http://localhost").pathname);
|
|
71361
71559
|
if (!resource) return false;
|
|
71362
71560
|
res.setHeader("Content-Type", resource.contentType);
|
|
71363
|
-
const stream =
|
|
71561
|
+
const stream = import_node_fs109.default.createReadStream(import_node_path110.default.join(cacheDir(), "staged", resource.file));
|
|
71364
71562
|
stream.on("error", () => {
|
|
71365
71563
|
res.statusCode = 500;
|
|
71366
71564
|
res.end("packaged resource unavailable");
|
|
@@ -74227,8 +74425,8 @@ init_package_versions();
|
|
|
74227
74425
|
|
|
74228
74426
|
// src/installed-native-build-options.ts
|
|
74229
74427
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
74230
|
-
var
|
|
74231
|
-
var
|
|
74428
|
+
var import_node_fs110 = __toESM(require("node:fs"), 1);
|
|
74429
|
+
var import_node_path111 = __toESM(require("node:path"), 1);
|
|
74232
74430
|
var RIVE_PACKAGE = "@rive-app/react-native";
|
|
74233
74431
|
var RIVE_05 = [">=0.5.0 <0.6.0"];
|
|
74234
74432
|
function missing(error) {
|
|
@@ -74236,11 +74434,11 @@ function missing(error) {
|
|
|
74236
74434
|
}
|
|
74237
74435
|
async function answerAsync(step) {
|
|
74238
74436
|
try {
|
|
74239
|
-
if (step.type === "realpath") return await
|
|
74240
|
-
if (step.type === "read") return await
|
|
74437
|
+
if (step.type === "realpath") return await import_node_fs110.default.promises.realpath(step.path);
|
|
74438
|
+
if (step.type === "read") return await import_node_fs110.default.promises.readFile(step.path, "utf8");
|
|
74241
74439
|
if (step.type === "isDirectory")
|
|
74242
|
-
return (await
|
|
74243
|
-
return (await
|
|
74440
|
+
return (await import_node_fs110.default.promises.stat(step.path)).isDirectory();
|
|
74441
|
+
return (await import_node_fs110.default.promises.readdir(step.path, { withFileTypes: true })).map(
|
|
74244
74442
|
(entry) => ({
|
|
74245
74443
|
name: entry.name,
|
|
74246
74444
|
directory: entry.isDirectory(),
|
|
@@ -74273,7 +74471,7 @@ function* rubyFiles(directory2, seen, iosRoot = false) {
|
|
|
74273
74471
|
const files2 = [];
|
|
74274
74472
|
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
74275
74473
|
if (iosRoot && (entry.name === "Pods" || entry.name === "build")) continue;
|
|
74276
|
-
const target =
|
|
74474
|
+
const target = import_node_path111.default.join(directory2, entry.name);
|
|
74277
74475
|
let isDirectory3 = entry.directory;
|
|
74278
74476
|
if (entry.symbolicLink)
|
|
74279
74477
|
isDirectory3 = (yield { type: "isDirectory", path: target }) === true;
|
|
@@ -74286,7 +74484,7 @@ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
|
|
|
74286
74484
|
let sensorOptions = {};
|
|
74287
74485
|
const sensors = versions["expo-sensors"];
|
|
74288
74486
|
if (sensors && resolveCompatVersionRange([">=58.0.4 <59.0.0"], sensors).status === "matched") {
|
|
74289
|
-
const file =
|
|
74487
|
+
const file = import_node_path111.default.join(projectRoot, "ios", "Podfile.properties.json");
|
|
74290
74488
|
const source = yield { type: "read", path: file };
|
|
74291
74489
|
if (source !== null && typeof source !== "string")
|
|
74292
74490
|
throw new Error(`cannot inspect ${file}`);
|
|
@@ -74302,8 +74500,8 @@ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
|
|
|
74302
74500
|
if (!needsRiveOptions(versions)) return sensorOptions;
|
|
74303
74501
|
if (environment.USE_RIVE_LEGACY === "1" || environment.USE_RIVE_LEGACY === "true")
|
|
74304
74502
|
return { ...sensorOptions, [RIVE_PACKAGE]: { USE_RIVE_LEGACY: true } };
|
|
74305
|
-
const ios =
|
|
74306
|
-
const podfile =
|
|
74503
|
+
const ios = import_node_path111.default.join(projectRoot, "ios");
|
|
74504
|
+
const podfile = import_node_path111.default.join(ios, "Podfile");
|
|
74307
74505
|
const files2 = [podfile, ...yield* rubyFiles(ios, /* @__PURE__ */ new Set(), true)];
|
|
74308
74506
|
let value = false;
|
|
74309
74507
|
let assigned = false;
|
|
@@ -74754,7 +74952,7 @@ function parseIpv6(text6) {
|
|
|
74754
74952
|
|
|
74755
74953
|
// src/host/network-policy.ts
|
|
74756
74954
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
74757
|
-
var
|
|
74955
|
+
var import_node_path112 = require("node:path");
|
|
74758
74956
|
var import_node_url8 = require("node:url");
|
|
74759
74957
|
var NETWORK_POLICY_TIMEOUT_MS = 1e4;
|
|
74760
74958
|
var NetworkPolicyDeniedError = class extends Error {
|
|
@@ -74807,7 +75005,7 @@ function createNetworkAuthorizer(policy) {
|
|
|
74807
75005
|
};
|
|
74808
75006
|
}
|
|
74809
75007
|
async function loadNetworkPolicy(file) {
|
|
74810
|
-
if (!(0,
|
|
75008
|
+
if (!(0, import_node_path112.isAbsolute)(file)) {
|
|
74811
75009
|
throw new Error(`PEACH_NETWORK_POLICY must be an absolute path: ${file}`);
|
|
74812
75010
|
}
|
|
74813
75011
|
const loaded3 = await import(
|
|
@@ -75347,14 +75545,14 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
|
|
|
75347
75545
|
// src/host/fetch-proxy-transport.ts
|
|
75348
75546
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
75349
75547
|
var import_node_crypto58 = require("node:crypto");
|
|
75350
|
-
var
|
|
75548
|
+
var import_node_fs111 = require("node:fs");
|
|
75351
75549
|
var import_node_http22 = require("node:http2");
|
|
75352
|
-
var
|
|
75550
|
+
var import_node_path113 = __toESM(require("node:path"), 1);
|
|
75353
75551
|
var import_x509 = require("@peculiar/x509");
|
|
75354
75552
|
function readIdentity(identityPath) {
|
|
75355
75553
|
let parsed;
|
|
75356
75554
|
try {
|
|
75357
|
-
parsed = JSON.parse((0,
|
|
75555
|
+
parsed = JSON.parse((0, import_node_fs111.readFileSync)(identityPath, "utf8"));
|
|
75358
75556
|
} catch {
|
|
75359
75557
|
return null;
|
|
75360
75558
|
}
|
|
@@ -75369,8 +75567,8 @@ function readIdentity(identityPath) {
|
|
|
75369
75567
|
return { key: key2, cert, spki, port };
|
|
75370
75568
|
}
|
|
75371
75569
|
function writeIdentity(identityPath, identity2) {
|
|
75372
|
-
(0,
|
|
75373
|
-
(0,
|
|
75570
|
+
(0, import_node_fs111.mkdirSync)(import_node_path113.default.dirname(identityPath), { recursive: true });
|
|
75571
|
+
(0, import_node_fs111.writeFileSync)(identityPath, JSON.stringify(identity2), { mode: 384 });
|
|
75374
75572
|
}
|
|
75375
75573
|
async function createIdentity() {
|
|
75376
75574
|
const algorithm = { name: "ECDSA", namedCurve: "P-256", hash: "SHA-256" };
|
|
@@ -75576,8 +75774,8 @@ async function openUrl(url, options = {}) {
|
|
|
75576
75774
|
|
|
75577
75775
|
// src/host/plane-host.ts
|
|
75578
75776
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
75579
|
-
var
|
|
75580
|
-
var
|
|
75777
|
+
var import_node_fs113 = __toESM(require("node:fs"), 1);
|
|
75778
|
+
var import_node_path115 = __toESM(require("node:path"), 1);
|
|
75581
75779
|
|
|
75582
75780
|
// ../peach-box/src/plane.ts
|
|
75583
75781
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -75674,8 +75872,8 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
75674
75872
|
// cli/commands/box/checkout-plane.ts
|
|
75675
75873
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
75676
75874
|
var import_node_child_process50 = require("node:child_process");
|
|
75677
|
-
var
|
|
75678
|
-
var
|
|
75875
|
+
var import_node_fs112 = __toESM(require("node:fs"), 1);
|
|
75876
|
+
var import_node_path114 = __toESM(require("node:path"), 1);
|
|
75679
75877
|
var CheckoutRequiresGitError = class extends Error {
|
|
75680
75878
|
};
|
|
75681
75879
|
var BINARY_SNIFF_BYTES = 8192;
|
|
@@ -75686,14 +75884,14 @@ function looksBinary(filePath, size) {
|
|
|
75686
75884
|
if (size === 0) return false;
|
|
75687
75885
|
let fd;
|
|
75688
75886
|
try {
|
|
75689
|
-
fd =
|
|
75887
|
+
fd = import_node_fs112.default.openSync(filePath, "r");
|
|
75690
75888
|
const buffer = Buffer.alloc(Math.min(BINARY_SNIFF_BYTES, size));
|
|
75691
|
-
const read =
|
|
75889
|
+
const read = import_node_fs112.default.readSync(fd, buffer, 0, buffer.length, 0);
|
|
75692
75890
|
return buffer.subarray(0, read).includes(0);
|
|
75693
75891
|
} catch {
|
|
75694
75892
|
return false;
|
|
75695
75893
|
} finally {
|
|
75696
|
-
if (fd !== void 0)
|
|
75894
|
+
if (fd !== void 0) import_node_fs112.default.closeSync(fd);
|
|
75697
75895
|
}
|
|
75698
75896
|
}
|
|
75699
75897
|
var CheckoutFilePlane = class {
|
|
@@ -75706,7 +75904,7 @@ var CheckoutFilePlane = class {
|
|
|
75706
75904
|
listTimeoutMs;
|
|
75707
75905
|
trackedOnly;
|
|
75708
75906
|
constructor(root, options = {}) {
|
|
75709
|
-
this.root =
|
|
75907
|
+
this.root = import_node_path114.default.resolve(root);
|
|
75710
75908
|
this.listTimeoutMs = options.listTimeoutMs ?? LIST_FILES_TIMEOUT_MS;
|
|
75711
75909
|
this.trackedOnly = options.trackedOnly ?? false;
|
|
75712
75910
|
}
|
|
@@ -75768,13 +75966,13 @@ var CheckoutFilePlane = class {
|
|
|
75768
75966
|
if (!relative4) continue;
|
|
75769
75967
|
let stat2;
|
|
75770
75968
|
try {
|
|
75771
|
-
stat2 =
|
|
75969
|
+
stat2 = import_node_fs112.default.statSync(import_node_path114.default.join(this.root, relative4));
|
|
75772
75970
|
} catch {
|
|
75773
75971
|
continue;
|
|
75774
75972
|
}
|
|
75775
75973
|
if (!stat2.isFile()) continue;
|
|
75776
75974
|
const seen = this.sniffed.get(relative4);
|
|
75777
|
-
const binary2 = seen && seen.size === stat2.size && seen.mtimeMs === stat2.mtimeMs ? seen.binary : looksBinary(
|
|
75975
|
+
const binary2 = seen && seen.size === stat2.size && seen.mtimeMs === stat2.mtimeMs ? seen.binary : looksBinary(import_node_path114.default.join(this.root, relative4), stat2.size);
|
|
75778
75976
|
nextSniffed.set(relative4, { size: stat2.size, mtimeMs: stat2.mtimeMs, binary: binary2 });
|
|
75779
75977
|
next.set(relative4, {
|
|
75780
75978
|
size: stat2.size,
|
|
@@ -75788,22 +75986,22 @@ var CheckoutFilePlane = class {
|
|
|
75788
75986
|
this.sniffed = nextSniffed;
|
|
75789
75987
|
}
|
|
75790
75988
|
absolute(planePath) {
|
|
75791
|
-
const resolved =
|
|
75792
|
-
if (resolved !== this.root && !resolved.startsWith(`${this.root}${
|
|
75989
|
+
const resolved = import_node_path114.default.resolve(this.root, planePath);
|
|
75990
|
+
if (resolved !== this.root && !resolved.startsWith(`${this.root}${import_node_path114.default.sep}`)) {
|
|
75793
75991
|
throw new Error(`path escapes the project: ${planePath}`);
|
|
75794
75992
|
}
|
|
75795
75993
|
return resolved;
|
|
75796
75994
|
}
|
|
75797
75995
|
async read(planePath) {
|
|
75798
|
-
return
|
|
75996
|
+
return import_node_fs112.default.promises.readFile(this.absolute(planePath), "utf8");
|
|
75799
75997
|
}
|
|
75800
75998
|
async readBytes(planePath) {
|
|
75801
|
-
return
|
|
75999
|
+
return import_node_fs112.default.promises.readFile(this.absolute(planePath));
|
|
75802
76000
|
}
|
|
75803
76001
|
async write(planePath, content) {
|
|
75804
76002
|
const absolute = this.absolute(planePath);
|
|
75805
|
-
await
|
|
75806
|
-
await
|
|
76003
|
+
await import_node_fs112.default.promises.mkdir(import_node_path114.default.dirname(absolute), { recursive: true });
|
|
76004
|
+
await import_node_fs112.default.promises.writeFile(absolute, content);
|
|
75807
76005
|
this.entries.set(planePath, {
|
|
75808
76006
|
size: content.byteLength,
|
|
75809
76007
|
readOnly: false,
|
|
@@ -75812,7 +76010,7 @@ var CheckoutFilePlane = class {
|
|
|
75812
76010
|
});
|
|
75813
76011
|
}
|
|
75814
76012
|
async delete(planePath) {
|
|
75815
|
-
await
|
|
76013
|
+
await import_node_fs112.default.promises.rm(this.absolute(planePath), { force: true });
|
|
75816
76014
|
this.entries.delete(planePath);
|
|
75817
76015
|
}
|
|
75818
76016
|
};
|
|
@@ -75938,14 +76136,14 @@ var PlaneHost = class {
|
|
|
75938
76136
|
// root and an opened one cannot disagree about the same directory.
|
|
75939
76137
|
realRoot(root) {
|
|
75940
76138
|
if (!root) throw new Error("root is required");
|
|
75941
|
-
const resolved =
|
|
76139
|
+
const resolved = import_node_path115.default.resolve(root);
|
|
75942
76140
|
let real;
|
|
75943
76141
|
try {
|
|
75944
|
-
real =
|
|
76142
|
+
real = import_node_fs113.default.realpathSync(resolved);
|
|
75945
76143
|
} catch {
|
|
75946
76144
|
throw new Error(`no such directory: ${resolved}`);
|
|
75947
76145
|
}
|
|
75948
|
-
if (!
|
|
76146
|
+
if (!import_node_fs113.default.statSync(real).isDirectory()) throw new Error(`not a directory: ${real}`);
|
|
75949
76147
|
return real;
|
|
75950
76148
|
}
|
|
75951
76149
|
respond(ws, id, result) {
|
|
@@ -75966,9 +76164,9 @@ var PlaneHost = class {
|
|
|
75966
76164
|
|
|
75967
76165
|
// src/host/replacement-module-handler.ts
|
|
75968
76166
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
75969
|
-
var
|
|
76167
|
+
var import_node_fs114 = require("node:fs");
|
|
75970
76168
|
var import_promises15 = __toESM(require("node:fs/promises"), 1);
|
|
75971
|
-
var
|
|
76169
|
+
var import_node_path116 = __toESM(require("node:path"), 1);
|
|
75972
76170
|
|
|
75973
76171
|
// ../contrast-bundler/src/replacementModule.ts
|
|
75974
76172
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -76298,16 +76496,16 @@ function sendJavaScript(req, res, source) {
|
|
|
76298
76496
|
res.end(req.method === "HEAD" ? void 0 : source);
|
|
76299
76497
|
}
|
|
76300
76498
|
function resolveReplacementModuleFile(fromFile, specifier) {
|
|
76301
|
-
const base =
|
|
76499
|
+
const base = import_node_path116.default.resolve(import_node_path116.default.dirname(fromFile), specifier);
|
|
76302
76500
|
const candidates = [
|
|
76303
76501
|
...REPLACEMENT_MODULE_EXTENSIONS.some(
|
|
76304
|
-
(ext) => ext ===
|
|
76502
|
+
(ext) => ext === import_node_path116.default.extname(base).toLowerCase()
|
|
76305
76503
|
) ? [base] : [],
|
|
76306
76504
|
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
|
|
76307
|
-
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) =>
|
|
76505
|
+
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path116.default.join(base, `index${ext}`))
|
|
76308
76506
|
];
|
|
76309
76507
|
const found = candidates.find(
|
|
76310
|
-
(candidate) => (0,
|
|
76508
|
+
(candidate) => (0, import_node_fs114.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
|
|
76311
76509
|
);
|
|
76312
76510
|
if (!found) {
|
|
76313
76511
|
throw new Error(
|
|
@@ -76318,8 +76516,8 @@ function resolveReplacementModuleFile(fromFile, specifier) {
|
|
|
76318
76516
|
}
|
|
76319
76517
|
function isInsideAny(roots, file) {
|
|
76320
76518
|
return roots.some((root) => {
|
|
76321
|
-
const relative4 =
|
|
76322
|
-
return !relative4.startsWith("..") && !
|
|
76519
|
+
const relative4 = import_node_path116.default.relative(root, file);
|
|
76520
|
+
return !relative4.startsWith("..") && !import_node_path116.default.isAbsolute(relative4);
|
|
76323
76521
|
});
|
|
76324
76522
|
}
|
|
76325
76523
|
function isReplacementModuleRequestUrl(rawUrl) {
|
|
@@ -76368,19 +76566,19 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
76368
76566
|
res.end("missing path param");
|
|
76369
76567
|
return true;
|
|
76370
76568
|
}
|
|
76371
|
-
const extension =
|
|
76569
|
+
const extension = import_node_path116.default.extname(targetPath).toLowerCase();
|
|
76372
76570
|
if (!REPLACEMENT_MODULE_EXTENSIONS.some((allowed) => allowed === extension)) {
|
|
76373
76571
|
res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
|
|
76374
76572
|
res.end(`replacement files must be ${REPLACEMENT_MODULE_EXTENSIONS.join(", ")}`);
|
|
76375
76573
|
return true;
|
|
76376
76574
|
}
|
|
76377
|
-
if (!
|
|
76575
|
+
if (!import_node_path116.default.isAbsolute(targetPath)) {
|
|
76378
76576
|
res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
|
|
76379
76577
|
res.end("replacement file path must be absolute");
|
|
76380
76578
|
return true;
|
|
76381
76579
|
}
|
|
76382
76580
|
const runtimePackages = new Set(url.searchParams.getAll("runtimePackage"));
|
|
76383
|
-
const servedRoots = options.servedRoots?.map((root) =>
|
|
76581
|
+
const servedRoots = options.servedRoots?.map((root) => import_node_path116.default.resolve(root));
|
|
76384
76582
|
if (servedRoots && !isInsideAny(servedRoots, targetPath)) {
|
|
76385
76583
|
res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
|
|
76386
76584
|
res.end("replacement file must be inside a folder the bundler serves");
|
|
@@ -76440,16 +76638,16 @@ var SCAN_FRESH_MS = 2e3;
|
|
|
76440
76638
|
function createServerScanHandler(options) {
|
|
76441
76639
|
let cache = null;
|
|
76442
76640
|
let cachedAt = 0;
|
|
76443
|
-
let
|
|
76641
|
+
let inflight2 = null;
|
|
76444
76642
|
let inflightFresh = false;
|
|
76445
76643
|
function runScan(fresh = false) {
|
|
76446
|
-
if (
|
|
76644
|
+
if (inflight2 && fresh && !inflightFresh) {
|
|
76447
76645
|
const again = () => runScan(true);
|
|
76448
|
-
return
|
|
76646
|
+
return inflight2.then(again, again);
|
|
76449
76647
|
}
|
|
76450
|
-
if (
|
|
76648
|
+
if (inflight2) return inflight2;
|
|
76451
76649
|
inflightFresh = fresh;
|
|
76452
|
-
|
|
76650
|
+
inflight2 = scanDevServers({
|
|
76453
76651
|
excludePorts: options.excludePorts(),
|
|
76454
76652
|
fresh,
|
|
76455
76653
|
buildIconProxyUrl: buildBrowserAssetProxyUrl
|
|
@@ -76463,9 +76661,9 @@ function createServerScanHandler(options) {
|
|
|
76463
76661
|
if (cache && cache.length > 0) return cache;
|
|
76464
76662
|
throw error;
|
|
76465
76663
|
}).finally(() => {
|
|
76466
|
-
|
|
76664
|
+
inflight2 = null;
|
|
76467
76665
|
});
|
|
76468
|
-
return
|
|
76666
|
+
return inflight2;
|
|
76469
76667
|
}
|
|
76470
76668
|
return async function handleServerScan(req, res) {
|
|
76471
76669
|
function sendJson(status, body) {
|
|
@@ -78487,95 +78685,97 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
78487
78685
|
res.end("forbidden");
|
|
78488
78686
|
return;
|
|
78489
78687
|
}
|
|
78490
|
-
|
|
78491
|
-
|
|
78492
|
-
|
|
78493
|
-
|
|
78494
|
-
|
|
78495
|
-
|
|
78496
|
-
|
|
78497
|
-
|
|
78498
|
-
|
|
78499
|
-
|
|
78500
|
-
|
|
78501
|
-
|
|
78502
|
-
|
|
78503
|
-
|
|
78504
|
-
|
|
78505
|
-
|
|
78506
|
-
}
|
|
78507
|
-
}
|
|
78508
|
-
import_fs4.default.stat(servePath, (err, stats) => {
|
|
78509
|
-
if (err || !stats?.isFile()) {
|
|
78510
|
-
const ext2 = import_path4.default.extname(rel).toLowerCase();
|
|
78511
|
-
if (ext2 && ext2 !== ".html") {
|
|
78512
|
-
res.writeHead(404);
|
|
78513
|
-
res.end("not found");
|
|
78514
|
-
return;
|
|
78515
|
-
}
|
|
78516
|
-
if (rel.startsWith("/__") || rel.startsWith("/api/") || rel === "/api") {
|
|
78517
|
-
res.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" });
|
|
78518
|
-
res.end("not found");
|
|
78688
|
+
void ensureRuntimePackFor(baseDir, rel).then(
|
|
78689
|
+
() => import_fs4.default.realpath(resolved, (realErr, realResolved) => {
|
|
78690
|
+
const servePath = realErr ? resolved : realResolved;
|
|
78691
|
+
const servePathWithSep = servePath.endsWith(import_path4.default.sep) ? servePath : servePath + import_path4.default.sep;
|
|
78692
|
+
if (!realErr) {
|
|
78693
|
+
const realBaseWithSep = (() => {
|
|
78694
|
+
try {
|
|
78695
|
+
const rb = import_fs4.default.realpathSync(baseDir);
|
|
78696
|
+
return rb.endsWith(import_path4.default.sep) ? rb : rb + import_path4.default.sep;
|
|
78697
|
+
} catch {
|
|
78698
|
+
return baseWithSep;
|
|
78699
|
+
}
|
|
78700
|
+
})();
|
|
78701
|
+
if (!servePathWithSep.startsWith(realBaseWithSep) && servePath + import_path4.default.sep !== realBaseWithSep) {
|
|
78702
|
+
res.writeHead(403);
|
|
78703
|
+
res.end("forbidden");
|
|
78519
78704
|
return;
|
|
78520
78705
|
}
|
|
78521
|
-
|
|
78522
|
-
|
|
78523
|
-
|
|
78706
|
+
}
|
|
78707
|
+
import_fs4.default.stat(servePath, (err, stats) => {
|
|
78708
|
+
if (err || !stats?.isFile()) {
|
|
78709
|
+
const ext2 = import_path4.default.extname(rel).toLowerCase();
|
|
78710
|
+
if (ext2 && ext2 !== ".html") {
|
|
78524
78711
|
res.writeHead(404);
|
|
78525
78712
|
res.end("not found");
|
|
78526
78713
|
return;
|
|
78527
78714
|
}
|
|
78528
|
-
|
|
78529
|
-
"Content-Type": "text/
|
|
78530
|
-
"
|
|
78531
|
-
});
|
|
78532
|
-
if (method === "HEAD") {
|
|
78533
|
-
res.end();
|
|
78715
|
+
if (rel.startsWith("/__") || rel.startsWith("/api/") || rel === "/api") {
|
|
78716
|
+
res.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" });
|
|
78717
|
+
res.end("not found");
|
|
78534
78718
|
return;
|
|
78535
78719
|
}
|
|
78536
|
-
|
|
78537
|
-
|
|
78538
|
-
|
|
78539
|
-
|
|
78540
|
-
|
|
78541
|
-
|
|
78542
|
-
|
|
78543
|
-
|
|
78544
|
-
|
|
78545
|
-
|
|
78546
|
-
|
|
78547
|
-
|
|
78548
|
-
...publicEngineFont ? { "Access-Control-Allow-Origin": "*" } : {}
|
|
78549
|
-
});
|
|
78550
|
-
if (method === "HEAD") {
|
|
78551
|
-
res.end();
|
|
78552
|
-
return;
|
|
78553
|
-
}
|
|
78554
|
-
if (ext === ".html") {
|
|
78555
|
-
import_fs4.default.readFile(servePath, (readErr, data) => {
|
|
78556
|
-
if (readErr) {
|
|
78557
|
-
try {
|
|
78720
|
+
const indexPath = import_path4.default.join(baseDir, "index.html");
|
|
78721
|
+
import_fs4.default.readFile(indexPath, (err2, data) => {
|
|
78722
|
+
if (err2) {
|
|
78723
|
+
res.writeHead(404);
|
|
78724
|
+
res.end("not found");
|
|
78725
|
+
return;
|
|
78726
|
+
}
|
|
78727
|
+
res.writeHead(200, {
|
|
78728
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
78729
|
+
"Cache-Control": "no-store"
|
|
78730
|
+
});
|
|
78731
|
+
if (method === "HEAD") {
|
|
78558
78732
|
res.end();
|
|
78559
|
-
|
|
78733
|
+
return;
|
|
78560
78734
|
}
|
|
78561
|
-
|
|
78562
|
-
|
|
78563
|
-
|
|
78564
|
-
|
|
78565
|
-
|
|
78735
|
+
res.end(
|
|
78736
|
+
injectSharedConfigIntoHtml(data, this.effectivePort, this.contrastOrigin)
|
|
78737
|
+
);
|
|
78738
|
+
});
|
|
78739
|
+
return;
|
|
78740
|
+
}
|
|
78741
|
+
const ext = import_path4.default.extname(servePath).toLowerCase();
|
|
78742
|
+
const contentType2 = HTTP_MIME_TYPES[ext] || "application/octet-stream";
|
|
78743
|
+
res.writeHead(200, {
|
|
78744
|
+
"Content-Type": contentType2,
|
|
78745
|
+
"Cache-Control": "no-store",
|
|
78746
|
+
// native file documents have an opaque origin when reading public fonts.
|
|
78747
|
+
...publicEngineFont ? { "Access-Control-Allow-Origin": "*" } : {}
|
|
78566
78748
|
});
|
|
78567
|
-
|
|
78568
|
-
}
|
|
78569
|
-
const stream = import_fs4.default.createReadStream(servePath);
|
|
78570
|
-
stream.pipe(res);
|
|
78571
|
-
stream.on("error", () => {
|
|
78572
|
-
try {
|
|
78749
|
+
if (method === "HEAD") {
|
|
78573
78750
|
res.end();
|
|
78574
|
-
|
|
78751
|
+
return;
|
|
78575
78752
|
}
|
|
78753
|
+
if (ext === ".html") {
|
|
78754
|
+
import_fs4.default.readFile(servePath, (readErr, data) => {
|
|
78755
|
+
if (readErr) {
|
|
78756
|
+
try {
|
|
78757
|
+
res.end();
|
|
78758
|
+
} catch {
|
|
78759
|
+
}
|
|
78760
|
+
return;
|
|
78761
|
+
}
|
|
78762
|
+
res.end(
|
|
78763
|
+
injectSharedConfigIntoHtml(data, this.effectivePort, this.contrastOrigin)
|
|
78764
|
+
);
|
|
78765
|
+
});
|
|
78766
|
+
return;
|
|
78767
|
+
}
|
|
78768
|
+
const stream = import_fs4.default.createReadStream(servePath);
|
|
78769
|
+
stream.pipe(res);
|
|
78770
|
+
stream.on("error", () => {
|
|
78771
|
+
try {
|
|
78772
|
+
res.end();
|
|
78773
|
+
} catch {
|
|
78774
|
+
}
|
|
78775
|
+
});
|
|
78576
78776
|
});
|
|
78577
|
-
})
|
|
78578
|
-
|
|
78777
|
+
})
|
|
78778
|
+
);
|
|
78579
78779
|
}
|
|
78580
78780
|
sweepIdleCliClients() {
|
|
78581
78781
|
const now = Date.now();
|