peachsim 0.1.2186 → 0.1.2188
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +2708 -2383
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +3229 -3222
- 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 +4540 -4215
- package/dist-lib/host/fetch-proxy-handler.cjs +8 -7
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +431 -281
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +645 -284
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +732 -582
- package/dist-lib/native-app-identity-project.cjs +3 -3
- package/dist-lib/native-app-identity-project.mjs +3 -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 +24 -24
- package/dist-lib/public-origins-lib.json +99 -59
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +5198 -4873
- 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 +3 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +4 -4
- package/dist-lib/vite.cjs +8 -7
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -1
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +10 -0
- package/src/android-autolinking.ts +45 -4
- package/src/android-bridge-packages.ts +2 -2
- package/src/android-gradle-sources.ts +143 -0
- package/src/androidAutolinkingContract.ts +8 -0
- package/src/androidGradleContract.ts +14 -0
- package/src/expo-kotlin-host.ts +3 -0
- package/src/java-module-abi.ts +145 -0
- package/src/javaAbiContract.ts +14 -0
- package/src/kotlin-host.ts +55 -3
- package/src/nitro-source.ts +2 -167
- package/src/react-native-autolinking.ts +153 -0
- package/src/swift-distribution-contract.ts +72 -0
- package/src/swift-toolchain.ts +1 -1
package/dist-lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2188 | (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": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.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": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "a2817a624e79c3fa231a2cc0282988cac3fe3a27cf4c5d9237c77a4bd031e217", "home-paths.ts": "f5583b61f8bdd81823b3b29ff519a48daf9993719f194ddb7de22218472e90f9", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "5f41cd0bd86cb0cffbfb0047348b963f81d5e51cb0e8dd574c739b1a27aa56de", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -1474,17 +1474,17 @@ function visit(node, visitor) {
|
|
|
1474
1474
|
} else
|
|
1475
1475
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
1476
1476
|
}
|
|
1477
|
-
function visit_(key, node, visitor,
|
|
1478
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
1477
|
+
function visit_(key, node, visitor, path32) {
|
|
1478
|
+
const ctrl = callVisitor(key, node, visitor, path32);
|
|
1479
1479
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
1480
|
-
replaceNode(key,
|
|
1481
|
-
return visit_(key, ctrl, visitor,
|
|
1480
|
+
replaceNode(key, path32, ctrl);
|
|
1481
|
+
return visit_(key, ctrl, visitor, path32);
|
|
1482
1482
|
}
|
|
1483
1483
|
if (typeof ctrl !== "symbol") {
|
|
1484
1484
|
if (isCollection(node)) {
|
|
1485
|
-
|
|
1485
|
+
path32 = Object.freeze(path32.concat(node));
|
|
1486
1486
|
for (let i = 0; i < node.items.length; ++i) {
|
|
1487
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
1487
|
+
const ci = visit_(i, node.items[i], visitor, path32);
|
|
1488
1488
|
if (typeof ci === "number")
|
|
1489
1489
|
i = ci - 1;
|
|
1490
1490
|
else if (ci === BREAK)
|
|
@@ -1495,13 +1495,13 @@ function visit_(key, node, visitor, path31) {
|
|
|
1495
1495
|
}
|
|
1496
1496
|
}
|
|
1497
1497
|
} else if (isPair(node)) {
|
|
1498
|
-
|
|
1499
|
-
const ck = visit_("key", node.key, visitor,
|
|
1498
|
+
path32 = Object.freeze(path32.concat(node));
|
|
1499
|
+
const ck = visit_("key", node.key, visitor, path32);
|
|
1500
1500
|
if (ck === BREAK)
|
|
1501
1501
|
return BREAK;
|
|
1502
1502
|
else if (ck === REMOVE)
|
|
1503
1503
|
node.key = null;
|
|
1504
|
-
const cv = visit_("value", node.value, visitor,
|
|
1504
|
+
const cv = visit_("value", node.value, visitor, path32);
|
|
1505
1505
|
if (cv === BREAK)
|
|
1506
1506
|
return BREAK;
|
|
1507
1507
|
else if (cv === REMOVE)
|
|
@@ -1519,17 +1519,17 @@ async function visitAsync(node, visitor) {
|
|
|
1519
1519
|
} else
|
|
1520
1520
|
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
1521
1521
|
}
|
|
1522
|
-
async function visitAsync_(key, node, visitor,
|
|
1523
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
1522
|
+
async function visitAsync_(key, node, visitor, path32) {
|
|
1523
|
+
const ctrl = await callVisitor(key, node, visitor, path32);
|
|
1524
1524
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
1525
|
-
replaceNode(key,
|
|
1526
|
-
return visitAsync_(key, ctrl, visitor,
|
|
1525
|
+
replaceNode(key, path32, ctrl);
|
|
1526
|
+
return visitAsync_(key, ctrl, visitor, path32);
|
|
1527
1527
|
}
|
|
1528
1528
|
if (typeof ctrl !== "symbol") {
|
|
1529
1529
|
if (isCollection(node)) {
|
|
1530
|
-
|
|
1530
|
+
path32 = Object.freeze(path32.concat(node));
|
|
1531
1531
|
for (let i = 0; i < node.items.length; ++i) {
|
|
1532
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
1532
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path32);
|
|
1533
1533
|
if (typeof ci === "number")
|
|
1534
1534
|
i = ci - 1;
|
|
1535
1535
|
else if (ci === BREAK)
|
|
@@ -1540,13 +1540,13 @@ async function visitAsync_(key, node, visitor, path31) {
|
|
|
1540
1540
|
}
|
|
1541
1541
|
}
|
|
1542
1542
|
} else if (isPair(node)) {
|
|
1543
|
-
|
|
1544
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
1543
|
+
path32 = Object.freeze(path32.concat(node));
|
|
1544
|
+
const ck = await visitAsync_("key", node.key, visitor, path32);
|
|
1545
1545
|
if (ck === BREAK)
|
|
1546
1546
|
return BREAK;
|
|
1547
1547
|
else if (ck === REMOVE)
|
|
1548
1548
|
node.key = null;
|
|
1549
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
1549
|
+
const cv = await visitAsync_("value", node.value, visitor, path32);
|
|
1550
1550
|
if (cv === BREAK)
|
|
1551
1551
|
return BREAK;
|
|
1552
1552
|
else if (cv === REMOVE)
|
|
@@ -1573,23 +1573,23 @@ function initVisitor(visitor) {
|
|
|
1573
1573
|
}
|
|
1574
1574
|
return visitor;
|
|
1575
1575
|
}
|
|
1576
|
-
function callVisitor(key, node, visitor,
|
|
1576
|
+
function callVisitor(key, node, visitor, path32) {
|
|
1577
1577
|
if (typeof visitor === "function")
|
|
1578
|
-
return visitor(key, node,
|
|
1578
|
+
return visitor(key, node, path32);
|
|
1579
1579
|
if (isMap(node))
|
|
1580
|
-
return visitor.Map?.(key, node,
|
|
1580
|
+
return visitor.Map?.(key, node, path32);
|
|
1581
1581
|
if (isSeq(node))
|
|
1582
|
-
return visitor.Seq?.(key, node,
|
|
1582
|
+
return visitor.Seq?.(key, node, path32);
|
|
1583
1583
|
if (isPair(node))
|
|
1584
|
-
return visitor.Pair?.(key, node,
|
|
1584
|
+
return visitor.Pair?.(key, node, path32);
|
|
1585
1585
|
if (isScalar(node))
|
|
1586
|
-
return visitor.Scalar?.(key, node,
|
|
1586
|
+
return visitor.Scalar?.(key, node, path32);
|
|
1587
1587
|
if (isAlias(node))
|
|
1588
|
-
return visitor.Alias?.(key, node,
|
|
1588
|
+
return visitor.Alias?.(key, node, path32);
|
|
1589
1589
|
return void 0;
|
|
1590
1590
|
}
|
|
1591
|
-
function replaceNode(key,
|
|
1592
|
-
const parent =
|
|
1591
|
+
function replaceNode(key, path32, node) {
|
|
1592
|
+
const parent = path32[path32.length - 1];
|
|
1593
1593
|
if (isCollection(parent)) {
|
|
1594
1594
|
parent.items[key] = node;
|
|
1595
1595
|
} else if (isPair(parent)) {
|
|
@@ -2149,10 +2149,10 @@ var init_createNode = __esm({
|
|
|
2149
2149
|
});
|
|
2150
2150
|
|
|
2151
2151
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
2152
|
-
function collectionFromPath(schema4,
|
|
2152
|
+
function collectionFromPath(schema4, path32, value) {
|
|
2153
2153
|
let v6 = value;
|
|
2154
|
-
for (let i =
|
|
2155
|
-
const k =
|
|
2154
|
+
for (let i = path32.length - 1; i >= 0; --i) {
|
|
2155
|
+
const k = path32[i];
|
|
2156
2156
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
2157
2157
|
const a = [];
|
|
2158
2158
|
a[k] = v6;
|
|
@@ -2178,7 +2178,7 @@ var init_Collection = __esm({
|
|
|
2178
2178
|
init_createNode();
|
|
2179
2179
|
init_identity();
|
|
2180
2180
|
init_Node();
|
|
2181
|
-
isEmptyPath = (
|
|
2181
|
+
isEmptyPath = (path32) => path32 == null || typeof path32 === "object" && !!path32[Symbol.iterator]().next().done;
|
|
2182
2182
|
Collection = class extends NodeBase {
|
|
2183
2183
|
constructor(type, schema4) {
|
|
2184
2184
|
super(type);
|
|
@@ -2208,11 +2208,11 @@ var init_Collection = __esm({
|
|
|
2208
2208
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
2209
2209
|
* that already exists in the map.
|
|
2210
2210
|
*/
|
|
2211
|
-
addIn(
|
|
2212
|
-
if (isEmptyPath(
|
|
2211
|
+
addIn(path32, value) {
|
|
2212
|
+
if (isEmptyPath(path32))
|
|
2213
2213
|
this.add(value);
|
|
2214
2214
|
else {
|
|
2215
|
-
const [key, ...rest] =
|
|
2215
|
+
const [key, ...rest] = path32;
|
|
2216
2216
|
const node = this.get(key, true);
|
|
2217
2217
|
if (isCollection(node))
|
|
2218
2218
|
node.addIn(rest, value);
|
|
@@ -2226,8 +2226,8 @@ var init_Collection = __esm({
|
|
|
2226
2226
|
* Removes a value from the collection.
|
|
2227
2227
|
* @returns `true` if the item was found and removed.
|
|
2228
2228
|
*/
|
|
2229
|
-
deleteIn(
|
|
2230
|
-
const [key, ...rest] =
|
|
2229
|
+
deleteIn(path32) {
|
|
2230
|
+
const [key, ...rest] = path32;
|
|
2231
2231
|
if (rest.length === 0)
|
|
2232
2232
|
return this.delete(key);
|
|
2233
2233
|
const node = this.get(key, true);
|
|
@@ -2241,8 +2241,8 @@ var init_Collection = __esm({
|
|
|
2241
2241
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
2242
2242
|
* `true` (collections are always returned intact).
|
|
2243
2243
|
*/
|
|
2244
|
-
getIn(
|
|
2245
|
-
const [key, ...rest] =
|
|
2244
|
+
getIn(path32, keepScalar) {
|
|
2245
|
+
const [key, ...rest] = path32;
|
|
2246
2246
|
const node = this.get(key, true);
|
|
2247
2247
|
if (rest.length === 0)
|
|
2248
2248
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -2260,8 +2260,8 @@ var init_Collection = __esm({
|
|
|
2260
2260
|
/**
|
|
2261
2261
|
* Checks if the collection includes a value with the key `key`.
|
|
2262
2262
|
*/
|
|
2263
|
-
hasIn(
|
|
2264
|
-
const [key, ...rest] =
|
|
2263
|
+
hasIn(path32) {
|
|
2264
|
+
const [key, ...rest] = path32;
|
|
2265
2265
|
if (rest.length === 0)
|
|
2266
2266
|
return this.has(key);
|
|
2267
2267
|
const node = this.get(key, true);
|
|
@@ -2271,8 +2271,8 @@ var init_Collection = __esm({
|
|
|
2271
2271
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
2272
2272
|
* boolean to add/remove the item from the set.
|
|
2273
2273
|
*/
|
|
2274
|
-
setIn(
|
|
2275
|
-
const [key, ...rest] =
|
|
2274
|
+
setIn(path32, value) {
|
|
2275
|
+
const [key, ...rest] = path32;
|
|
2276
2276
|
if (rest.length === 0) {
|
|
2277
2277
|
this.set(key, value);
|
|
2278
2278
|
} else {
|
|
@@ -4245,15 +4245,15 @@ function visit2(cst, visitor) {
|
|
|
4245
4245
|
cst = { start: cst.start, value: cst.value };
|
|
4246
4246
|
_visit(Object.freeze([]), cst, visitor);
|
|
4247
4247
|
}
|
|
4248
|
-
function _visit(
|
|
4249
|
-
let ctrl = visitor(item,
|
|
4248
|
+
function _visit(path32, item, visitor) {
|
|
4249
|
+
let ctrl = visitor(item, path32);
|
|
4250
4250
|
if (typeof ctrl === "symbol")
|
|
4251
4251
|
return ctrl;
|
|
4252
4252
|
for (const field of ["key", "value"]) {
|
|
4253
4253
|
const token = item[field];
|
|
4254
4254
|
if (token && "items" in token) {
|
|
4255
4255
|
for (let i = 0; i < token.items.length; ++i) {
|
|
4256
|
-
const ci = _visit(Object.freeze(
|
|
4256
|
+
const ci = _visit(Object.freeze(path32.concat([[field, i]])), token.items[i], visitor);
|
|
4257
4257
|
if (typeof ci === "number")
|
|
4258
4258
|
i = ci - 1;
|
|
4259
4259
|
else if (ci === BREAK2)
|
|
@@ -4264,10 +4264,10 @@ function _visit(path31, item, visitor) {
|
|
|
4264
4264
|
}
|
|
4265
4265
|
}
|
|
4266
4266
|
if (typeof ctrl === "function" && field === "key")
|
|
4267
|
-
ctrl = ctrl(item,
|
|
4267
|
+
ctrl = ctrl(item, path32);
|
|
4268
4268
|
}
|
|
4269
4269
|
}
|
|
4270
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
4270
|
+
return typeof ctrl === "function" ? ctrl(item, path32) : ctrl;
|
|
4271
4271
|
}
|
|
4272
4272
|
var BREAK2, SKIP2, REMOVE2;
|
|
4273
4273
|
var init_cst_visit = __esm({
|
|
@@ -4279,9 +4279,9 @@ var init_cst_visit = __esm({
|
|
|
4279
4279
|
visit2.BREAK = BREAK2;
|
|
4280
4280
|
visit2.SKIP = SKIP2;
|
|
4281
4281
|
visit2.REMOVE = REMOVE2;
|
|
4282
|
-
visit2.itemAtPath = (cst,
|
|
4282
|
+
visit2.itemAtPath = (cst, path32) => {
|
|
4283
4283
|
let item = cst;
|
|
4284
|
-
for (const [field, index] of
|
|
4284
|
+
for (const [field, index] of path32) {
|
|
4285
4285
|
const tok = item?.[field];
|
|
4286
4286
|
if (tok && "items" in tok) {
|
|
4287
4287
|
item = tok.items[index];
|
|
@@ -4290,9 +4290,9 @@ var init_cst_visit = __esm({
|
|
|
4290
4290
|
}
|
|
4291
4291
|
return item;
|
|
4292
4292
|
};
|
|
4293
|
-
visit2.parentCollection = (cst,
|
|
4294
|
-
const parent = visit2.itemAtPath(cst,
|
|
4295
|
-
const field =
|
|
4293
|
+
visit2.parentCollection = (cst, path32) => {
|
|
4294
|
+
const parent = visit2.itemAtPath(cst, path32.slice(0, -1));
|
|
4295
|
+
const field = path32[path32.length - 1][0];
|
|
4296
4296
|
const coll = parent?.[field];
|
|
4297
4297
|
if (coll && "items" in coll)
|
|
4298
4298
|
return coll;
|
|
@@ -4462,8 +4462,8 @@ function metadataValue(value, key) {
|
|
|
4462
4462
|
if (!value || typeof value !== "object") return void 0;
|
|
4463
4463
|
return Object.getOwnPropertyDescriptor(value, key)?.value;
|
|
4464
4464
|
}
|
|
4465
|
-
function readProjectJson(
|
|
4466
|
-
const text2 = readProjectMetadata(
|
|
4465
|
+
function readProjectJson(path32, files = nodeRepoFileReader) {
|
|
4466
|
+
const text2 = readProjectMetadata(path32, files);
|
|
4467
4467
|
if (text2 === null) return null;
|
|
4468
4468
|
try {
|
|
4469
4469
|
const value = JSON.parse(text2);
|
|
@@ -4746,6 +4746,121 @@ var init_nitro_dependencies = __esm({
|
|
|
4746
4746
|
}
|
|
4747
4747
|
});
|
|
4748
4748
|
|
|
4749
|
+
// src/react-native-autolinking.ts
|
|
4750
|
+
function autolinkerJson(command, output2) {
|
|
4751
|
+
try {
|
|
4752
|
+
return JSON.parse(output2.stdout);
|
|
4753
|
+
} catch (cause) {
|
|
4754
|
+
throw new Error(
|
|
4755
|
+
`${command} exited 0 with ${output2.stdout.length} bytes of stdout that is not JSON (${cause instanceof Error ? cause.message : cause}); stderr: ${output2.stderr.trim().slice(0, 500) || "(empty)"}; stdout: ${output2.stdout.slice(0, 200) || "(empty)"}`,
|
|
4756
|
+
{ cause }
|
|
4757
|
+
);
|
|
4758
|
+
}
|
|
4759
|
+
}
|
|
4760
|
+
async function cliAdvertises(cli, args, token, appRoot, signal) {
|
|
4761
|
+
const { stdout, stderr } = await run5("node", [cli, ...args], {
|
|
4762
|
+
cwd: appRoot,
|
|
4763
|
+
signal,
|
|
4764
|
+
timeout: 3e4,
|
|
4765
|
+
maxBuffer: 1 * 1024 * 1024,
|
|
4766
|
+
env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" }
|
|
4767
|
+
});
|
|
4768
|
+
if (!stdout.trim())
|
|
4769
|
+
throw new Error(
|
|
4770
|
+
`${cli} ${args.join(" ")} returned empty help output${stderr.trim() ? `: ${stderr.trim()}` : ""}`
|
|
4771
|
+
);
|
|
4772
|
+
return stdout.includes(token);
|
|
4773
|
+
}
|
|
4774
|
+
function declaresDependency(appRoot, name2) {
|
|
4775
|
+
const manifest = JSON.parse(
|
|
4776
|
+
import_node_fs18.default.readFileSync(import_node_path20.default.join(appRoot, "package.json"), "utf8")
|
|
4777
|
+
);
|
|
4778
|
+
return isRecord(manifest) && ["dependencies", "devDependencies"].some((field) => {
|
|
4779
|
+
const group = manifest[field];
|
|
4780
|
+
return isRecord(group) && Object.hasOwn(group, name2);
|
|
4781
|
+
});
|
|
4782
|
+
}
|
|
4783
|
+
async function reactNativeAutolinkingConfig(appRoot, platform, signal) {
|
|
4784
|
+
appRoot = import_node_fs18.default.realpathSync(appRoot);
|
|
4785
|
+
const appRequire = (0, import_node_module2.createRequire)(import_node_path20.default.join(appRoot, "package.json"));
|
|
4786
|
+
const expoManifest = appRequire.resolve.paths("expo")?.map((directory) => import_node_path20.default.join(directory, "expo/package.json")).find((manifest) => import_node_fs18.default.existsSync(manifest));
|
|
4787
|
+
const expoRequire = expoManifest ? (0, import_node_module2.createRequire)(import_node_fs18.default.realpathSync(expoManifest)) : appRequire;
|
|
4788
|
+
const nativeFile = (platform === "ios" ? ["ios/Podfile"] : ["android/settings.gradle", "android/settings.gradle.kts"]).map((name2) => import_node_path20.default.join(appRoot, name2)).find((file) => import_node_fs18.default.existsSync(file));
|
|
4789
|
+
const nativeSource = nativeFile ? import_node_fs18.default.readFileSync(nativeFile, "utf8") : null;
|
|
4790
|
+
const asksExpo = process.env.EXPO_USE_COMMUNITY_AUTOLINKING !== "1" && (nativeSource === null ? declaresDependency(appRoot, "expo") : nativeSource.includes("expo-modules-autolinking") || platform === "android" && nativeSource.includes("expoAutolinking.rnConfigCommand"));
|
|
4791
|
+
const expoAutolinker = asksExpo ? [appRequire, expoRequire].flatMap((req) => req.resolve.paths("expo-modules-autolinking") ?? []).map((directory) => import_node_path20.default.join(directory, "expo-modules-autolinking/package.json")).find((manifest) => import_node_fs18.default.existsSync(manifest)) : void 0;
|
|
4792
|
+
if (expoAutolinker) {
|
|
4793
|
+
const cli2 = import_node_path20.default.join(import_node_path20.default.dirname(expoAutolinker), "bin/expo-modules-autolinking.js");
|
|
4794
|
+
if (await cliAdvertises(cli2, ["--help"], "react-native-config", appRoot, signal)) {
|
|
4795
|
+
const args = [
|
|
4796
|
+
cli2,
|
|
4797
|
+
"react-native-config",
|
|
4798
|
+
"--json",
|
|
4799
|
+
"--platform",
|
|
4800
|
+
platform,
|
|
4801
|
+
"--project-root",
|
|
4802
|
+
appRoot
|
|
4803
|
+
];
|
|
4804
|
+
return autolinkerJson(
|
|
4805
|
+
"expo-modules-autolinking react-native-config",
|
|
4806
|
+
await run5("node", args, {
|
|
4807
|
+
timeout: 3e4,
|
|
4808
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
4809
|
+
env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" },
|
|
4810
|
+
// expo configuration resolves its project from cwd.
|
|
4811
|
+
cwd: appRoot,
|
|
4812
|
+
signal
|
|
4813
|
+
})
|
|
4814
|
+
);
|
|
4815
|
+
}
|
|
4816
|
+
}
|
|
4817
|
+
const cliRequire = declaresDependency(appRoot, "one") ? (0, import_node_module2.createRequire)(
|
|
4818
|
+
(0, import_node_module2.createRequire)(appRequire.resolve("one/package.json")).resolve(
|
|
4819
|
+
"vxrn/package.json"
|
|
4820
|
+
)
|
|
4821
|
+
) : appRequire;
|
|
4822
|
+
const cliManifest = cliRequire.resolve("@react-native-community/cli/package.json");
|
|
4823
|
+
const cli = JSON.parse(import_node_fs18.default.readFileSync(cliManifest, "utf8"));
|
|
4824
|
+
const bins = isRecord(cli) && isRecord(cli.bin) ? cli.bin : void 0;
|
|
4825
|
+
const bin = [bins?.["rnc-cli"], bins?.["react-native"]].find(
|
|
4826
|
+
(entry) => typeof entry === "string"
|
|
4827
|
+
);
|
|
4828
|
+
if (bin === void 0) throw new Error(`${cliManifest} declares no CLI bin`);
|
|
4829
|
+
const cliPath = import_node_path20.default.join(import_node_path20.default.dirname(cliManifest), bin);
|
|
4830
|
+
const configArgs = await cliAdvertises(
|
|
4831
|
+
cliPath,
|
|
4832
|
+
["config", "--help"],
|
|
4833
|
+
"--platform",
|
|
4834
|
+
appRoot,
|
|
4835
|
+
signal
|
|
4836
|
+
) ? ["config", "--platform", platform] : ["config"];
|
|
4837
|
+
return autolinkerJson(
|
|
4838
|
+
`react-native ${configArgs.join(" ")}`,
|
|
4839
|
+
await run5("node", [cliPath, ...configArgs], {
|
|
4840
|
+
cwd: appRoot,
|
|
4841
|
+
signal,
|
|
4842
|
+
timeout: 3e4,
|
|
4843
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
4844
|
+
env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1", NO_COLOR: "1" }
|
|
4845
|
+
})
|
|
4846
|
+
);
|
|
4847
|
+
}
|
|
4848
|
+
var import_node_child_process10, import_node_fs18, import_node_module2, import_node_path20, import_node_util6, run5;
|
|
4849
|
+
var init_react_native_autolinking = __esm({
|
|
4850
|
+
"src/react-native-autolinking.ts"() {
|
|
4851
|
+
"use strict";
|
|
4852
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
4853
|
+
import_node_child_process10 = require("node:child_process");
|
|
4854
|
+
import_node_fs18 = __toESM(require("node:fs"), 1);
|
|
4855
|
+
import_node_module2 = require("node:module");
|
|
4856
|
+
import_node_path20 = __toESM(require("node:path"), 1);
|
|
4857
|
+
import_node_util6 = require("node:util");
|
|
4858
|
+
init_forked_script_contract();
|
|
4859
|
+
init_is_record();
|
|
4860
|
+
run5 = (0, import_node_util6.promisify)(import_node_child_process10.execFile);
|
|
4861
|
+
}
|
|
4862
|
+
});
|
|
4863
|
+
|
|
4749
4864
|
// src/nitro-source.ts
|
|
4750
4865
|
function object3(value) {
|
|
4751
4866
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -4754,19 +4869,19 @@ function readJson(root, relative3) {
|
|
|
4754
4869
|
return JSON.parse(
|
|
4755
4870
|
readPackageFile(
|
|
4756
4871
|
root,
|
|
4757
|
-
|
|
4872
|
+
import_node_path21.default.join(root, relative3),
|
|
4758
4873
|
MAX_SWIFT_COMPILE_SOURCE_BYTES
|
|
4759
4874
|
).toString("utf8")
|
|
4760
4875
|
);
|
|
4761
4876
|
}
|
|
4762
4877
|
function registrations(root) {
|
|
4763
|
-
const directory =
|
|
4764
|
-
const initializers =
|
|
4878
|
+
const directory = import_node_path21.default.join(root, "nitrogen/generated/ios");
|
|
4879
|
+
const initializers = import_node_fs19.default.readdirSync(directory).filter((file) => file.endsWith("Autolinking.mm"));
|
|
4765
4880
|
if (initializers.length !== 1)
|
|
4766
4881
|
throw new Error(`${root}: expected one generated Nitro iOS initializer`);
|
|
4767
4882
|
const source = readPackageFile(
|
|
4768
4883
|
root,
|
|
4769
|
-
|
|
4884
|
+
import_node_path21.default.join(directory, initializers[0]),
|
|
4770
4885
|
MAX_SWIFT_COMPILE_SOURCE_BYTES
|
|
4771
4886
|
).toString("utf8");
|
|
4772
4887
|
const namespaces = [
|
|
@@ -4829,18 +4944,18 @@ function registrations(root) {
|
|
|
4829
4944
|
if (new Set(classes.map(({ name: name2 }) => name2)).size !== classes.length)
|
|
4830
4945
|
throw new Error(`${root}: duplicate generated Nitro iOS registration`);
|
|
4831
4946
|
classes.sort((a, b) => a.name.localeCompare(b.name));
|
|
4832
|
-
const ios =
|
|
4833
|
-
if (swiftModule === null &&
|
|
4947
|
+
const ios = import_node_path21.default.join(root, "ios");
|
|
4948
|
+
if (swiftModule === null && import_node_fs19.default.existsSync(ios) && import_node_fs19.default.readdirSync(ios, { recursive: true, encoding: "utf8" }).some((file) => file.endsWith(".swift") && !file.startsWith("Tests")))
|
|
4834
4949
|
swiftModule = initializers[0].slice(0, -"Autolinking.mm".length);
|
|
4835
4950
|
return { namespace, swiftModule, classes, views: viewNames(root, classes) };
|
|
4836
4951
|
}
|
|
4837
4952
|
function viewNames(root, classes) {
|
|
4838
|
-
const directory =
|
|
4839
|
-
if (!
|
|
4953
|
+
const directory = import_node_path21.default.join(root, "nitrogen/generated/shared/json");
|
|
4954
|
+
if (!import_node_fs19.default.existsSync(directory)) return /* @__PURE__ */ new Set();
|
|
4840
4955
|
const views = /* @__PURE__ */ new Set();
|
|
4841
|
-
for (const file of
|
|
4956
|
+
for (const file of import_node_fs19.default.readdirSync(directory)) {
|
|
4842
4957
|
if (!file.endsWith("Config.json")) continue;
|
|
4843
|
-
const config = readJson(root,
|
|
4958
|
+
const config = readJson(root, import_node_path21.default.join("nitrogen/generated/shared/json", file));
|
|
4844
4959
|
const name2 = object3(config) ? config.uiViewClassName : void 0;
|
|
4845
4960
|
if (typeof name2 === "string" && classes.some((entry) => entry.name === name2))
|
|
4846
4961
|
views.add(name2);
|
|
@@ -4848,28 +4963,25 @@ function viewNames(root, classes) {
|
|
|
4848
4963
|
return views;
|
|
4849
4964
|
}
|
|
4850
4965
|
function hasNitroIosInitializer(root) {
|
|
4851
|
-
const generated =
|
|
4852
|
-
return
|
|
4966
|
+
const generated = import_node_path21.default.join(root, "nitrogen/generated/ios");
|
|
4967
|
+
return import_node_fs19.default.existsSync(generated) && import_node_fs19.default.readdirSync(generated).some((file) => file.endsWith("Autolinking.mm"));
|
|
4853
4968
|
}
|
|
4854
4969
|
function nitroRegisteredNames(root) {
|
|
4855
4970
|
if (!hasNitroIosInitializer(root)) return null;
|
|
4856
4971
|
const { classes, views } = registrations(root);
|
|
4857
4972
|
return { names: classes.map(({ name: name2 }) => name2), views: [...views].sort() };
|
|
4858
4973
|
}
|
|
4859
|
-
var
|
|
4974
|
+
var import_node_fs19, import_node_path21;
|
|
4860
4975
|
var init_nitro_source = __esm({
|
|
4861
4976
|
"src/nitro-source.ts"() {
|
|
4862
4977
|
"use strict";
|
|
4863
4978
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
import_node_path20 = __toESM(require("node:path"), 1);
|
|
4867
|
-
import_node_util6 = require("node:util");
|
|
4868
|
-
init_forked_script_contract();
|
|
4979
|
+
import_node_fs19 = __toESM(require("node:fs"), 1);
|
|
4980
|
+
import_node_path21 = __toESM(require("node:path"), 1);
|
|
4869
4981
|
init_nitro_dependencies();
|
|
4982
|
+
init_react_native_autolinking();
|
|
4870
4983
|
init_swift_source_file();
|
|
4871
4984
|
init_swift_submit();
|
|
4872
|
-
run5 = (0, import_node_util6.promisify)(import_node_child_process10.execFile);
|
|
4873
4985
|
}
|
|
4874
4986
|
});
|
|
4875
4987
|
|
|
@@ -5752,16 +5864,16 @@ function sendJavaScript(req, res, source) {
|
|
|
5752
5864
|
res.end(req.method === "HEAD" ? void 0 : source);
|
|
5753
5865
|
}
|
|
5754
5866
|
function resolveReplacementModuleFile(fromFile, specifier) {
|
|
5755
|
-
const base =
|
|
5867
|
+
const base = import_node_path26.default.resolve(import_node_path26.default.dirname(fromFile), specifier);
|
|
5756
5868
|
const candidates = [
|
|
5757
5869
|
...REPLACEMENT_MODULE_EXTENSIONS.some(
|
|
5758
|
-
(ext) => ext ===
|
|
5870
|
+
(ext) => ext === import_node_path26.default.extname(base).toLowerCase()
|
|
5759
5871
|
) ? [base] : [],
|
|
5760
5872
|
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
|
|
5761
|
-
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) =>
|
|
5873
|
+
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path26.default.join(base, `index${ext}`))
|
|
5762
5874
|
];
|
|
5763
5875
|
const found = candidates.find(
|
|
5764
|
-
(candidate) => (0,
|
|
5876
|
+
(candidate) => (0, import_node_fs23.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
|
|
5765
5877
|
);
|
|
5766
5878
|
if (!found) {
|
|
5767
5879
|
throw new Error(
|
|
@@ -5772,8 +5884,8 @@ function resolveReplacementModuleFile(fromFile, specifier) {
|
|
|
5772
5884
|
}
|
|
5773
5885
|
function isInsideAny(roots, file) {
|
|
5774
5886
|
return roots.some((root) => {
|
|
5775
|
-
const relative3 =
|
|
5776
|
-
return !relative3.startsWith("..") && !
|
|
5887
|
+
const relative3 = import_node_path26.default.relative(root, file);
|
|
5888
|
+
return !relative3.startsWith("..") && !import_node_path26.default.isAbsolute(relative3);
|
|
5777
5889
|
});
|
|
5778
5890
|
}
|
|
5779
5891
|
function isReplacementModuleRequestUrl(rawUrl) {
|
|
@@ -5822,19 +5934,19 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
5822
5934
|
res.end("missing path param");
|
|
5823
5935
|
return true;
|
|
5824
5936
|
}
|
|
5825
|
-
const extension =
|
|
5937
|
+
const extension = import_node_path26.default.extname(targetPath).toLowerCase();
|
|
5826
5938
|
if (!REPLACEMENT_MODULE_EXTENSIONS.some((allowed) => allowed === extension)) {
|
|
5827
5939
|
res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
|
|
5828
5940
|
res.end(`replacement files must be ${REPLACEMENT_MODULE_EXTENSIONS.join(", ")}`);
|
|
5829
5941
|
return true;
|
|
5830
5942
|
}
|
|
5831
|
-
if (!
|
|
5943
|
+
if (!import_node_path26.default.isAbsolute(targetPath)) {
|
|
5832
5944
|
res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
|
|
5833
5945
|
res.end("replacement file path must be absolute");
|
|
5834
5946
|
return true;
|
|
5835
5947
|
}
|
|
5836
5948
|
const runtimePackages = new Set(url.searchParams.getAll("runtimePackage"));
|
|
5837
|
-
const servedRoots = options.servedRoots?.map((root) =>
|
|
5949
|
+
const servedRoots = options.servedRoots?.map((root) => import_node_path26.default.resolve(root));
|
|
5838
5950
|
if (servedRoots && !isInsideAny(servedRoots, targetPath)) {
|
|
5839
5951
|
res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
|
|
5840
5952
|
res.end("replacement file must be inside a folder the bundler serves");
|
|
@@ -5886,14 +5998,14 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
5886
5998
|
}
|
|
5887
5999
|
return true;
|
|
5888
6000
|
}
|
|
5889
|
-
var
|
|
6001
|
+
var import_node_fs23, import_promises5, import_node_path26, REPLACEMENT_MODULE_ROUTE;
|
|
5890
6002
|
var init_replacement_module_handler = __esm({
|
|
5891
6003
|
"src/host/replacement-module-handler.ts"() {
|
|
5892
6004
|
"use strict";
|
|
5893
6005
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
5894
|
-
|
|
6006
|
+
import_node_fs23 = require("node:fs");
|
|
5895
6007
|
import_promises5 = __toESM(require("node:fs/promises"), 1);
|
|
5896
|
-
|
|
6008
|
+
import_node_path26 = __toESM(require("node:path"), 1);
|
|
5897
6009
|
init_replacementModule();
|
|
5898
6010
|
init_backend_origin();
|
|
5899
6011
|
REPLACEMENT_MODULE_ROUTE = "/__sootsim-replacement-module";
|
|
@@ -5903,9 +6015,9 @@ var init_replacement_module_handler = __esm({
|
|
|
5903
6015
|
// cli/app-project.ts
|
|
5904
6016
|
function firstNamedFile(dir, names) {
|
|
5905
6017
|
for (const name2 of names) {
|
|
5906
|
-
const candidate =
|
|
6018
|
+
const candidate = import_node_path29.default.join(dir, name2);
|
|
5907
6019
|
try {
|
|
5908
|
-
if (
|
|
6020
|
+
if (import_node_fs25.default.statSync(candidate).isFile()) return candidate;
|
|
5909
6021
|
} catch {
|
|
5910
6022
|
}
|
|
5911
6023
|
}
|
|
@@ -5918,25 +6030,25 @@ function findRNXAppConfig(dir) {
|
|
|
5918
6030
|
return firstNamedFile(dir, PEACH_APP_CONFIG_NAMES);
|
|
5919
6031
|
}
|
|
5920
6032
|
function resolveAppProject(projectRoot) {
|
|
5921
|
-
const appDir =
|
|
6033
|
+
const appDir = import_node_path29.default.resolve(projectRoot);
|
|
5922
6034
|
try {
|
|
5923
|
-
if (!
|
|
6035
|
+
if (!import_node_fs25.default.statSync(appDir).isDirectory()) return null;
|
|
5924
6036
|
} catch {
|
|
5925
6037
|
return null;
|
|
5926
6038
|
}
|
|
5927
6039
|
const configPath = findRNXAppConfig(appDir);
|
|
5928
|
-
if (!configPath && !findExpoAppConfig(appDir) && !
|
|
6040
|
+
if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs25.default.existsSync(import_node_path29.default.join(appDir, "package.json"))) {
|
|
5929
6041
|
return null;
|
|
5930
6042
|
}
|
|
5931
6043
|
return { appDir, configPath };
|
|
5932
6044
|
}
|
|
5933
|
-
var
|
|
6045
|
+
var import_node_fs25, import_node_path29, EXPO_APP_CONFIG_NAMES, PEACH_APP_CONFIG_NAMES;
|
|
5934
6046
|
var init_app_project = __esm({
|
|
5935
6047
|
"cli/app-project.ts"() {
|
|
5936
6048
|
"use strict";
|
|
5937
6049
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
5938
|
-
|
|
5939
|
-
|
|
6050
|
+
import_node_fs25 = __toESM(require("node:fs"), 1);
|
|
6051
|
+
import_node_path29 = __toESM(require("node:path"), 1);
|
|
5940
6052
|
EXPO_APP_CONFIG_NAMES = [
|
|
5941
6053
|
"app.config.js",
|
|
5942
6054
|
"app.config.ts",
|
|
@@ -6069,7 +6181,7 @@ function resolveAppStubs(appDir, config, configDir) {
|
|
|
6069
6181
|
const { modules, views, hybridObjects } = expandStubs(appDir, source);
|
|
6070
6182
|
assertRegisteredHybridObjects(appDir, source, hybridObjects);
|
|
6071
6183
|
for (const [name2, answer] of Object.entries(hybridObjects))
|
|
6072
|
-
nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0,
|
|
6184
|
+
nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0, import_node_path32.resolve)(source.baseDir, answer) };
|
|
6073
6185
|
for (const [name2, stub] of Object.entries(modules))
|
|
6074
6186
|
nativeModules[name2] = lowerStub(stub, source.baseDir);
|
|
6075
6187
|
for (const [name2, stub] of Object.entries(views))
|
|
@@ -6134,10 +6246,10 @@ function assertRegisteredHybridObjects(appDir, source, hybridObjects) {
|
|
|
6134
6246
|
);
|
|
6135
6247
|
}
|
|
6136
6248
|
function lowerStub(stub, baseDir) {
|
|
6137
|
-
return stub === "noop" ? stub : { file: (0,
|
|
6249
|
+
return stub === "noop" ? stub : { file: (0, import_node_path32.resolve)(baseDir, stub) };
|
|
6138
6250
|
}
|
|
6139
6251
|
function readPackageJson(dir) {
|
|
6140
|
-
const text2 = readSmallFile((0,
|
|
6252
|
+
const text2 = readSmallFile((0, import_node_path32.join)(dir, "package.json"));
|
|
6141
6253
|
if (!text2) return null;
|
|
6142
6254
|
try {
|
|
6143
6255
|
const parsed = JSON.parse(text2);
|
|
@@ -6149,9 +6261,9 @@ function readPackageJson(dir) {
|
|
|
6149
6261
|
function installedPackageDir(appDir, name2) {
|
|
6150
6262
|
let current = appDir;
|
|
6151
6263
|
while (true) {
|
|
6152
|
-
const dir = (0,
|
|
6153
|
-
if ((0,
|
|
6154
|
-
const parent = (0,
|
|
6264
|
+
const dir = (0, import_node_path32.join)(current, "node_modules", name2);
|
|
6265
|
+
if ((0, import_node_fs28.existsSync)((0, import_node_path32.join)(dir, "package.json"))) return (0, import_node_fs28.realpathSync)(dir);
|
|
6266
|
+
const parent = (0, import_node_path32.dirname)(current);
|
|
6155
6267
|
if (parent === current) return null;
|
|
6156
6268
|
current = parent;
|
|
6157
6269
|
}
|
|
@@ -6255,7 +6367,7 @@ function mergeRequests(previous, next) {
|
|
|
6255
6367
|
function packageNativeRequests(dir) {
|
|
6256
6368
|
const found = /* @__PURE__ */ new Map();
|
|
6257
6369
|
const directories = scanRepository(dir).directories.filter((sub) => {
|
|
6258
|
-
const segments = (0,
|
|
6370
|
+
const segments = (0, import_node_path32.relative)(dir, sub).split("/");
|
|
6259
6371
|
return !NATIVE_SOURCE_DIRS.has(segments[0]) && !segments.some((segment) => PACKAGE_SKIP_DIRS.has(segment));
|
|
6260
6372
|
});
|
|
6261
6373
|
let files = 0;
|
|
@@ -6263,7 +6375,7 @@ function packageNativeRequests(dir) {
|
|
|
6263
6375
|
for (const name2 of listDir(sub)) {
|
|
6264
6376
|
if (!SOURCE_FILE.test(name2) || name2.endsWith(".d.ts") || files >= 2e3) continue;
|
|
6265
6377
|
files++;
|
|
6266
|
-
const file = (0,
|
|
6378
|
+
const file = (0, import_node_path32.join)(sub, name2);
|
|
6267
6379
|
const text2 = readSmallFile(file);
|
|
6268
6380
|
if (!text2) continue;
|
|
6269
6381
|
for (const { line: _line, ...request } of sourceNativeRequests(file, text2, true)) {
|
|
@@ -6381,27 +6493,27 @@ function wireSlotMigration(appDir, configPath, wire, kept = []) {
|
|
|
6381
6493
|
}
|
|
6382
6494
|
function listDir(dir) {
|
|
6383
6495
|
try {
|
|
6384
|
-
return (0,
|
|
6496
|
+
return (0, import_node_fs28.readdirSync)(dir);
|
|
6385
6497
|
} catch {
|
|
6386
6498
|
return [];
|
|
6387
6499
|
}
|
|
6388
6500
|
}
|
|
6389
6501
|
function readSmallFile(file) {
|
|
6390
6502
|
try {
|
|
6391
|
-
return (0,
|
|
6503
|
+
return (0, import_node_fs28.statSync)(file).size <= 1024 * 1024 ? (0, import_node_fs28.readFileSync)(file, "utf8") : null;
|
|
6392
6504
|
} catch {
|
|
6393
6505
|
return null;
|
|
6394
6506
|
}
|
|
6395
6507
|
}
|
|
6396
6508
|
function hasNativeCode(dir, platform) {
|
|
6397
|
-
const expoConfig = (0,
|
|
6509
|
+
const expoConfig = (0, import_node_path32.join)(dir, "expo-module.config.json");
|
|
6398
6510
|
const platforms = metadataValue(readProjectJson(expoConfig), "platforms");
|
|
6399
6511
|
if (Array.isArray(platforms))
|
|
6400
6512
|
return platforms.includes(platform) || platform === "ios" && platforms.includes("apple");
|
|
6401
|
-
if ([platform, "expo-module.config.json"].some((entry) => (0,
|
|
6513
|
+
if ([platform, "expo-module.config.json"].some((entry) => (0, import_node_fs28.existsSync)((0, import_node_path32.join)(dir, entry))))
|
|
6402
6514
|
return true;
|
|
6403
6515
|
if (listDir(dir).some((name2) => name2.endsWith(".podspec"))) return true;
|
|
6404
|
-
const manifest = readSmallFile((0,
|
|
6516
|
+
const manifest = readSmallFile((0, import_node_path32.join)(dir, "package.json"));
|
|
6405
6517
|
return manifest !== null && manifest.includes('"codegenConfig"');
|
|
6406
6518
|
}
|
|
6407
6519
|
function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__PURE__ */ new Set(), includeLegacy = false, providers) {
|
|
@@ -6414,7 +6526,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6414
6526
|
(excluded) => dir === excluded || dir.startsWith(`${excluded}/`)
|
|
6415
6527
|
))
|
|
6416
6528
|
continue;
|
|
6417
|
-
if ((0,
|
|
6529
|
+
if ((0, import_node_fs28.existsSync)((0, import_node_path32.join)(dir, "expo-module.config.json"))) {
|
|
6418
6530
|
if (platform && !hasNativeCode(dir, platform)) {
|
|
6419
6531
|
excludedModuleDirs.push(dir);
|
|
6420
6532
|
continue;
|
|
@@ -6423,7 +6535,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6423
6535
|
}
|
|
6424
6536
|
for (const name2 of listDir(dir)) {
|
|
6425
6537
|
if (SOURCE_FILE.test(name2) && !name2.endsWith(".d.ts"))
|
|
6426
|
-
sourceFiles.push((0,
|
|
6538
|
+
sourceFiles.push((0, import_node_path32.join)(dir, name2));
|
|
6427
6539
|
}
|
|
6428
6540
|
}
|
|
6429
6541
|
}
|
|
@@ -6433,7 +6545,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6433
6545
|
scanRepository(dir).directories.flatMap(
|
|
6434
6546
|
(sub) => listDir(sub).filter(
|
|
6435
6547
|
(name2) => NATIVE_SOURCE_FILE.test(name2) && (!platform || (platform === "ios" ? name2.endsWith(".swift") : name2.endsWith(".kt")))
|
|
6436
|
-
).map((name2) => (0,
|
|
6548
|
+
).map((name2) => (0, import_node_path32.join)(sub, name2))
|
|
6437
6549
|
)
|
|
6438
6550
|
])
|
|
6439
6551
|
);
|
|
@@ -6442,7 +6554,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6442
6554
|
const known = owners.get(dir);
|
|
6443
6555
|
if (known) return known;
|
|
6444
6556
|
const name2 = readPackageJson(dir)?.name;
|
|
6445
|
-
const parent = (0,
|
|
6557
|
+
const parent = (0, import_node_path32.dirname)(dir);
|
|
6446
6558
|
const result = typeof name2 === "string" ? name2 : parent === dir ? pkg.name ?? "app" : owner(parent);
|
|
6447
6559
|
owners.set(dir, result);
|
|
6448
6560
|
return result;
|
|
@@ -6456,25 +6568,25 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6456
6568
|
else {
|
|
6457
6569
|
const moduleDir2 = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`));
|
|
6458
6570
|
if (moduleDir2 && (file.endsWith(".swift") || !known.expoModule)) {
|
|
6459
|
-
known.expoModule = (0,
|
|
6571
|
+
known.expoModule = (0, import_node_path32.relative)(appDir, moduleDir2) || ".";
|
|
6460
6572
|
known.swift = file.endsWith(".swift");
|
|
6461
6573
|
}
|
|
6462
6574
|
}
|
|
6463
6575
|
return;
|
|
6464
6576
|
}
|
|
6465
6577
|
providers ??= dependencyNativeOwners(appDir, pkg);
|
|
6466
|
-
const packageName = providers.get(key) ?? owner((0,
|
|
6578
|
+
const packageName = providers.get(key) ?? owner((0, import_node_path32.dirname)(file));
|
|
6467
6579
|
if (knownPackages.has(packageName)) return;
|
|
6468
6580
|
const moduleDir = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`)) ?? null;
|
|
6469
6581
|
found.set(key, {
|
|
6470
6582
|
kind,
|
|
6471
6583
|
name: name2,
|
|
6472
6584
|
package: packageName,
|
|
6473
|
-
path: `${(0,
|
|
6474
|
-
expoModule: moduleDir ? (0,
|
|
6585
|
+
path: `${(0, import_node_path32.relative)(appDir, file)}:${line}`,
|
|
6586
|
+
expoModule: moduleDir ? (0, import_node_path32.relative)(appDir, moduleDir) || "." : null,
|
|
6475
6587
|
optional: optional3,
|
|
6476
6588
|
swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
|
|
6477
|
-
(
|
|
6589
|
+
(path32) => path32.endsWith(".swift") && [...(readSmallFile(path32) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
|
|
6478
6590
|
(match) => match[1] === name2
|
|
6479
6591
|
)
|
|
6480
6592
|
) : false,
|
|
@@ -6522,30 +6634,30 @@ function workspacePackageDirs(appDir, pkg) {
|
|
|
6522
6634
|
for (const name2 of Object.keys({ ...pkg.dependencies, ...pkg.devDependencies })) {
|
|
6523
6635
|
let current = appDir;
|
|
6524
6636
|
while (true) {
|
|
6525
|
-
const link = (0,
|
|
6526
|
-
if ((0,
|
|
6527
|
-
if ((0,
|
|
6528
|
-
const target = (0,
|
|
6637
|
+
const link = (0, import_node_path32.join)(current, "node_modules", name2);
|
|
6638
|
+
if ((0, import_node_fs28.existsSync)(link)) {
|
|
6639
|
+
if ((0, import_node_fs28.lstatSync)(link).isSymbolicLink()) {
|
|
6640
|
+
const target = (0, import_node_fs28.realpathSync)(link);
|
|
6529
6641
|
if (!target.split("/").includes("node_modules") && !target.startsWith(`${appDir}/`)) {
|
|
6530
6642
|
dirs.add(target);
|
|
6531
6643
|
}
|
|
6532
6644
|
}
|
|
6533
6645
|
break;
|
|
6534
6646
|
}
|
|
6535
|
-
const parent = (0,
|
|
6647
|
+
const parent = (0, import_node_path32.dirname)(current);
|
|
6536
6648
|
if (parent === current) break;
|
|
6537
6649
|
current = parent;
|
|
6538
6650
|
}
|
|
6539
6651
|
}
|
|
6540
6652
|
return [...dirs];
|
|
6541
6653
|
}
|
|
6542
|
-
var
|
|
6654
|
+
var import_node_fs28, import_node_path32, import_oxc_parser2, import_sucrase, SOURCE_FILE, NATIVE_LOOKUP, NATIVE_SOURCE_DIRS, PACKAGE_SKIP_DIRS, NATIVE_SOURCE_FILE;
|
|
6543
6655
|
var init_app_stubs = __esm({
|
|
6544
6656
|
"cli/app-stubs.ts"() {
|
|
6545
6657
|
"use strict";
|
|
6546
6658
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6547
|
-
|
|
6548
|
-
|
|
6659
|
+
import_node_fs28 = require("node:fs");
|
|
6660
|
+
import_node_path32 = require("node:path");
|
|
6549
6661
|
init_version_range();
|
|
6550
6662
|
import_oxc_parser2 = require("oxc-parser");
|
|
6551
6663
|
import_sucrase = require("sucrase");
|
|
@@ -6581,12 +6693,12 @@ function resolveFileEntries(entries, configDir) {
|
|
|
6581
6693
|
return Object.fromEntries(
|
|
6582
6694
|
Object.entries(entries).map(([name2, resolution]) => [
|
|
6583
6695
|
name2,
|
|
6584
|
-
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file:
|
|
6696
|
+
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path33.default.resolve(configDir, resolution.file) } : resolution
|
|
6585
6697
|
])
|
|
6586
6698
|
);
|
|
6587
6699
|
}
|
|
6588
6700
|
function resolveConfigReplacementFiles(config, configPath) {
|
|
6589
|
-
const configDir =
|
|
6701
|
+
const configDir = import_node_path33.default.dirname(configPath);
|
|
6590
6702
|
return {
|
|
6591
6703
|
...config,
|
|
6592
6704
|
modules: resolveFileEntries(config.modules, configDir)
|
|
@@ -6602,7 +6714,7 @@ async function loadRNXAppStubs(project) {
|
|
|
6602
6714
|
return resolveAppStubs(
|
|
6603
6715
|
project.appDir,
|
|
6604
6716
|
config,
|
|
6605
|
-
project.configPath ?
|
|
6717
|
+
project.configPath ? import_node_path33.default.dirname(project.configPath) : project.appDir
|
|
6606
6718
|
);
|
|
6607
6719
|
} catch (error) {
|
|
6608
6720
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -6621,7 +6733,7 @@ async function loadConfigFile(project) {
|
|
|
6621
6733
|
[`${rnxPublicBrand.packageName}/config`]: config_exports
|
|
6622
6734
|
}
|
|
6623
6735
|
});
|
|
6624
|
-
const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0,
|
|
6736
|
+
const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0, import_node_fs29.readFileSync)(project.configPath, "utf8")) : await jiti.import(project.configPath, { default: true });
|
|
6625
6737
|
if (!isPeachConfig(loaded3)) {
|
|
6626
6738
|
throw new Error("the default export must be a peach config object");
|
|
6627
6739
|
}
|
|
@@ -6657,13 +6769,13 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
|
|
|
6657
6769
|
const project = resolveAppProject(startDir);
|
|
6658
6770
|
return { project, ...await loadRNXAppStubs(project) };
|
|
6659
6771
|
}
|
|
6660
|
-
var
|
|
6772
|
+
var import_node_fs29, import_node_path33, import_jiti, WIRE_SLOTS;
|
|
6661
6773
|
var init_app_config = __esm({
|
|
6662
6774
|
"cli/app-config.ts"() {
|
|
6663
6775
|
"use strict";
|
|
6664
6776
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6665
|
-
|
|
6666
|
-
|
|
6777
|
+
import_node_fs29 = require("node:fs");
|
|
6778
|
+
import_node_path33 = __toESM(require("node:path"), 1);
|
|
6667
6779
|
import_jiti = require("jiti");
|
|
6668
6780
|
init_config();
|
|
6669
6781
|
init_config();
|
|
@@ -6763,14 +6875,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
6763
6875
|
const neededPackages = /* @__PURE__ */ new Set();
|
|
6764
6876
|
const factories = [];
|
|
6765
6877
|
const visit3 = (filePath) => {
|
|
6766
|
-
const real =
|
|
6878
|
+
const real = import_node_fs30.default.realpathSync(filePath);
|
|
6767
6879
|
const previous = files.get(real);
|
|
6768
6880
|
if (previous !== void 0) return previous;
|
|
6769
6881
|
const id = "peach-config-file:" + files.size;
|
|
6770
6882
|
files.set(real, id);
|
|
6771
6883
|
const compiled = compileReplacementModule({
|
|
6772
6884
|
filePath: real,
|
|
6773
|
-
source:
|
|
6885
|
+
source: import_node_fs30.default.readFileSync(real, "utf8"),
|
|
6774
6886
|
runtimePackages,
|
|
6775
6887
|
localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
|
|
6776
6888
|
});
|
|
@@ -6794,7 +6906,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
6794
6906
|
if (!entries || typeof entries !== "object") continue;
|
|
6795
6907
|
for (const resolution of Object.values(entries)) {
|
|
6796
6908
|
if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
|
|
6797
|
-
resolution.file = visit3(
|
|
6909
|
+
resolution.file = visit3(import_node_path34.default.resolve(resolution.file));
|
|
6798
6910
|
}
|
|
6799
6911
|
}
|
|
6800
6912
|
}
|
|
@@ -6818,13 +6930,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
6818
6930
|
const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
|
|
6819
6931
|
return prefix2 + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
|
|
6820
6932
|
}
|
|
6821
|
-
var
|
|
6933
|
+
var import_node_fs30, import_node_path34, import_sucrase2, import_terser, PREFIX_START, PREFIX_END;
|
|
6822
6934
|
var init_configured_bundle_producer = __esm({
|
|
6823
6935
|
"src/configured-bundle-producer.ts"() {
|
|
6824
6936
|
"use strict";
|
|
6825
6937
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6826
|
-
|
|
6827
|
-
|
|
6938
|
+
import_node_fs30 = __toESM(require("node:fs"), 1);
|
|
6939
|
+
import_node_path34 = __toESM(require("node:path"), 1);
|
|
6828
6940
|
init_bundle_global_footer();
|
|
6829
6941
|
import_sucrase2 = require("sucrase");
|
|
6830
6942
|
import_terser = require("terser");
|
|
@@ -12120,7 +12232,7 @@ function readIosSdkTree(root) {
|
|
|
12120
12232
|
|
|
12121
12233
|
// src/swift-standin-digest.ts
|
|
12122
12234
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
12123
|
-
var STANDIN_SOURCE_DIGEST = true ? "
|
|
12235
|
+
var STANDIN_SOURCE_DIGEST = true ? "534310cfac2856971a0189d9835d2bc10e471963394e3c17bdc2815a82872e0f" : standinSourceDigest();
|
|
12124
12236
|
|
|
12125
12237
|
// src/expo-native-workspace.ts
|
|
12126
12238
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -12843,10 +12955,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
|
|
|
12843
12955
|
var APP_DELEGATE_PATH_RE = /(?:^|\/)(?:ios\/)?([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
|
|
12844
12956
|
function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
|
|
12845
12957
|
const pbxprojPath = Object.keys(files).find(
|
|
12846
|
-
(
|
|
12958
|
+
(path32) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path32)
|
|
12847
12959
|
) ?? Object.keys(files).find(
|
|
12848
|
-
(
|
|
12849
|
-
) ?? Object.keys(files).find((
|
|
12960
|
+
(path32) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path32)
|
|
12961
|
+
) ?? Object.keys(files).find((path32) => /(?:^|\/)project\.pbxproj$/.test(path32));
|
|
12850
12962
|
if (!pbxprojPath) return null;
|
|
12851
12963
|
const pbxproj = files[pbxprojPath];
|
|
12852
12964
|
let objects = {};
|
|
@@ -12888,7 +13000,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
12888
13000
|
} else if (applicationTargetNames.size === 1) {
|
|
12889
13001
|
targetName = [...applicationTargetNames][0];
|
|
12890
13002
|
} else if (applicationTargetNames.size > 1) {
|
|
12891
|
-
const delegateTargets = Object.keys(files).filter((
|
|
13003
|
+
const delegateTargets = Object.keys(files).filter((path32) => !path32.includes("/Pods/")).map((path32) => path32.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
|
|
12892
13004
|
(name2) => typeof name2 === "string" && applicationTargetNames.has(name2)
|
|
12893
13005
|
);
|
|
12894
13006
|
if (delegateTargets.length === 1) {
|
|
@@ -13129,7 +13241,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
13129
13241
|
if (Object.hasOwn(files, file)) return [file];
|
|
13130
13242
|
const prefix2 = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
|
|
13131
13243
|
return paths.filter(
|
|
13132
|
-
(
|
|
13244
|
+
(path32) => path32.startsWith(prefix2) && !/(?:^|\/)\./.test(path32.slice(prefix2.length))
|
|
13133
13245
|
);
|
|
13134
13246
|
},
|
|
13135
13247
|
join9,
|
|
@@ -13140,7 +13252,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
13140
13252
|
}
|
|
13141
13253
|
const rootModuleName = readRootModuleName(
|
|
13142
13254
|
Object.entries(files).filter(
|
|
13143
|
-
([
|
|
13255
|
+
([path32]) => !path32.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path32) || path32.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
|
|
13144
13256
|
).map(([, source]) => source)
|
|
13145
13257
|
);
|
|
13146
13258
|
return {
|
|
@@ -14285,7 +14397,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
|
|
|
14285
14397
|
var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
14286
14398
|
(module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
|
|
14287
14399
|
).join("");
|
|
14288
|
-
var compilerSourceDigest = true ? "
|
|
14400
|
+
var compilerSourceDigest = true ? "02a45415d48ad9eb28df54607ec6601ccbe130e18dcc1522b7ad9adba9921f43" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
|
|
14289
14401
|
var CORE_FOUNDATION_HANDLE_IMPORTS = [
|
|
14290
14402
|
"CFAllocator",
|
|
14291
14403
|
"CFArray",
|
|
@@ -17409,9 +17521,9 @@ init_is_record();
|
|
|
17409
17521
|
|
|
17410
17522
|
// src/native-app-identity-project.ts
|
|
17411
17523
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
17412
|
-
var
|
|
17413
|
-
var
|
|
17414
|
-
var
|
|
17524
|
+
var import_node_fs20 = __toESM(require("node:fs"), 1);
|
|
17525
|
+
var import_node_module3 = require("node:module");
|
|
17526
|
+
var import_node_path22 = __toESM(require("node:path"), 1);
|
|
17415
17527
|
init_is_record();
|
|
17416
17528
|
function nonEmptyString2(value) {
|
|
17417
17529
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
@@ -17499,7 +17611,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
17499
17611
|
const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
|
|
17500
17612
|
const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
|
|
17501
17613
|
const rootModuleName = readRootModuleName(
|
|
17502
|
-
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) &&
|
|
17614
|
+
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && import_node_fs20.default.existsSync(file)).map((file) => import_node_fs20.default.readFileSync(file, "utf8"))
|
|
17503
17615
|
);
|
|
17504
17616
|
return stampNativeBuildSdk({
|
|
17505
17617
|
...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
|
|
@@ -17521,7 +17633,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
17521
17633
|
googleSignIn: readGoogleSignInConfiguration(
|
|
17522
17634
|
dictionary,
|
|
17523
17635
|
Object.fromEntries(
|
|
17524
|
-
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(
|
|
17636
|
+
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs20.default.readFileSync(file, "utf8"))])
|
|
17525
17637
|
)
|
|
17526
17638
|
),
|
|
17527
17639
|
supportedInterfaceOrientations,
|
|
@@ -17531,11 +17643,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
17531
17643
|
bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => value),
|
|
17532
17644
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
17533
17645
|
app.resources,
|
|
17534
|
-
(file) =>
|
|
17646
|
+
(file) => import_node_fs20.default.readFileSync(file, "utf8"),
|
|
17535
17647
|
(file) => {
|
|
17536
|
-
const extension =
|
|
17648
|
+
const extension = import_node_path22.default.extname(file).toLowerCase();
|
|
17537
17649
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
17538
|
-
return `data:${contentType};base64,${
|
|
17650
|
+
return `data:${contentType};base64,${import_node_fs20.default.readFileSync(file).toString("base64")}`;
|
|
17539
17651
|
},
|
|
17540
17652
|
icons,
|
|
17541
17653
|
app.appIconName,
|
|
@@ -17565,11 +17677,11 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
17565
17677
|
const read = selectNativeAppIdentityReader(platform, {
|
|
17566
17678
|
android: () => null,
|
|
17567
17679
|
ios: () => {
|
|
17568
|
-
const nested =
|
|
17569
|
-
const iosRoot =
|
|
17680
|
+
const nested = import_node_path22.default.join(projectRoot, "ios");
|
|
17681
|
+
const iosRoot = import_node_fs20.default.existsSync(nested) ? nested : projectRoot;
|
|
17570
17682
|
const prefix2 = iosRoot === nested ? "ios/" : "";
|
|
17571
17683
|
const files = {};
|
|
17572
|
-
for (const entry of
|
|
17684
|
+
for (const entry of import_node_fs20.default.readdirSync(iosRoot, { withFileTypes: true })) {
|
|
17573
17685
|
if (entry.name === "Pods") continue;
|
|
17574
17686
|
if (entry.isDirectory()) {
|
|
17575
17687
|
const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : [
|
|
@@ -17577,17 +17689,17 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
17577
17689
|
"AppDelegate.swift",
|
|
17578
17690
|
"AppDelegate.mm",
|
|
17579
17691
|
"AppDelegate.m",
|
|
17580
|
-
...
|
|
17692
|
+
...import_node_fs20.default.readdirSync(import_node_path22.default.join(iosRoot, entry.name)).filter((name2) => name2.endsWith(".entitlements"))
|
|
17581
17693
|
];
|
|
17582
17694
|
for (const name2 of names) {
|
|
17583
17695
|
const relative3 = `${prefix2}${entry.name}/${name2}`;
|
|
17584
|
-
const file =
|
|
17585
|
-
if (
|
|
17696
|
+
const file = import_node_path22.default.join(projectRoot, relative3);
|
|
17697
|
+
if (import_node_fs20.default.existsSync(file)) files[relative3] = import_node_fs20.default.readFileSync(file, "utf8");
|
|
17586
17698
|
}
|
|
17587
17699
|
} else if (/AppDelegate\.(?:swift|mm|m)$|\.entitlements$/.test(entry.name)) {
|
|
17588
17700
|
const relative3 = `${prefix2}${entry.name}`;
|
|
17589
|
-
const file =
|
|
17590
|
-
if (
|
|
17701
|
+
const file = import_node_path22.default.join(projectRoot, relative3);
|
|
17702
|
+
if (import_node_fs20.default.existsSync(file)) files[relative3] = import_node_fs20.default.readFileSync(file, "utf8");
|
|
17591
17703
|
}
|
|
17592
17704
|
}
|
|
17593
17705
|
const identity = extractNativeAppIdentityFromFiles(
|
|
@@ -17604,41 +17716,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
17604
17716
|
function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
17605
17717
|
const files = {};
|
|
17606
17718
|
if (androidMergedManifest) {
|
|
17607
|
-
const file =
|
|
17608
|
-
if (!
|
|
17609
|
-
files[androidMergedManifest] =
|
|
17719
|
+
const file = import_node_path22.default.resolve(projectRoot, androidMergedManifest);
|
|
17720
|
+
if (!import_node_fs20.default.existsSync(file)) return null;
|
|
17721
|
+
files[androidMergedManifest] = import_node_fs20.default.readFileSync(file, "utf8");
|
|
17610
17722
|
} else {
|
|
17611
|
-
const androidRoot =
|
|
17612
|
-
if (!
|
|
17723
|
+
const androidRoot = import_node_path22.default.join(projectRoot, "android");
|
|
17724
|
+
if (!import_node_fs20.default.existsSync(androidRoot)) return null;
|
|
17613
17725
|
const collect = (directory) => {
|
|
17614
|
-
for (const entry of
|
|
17615
|
-
const file =
|
|
17726
|
+
for (const entry of import_node_fs20.default.readdirSync(directory, { withFileTypes: true })) {
|
|
17727
|
+
const file = import_node_path22.default.join(directory, entry.name);
|
|
17616
17728
|
if (entry.isDirectory()) collect(file);
|
|
17617
17729
|
else if (entry.isFile() && entry.name === "AndroidManifest.xml")
|
|
17618
|
-
files[
|
|
17730
|
+
files[import_node_path22.default.relative(projectRoot, file).split(import_node_path22.default.sep).join("/")] = import_node_fs20.default.readFileSync(file, "utf8");
|
|
17619
17731
|
}
|
|
17620
17732
|
};
|
|
17621
|
-
for (const module2 of
|
|
17733
|
+
for (const module2 of import_node_fs20.default.readdirSync(androidRoot, { withFileTypes: true })) {
|
|
17622
17734
|
if (!module2.isDirectory()) continue;
|
|
17623
|
-
const outputs =
|
|
17735
|
+
const outputs = import_node_path22.default.join(
|
|
17624
17736
|
androidRoot,
|
|
17625
17737
|
module2.name,
|
|
17626
17738
|
"build/intermediates/merged_manifests"
|
|
17627
17739
|
);
|
|
17628
|
-
if (
|
|
17740
|
+
if (import_node_fs20.default.existsSync(outputs)) collect(outputs);
|
|
17629
17741
|
}
|
|
17630
17742
|
}
|
|
17631
17743
|
for (const manifest of Object.keys(files)) {
|
|
17632
17744
|
const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
|
|
17633
17745
|
if (!resourceDirectory) continue;
|
|
17634
|
-
const absolute =
|
|
17635
|
-
if (!
|
|
17636
|
-
for (const entry of
|
|
17746
|
+
const absolute = import_node_path22.default.resolve(projectRoot, resourceDirectory);
|
|
17747
|
+
if (!import_node_fs20.default.existsSync(absolute)) continue;
|
|
17748
|
+
for (const entry of import_node_fs20.default.readdirSync(absolute, { withFileTypes: true })) {
|
|
17637
17749
|
if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
|
|
17638
|
-
for (const resource of
|
|
17750
|
+
for (const resource of import_node_fs20.default.readdirSync(import_node_path22.default.join(absolute, entry.name))) {
|
|
17639
17751
|
if (!resource.endsWith(".xml")) continue;
|
|
17640
17752
|
const file = `${resourceDirectory}/${entry.name}/${resource}`;
|
|
17641
|
-
files[file] =
|
|
17753
|
+
files[file] = import_node_fs20.default.readFileSync(import_node_path22.default.resolve(projectRoot, file), "utf8");
|
|
17642
17754
|
}
|
|
17643
17755
|
}
|
|
17644
17756
|
}
|
|
@@ -17655,8 +17767,8 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
17655
17767
|
const app = readIosAppTarget(projectRoot, iosTarget, environment);
|
|
17656
17768
|
if (!app) return null;
|
|
17657
17769
|
const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
|
|
17658
|
-
const projectManifestPath =
|
|
17659
|
-
const projectRequire = (0,
|
|
17770
|
+
const projectManifestPath = import_node_path22.default.join(projectRoot, "package.json");
|
|
17771
|
+
const projectRequire = (0, import_node_module3.createRequire)(projectManifestPath);
|
|
17660
17772
|
let reanimatedManifestPath;
|
|
17661
17773
|
try {
|
|
17662
17774
|
reanimatedManifestPath = projectRequire.resolve(
|
|
@@ -17669,22 +17781,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
17669
17781
|
throw error;
|
|
17670
17782
|
}
|
|
17671
17783
|
const installedManifest = JSON.parse(
|
|
17672
|
-
|
|
17784
|
+
import_node_fs20.default.readFileSync(reanimatedManifestPath, "utf8")
|
|
17673
17785
|
);
|
|
17674
17786
|
const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
|
|
17675
17787
|
if (!installedVersion) throw new Error("Reanimated package version is malformed");
|
|
17676
17788
|
if (Number.parseInt(installedVersion, 10) < 4) return identity;
|
|
17677
17789
|
const defaults = JSON.parse(
|
|
17678
|
-
|
|
17679
|
-
|
|
17680
|
-
|
|
17790
|
+
import_node_fs20.default.readFileSync(
|
|
17791
|
+
import_node_path22.default.join(
|
|
17792
|
+
import_node_path22.default.dirname(reanimatedManifestPath),
|
|
17681
17793
|
"src/featureFlags/staticFlags.json"
|
|
17682
17794
|
),
|
|
17683
17795
|
"utf8"
|
|
17684
17796
|
)
|
|
17685
17797
|
);
|
|
17686
17798
|
if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
|
|
17687
|
-
const manifest = JSON.parse(
|
|
17799
|
+
const manifest = JSON.parse(import_node_fs20.default.readFileSync(projectManifestPath, "utf8"));
|
|
17688
17800
|
const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
|
|
17689
17801
|
const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
|
|
17690
17802
|
if (overrides !== void 0 && !isRecord(overrides)) {
|
|
@@ -20566,8 +20678,8 @@ var COMPAT_STUBS = {
|
|
|
20566
20678
|
|
|
20567
20679
|
// src/installed-native-build-options.ts
|
|
20568
20680
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
20569
|
-
var
|
|
20570
|
-
var
|
|
20681
|
+
var import_node_fs21 = __toESM(require("node:fs"), 1);
|
|
20682
|
+
var import_node_path23 = __toESM(require("node:path"), 1);
|
|
20571
20683
|
init_version_range();
|
|
20572
20684
|
var RIVE_PACKAGE = "@rive-app/react-native";
|
|
20573
20685
|
var RIVE_05 = [">=0.5.0 <0.6.0"];
|
|
@@ -20576,10 +20688,10 @@ function missing(error) {
|
|
|
20576
20688
|
}
|
|
20577
20689
|
function answerSync(step) {
|
|
20578
20690
|
try {
|
|
20579
|
-
if (step.type === "realpath") return
|
|
20580
|
-
if (step.type === "read") return
|
|
20581
|
-
if (step.type === "isDirectory") return
|
|
20582
|
-
return
|
|
20691
|
+
if (step.type === "realpath") return import_node_fs21.default.realpathSync(step.path);
|
|
20692
|
+
if (step.type === "read") return import_node_fs21.default.readFileSync(step.path, "utf8");
|
|
20693
|
+
if (step.type === "isDirectory") return import_node_fs21.default.statSync(step.path).isDirectory();
|
|
20694
|
+
return import_node_fs21.default.readdirSync(step.path, { withFileTypes: true }).map((entry) => ({
|
|
20583
20695
|
name: entry.name,
|
|
20584
20696
|
directory: entry.isDirectory(),
|
|
20585
20697
|
symbolicLink: entry.isSymbolicLink()
|
|
@@ -20591,11 +20703,11 @@ function answerSync(step) {
|
|
|
20591
20703
|
}
|
|
20592
20704
|
async function answerAsync(step) {
|
|
20593
20705
|
try {
|
|
20594
|
-
if (step.type === "realpath") return await
|
|
20595
|
-
if (step.type === "read") return await
|
|
20706
|
+
if (step.type === "realpath") return await import_node_fs21.default.promises.realpath(step.path);
|
|
20707
|
+
if (step.type === "read") return await import_node_fs21.default.promises.readFile(step.path, "utf8");
|
|
20596
20708
|
if (step.type === "isDirectory")
|
|
20597
|
-
return (await
|
|
20598
|
-
return (await
|
|
20709
|
+
return (await import_node_fs21.default.promises.stat(step.path)).isDirectory();
|
|
20710
|
+
return (await import_node_fs21.default.promises.readdir(step.path, { withFileTypes: true })).map(
|
|
20599
20711
|
(entry) => ({
|
|
20600
20712
|
name: entry.name,
|
|
20601
20713
|
directory: entry.isDirectory(),
|
|
@@ -20628,7 +20740,7 @@ function* rubyFiles(directory, seen, iosRoot = false) {
|
|
|
20628
20740
|
const files = [];
|
|
20629
20741
|
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
20630
20742
|
if (iosRoot && (entry.name === "Pods" || entry.name === "build")) continue;
|
|
20631
|
-
const target =
|
|
20743
|
+
const target = import_node_path23.default.join(directory, entry.name);
|
|
20632
20744
|
let isDirectory2 = entry.directory;
|
|
20633
20745
|
if (entry.symbolicLink)
|
|
20634
20746
|
isDirectory2 = (yield { type: "isDirectory", path: target }) === true;
|
|
@@ -20641,7 +20753,7 @@ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
|
|
|
20641
20753
|
let sensorOptions = {};
|
|
20642
20754
|
const sensors = versions["expo-sensors"];
|
|
20643
20755
|
if (sensors && resolveCompatVersionRange([">=58.0.4 <59.0.0"], sensors).status === "matched") {
|
|
20644
|
-
const file =
|
|
20756
|
+
const file = import_node_path23.default.join(projectRoot, "ios", "Podfile.properties.json");
|
|
20645
20757
|
const source = yield { type: "read", path: file };
|
|
20646
20758
|
if (source !== null && typeof source !== "string")
|
|
20647
20759
|
throw new Error(`cannot inspect ${file}`);
|
|
@@ -20657,8 +20769,8 @@ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
|
|
|
20657
20769
|
if (!needsRiveOptions(versions)) return sensorOptions;
|
|
20658
20770
|
if (environment.USE_RIVE_LEGACY === "1" || environment.USE_RIVE_LEGACY === "true")
|
|
20659
20771
|
return { ...sensorOptions, [RIVE_PACKAGE]: { USE_RIVE_LEGACY: true } };
|
|
20660
|
-
const ios =
|
|
20661
|
-
const podfile =
|
|
20772
|
+
const ios = import_node_path23.default.join(projectRoot, "ios");
|
|
20773
|
+
const podfile = import_node_path23.default.join(ios, "Podfile");
|
|
20662
20774
|
const files = [podfile, ...yield* rubyFiles(ios, /* @__PURE__ */ new Set(), true)];
|
|
20663
20775
|
let value = false;
|
|
20664
20776
|
let assigned = false;
|
|
@@ -20931,9 +21043,9 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
20931
21043
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
20932
21044
|
var import_child_process2 = require("child_process");
|
|
20933
21045
|
var import_promises = require("fs/promises");
|
|
20934
|
-
var
|
|
21046
|
+
var import_node_fs22 = require("node:fs");
|
|
20935
21047
|
var import_node_os4 = require("node:os");
|
|
20936
|
-
var
|
|
21048
|
+
var import_node_path24 = require("node:path");
|
|
20937
21049
|
init_backend_origin();
|
|
20938
21050
|
init_config();
|
|
20939
21051
|
|
|
@@ -21082,8 +21194,8 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
21082
21194
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
21083
21195
|
|
|
21084
21196
|
// scripts/dev-server-scanner.ts
|
|
21085
|
-
var LISTENER_LOCK_PATH = (0,
|
|
21086
|
-
var LISTENER_RESULT_PATH = (0,
|
|
21197
|
+
var LISTENER_LOCK_PATH = (0, import_node_path24.join)((0, import_node_os4.tmpdir)(), "peach-listener-scan.lock");
|
|
21198
|
+
var LISTENER_RESULT_PATH = (0, import_node_path24.join)((0, import_node_os4.tmpdir)(), "peach-listener-scan.result");
|
|
21087
21199
|
var LISTENER_LOCK_STALE_MS = 25e3;
|
|
21088
21200
|
var LISTENER_LOCK_WAIT_MS = 8e3;
|
|
21089
21201
|
function sleep2(ms) {
|
|
@@ -21101,8 +21213,8 @@ function pidIsAlive(pid) {
|
|
|
21101
21213
|
}
|
|
21102
21214
|
function readLockOwner() {
|
|
21103
21215
|
try {
|
|
21104
|
-
const raw = (0,
|
|
21105
|
-
const mtimeMs = (0,
|
|
21216
|
+
const raw = (0, import_node_fs22.readFileSync)(LISTENER_LOCK_PATH, "utf8");
|
|
21217
|
+
const mtimeMs = (0, import_node_fs22.statSync)(LISTENER_LOCK_PATH).mtimeMs;
|
|
21106
21218
|
const pid = Number(raw.split("-")[0]);
|
|
21107
21219
|
return { raw, pid: Number.isInteger(pid) ? pid : -1, mtimeMs };
|
|
21108
21220
|
} catch {
|
|
@@ -21115,15 +21227,15 @@ function lockIsAbandoned(owner) {
|
|
|
21115
21227
|
}
|
|
21116
21228
|
function clearLock(raw) {
|
|
21117
21229
|
try {
|
|
21118
|
-
if ((0,
|
|
21119
|
-
(0,
|
|
21230
|
+
if ((0, import_node_fs22.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
|
|
21231
|
+
(0, import_node_fs22.unlinkSync)(LISTENER_LOCK_PATH);
|
|
21120
21232
|
} catch {
|
|
21121
21233
|
}
|
|
21122
21234
|
}
|
|
21123
21235
|
function readResult() {
|
|
21124
21236
|
try {
|
|
21125
21237
|
const parsed = JSON.parse(
|
|
21126
|
-
(0,
|
|
21238
|
+
(0, import_node_fs22.readFileSync)(LISTENER_RESULT_PATH, "utf8")
|
|
21127
21239
|
);
|
|
21128
21240
|
if (!parsed || typeof parsed.token !== "string" || typeof parsed.key !== "string")
|
|
21129
21241
|
return null;
|
|
@@ -21134,8 +21246,8 @@ function readResult() {
|
|
|
21134
21246
|
}
|
|
21135
21247
|
function publishResult(payload) {
|
|
21136
21248
|
const tmp = `${LISTENER_RESULT_PATH}.${process.pid}.tmp`;
|
|
21137
|
-
(0,
|
|
21138
|
-
(0,
|
|
21249
|
+
(0, import_node_fs22.writeFileSync)(tmp, JSON.stringify(payload));
|
|
21250
|
+
(0, import_node_fs22.renameSync)(tmp, LISTENER_RESULT_PATH);
|
|
21139
21251
|
}
|
|
21140
21252
|
function throwPublished(payload) {
|
|
21141
21253
|
throw Object.assign(new Error(payload.message || "listener scan failed"), {
|
|
@@ -21178,7 +21290,7 @@ async function withListenerLock(key, body) {
|
|
|
21178
21290
|
for (; ; ) {
|
|
21179
21291
|
let fd = null;
|
|
21180
21292
|
try {
|
|
21181
|
-
fd = (0,
|
|
21293
|
+
fd = (0, import_node_fs22.openSync)(LISTENER_LOCK_PATH, "wx");
|
|
21182
21294
|
} catch (error) {
|
|
21183
21295
|
const code = error instanceof Error && "code" in error ? error.code : "";
|
|
21184
21296
|
if (code !== "EEXIST") throw error;
|
|
@@ -21187,7 +21299,7 @@ async function withListenerLock(key, body) {
|
|
|
21187
21299
|
if (owner) clearLock(owner.raw);
|
|
21188
21300
|
else {
|
|
21189
21301
|
try {
|
|
21190
|
-
(0,
|
|
21302
|
+
(0, import_node_fs22.unlinkSync)(LISTENER_LOCK_PATH);
|
|
21191
21303
|
} catch {
|
|
21192
21304
|
}
|
|
21193
21305
|
}
|
|
@@ -21203,7 +21315,7 @@ async function withListenerLock(key, body) {
|
|
|
21203
21315
|
}
|
|
21204
21316
|
if (fd === null) continue;
|
|
21205
21317
|
try {
|
|
21206
|
-
(0,
|
|
21318
|
+
(0, import_node_fs22.writeSync)(fd, token);
|
|
21207
21319
|
try {
|
|
21208
21320
|
const value = await body();
|
|
21209
21321
|
publishResult({ token, key, ok: true, value });
|
|
@@ -21220,7 +21332,7 @@ async function withListenerLock(key, body) {
|
|
|
21220
21332
|
}
|
|
21221
21333
|
} finally {
|
|
21222
21334
|
try {
|
|
21223
|
-
(0,
|
|
21335
|
+
(0, import_node_fs22.closeSync)(fd);
|
|
21224
21336
|
} catch {
|
|
21225
21337
|
}
|
|
21226
21338
|
clearLock(token);
|
|
@@ -21747,7 +21859,7 @@ function parseIpv6(text2) {
|
|
|
21747
21859
|
|
|
21748
21860
|
// src/host/network-policy.ts
|
|
21749
21861
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
21750
|
-
var
|
|
21862
|
+
var import_node_path25 = require("node:path");
|
|
21751
21863
|
var import_node_url = require("node:url");
|
|
21752
21864
|
var NETWORK_POLICY_TIMEOUT_MS = 1e4;
|
|
21753
21865
|
var NetworkPolicyDeniedError = class extends Error {
|
|
@@ -21800,7 +21912,7 @@ function createNetworkAuthorizer(policy) {
|
|
|
21800
21912
|
};
|
|
21801
21913
|
}
|
|
21802
21914
|
async function loadNetworkPolicy(file) {
|
|
21803
|
-
if (!(0,
|
|
21915
|
+
if (!(0, import_node_path25.isAbsolute)(file)) {
|
|
21804
21916
|
throw new Error(`PEACH_NETWORK_POLICY must be an absolute path: ${file}`);
|
|
21805
21917
|
}
|
|
21806
21918
|
const loaded3 = await import(
|
|
@@ -22356,7 +22468,7 @@ init_replacement_module_handler();
|
|
|
22356
22468
|
|
|
22357
22469
|
// src/one-native-app-catalog.ts
|
|
22358
22470
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
22359
|
-
var
|
|
22471
|
+
var import_node_path27 = __toESM(require("node:path"), 1);
|
|
22360
22472
|
init_is_record();
|
|
22361
22473
|
var ONE_NATIVE_APP_CATALOG_ROUTE = "/__peach/native-app-catalog";
|
|
22362
22474
|
var HEX_COLOR = /^#[\da-f]{6}$/i;
|
|
@@ -22369,7 +22481,7 @@ function parseAccent(value) {
|
|
|
22369
22481
|
function parseOneNativeAppCatalog(value) {
|
|
22370
22482
|
if (!isRecord(value)) return null;
|
|
22371
22483
|
const accentColor = parseAccent(value.accentColor);
|
|
22372
|
-
const assetCatalog = typeof value.assetCatalog === "string" &&
|
|
22484
|
+
const assetCatalog = typeof value.assetCatalog === "string" && import_node_path27.default.isAbsolute(value.assetCatalog) ? value.assetCatalog : null;
|
|
22373
22485
|
return accentColor || assetCatalog ? { accentColor, assetCatalog } : null;
|
|
22374
22486
|
}
|
|
22375
22487
|
function readOneNativeAppCatalog(entryConfig, root) {
|
|
@@ -22378,7 +22490,7 @@ function readOneNativeAppCatalog(entryConfig, root) {
|
|
|
22378
22490
|
if (!isRecord(ios)) return null;
|
|
22379
22491
|
return parseOneNativeAppCatalog({
|
|
22380
22492
|
accentColor: ios.accentColor,
|
|
22381
|
-
assetCatalog: typeof ios.assetCatalog === "string" ?
|
|
22493
|
+
assetCatalog: typeof ios.assetCatalog === "string" ? import_node_path27.default.resolve(root, ios.assetCatalog) : null
|
|
22382
22494
|
});
|
|
22383
22495
|
}
|
|
22384
22496
|
|
|
@@ -22386,9 +22498,9 @@ function readOneNativeAppCatalog(entryConfig, root) {
|
|
|
22386
22498
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
22387
22499
|
var import_node_child_process11 = require("node:child_process");
|
|
22388
22500
|
var import_node_crypto10 = require("node:crypto");
|
|
22389
|
-
var
|
|
22390
|
-
var
|
|
22391
|
-
var
|
|
22501
|
+
var import_node_fs24 = __toESM(require("node:fs"), 1);
|
|
22502
|
+
var import_node_module4 = require("node:module");
|
|
22503
|
+
var import_node_path28 = __toESM(require("node:path"), 1);
|
|
22392
22504
|
var import_node_util7 = require("node:util");
|
|
22393
22505
|
init_forked_script_contract();
|
|
22394
22506
|
init_is_record();
|
|
@@ -22414,8 +22526,8 @@ fs.writeFileSync(process.argv[2], JSON.stringify({
|
|
|
22414
22526
|
function configStamp(files) {
|
|
22415
22527
|
return JSON.stringify(
|
|
22416
22528
|
files.map((file) => {
|
|
22417
|
-
if (!
|
|
22418
|
-
const stat =
|
|
22529
|
+
if (!import_node_fs24.default.existsSync(file)) return [file, null];
|
|
22530
|
+
const stat = import_node_fs24.default.statSync(file);
|
|
22419
22531
|
return [file, stat.mtimeMs, stat.ctimeMs, stat.size];
|
|
22420
22532
|
})
|
|
22421
22533
|
);
|
|
@@ -22426,13 +22538,13 @@ async function readConfig(root) {
|
|
|
22426
22538
|
const reading = reads.get(root);
|
|
22427
22539
|
if (reading) return reading;
|
|
22428
22540
|
const promise = (async () => {
|
|
22429
|
-
(0,
|
|
22430
|
-
const cache =
|
|
22431
|
-
|
|
22432
|
-
const directory =
|
|
22433
|
-
const script =
|
|
22434
|
-
const result =
|
|
22435
|
-
|
|
22541
|
+
(0, import_node_module4.createRequire)(import_node_path28.default.join(root, "package.json")).resolve("one/vite");
|
|
22542
|
+
const cache = import_node_path28.default.join(root, "node_modules/.cache/peach-widget-config");
|
|
22543
|
+
import_node_fs24.default.mkdirSync(cache, { recursive: true });
|
|
22544
|
+
const directory = import_node_fs24.default.mkdtempSync(import_node_path28.default.join(cache, "read-"));
|
|
22545
|
+
const script = import_node_path28.default.join(directory, "read.mjs");
|
|
22546
|
+
const result = import_node_path28.default.join(directory, "result.json");
|
|
22547
|
+
import_node_fs24.default.writeFileSync(script, CONFIG_CHILD);
|
|
22436
22548
|
try {
|
|
22437
22549
|
await run6(process.execPath, [script, result], {
|
|
22438
22550
|
cwd: root,
|
|
@@ -22440,7 +22552,7 @@ async function readConfig(root) {
|
|
|
22440
22552
|
timeout: 3e4,
|
|
22441
22553
|
maxBuffer: 1024 * 1024
|
|
22442
22554
|
});
|
|
22443
|
-
const value = JSON.parse(
|
|
22555
|
+
const value = JSON.parse(import_node_fs24.default.readFileSync(result, "utf8"));
|
|
22444
22556
|
if (!isRecord(value) || !Array.isArray(value.watched) || !value.watched.every((file) => typeof file === "string"))
|
|
22445
22557
|
throw new Error("One config loader returned invalid dependencies");
|
|
22446
22558
|
if (!Array.isArray(value.urlSchemes) || !value.urlSchemes.every(
|
|
@@ -22463,8 +22575,8 @@ async function readConfig(root) {
|
|
|
22463
22575
|
}
|
|
22464
22576
|
const watched = [
|
|
22465
22577
|
.../* @__PURE__ */ new Set([
|
|
22466
|
-
|
|
22467
|
-
...value.watched.map((file) =>
|
|
22578
|
+
import_node_path28.default.join(root, "package.json"),
|
|
22579
|
+
...value.watched.map((file) => import_node_path28.default.resolve(root, file))
|
|
22468
22580
|
])
|
|
22469
22581
|
];
|
|
22470
22582
|
const loaded3 = {
|
|
@@ -22476,7 +22588,7 @@ async function readConfig(root) {
|
|
|
22476
22588
|
configs.set(root, loaded3);
|
|
22477
22589
|
return loaded3;
|
|
22478
22590
|
} finally {
|
|
22479
|
-
|
|
22591
|
+
import_node_fs24.default.rmSync(directory, { recursive: true, force: true });
|
|
22480
22592
|
}
|
|
22481
22593
|
})();
|
|
22482
22594
|
reads.set(root, promise);
|
|
@@ -22497,13 +22609,13 @@ function declaredFamilies(source) {
|
|
|
22497
22609
|
return home;
|
|
22498
22610
|
}
|
|
22499
22611
|
async function readOneWidgetSources(appRoot) {
|
|
22500
|
-
const root =
|
|
22612
|
+
const root = import_node_fs24.default.realpathSync(appRoot);
|
|
22501
22613
|
const config = await readConfig(root);
|
|
22502
22614
|
if (!config.widget) return null;
|
|
22503
22615
|
const widget = config.widget;
|
|
22504
22616
|
const sourceFiles = {
|
|
22505
|
-
"OneWidget.swift":
|
|
22506
|
-
"OneWidgetContract.swift":
|
|
22617
|
+
"OneWidget.swift": import_node_path28.default.join(root, "ios/OneWidgets/OneWidget.swift"),
|
|
22618
|
+
"OneWidgetContract.swift": import_node_path28.default.join(
|
|
22507
22619
|
root,
|
|
22508
22620
|
"ios",
|
|
22509
22621
|
widget.appName,
|
|
@@ -22513,14 +22625,14 @@ async function readOneWidgetSources(appRoot) {
|
|
|
22513
22625
|
const files = /* @__PURE__ */ new Map();
|
|
22514
22626
|
const sources = {};
|
|
22515
22627
|
for (const [name2, file] of Object.entries(sourceFiles)) {
|
|
22516
|
-
if (!
|
|
22628
|
+
if (!import_node_fs24.default.existsSync(file))
|
|
22517
22629
|
throw new Error(`missing One widget prebuild source ${file}; run one prebuild`);
|
|
22518
22630
|
const bytes = readPackageFile(root, file, MAX_SWIFT_COMPILE_SOURCE_BYTES);
|
|
22519
22631
|
const text2 = bytes.toString("utf8");
|
|
22520
22632
|
if (!Buffer.from(text2).equals(bytes))
|
|
22521
22633
|
throw new Error(`One widget prebuild source is not UTF-8: ${file}`);
|
|
22522
22634
|
files.set(name2, text2);
|
|
22523
|
-
sources[
|
|
22635
|
+
sources[import_node_path28.default.relative(root, file).split(import_node_path28.default.sep).join("/")] = (0, import_node_crypto10.createHash)("sha256").update(bytes).digest("hex");
|
|
22524
22636
|
}
|
|
22525
22637
|
const contract = files.get("OneWidgetContract.swift") ?? "";
|
|
22526
22638
|
const source = files.get("OneWidget.swift") ?? "";
|
|
@@ -23074,16 +23186,17 @@ init_app_project();
|
|
|
23074
23186
|
// src/android-autolinking.ts
|
|
23075
23187
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
23076
23188
|
var import_node_child_process12 = require("node:child_process");
|
|
23077
|
-
var
|
|
23078
|
-
var
|
|
23079
|
-
var
|
|
23189
|
+
var import_node_fs26 = __toESM(require("node:fs"), 1);
|
|
23190
|
+
var import_node_module5 = require("node:module");
|
|
23191
|
+
var import_node_path30 = __toESM(require("node:path"), 1);
|
|
23080
23192
|
var import_node_util8 = require("node:util");
|
|
23081
23193
|
init_forked_script_contract();
|
|
23082
23194
|
init_is_record();
|
|
23195
|
+
init_react_native_autolinking();
|
|
23083
23196
|
var run7 = (0, import_node_util8.promisify)(import_node_child_process12.execFile);
|
|
23084
23197
|
var resolving = /* @__PURE__ */ new Map();
|
|
23085
23198
|
async function resolveExpoAndroidAutolinking(appRoot) {
|
|
23086
|
-
const root =
|
|
23199
|
+
const root = import_node_fs26.default.realpathSync(appRoot);
|
|
23087
23200
|
const existing = resolving.get(root);
|
|
23088
23201
|
if (existing) return existing;
|
|
23089
23202
|
const pending = resolveAndroidModules(root);
|
|
@@ -23097,7 +23210,7 @@ async function resolveExpoAndroidAutolinking(appRoot) {
|
|
|
23097
23210
|
async function resolveAndroidModules(appRoot) {
|
|
23098
23211
|
let autolinker;
|
|
23099
23212
|
try {
|
|
23100
|
-
autolinker = (0,
|
|
23213
|
+
autolinker = (0, import_node_module5.createRequire)(import_node_path30.default.join(appRoot, "package.json")).resolve(
|
|
23101
23214
|
"expo-modules-autolinking/package.json"
|
|
23102
23215
|
);
|
|
23103
23216
|
} catch (error) {
|
|
@@ -23107,7 +23220,7 @@ async function resolveAndroidModules(appRoot) {
|
|
|
23107
23220
|
const { stdout } = await run7(
|
|
23108
23221
|
process.execPath,
|
|
23109
23222
|
[
|
|
23110
|
-
|
|
23223
|
+
import_node_path30.default.join(import_node_path30.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
|
|
23111
23224
|
"resolve",
|
|
23112
23225
|
"--platform",
|
|
23113
23226
|
"android",
|
|
@@ -23130,14 +23243,51 @@ async function resolveAndroidModules(appRoot) {
|
|
|
23130
23243
|
return resolved.modules;
|
|
23131
23244
|
}
|
|
23132
23245
|
async function collectAndroidAutolinkedPackages(appRoot) {
|
|
23133
|
-
const modules = await
|
|
23134
|
-
|
|
23246
|
+
const [modules, dependencies] = await Promise.all([
|
|
23247
|
+
resolveExpoAndroidAutolinking(appRoot),
|
|
23248
|
+
resolveReactNativeAndroidAutolinking(appRoot)
|
|
23249
|
+
]);
|
|
23250
|
+
return readAndroidAutolinkedPackages([
|
|
23251
|
+
...modules.map((entry) => entry.packageName),
|
|
23252
|
+
...dependencies.map((entry) => entry.name)
|
|
23253
|
+
]);
|
|
23254
|
+
}
|
|
23255
|
+
async function resolveReactNativeAndroidAutolinking(appRoot) {
|
|
23256
|
+
const config = await reactNativeAutolinkingConfig(appRoot, "android");
|
|
23257
|
+
if (!isRecord(config) || !isRecord(config.dependencies))
|
|
23258
|
+
throw new Error(`${appRoot}: React Native autolinking config has no dependencies`);
|
|
23259
|
+
const linked = [];
|
|
23260
|
+
for (const [name2, dependency] of Object.entries(config.dependencies)) {
|
|
23261
|
+
if (!isRecord(dependency) || !isRecord(dependency.platforms))
|
|
23262
|
+
throw new Error(
|
|
23263
|
+
`${appRoot}: React Native autolinking dependency ${name2} is malformed`
|
|
23264
|
+
);
|
|
23265
|
+
const android = dependency.platforms.android;
|
|
23266
|
+
if (android == null) continue;
|
|
23267
|
+
if (!isRecord(android) || typeof dependency.root !== "string")
|
|
23268
|
+
throw new Error(
|
|
23269
|
+
`${appRoot}: React Native autolinking dependency ${name2} has no Android project`
|
|
23270
|
+
);
|
|
23271
|
+
const string4 = (field) => {
|
|
23272
|
+
const value = android[field];
|
|
23273
|
+
if (value == null || typeof value === "string") return value ?? null;
|
|
23274
|
+
throw new Error(`${appRoot}: Android dependency ${name2} has invalid ${field}`);
|
|
23275
|
+
};
|
|
23276
|
+
linked.push({
|
|
23277
|
+
name: name2,
|
|
23278
|
+
root: dependency.root,
|
|
23279
|
+
sourceDir: string4("sourceDir"),
|
|
23280
|
+
packageImportPath: string4("packageImportPath"),
|
|
23281
|
+
packageInstance: string4("packageInstance")
|
|
23282
|
+
});
|
|
23283
|
+
}
|
|
23284
|
+
return linked;
|
|
23135
23285
|
}
|
|
23136
23286
|
|
|
23137
23287
|
// src/android-root-module.ts
|
|
23138
23288
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
23139
|
-
var
|
|
23140
|
-
var
|
|
23289
|
+
var import_node_fs27 = __toESM(require("node:fs"), 1);
|
|
23290
|
+
var import_node_path31 = __toESM(require("node:path"), 1);
|
|
23141
23291
|
var STRINGS_AND_COMMENTS = /"(?:\\.|[^"\\])*"|\/\/[^\n]*|\/\*[\s\S]*?\*\//g;
|
|
23142
23292
|
var DECLARATION = /\b(?:fun|String)\s+getMainComponentName\s*\(/g;
|
|
23143
23293
|
var KOTLIN_LITERAL = /^override\s+fun\s+getMainComponentName\s*\(\s*\)\s*(?::\s*String\s*)?(?:=\s*|\{\s*return\s+)"([^"\\$]+)"(?=\s*(?:;|\}|override\b|fun\b|private\b|public\b|protected\b|@|$))/;
|
|
@@ -23174,29 +23324,29 @@ function launcherActivities(application) {
|
|
|
23174
23324
|
function readModuleNamespace(moduleRoot, manifest) {
|
|
23175
23325
|
if (manifest.attributes.package) return manifest.attributes.package;
|
|
23176
23326
|
for (const name2 of ["build.gradle", "build.gradle.kts"]) {
|
|
23177
|
-
const file =
|
|
23178
|
-
if (!
|
|
23327
|
+
const file = import_node_path31.default.join(moduleRoot, name2);
|
|
23328
|
+
if (!import_node_fs27.default.existsSync(file)) continue;
|
|
23179
23329
|
const match = /\bnamespace\s*=?\s*["']([\w.]+)["']/.exec(
|
|
23180
|
-
|
|
23330
|
+
import_node_fs27.default.readFileSync(file, "utf8")
|
|
23181
23331
|
);
|
|
23182
23332
|
if (match) return match[1];
|
|
23183
23333
|
}
|
|
23184
23334
|
return void 0;
|
|
23185
23335
|
}
|
|
23186
23336
|
function readModuleRootModuleName(moduleRoot) {
|
|
23187
|
-
const sourceSets =
|
|
23188
|
-
const manifestFile =
|
|
23189
|
-
if (!
|
|
23190
|
-
const document = parseXml(
|
|
23337
|
+
const sourceSets = import_node_path31.default.join(moduleRoot, "src");
|
|
23338
|
+
const manifestFile = import_node_path31.default.join(sourceSets, "main/AndroidManifest.xml");
|
|
23339
|
+
if (!import_node_fs27.default.existsSync(manifestFile)) return null;
|
|
23340
|
+
const document = parseXml(import_node_fs27.default.readFileSync(manifestFile, "utf8"), manifestFile);
|
|
23191
23341
|
const manifest = document.children[0];
|
|
23192
23342
|
const application = manifest?.children.find((child) => child.name === "application");
|
|
23193
23343
|
if (manifest?.name !== "manifest" || !application) return null;
|
|
23194
23344
|
const launchers = launcherActivities(application);
|
|
23195
23345
|
if (launchers.length === 0) return null;
|
|
23196
|
-
for (const set2 of
|
|
23197
|
-
const file =
|
|
23198
|
-
if (!set2.isDirectory() || set2.name === "main" || !
|
|
23199
|
-
if (
|
|
23346
|
+
for (const set2 of import_node_fs27.default.readdirSync(sourceSets, { withFileTypes: true })) {
|
|
23347
|
+
const file = import_node_path31.default.join(sourceSets, set2.name, "AndroidManifest.xml");
|
|
23348
|
+
if (!set2.isDirectory() || set2.name === "main" || !import_node_fs27.default.existsSync(file)) continue;
|
|
23349
|
+
if (import_node_fs27.default.readFileSync(file, "utf8").includes("<activity")) return void 0;
|
|
23200
23350
|
}
|
|
23201
23351
|
const launcher = launchers[0];
|
|
23202
23352
|
const enabled = launcher.attributes["android:enabled"];
|
|
@@ -23208,23 +23358,23 @@ function readModuleRootModuleName(moduleRoot) {
|
|
|
23208
23358
|
const qualified = declared.startsWith(".") ? namespace && `${namespace}${declared}` : declared.includes(".") ? declared : namespace && `${namespace}.${declared}`;
|
|
23209
23359
|
if (!qualified || qualified.includes("$")) return void 0;
|
|
23210
23360
|
const relative3 = qualified.split(".").join("/");
|
|
23211
|
-
const files =
|
|
23361
|
+
const files = import_node_fs27.default.readdirSync(sourceSets, { withFileTypes: true }).filter((set2) => set2.isDirectory()).flatMap(
|
|
23212
23362
|
(set2) => ["java", "kotlin"].flatMap(
|
|
23213
23363
|
(language) => ["kt", "java"].map(
|
|
23214
|
-
(extension) =>
|
|
23364
|
+
(extension) => import_node_path31.default.join(sourceSets, set2.name, language, `${relative3}.${extension}`)
|
|
23215
23365
|
)
|
|
23216
23366
|
)
|
|
23217
|
-
).filter((file) =>
|
|
23367
|
+
).filter((file) => import_node_fs27.default.existsSync(file));
|
|
23218
23368
|
if (files.length !== 1) return void 0;
|
|
23219
23369
|
return readAndroidRootModuleFromActivitySource(
|
|
23220
|
-
|
|
23370
|
+
import_node_fs27.default.readFileSync(files[0], "utf8"),
|
|
23221
23371
|
qualified.slice(qualified.lastIndexOf(".") + 1)
|
|
23222
23372
|
);
|
|
23223
23373
|
}
|
|
23224
23374
|
function readAndroidLauncherRootModuleName(projectRoot) {
|
|
23225
|
-
const androidRoot =
|
|
23226
|
-
if (!
|
|
23227
|
-
const names =
|
|
23375
|
+
const androidRoot = import_node_path31.default.join(projectRoot, "android");
|
|
23376
|
+
if (!import_node_fs27.default.existsSync(androidRoot)) return void 0;
|
|
23377
|
+
const names = import_node_fs27.default.readdirSync(androidRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => readModuleRootModuleName(import_node_path31.default.join(androidRoot, entry.name))).filter((name2) => name2 !== null);
|
|
23228
23378
|
return names.length === 1 ? names[0] : void 0;
|
|
23229
23379
|
}
|
|
23230
23380
|
|
|
@@ -23674,13 +23824,13 @@ var metro_plugin_default = withPeach;
|
|
|
23674
23824
|
|
|
23675
23825
|
// src/jump-to-source-babel.ts
|
|
23676
23826
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
23677
|
-
function normalizeSourcePath(
|
|
23678
|
-
const queryStart =
|
|
23679
|
-
const clean = queryStart >= 0 ?
|
|
23827
|
+
function normalizeSourcePath(path32) {
|
|
23828
|
+
const queryStart = path32.indexOf("?");
|
|
23829
|
+
const clean = queryStart >= 0 ? path32.slice(0, queryStart) : path32;
|
|
23680
23830
|
return clean.replace(/\\/g, "/");
|
|
23681
23831
|
}
|
|
23682
|
-
function matchesPath(
|
|
23683
|
-
return typeof matcher === "string" ?
|
|
23832
|
+
function matchesPath(path32, matcher) {
|
|
23833
|
+
return typeof matcher === "string" ? path32.includes(matcher) : matcher.test(path32);
|
|
23684
23834
|
}
|
|
23685
23835
|
function shouldStampFile(filename, options) {
|
|
23686
23836
|
const normalized = normalizeSourcePath(filename);
|
|
@@ -23700,11 +23850,11 @@ function sootsimJumpToSourceBabelPlugin(api, options = {}) {
|
|
|
23700
23850
|
name: "sootsim-jump-to-source",
|
|
23701
23851
|
visitor: {
|
|
23702
23852
|
JSXElement: {
|
|
23703
|
-
exit(
|
|
23853
|
+
exit(path32, state) {
|
|
23704
23854
|
if (options.enabled === false) return;
|
|
23705
23855
|
const filename = state.filename;
|
|
23706
23856
|
if (!filename || !shouldStampFile(filename, options)) return;
|
|
23707
|
-
const node =
|
|
23857
|
+
const node = path32.node;
|
|
23708
23858
|
if (stamped.has(node)) return;
|
|
23709
23859
|
stamped.add(node);
|
|
23710
23860
|
const opening = node.openingElement;
|
|
@@ -23723,12 +23873,12 @@ function sootsimJumpToSourceBabelPlugin(api, options = {}) {
|
|
|
23723
23873
|
);
|
|
23724
23874
|
return;
|
|
23725
23875
|
}
|
|
23726
|
-
const fn =
|
|
23876
|
+
const fn = path32.getFunctionParent();
|
|
23727
23877
|
const parameterDefault = Boolean(
|
|
23728
23878
|
fn && opening.start != null && fn.node.body.start != null && opening.start < fn.node.body.start
|
|
23729
23879
|
);
|
|
23730
|
-
const type =
|
|
23731
|
-
if (!parameterDefault)
|
|
23880
|
+
const type = path32.scope.generateUidIdentifier("PeachSourceType");
|
|
23881
|
+
if (!parameterDefault) path32.scope.push({ id: type });
|
|
23732
23882
|
function expression(tag) {
|
|
23733
23883
|
return t.isJSXIdentifier(tag) ? t.identifier(tag.name) : t.memberExpression(
|
|
23734
23884
|
expression(tag.object),
|
|
@@ -23763,10 +23913,10 @@ function sootsimJumpToSourceBabelPlugin(api, options = {}) {
|
|
|
23763
23913
|
),
|
|
23764
23914
|
node
|
|
23765
23915
|
);
|
|
23766
|
-
if (
|
|
23767
|
-
|
|
23916
|
+
if (path32.parentPath.isJSXElement() || path32.parentPath.isJSXFragment()) {
|
|
23917
|
+
path32.replaceWith(t.jsxExpressionContainer(replacement));
|
|
23768
23918
|
} else {
|
|
23769
|
-
|
|
23919
|
+
path32.replaceWith(replacement);
|
|
23770
23920
|
}
|
|
23771
23921
|
}
|
|
23772
23922
|
}
|