peachsim 0.1.2584 → 0.1.2585
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 +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +14 -4
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-ZVZ3OCQ5.mjs → acorn-LDXT22UO.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-NMYRZ4GT.mjs → chunk-5A7MW6AP.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GOQIYGJD.mjs → chunk-A7FZGG2S.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HEG3RAXL.mjs → chunk-BNGB7KE3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HHYIRDUH.mjs → chunk-EHYHN3HO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CVDY4GSP.mjs → chunk-IMW47JXH.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-RYY3XHOE.mjs → chunk-KCHIN7QL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ENXDCDUJ.mjs → chunk-KUKQWU26.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-KG72KS7D.mjs → chunk-M4Y4JQIF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-5RPUNG6E.mjs → chunk-MOGNFYJI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CXTYIQH4.mjs → chunk-MPBZNRHK.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-6HF6IVRZ.mjs → chunk-PLUWGO4T.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JJ3AI5Y2.mjs → chunk-Q4NA5FTS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3FPE4AWV.mjs → chunk-QGAH3NER.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-N6PTRYT5.mjs → chunk-QVCTM3TX.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-RJNIFR5Q.mjs → chunk-QZM6XIZD.mjs} +12 -12
- package/dist-lib/esm-chunks/{chunk-WWYAWBD7.mjs → chunk-R465NOUG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-DXUEAJB5.mjs → chunk-RD2NKEZA.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-PMAEKUDN.mjs → chunk-RFV7WODY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-IDKMFS7W.mjs → chunk-SFJLRTKT.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VIUKS7O4.mjs → chunk-VKKM72YW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-W5SRJG3R.mjs → chunk-XVR3ZLTD.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6LCGYQ3Z.mjs → chunk-Y4D7QJRI.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-VG2C6B5W.mjs → metro-layout-parser-L24YQRPD.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-7W4NG7RW.mjs → swift-package-prebuilt-ULLFZLF2.mjs} +10 -10
- package/dist-lib/esm-chunks/{swift-sdk-app-module-PUXEFZD4.mjs → swift-sdk-app-module-Z2TLEB5O.mjs} +14 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-GGYEV75P.mjs → swift-sdk-image-BGHO5BE3.mjs} +14 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-EWBJ4A2A.mjs → swift-sdk-image-producer-OJ6YMFRP.mjs} +4 -4
- package/dist-lib/expo-swift-bundle.cjs +13 -3
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1061 -806
- package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +16 -16
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +81 -81
- package/dist-lib/public-origins-lib.json +71 -69
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- 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 +8 -8
- package/dist-lib/skills.cjs +1485 -1230
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +10 -10
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/@xmldom/xmldom.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/bplist-parser.cjs +1 -1
- package/dist-lib/vendor/ignore.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/plist.cjs +1 -1
- package/dist-lib/vendor/smol-toml.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/package.json +1 -1
- package/src/one-native-controls-package.ts +86 -43
- package/src/one-native-source.ts +7 -0
- package/src/swift-wasm64-native-source.ts +10 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2585 | (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;
|
|
@@ -1142,9 +1142,9 @@ function compareSemver(a, b) {
|
|
|
1142
1142
|
const hyphen = v10.indexOf("-");
|
|
1143
1143
|
const core = hyphen >= 0 ? v10.slice(0, hyphen) : v10;
|
|
1144
1144
|
const pre = hyphen >= 0 ? v10.slice(hyphen + 1) : "";
|
|
1145
|
-
const
|
|
1146
|
-
if (
|
|
1147
|
-
return [
|
|
1145
|
+
const parts2 = core.split(".").map((n) => Number.parseInt(n, 10));
|
|
1146
|
+
if (parts2.some((n) => !Number.isFinite(n))) return [[Number.POSITIVE_INFINITY], v10];
|
|
1147
|
+
return [parts2, pre];
|
|
1148
1148
|
};
|
|
1149
1149
|
const [an, ap] = parse17(a);
|
|
1150
1150
|
const [bn, bp] = parse17(b);
|
|
@@ -2026,9 +2026,9 @@ function serveRuntimeFile(req, res, fullPath) {
|
|
|
2026
2026
|
sendFileWithRanges(req, res, fullPath, stat2.size, {});
|
|
2027
2027
|
}
|
|
2028
2028
|
function runtimeFileRange(header, total) {
|
|
2029
|
-
const
|
|
2030
|
-
if (!
|
|
2031
|
-
const [, startRaw, endRaw] =
|
|
2029
|
+
const parts2 = /^bytes=(\d*)-(\d*)$/.exec(header ?? "");
|
|
2030
|
+
if (!parts2) return;
|
|
2031
|
+
const [, startRaw, endRaw] = parts2;
|
|
2032
2032
|
if (!startRaw && !endRaw || startRaw && endRaw && Number(endRaw) < Number(startRaw))
|
|
2033
2033
|
return;
|
|
2034
2034
|
const start = startRaw ? Number(startRaw) : Math.max(0, total - Number(endRaw));
|
|
@@ -3629,15 +3629,15 @@ async function settingsBundleFingerprint(bundlePath) {
|
|
|
3629
3629
|
const entries2 = await (0, import_promises3.readdir)(bundlePath, { withFileTypes: true });
|
|
3630
3630
|
const names = entries2.filter((entry) => entry.isFile() && entry.name.toLowerCase().endsWith(".plist")).map((entry) => entry.name).sort().slice(0, MAX_PLIST_FILES + 1);
|
|
3631
3631
|
if (names.length === 0 || names.length > MAX_PLIST_FILES) return null;
|
|
3632
|
-
const
|
|
3632
|
+
const parts2 = await Promise.all(
|
|
3633
3633
|
names.map(async (name3) => {
|
|
3634
3634
|
const metadata = await (0, import_promises3.stat)((0, import_node_path10.join)(bundlePath, name3));
|
|
3635
3635
|
if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
|
|
3636
3636
|
return `${name3}:${metadata.size}:${metadata.mtimeMs}:${metadata.ctimeMs}`;
|
|
3637
3637
|
})
|
|
3638
3638
|
);
|
|
3639
|
-
if (
|
|
3640
|
-
return
|
|
3639
|
+
if (parts2.some((part) => part === null)) return null;
|
|
3640
|
+
return parts2.join("|");
|
|
3641
3641
|
} catch {
|
|
3642
3642
|
return null;
|
|
3643
3643
|
}
|
|
@@ -5182,9 +5182,9 @@ var init_fetch_proxy_overrides = __esm({
|
|
|
5182
5182
|
// src/dns-over-https.ts
|
|
5183
5183
|
function parseIpLiteral(text7) {
|
|
5184
5184
|
if (text7.includes(":")) return parseIpv6(text7);
|
|
5185
|
-
const
|
|
5186
|
-
if (
|
|
5187
|
-
const bytes =
|
|
5185
|
+
const parts2 = text7.split(".");
|
|
5186
|
+
if (parts2.length !== 4 || !parts2.every((part) => /^\d{1,3}$/.test(part))) return null;
|
|
5187
|
+
const bytes = parts2.map(Number);
|
|
5188
5188
|
return bytes.every((byte) => byte <= 255) ? bytes : null;
|
|
5189
5189
|
}
|
|
5190
5190
|
function parseIpv6(text7) {
|
|
@@ -5518,8 +5518,8 @@ var init_autolinker_process = __esm({
|
|
|
5518
5518
|
function autolinkerAppleFlags(autolinkerManifest, appRoot) {
|
|
5519
5519
|
const manifest = JSON.parse(import_node_fs20.default.readFileSync(autolinkerManifest, "utf8"));
|
|
5520
5520
|
const version2 = manifest && typeof manifest === "object" && Reflect.get(manifest, "version");
|
|
5521
|
-
const
|
|
5522
|
-
const [major, minor, patch] =
|
|
5521
|
+
const parts2 = typeof version2 === "string" ? version2.split(".").map((part) => Number.parseInt(part, 10)) : [];
|
|
5522
|
+
const [major, minor, patch] = parts2;
|
|
5523
5523
|
if (!Number.isInteger(major) || !Number.isInteger(minor) || !Number.isInteger(patch))
|
|
5524
5524
|
throw new Error(
|
|
5525
5525
|
`unreadable expo-modules-autolinking version in ${autolinkerManifest}`
|
|
@@ -5712,13 +5712,13 @@ var init_swift_standin_digest = __esm({
|
|
|
5712
5712
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
5713
5713
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
5714
5714
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
5715
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
5715
|
+
STANDIN_SOURCE_DIGEST = true ? "f9c7192135f0d9ee6cc78cbd2401aa19d73d0b5e5e6b3138b21fcbc7c062213f" : standinSourceDigest();
|
|
5716
5716
|
}
|
|
5717
5717
|
});
|
|
5718
5718
|
|
|
5719
5719
|
// src/expo-native-compiler-digest.ts
|
|
5720
5720
|
function expoNativeCompilerDigestValue() {
|
|
5721
|
-
return true ? "
|
|
5721
|
+
return true ? "b5ae0afd141dcff04a04aa6feaf69f35959555ec359d65980438b5435eaa5fbc" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
5722
5722
|
}
|
|
5723
5723
|
var import_node_crypto11;
|
|
5724
5724
|
var init_expo_native_compiler_digest = __esm({
|
|
@@ -7290,24 +7290,24 @@ function stringMethod(interp, self, call, env) {
|
|
|
7290
7290
|
return i < 0 ? null : i;
|
|
7291
7291
|
}
|
|
7292
7292
|
case "split": {
|
|
7293
|
-
let
|
|
7293
|
+
let parts2;
|
|
7294
7294
|
if (a === void 0 || a === null || a instanceof RString && a.s === " ")
|
|
7295
|
-
|
|
7296
|
-
else if (a instanceof RRegexp)
|
|
7297
|
-
else
|
|
7295
|
+
parts2 = s.trim().split(/\s+/).filter((x, i, all) => x !== "" || all.length > 1);
|
|
7296
|
+
else if (a instanceof RRegexp) parts2 = s.split(new RegExp(a.re.source, a.re.flags));
|
|
7297
|
+
else parts2 = s.split(strArg(interp, a));
|
|
7298
7298
|
if (b !== void 0) {
|
|
7299
7299
|
const limit = intArg(interp, b);
|
|
7300
|
-
if (limit > 0 &&
|
|
7300
|
+
if (limit > 0 && parts2.length > limit) {
|
|
7301
7301
|
const separator = a instanceof RString ? a.s : null;
|
|
7302
7302
|
if (separator === null)
|
|
7303
7303
|
throw new UnsupportedRuby("split with a limit and a non-string separator");
|
|
7304
|
-
|
|
7304
|
+
parts2 = [...parts2.slice(0, limit - 1), parts2.slice(limit - 1).join(separator)];
|
|
7305
7305
|
}
|
|
7306
7306
|
if (limit === 0)
|
|
7307
|
-
while (
|
|
7308
|
-
} else while (
|
|
7309
|
-
if (s === "")
|
|
7310
|
-
return
|
|
7307
|
+
while (parts2.length && parts2[parts2.length - 1] === "") parts2.pop();
|
|
7308
|
+
} else while (parts2.length && parts2[parts2.length - 1] === "") parts2.pop();
|
|
7309
|
+
if (s === "") parts2 = [];
|
|
7310
|
+
return parts2.map(str);
|
|
7311
7311
|
}
|
|
7312
7312
|
case "sub":
|
|
7313
7313
|
return str(stringSub(interp, s, call, false));
|
|
@@ -7877,8 +7877,8 @@ function arrayMethod(interp, self, call, env) {
|
|
|
7877
7877
|
return Array.from({ length: intArg(interp, a) }, () => self).flat();
|
|
7878
7878
|
case "join": {
|
|
7879
7879
|
const sep3 = a === void 0 || a === null ? "" : strArg(interp, a);
|
|
7880
|
-
const
|
|
7881
|
-
return str(
|
|
7880
|
+
const join30 = (values) => values.map((v10) => Array.isArray(v10) ? join30(v10) : interp.toS(v10, env)).join(sep3);
|
|
7881
|
+
return str(join30(self));
|
|
7882
7882
|
}
|
|
7883
7883
|
case "compact":
|
|
7884
7884
|
return self.filter((v10) => v10 !== null);
|
|
@@ -10462,9 +10462,9 @@ var init_podspec_ruby = __esm({
|
|
|
10462
10462
|
if (self instanceof RObject || self instanceof RModule) return self.ivars;
|
|
10463
10463
|
throw new UnsupportedRuby("instance variables on a builtin value");
|
|
10464
10464
|
}
|
|
10465
|
-
interpolate(
|
|
10465
|
+
interpolate(parts2, env, regexp = false) {
|
|
10466
10466
|
let out = "";
|
|
10467
|
-
for (const part of
|
|
10467
|
+
for (const part of parts2) {
|
|
10468
10468
|
if (part instanceof N.StringNode)
|
|
10469
10469
|
out += regexp ? sourceOfRegexpPart(part) : part.unescaped.value;
|
|
10470
10470
|
else {
|
|
@@ -11538,9 +11538,9 @@ function text(interp, value) {
|
|
|
11538
11538
|
function expandHome(p) {
|
|
11539
11539
|
return p === "~" || p.startsWith("~/") ? import_node_path30.default.join(import_node_os7.default.homedir(), p.slice(1)) : p;
|
|
11540
11540
|
}
|
|
11541
|
-
function joinPaths(
|
|
11541
|
+
function joinPaths(parts2) {
|
|
11542
11542
|
let out = "";
|
|
11543
|
-
|
|
11543
|
+
parts2.forEach((part, index) => {
|
|
11544
11544
|
if (index === 0) {
|
|
11545
11545
|
out = part;
|
|
11546
11546
|
return;
|
|
@@ -11624,7 +11624,7 @@ function rubyGlob(pattern, base2, dotMatch = false) {
|
|
|
11624
11624
|
return;
|
|
11625
11625
|
}
|
|
11626
11626
|
const segment2 = segments[index];
|
|
11627
|
-
const
|
|
11627
|
+
const join30 = (name3) => shown === "" ? name3 : shown.endsWith("/") ? shown + name3 : `${shown}/${name3}`;
|
|
11628
11628
|
if (segment2 === "" && index === 0) {
|
|
11629
11629
|
walk4("/", "/", index + 1);
|
|
11630
11630
|
return;
|
|
@@ -11640,14 +11640,14 @@ function rubyGlob(pattern, base2, dotMatch = false) {
|
|
|
11640
11640
|
for (const entry of entries2.sort((a, b) => a.name < b.name ? -1 : 1)) {
|
|
11641
11641
|
if (!dotMatch && entry.name.startsWith(".")) continue;
|
|
11642
11642
|
if (entry.isDirectory())
|
|
11643
|
-
walk4(import_node_path30.default.join(dir, entry.name),
|
|
11643
|
+
walk4(import_node_path30.default.join(dir, entry.name), join30(entry.name), index);
|
|
11644
11644
|
}
|
|
11645
11645
|
return;
|
|
11646
11646
|
}
|
|
11647
11647
|
if (!/[*?[{\\]/.test(segment2)) {
|
|
11648
11648
|
const next = import_node_path30.default.join(dir, segment2);
|
|
11649
11649
|
if (index === segments.length - 1 ? import_node_fs32.default.existsSync(next) : isDirectory(next))
|
|
11650
|
-
walk4(next,
|
|
11650
|
+
walk4(next, join30(segment2), index + 1);
|
|
11651
11651
|
return;
|
|
11652
11652
|
}
|
|
11653
11653
|
const matcher = segmentMatcher(segment2, dotMatch);
|
|
@@ -11661,7 +11661,7 @@ function rubyGlob(pattern, base2, dotMatch = false) {
|
|
|
11661
11661
|
if (!matcher.test(name3)) continue;
|
|
11662
11662
|
const next = import_node_path30.default.join(dir, name3);
|
|
11663
11663
|
if (index < segments.length - 1 && !isDirectory(next)) continue;
|
|
11664
|
-
walk4(next,
|
|
11664
|
+
walk4(next, join30(name3), index + 1);
|
|
11665
11665
|
}
|
|
11666
11666
|
};
|
|
11667
11667
|
walk4(absolute ? "/" : base2, "", absolute ? 1 : 0);
|
|
@@ -12286,9 +12286,9 @@ function installStdlib(interp) {
|
|
|
12286
12286
|
for (const name3 of ["escape", "quote"])
|
|
12287
12287
|
def(regexp, name3, (c) => str(escapeRegexp(text(interp, c.args[0]))));
|
|
12288
12288
|
def(regexp, "union", (c) => {
|
|
12289
|
-
const
|
|
12290
|
-
if (
|
|
12291
|
-
const sources =
|
|
12289
|
+
const parts2 = c.args.length === 1 && Array.isArray(c.args[0]) ? c.args[0] : c.args;
|
|
12290
|
+
if (parts2.length === 1 && parts2[0] instanceof RRegexp) return parts2[0];
|
|
12291
|
+
const sources = parts2.map((part) => {
|
|
12292
12292
|
if (!(part instanceof RRegexp)) return escapeRegexp(text(interp, part));
|
|
12293
12293
|
if (part.re.flags !== "m")
|
|
12294
12294
|
throw new UnsupportedRuby(`Regexp.union of /${part.source}/ with options`);
|
|
@@ -13520,12 +13520,12 @@ function swiftSdkBundle(swift, id, options2) {
|
|
|
13520
13520
|
const key2 = [swift, id, ...options2].join("\0");
|
|
13521
13521
|
const known = sdkBundles.get(key2);
|
|
13522
13522
|
if (known && import_node_fs35.default.existsSync(known)) return known;
|
|
13523
|
-
const
|
|
13523
|
+
const configuration2 = (0, import_node_child_process12.execFileSync)(
|
|
13524
13524
|
swift,
|
|
13525
13525
|
["sdk", "configure", ...options2, "--show-configuration", id, SWIFT_WASM_TRIPLE],
|
|
13526
13526
|
{ encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
|
|
13527
13527
|
);
|
|
13528
|
-
const sysroot = /^sdkRootPath: (.+)$/m.exec(
|
|
13528
|
+
const sysroot = /^sdkRootPath: (.+)$/m.exec(configuration2)?.[1]?.trim();
|
|
13529
13529
|
if (!sysroot || !import_node_path33.default.isAbsolute(sysroot))
|
|
13530
13530
|
throw new Error(`Swift SDK ${id} reports no absolute sdkRootPath`);
|
|
13531
13531
|
let bundle = sysroot;
|
|
@@ -15036,7 +15036,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
|
|
|
15036
15036
|
const symbols = [];
|
|
15037
15037
|
const relationships = [];
|
|
15038
15038
|
const scopeOf = (name3, enclosing, extensionScope) => extensionScope ? name3.split(".").filter(
|
|
15039
|
-
(part, index,
|
|
15039
|
+
(part, index, parts2) => !(index === 0 && parts2.length > 1 && part === module2)
|
|
15040
15040
|
) : [...enclosing, name3];
|
|
15041
15041
|
const scopePattern = /^\s*((?:@\w+(?:\([^)]*\))?\s+)*)((?:\w+\s+)*?)(extension|class|struct|enum|protocol|actor)\s+([A-Za-z_][\w.]*)/;
|
|
15042
15042
|
const lines = interfaceText.split("\n");
|
|
@@ -15206,7 +15206,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
|
|
|
15206
15206
|
return { module: { name: module2 }, symbols, relationships };
|
|
15207
15207
|
}
|
|
15208
15208
|
function splitTopLevel(text7, separator) {
|
|
15209
|
-
const
|
|
15209
|
+
const parts2 = [];
|
|
15210
15210
|
let depth = 0;
|
|
15211
15211
|
let start = 0;
|
|
15212
15212
|
for (let index = 0; index < text7.length; index++) {
|
|
@@ -15214,12 +15214,12 @@ function splitTopLevel(text7, separator) {
|
|
|
15214
15214
|
if (char === "(" || char === "[" || char === "<") depth++;
|
|
15215
15215
|
else if (char === ")" || char === "]" || char === ">") depth--;
|
|
15216
15216
|
else if (char === separator && depth === 0) {
|
|
15217
|
-
|
|
15217
|
+
parts2.push(text7.slice(start, index));
|
|
15218
15218
|
start = index + 1;
|
|
15219
15219
|
}
|
|
15220
15220
|
}
|
|
15221
|
-
|
|
15222
|
-
return
|
|
15221
|
+
parts2.push(text7.slice(start));
|
|
15222
|
+
return parts2;
|
|
15223
15223
|
}
|
|
15224
15224
|
function emitSwiftStandin(sourceGraphs, options2) {
|
|
15225
15225
|
const imported = new Set(options2.imports);
|
|
@@ -15301,12 +15301,12 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15301
15301
|
const local = byId.get(id);
|
|
15302
15302
|
if (local) return { name: pathOf(local), local: true };
|
|
15303
15303
|
if (!fallback) return null;
|
|
15304
|
-
const
|
|
15305
|
-
const module2 =
|
|
15306
|
-
const unqualified =
|
|
15307
|
-
const name3 =
|
|
15304
|
+
const parts2 = fallback.split(".");
|
|
15305
|
+
const module2 = parts2[0] === "SwiftUICore" ? "SwiftUI" : parts2[0];
|
|
15306
|
+
const unqualified = parts2.slice(1).join(".") || parts2[0];
|
|
15307
|
+
const name3 = parts2.length > 1 && family.has(parts2[0]) && parts2[0] !== "SwiftUICore" ? (
|
|
15308
15308
|
// a module selector reaches past a class named like its module
|
|
15309
|
-
`${
|
|
15309
|
+
`${parts2[0]}::${unqualified}`
|
|
15310
15310
|
) : unqualified;
|
|
15311
15311
|
return { name: name3, module: module2, local: false };
|
|
15312
15312
|
};
|
|
@@ -15446,7 +15446,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15446
15446
|
};
|
|
15447
15447
|
const structBuilds = (id) => !omit.has(hiddenInit(id));
|
|
15448
15448
|
const splitTop = (list2) => {
|
|
15449
|
-
const
|
|
15449
|
+
const parts2 = [];
|
|
15450
15450
|
let depth = 0;
|
|
15451
15451
|
let start = 0;
|
|
15452
15452
|
for (let at = 0; at < list2.length; at++) {
|
|
@@ -15454,12 +15454,12 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15454
15454
|
if (char === "(" || char === "[" || char === "<") depth++;
|
|
15455
15455
|
if (char === ")" || char === "]" || char === ">" && list2[at - 1] !== "-") depth--;
|
|
15456
15456
|
if (char === "," && depth === 0) {
|
|
15457
|
-
|
|
15457
|
+
parts2.push(list2.slice(start, at).trim());
|
|
15458
15458
|
start = at + 1;
|
|
15459
15459
|
}
|
|
15460
15460
|
}
|
|
15461
15461
|
const last = list2.slice(start).trim();
|
|
15462
|
-
return last ? [...
|
|
15462
|
+
return last ? [...parts2, last] : parts2;
|
|
15463
15463
|
};
|
|
15464
15464
|
const building2 = [];
|
|
15465
15465
|
const inertValue = (type, generics, scope2) => {
|
|
@@ -16643,9 +16643,9 @@ function objcSdkIntakeFlags(headers, toolchainBin, minimum) {
|
|
|
16643
16643
|
];
|
|
16644
16644
|
}
|
|
16645
16645
|
function iosDeploymentMinimum(version2) {
|
|
16646
|
-
const
|
|
16647
|
-
if (!
|
|
16648
|
-
return Number(
|
|
16646
|
+
const parts2 = /^(\d{1,2})(?:\.(\d{1,2}))?(?:\.(\d{1,2}))?$/.exec(version2 ?? "");
|
|
16647
|
+
if (!parts2) return void 0;
|
|
16648
|
+
return Number(parts2[1]) * 1e4 + Number(parts2[2] ?? 0) * 100 + Number(parts2[3] ?? 0);
|
|
16649
16649
|
}
|
|
16650
16650
|
function moduleMapHeaders(modulemap, directoryHeaders) {
|
|
16651
16651
|
const tokens2 = moduleMapTokens(import_node_fs36.default.readFileSync(modulemap, "utf8"));
|
|
@@ -19151,20 +19151,20 @@ function podspecLibrarySpecs(spec) {
|
|
|
19151
19151
|
function podspecMembers(spec, requested = [""]) {
|
|
19152
19152
|
const selected = /* @__PURE__ */ new Set();
|
|
19153
19153
|
const visited = /* @__PURE__ */ new Set();
|
|
19154
|
-
const select = (
|
|
19155
|
-
const key2 =
|
|
19154
|
+
const select = (parts2) => {
|
|
19155
|
+
const key2 = parts2.join("/");
|
|
19156
19156
|
if (visited.has(key2)) return;
|
|
19157
19157
|
visited.add(key2);
|
|
19158
19158
|
let current2 = spec;
|
|
19159
19159
|
const chain = [spec];
|
|
19160
|
-
for (const part of
|
|
19160
|
+
for (const part of parts2) {
|
|
19161
19161
|
current2 = podspecSubspec(current2, part);
|
|
19162
19162
|
chain.push(current2);
|
|
19163
19163
|
}
|
|
19164
19164
|
chain.forEach((member) => selected.add(member));
|
|
19165
19165
|
const defaults = strings(current2, "default_subspecs");
|
|
19166
19166
|
const children = defaults[0] === "none" ? [] : defaults.length ? defaults : current2.subspecs.map((child) => podspecName(child));
|
|
19167
|
-
for (const child of children) select([...
|
|
19167
|
+
for (const child of children) select([...parts2, ...child.split("/")]);
|
|
19168
19168
|
for (const member of chain) {
|
|
19169
19169
|
const dependencies = import_zod.z.record(import_zod.z.string(), import_zod.z.array(import_zod.z.string())).parse(member.attrs.get("dependencies") ?? {});
|
|
19170
19170
|
for (const name3 of Object.keys(dependencies)) {
|
|
@@ -22008,26 +22008,26 @@ var init_directives = __esm({
|
|
|
22008
22008
|
this.tags = Object.assign({}, _Directives.defaultTags);
|
|
22009
22009
|
this.atNextDocument = false;
|
|
22010
22010
|
}
|
|
22011
|
-
const
|
|
22012
|
-
const name3 =
|
|
22011
|
+
const parts2 = line.trim().split(/[ \t]+/);
|
|
22012
|
+
const name3 = parts2.shift();
|
|
22013
22013
|
switch (name3) {
|
|
22014
22014
|
case "%TAG": {
|
|
22015
|
-
if (
|
|
22015
|
+
if (parts2.length !== 2) {
|
|
22016
22016
|
onError(0, "%TAG directive should contain exactly two parts");
|
|
22017
|
-
if (
|
|
22017
|
+
if (parts2.length < 2)
|
|
22018
22018
|
return false;
|
|
22019
22019
|
}
|
|
22020
|
-
const [handle, prefix] =
|
|
22020
|
+
const [handle, prefix] = parts2;
|
|
22021
22021
|
this.tags[handle] = prefix;
|
|
22022
22022
|
return true;
|
|
22023
22023
|
}
|
|
22024
22024
|
case "%YAML": {
|
|
22025
22025
|
this.yaml.explicit = true;
|
|
22026
|
-
if (
|
|
22026
|
+
if (parts2.length !== 1) {
|
|
22027
22027
|
onError(0, "%YAML directive should contain exactly one part");
|
|
22028
22028
|
return false;
|
|
22029
22029
|
}
|
|
22030
|
-
const [version2] =
|
|
22030
|
+
const [version2] = parts2;
|
|
22031
22031
|
if (version2 === "1.1" || version2 === "1.2") {
|
|
22032
22032
|
this.yaml.version = version2;
|
|
22033
22033
|
return true;
|
|
@@ -24666,9 +24666,9 @@ var init_set = __esm({
|
|
|
24666
24666
|
// ../../node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js
|
|
24667
24667
|
function parseSexagesimal(str3, asBigInt) {
|
|
24668
24668
|
const sign = str3[0];
|
|
24669
|
-
const
|
|
24669
|
+
const parts2 = sign === "-" || sign === "+" ? str3.substring(1) : str3;
|
|
24670
24670
|
const num = (n) => asBigInt ? BigInt(n) : Number(n);
|
|
24671
|
-
const res =
|
|
24671
|
+
const res = parts2.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
|
|
24672
24672
|
return sign === "-" ? num(-1) * res : res;
|
|
24673
24673
|
}
|
|
24674
24674
|
function stringifySexagesimal(node) {
|
|
@@ -24684,18 +24684,18 @@ function stringifySexagesimal(node) {
|
|
|
24684
24684
|
value *= num(-1);
|
|
24685
24685
|
}
|
|
24686
24686
|
const _60 = num(60);
|
|
24687
|
-
const
|
|
24687
|
+
const parts2 = [value % _60];
|
|
24688
24688
|
if (value < 60) {
|
|
24689
|
-
|
|
24689
|
+
parts2.unshift(0);
|
|
24690
24690
|
} else {
|
|
24691
|
-
value = (value -
|
|
24692
|
-
|
|
24691
|
+
value = (value - parts2[0]) / _60;
|
|
24692
|
+
parts2.unshift(value % _60);
|
|
24693
24693
|
if (value >= 60) {
|
|
24694
|
-
value = (value -
|
|
24695
|
-
|
|
24694
|
+
value = (value - parts2[0]) / _60;
|
|
24695
|
+
parts2.unshift(value);
|
|
24696
24696
|
}
|
|
24697
24697
|
}
|
|
24698
|
-
return sign +
|
|
24698
|
+
return sign + parts2.map((n) => String(n).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
|
|
24699
24699
|
}
|
|
24700
24700
|
var intTime, floatTime, timestamp;
|
|
24701
24701
|
var init_timestamp = __esm({
|
|
@@ -29540,11 +29540,11 @@ function wireSlotMigration(appDir, configPath, wire, kept = []) {
|
|
|
29540
29540
|
}
|
|
29541
29541
|
}
|
|
29542
29542
|
const lines = [...blocks].map(([owner, { modules, views }]) => {
|
|
29543
|
-
const
|
|
29543
|
+
const parts2 = [
|
|
29544
29544
|
modules.length ? `modules: { ${modules.join(", ")} }` : "",
|
|
29545
29545
|
views.length ? `views: { ${views.join(", ")} }` : ""
|
|
29546
29546
|
].filter(Boolean);
|
|
29547
|
-
return ` [${JSON.stringify(owner)}]: { ${
|
|
29547
|
+
return ` [${JSON.stringify(owner)}]: { ${parts2.join(", ")} },`;
|
|
29548
29548
|
});
|
|
29549
29549
|
if (lines.length && kept.length)
|
|
29550
29550
|
return [
|
|
@@ -31320,8 +31320,8 @@ var init_storeKitContract = __esm({
|
|
|
31320
31320
|
});
|
|
31321
31321
|
|
|
31322
31322
|
// src/storekit-test-store.ts
|
|
31323
|
-
async function loadStoreKitTestStore(
|
|
31324
|
-
const catalog = readStoreKitCatalog(JSON.parse(await (0, import_promises8.readFile)(
|
|
31323
|
+
async function loadStoreKitTestStore(configuration2, appDir) {
|
|
31324
|
+
const catalog = readStoreKitCatalog(JSON.parse(await (0, import_promises8.readFile)(configuration2, "utf8")));
|
|
31325
31325
|
const identityPath = import_node_path44.default.join(
|
|
31326
31326
|
cacheDir(),
|
|
31327
31327
|
"storekit-identities",
|
|
@@ -31553,20 +31553,20 @@ async function workspaceExclusion(root, portable = false, linkedPackages = []) {
|
|
|
31553
31553
|
env: gitEnvironment()
|
|
31554
31554
|
}).catch(() => ({ stdout: "" }));
|
|
31555
31555
|
for (const entry of cached4.stdout.split("\0").filter(Boolean)) {
|
|
31556
|
-
const
|
|
31557
|
-
for (let index = 1; index <=
|
|
31558
|
-
tracked.add(
|
|
31556
|
+
const parts2 = entry.split("/");
|
|
31557
|
+
for (let index = 1; index <= parts2.length; index++)
|
|
31558
|
+
tracked.add(parts2.slice(0, index).join(import_node_path46.default.sep));
|
|
31559
31559
|
}
|
|
31560
31560
|
}
|
|
31561
31561
|
const ignoredByRules = gitignoreRules(root);
|
|
31562
31562
|
return (relative5, knownDirectory) => {
|
|
31563
|
-
const
|
|
31563
|
+
const parts2 = relative5.split(import_node_path46.default.sep);
|
|
31564
31564
|
const linked = linkedPackages.some(
|
|
31565
31565
|
(directory2) => relative5.startsWith(directory2 + import_node_path46.default.sep)
|
|
31566
31566
|
);
|
|
31567
31567
|
if (linked) {
|
|
31568
31568
|
return ["node_modules", ".git", ".expo", ".one"].some(
|
|
31569
|
-
(name3) =>
|
|
31569
|
+
(name3) => parts2.includes(name3)
|
|
31570
31570
|
);
|
|
31571
31571
|
}
|
|
31572
31572
|
if (portable && relative5 && !tracked.has(relative5) && ignoredByRules(
|
|
@@ -31574,7 +31574,7 @@ async function workspaceExclusion(root, portable = false, linkedPackages = []) {
|
|
|
31574
31574
|
knownDirectory ?? import_node_fs46.default.lstatSync(import_node_path46.default.join(root, relative5)).isDirectory()
|
|
31575
31575
|
))
|
|
31576
31576
|
return true;
|
|
31577
|
-
return ignored.has(
|
|
31577
|
+
return ignored.has(parts2.join("/")) && !tracked.has(relative5) || parts2.includes("node_modules") || parts2.includes(".git") || parts2.includes(".expo") || parts2.includes(".one") || parts2.some((name3) => name3 === ".beast-gate" || name3.startsWith(".beast-gate-")) || parts2.includes("ios") && (parts2.includes("Pods") || parts2.includes("build"));
|
|
31578
31578
|
};
|
|
31579
31579
|
}
|
|
31580
31580
|
async function untrackedIgnored(root, linkedPackages) {
|
|
@@ -31591,10 +31591,10 @@ async function untrackedIgnored(root, linkedPackages) {
|
|
|
31591
31591
|
function gitignoreRules(root) {
|
|
31592
31592
|
const ignoreFiles = /* @__PURE__ */ new Map();
|
|
31593
31593
|
return (relative5, isDirectory5) => {
|
|
31594
|
-
const
|
|
31594
|
+
const parts2 = relative5.split(import_node_path46.default.sep);
|
|
31595
31595
|
let excluded = false;
|
|
31596
|
-
for (let index = 0; index <
|
|
31597
|
-
const directory2 =
|
|
31596
|
+
for (let index = 0; index < parts2.length; index++) {
|
|
31597
|
+
const directory2 = parts2.slice(0, index).join(import_node_path46.default.sep);
|
|
31598
31598
|
let rules2 = ignoreFiles.get(directory2);
|
|
31599
31599
|
if (rules2 === void 0) {
|
|
31600
31600
|
const file = import_node_path46.default.join(root, directory2, ".gitignore");
|
|
@@ -31602,7 +31602,7 @@ function gitignoreRules(root) {
|
|
|
31602
31602
|
ignoreFiles.set(directory2, rules2);
|
|
31603
31603
|
}
|
|
31604
31604
|
if (!rules2) continue;
|
|
31605
|
-
const item =
|
|
31605
|
+
const item = parts2.slice(index).join("/");
|
|
31606
31606
|
const result = rules2.test(isDirectory5 ? `${item}/` : item);
|
|
31607
31607
|
if (result.ignored) excluded = true;
|
|
31608
31608
|
else if (result.unignored) excluded = false;
|
|
@@ -32151,10 +32151,10 @@ function normalizeArraySettings(settings, objectVersion) {
|
|
|
32151
32151
|
const stripped2 = key2.replace(/\[[^\]]+\]$/, "");
|
|
32152
32152
|
if (typeof value === "string") {
|
|
32153
32153
|
if (!arraySettings.has(stripped2)) continue;
|
|
32154
|
-
const
|
|
32154
|
+
const parts2 = [...value.matchAll(/ *((['"]?).*?[^\\]\2)(?= |(?![\s\S]))/g)].map(
|
|
32155
32155
|
(match) => match[1]
|
|
32156
32156
|
);
|
|
32157
|
-
if (
|
|
32157
|
+
if (parts2.length > 1) settings[key2] = parts2;
|
|
32158
32158
|
} else if (Array.isArray(value)) {
|
|
32159
32159
|
if (value.length > 1 && arraySettings.has(stripped2)) continue;
|
|
32160
32160
|
settings[key2] = value.map((item) => typeof item === "string" ? item : "").join(" ");
|
|
@@ -34695,7 +34695,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk2)
|
|
|
34695
34695
|
]);
|
|
34696
34696
|
const cached4 = sdkViews.get(key2);
|
|
34697
34697
|
if (cached4 && import_node_fs51.default.existsSync(cached4.manifest)) return touchSdkView(cached4.options);
|
|
34698
|
-
const
|
|
34698
|
+
const configuration2 = (0, import_node_child_process22.execFileSync)(
|
|
34699
34699
|
import_node_path51.default.join(toolchainBin, "swift"),
|
|
34700
34700
|
[
|
|
34701
34701
|
"sdk",
|
|
@@ -34707,7 +34707,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk2)
|
|
|
34707
34707
|
],
|
|
34708
34708
|
{ encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
|
|
34709
34709
|
);
|
|
34710
|
-
const sysroot = /^sdkRootPath: (.+)$/m.exec(
|
|
34710
|
+
const sysroot = /^sdkRootPath: (.+)$/m.exec(configuration2)?.[1]?.trim();
|
|
34711
34711
|
if (!sysroot || !import_node_path51.default.isAbsolute(sysroot))
|
|
34712
34712
|
throw new Error(`swift sdk ${sdk2} reports no absolute sdkRootPath`);
|
|
34713
34713
|
let bundle = sysroot;
|
|
@@ -36657,7 +36657,7 @@ function takeGuestStartupData(wasm, address, length) {
|
|
|
36657
36657
|
}
|
|
36658
36658
|
if (covered !== length)
|
|
36659
36659
|
throw new Error("guest startup data does not initialize the whole range");
|
|
36660
|
-
const
|
|
36660
|
+
const parts2 = [result.subarray(0, data[0])];
|
|
36661
36661
|
const payload = [result.subarray(data[1], segments[0].header)];
|
|
36662
36662
|
for (const [index, segment2] of segments.entries()) {
|
|
36663
36663
|
if (!emptied.has(index)) {
|
|
@@ -36675,8 +36675,8 @@ function takeGuestStartupData(wasm, address, length) {
|
|
|
36675
36675
|
}
|
|
36676
36676
|
size2.push(rest % 128 | 128);
|
|
36677
36677
|
}
|
|
36678
|
-
|
|
36679
|
-
return { wasm: Buffer.concat(
|
|
36678
|
+
parts2.push(Uint8Array.of(11, ...size2), section2, result.subarray(data[2]));
|
|
36679
|
+
return { wasm: Buffer.concat(parts2), bytes };
|
|
36680
36680
|
}
|
|
36681
36681
|
var import_node_fs55, import_node_string_decoder, constant;
|
|
36682
36682
|
var init_swift_guest_linked_spans = __esm({
|
|
@@ -37132,11 +37132,11 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
|
|
|
37132
37132
|
]
|
|
37133
37133
|
]
|
|
37134
37134
|
]);
|
|
37135
|
-
const
|
|
37135
|
+
const parts2 = [bytes.subarray(0, 8)];
|
|
37136
37136
|
for (const s of m.sections) {
|
|
37137
37137
|
if (s.name === ".swift1_autolink_entries") continue;
|
|
37138
37138
|
const payload = replaced.get(s.id);
|
|
37139
|
-
|
|
37139
|
+
parts2.push(payload ? section(s.id, payload) : bytes.subarray(s.offset, s.end));
|
|
37140
37140
|
}
|
|
37141
37141
|
const address = (name3) => {
|
|
37142
37142
|
const value = m.global(name3);
|
|
@@ -37161,7 +37161,7 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
|
|
|
37161
37161
|
const functionSlots = m.bodies.map(
|
|
37162
37162
|
(_, ordinal) => m.slots.get(ordinal + m.importedFuncs) ?? 0
|
|
37163
37163
|
);
|
|
37164
|
-
return { image: Buffer.concat(
|
|
37164
|
+
return { image: Buffer.concat(parts2), sdkInterface, functionSlots };
|
|
37165
37165
|
}
|
|
37166
37166
|
function passiveSegments(bytes) {
|
|
37167
37167
|
const data = wasmSections(bytes).find((s) => s.id === 11);
|
|
@@ -40089,8 +40089,8 @@ function primaryFunctionTable(bytes) {
|
|
|
40089
40089
|
throw new Error("native primary exports no function table");
|
|
40090
40090
|
return { name: wasmReader(exported, 0).name(), table64 };
|
|
40091
40091
|
}
|
|
40092
|
-
function vectorSection(id, count,
|
|
40093
|
-
const body = Buffer.concat([Buffer.from(uleb2(count)), ...
|
|
40092
|
+
function vectorSection(id, count, parts2) {
|
|
40093
|
+
const body = Buffer.concat([Buffer.from(uleb2(count)), ...parts2]);
|
|
40094
40094
|
return Buffer.concat([Buffer.from([id, ...uleb2(body.length)]), body]);
|
|
40095
40095
|
}
|
|
40096
40096
|
function rewriteSections(bytes, sections, changes) {
|
|
@@ -40725,7 +40725,7 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
|
|
|
40725
40725
|
offset = stop;
|
|
40726
40726
|
subsections.push({ kind, content });
|
|
40727
40727
|
}
|
|
40728
|
-
const
|
|
40728
|
+
const parts2 = [encodedString(sectionName), encodeNumber(version2)];
|
|
40729
40729
|
for (const subsection of subsections) {
|
|
40730
40730
|
let content = subsection.content;
|
|
40731
40731
|
if (subsection.kind === 6 && objcLoader !== void 0) {
|
|
@@ -40748,13 +40748,13 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
|
|
|
40748
40748
|
throw new Error("invalid init functions subsection");
|
|
40749
40749
|
content = Buffer.concat(entries2);
|
|
40750
40750
|
}
|
|
40751
|
-
|
|
40751
|
+
parts2.push(
|
|
40752
40752
|
Buffer.from([subsection.kind]),
|
|
40753
40753
|
encodeNumber(content.length),
|
|
40754
40754
|
content
|
|
40755
40755
|
);
|
|
40756
40756
|
}
|
|
40757
|
-
section2 = Buffer.concat(
|
|
40757
|
+
section2 = Buffer.concat(parts2);
|
|
40758
40758
|
} else if (!sections && sectionName.startsWith("reloc.")) {
|
|
40759
40759
|
number4();
|
|
40760
40760
|
for (let count = number4(); count > 0; count--) {
|
|
@@ -41209,14 +41209,14 @@ ${store} call void @__peach_register_guest_tables(ptr @.app_tables)
|
|
|
41209
41209
|
}
|
|
41210
41210
|
function nameGuestImageAliases(wasm, symbols) {
|
|
41211
41211
|
const alias = /^__peach_image_\d+_symbol_(\d+)$/;
|
|
41212
|
-
const
|
|
41212
|
+
const parts2 = [wasm.subarray(0, 8)];
|
|
41213
41213
|
let position = 8;
|
|
41214
41214
|
while (position < wasm.length) {
|
|
41215
41215
|
const [size2, start] = readNumber(wasm, position + 1);
|
|
41216
41216
|
const end = start + size2;
|
|
41217
41217
|
const custom = wasm[position] === 0 ? readString(wasm, start) : void 0;
|
|
41218
41218
|
if (custom?.[0] !== "name") {
|
|
41219
|
-
|
|
41219
|
+
parts2.push(wasm.subarray(position, end));
|
|
41220
41220
|
position = end;
|
|
41221
41221
|
continue;
|
|
41222
41222
|
}
|
|
@@ -41244,10 +41244,10 @@ function nameGuestImageAliases(wasm, symbols) {
|
|
|
41244
41244
|
at = subEnd;
|
|
41245
41245
|
}
|
|
41246
41246
|
const section2 = Buffer.concat(subsections);
|
|
41247
|
-
|
|
41247
|
+
parts2.push(Buffer.from([0]), encodeNumber(section2.length), section2);
|
|
41248
41248
|
position = end;
|
|
41249
41249
|
}
|
|
41250
|
-
return Buffer.concat(
|
|
41250
|
+
return Buffer.concat(parts2);
|
|
41251
41251
|
}
|
|
41252
41252
|
var import_node_crypto31, OBJC_INIT_RECORD, TABLE_INDEX_RELOCATIONS, GUEST_DYLD_VALUES_SECTION, GUEST_LAZY_FUNCTION_BASE, SDK_DYLD_RESOLVER;
|
|
41253
41253
|
var init_swift_guest_image_ledger = __esm({
|
|
@@ -41345,12 +41345,12 @@ function readWasmCustomSection(bytes, name3) {
|
|
|
41345
41345
|
return void 0;
|
|
41346
41346
|
}
|
|
41347
41347
|
function dropWasmCustomSection(bytes, name3) {
|
|
41348
|
-
const
|
|
41348
|
+
const parts2 = [bytes.subarray(0, 8)];
|
|
41349
41349
|
for (const { id, offset, start, end } of wasmSections2(bytes)) {
|
|
41350
41350
|
if (id === 0 && readWasmSection(bytes, start, end).name() === name3) continue;
|
|
41351
|
-
|
|
41351
|
+
parts2.push(bytes.subarray(offset, end));
|
|
41352
41352
|
}
|
|
41353
|
-
return Buffer.concat(
|
|
41353
|
+
return Buffer.concat(parts2);
|
|
41354
41354
|
}
|
|
41355
41355
|
function writeWasmCustomSection(bytes, name3, data) {
|
|
41356
41356
|
const section2 = Buffer.concat([Buffer.from(encodeWasmName(name3)), data]);
|
|
@@ -41580,16 +41580,16 @@ function hasWasmExport(bytes, name3) {
|
|
|
41580
41580
|
return false;
|
|
41581
41581
|
}
|
|
41582
41582
|
function withSections(bytes, layout2, replacements) {
|
|
41583
|
-
const
|
|
41583
|
+
const parts2 = [bytes.subarray(0, 8)];
|
|
41584
41584
|
let at = 8;
|
|
41585
41585
|
for (const section2 of layout2) {
|
|
41586
41586
|
const body = replacements.get(section2.id);
|
|
41587
|
-
|
|
41587
|
+
parts2.push(
|
|
41588
41588
|
body ? Uint8Array.from([section2.id, ...encodeWasmNumber(body.length), ...body]) : bytes.subarray(at, section2.end)
|
|
41589
41589
|
);
|
|
41590
41590
|
at = section2.end;
|
|
41591
41591
|
}
|
|
41592
|
-
return Buffer.concat(
|
|
41592
|
+
return Buffer.concat(parts2);
|
|
41593
41593
|
}
|
|
41594
41594
|
function narrowWasmBoundary(bytes, wideExports) {
|
|
41595
41595
|
const layout2 = wasmSections2(bytes);
|
|
@@ -44513,8 +44513,8 @@ function clangIrLinkOptions(ir) {
|
|
|
44513
44513
|
if (!/^!\d+$/.test(id)) throw new Error(`invalid clang link metadata ${id}`);
|
|
44514
44514
|
const node = new RegExp(`^${id} = !\\{([^\\n]*)\\}$`, "m").exec(ir);
|
|
44515
44515
|
if (!node) throw new Error(`missing clang link metadata ${id}`);
|
|
44516
|
-
const
|
|
44517
|
-
for (const part of
|
|
44516
|
+
const parts2 = node[1].split(/,\s*(?=!")/);
|
|
44517
|
+
for (const part of parts2) {
|
|
44518
44518
|
const value = /^!"((?:[^"\\]|\\[0-9A-Fa-f]{2})*)"$/.exec(part.trim());
|
|
44519
44519
|
if (!value) throw new Error(`invalid clang link option ${part}`);
|
|
44520
44520
|
const decoded = value[1].replace(
|
|
@@ -46767,9 +46767,9 @@ async function publishedClosure(pkg, version2, stage) {
|
|
|
46767
46767
|
for (const entry of listing.files) {
|
|
46768
46768
|
const name3 = entry.name.slice(1);
|
|
46769
46769
|
if (!name3.startsWith(`${stage.from}/`)) continue;
|
|
46770
|
-
const
|
|
46771
|
-
const base2 =
|
|
46772
|
-
if (
|
|
46770
|
+
const parts2 = name3.slice(stage.from.length + 1).split("/");
|
|
46771
|
+
const base2 = parts2.at(-1) ?? "";
|
|
46772
|
+
if (parts2.some((part) => part.startsWith(".") || stage.skip.includes(part))) continue;
|
|
46773
46773
|
if (!keep.test(base2) || base2 === stage.exclude) continue;
|
|
46774
46774
|
files2[name3] = Buffer.from(entry.hash, "base64").toString("hex");
|
|
46775
46775
|
}
|
|
@@ -48262,11 +48262,11 @@ function sdkLinkInputs(appRoot) {
|
|
|
48262
48262
|
const libraries = [];
|
|
48263
48263
|
const objects = /* @__PURE__ */ new Set();
|
|
48264
48264
|
const seen = /* @__PURE__ */ new Set();
|
|
48265
|
-
const flag = (...
|
|
48266
|
-
const key2 =
|
|
48265
|
+
const flag = (...parts2) => {
|
|
48266
|
+
const key2 = parts2.join(" ");
|
|
48267
48267
|
if (seen.has(key2)) return;
|
|
48268
48268
|
seen.add(key2);
|
|
48269
|
-
flags.push(...
|
|
48269
|
+
flags.push(...parts2);
|
|
48270
48270
|
};
|
|
48271
48271
|
let crt = "";
|
|
48272
48272
|
for (let i = 0; i < tokens2.length; i++) {
|
|
@@ -48671,10 +48671,10 @@ function decodeNativeSdkLater(trailer) {
|
|
|
48671
48671
|
at += LATER_DIGEST_BYTES + 4;
|
|
48672
48672
|
}
|
|
48673
48673
|
if (!files2.length || at + 4 > trailer.byteLength) throw truncated();
|
|
48674
|
-
const
|
|
48674
|
+
const parts2 = view.getUint32(at, true);
|
|
48675
48675
|
at += 4;
|
|
48676
48676
|
const needs = [];
|
|
48677
|
-
for (let part = 0; part <
|
|
48677
|
+
for (let part = 0; part < parts2; part++) {
|
|
48678
48678
|
if (at >= trailer.byteLength) throw truncated();
|
|
48679
48679
|
const n = trailer[at++];
|
|
48680
48680
|
if (at + n > trailer.byteLength) throw truncated();
|
|
@@ -48685,7 +48685,7 @@ function decodeNativeSdkLater(trailer) {
|
|
|
48685
48685
|
at += n;
|
|
48686
48686
|
}
|
|
48687
48687
|
if (at !== trailer.byteLength) throw new Error("Swift SDK binding has trailing bytes");
|
|
48688
|
-
return
|
|
48688
|
+
return parts2 ? { files: files2, needs } : { files: files2 };
|
|
48689
48689
|
}
|
|
48690
48690
|
function encodeNativeSdkFixups(triples) {
|
|
48691
48691
|
if (triples.length % 3) throw new Error("Swift SDK fixups are not triples");
|
|
@@ -49489,16 +49489,16 @@ function resolveSdkReferences(source, sdk2, forwarders) {
|
|
|
49489
49489
|
sections.find((section2) => section2.id === 10),
|
|
49490
49490
|
expanded
|
|
49491
49491
|
) : void 0;
|
|
49492
|
-
const
|
|
49492
|
+
const parts2 = [bytes.subarray(0, 8)];
|
|
49493
49493
|
for (const s of sections) {
|
|
49494
49494
|
if (s === tags || s.name === "linking" || s.name?.startsWith("reloc.") || s.name === ".swift1_autolink_entries")
|
|
49495
49495
|
continue;
|
|
49496
49496
|
const payload = replaced.get(s.id);
|
|
49497
|
-
|
|
49497
|
+
parts2.push(
|
|
49498
49498
|
s.id === 10 && rebuiltCode ? rebuiltCode : payload ? Uint8Array.from([s.id, ...uleb4(payload.length), ...payload]) : bytes.subarray(s.offset, s.end)
|
|
49499
49499
|
);
|
|
49500
49500
|
}
|
|
49501
|
-
return { bytes: Buffer.concat(
|
|
49501
|
+
return { bytes: Buffer.concat(parts2), linkage };
|
|
49502
49502
|
}
|
|
49503
49503
|
function expandSdkRelocations(bytes, section2, patches) {
|
|
49504
49504
|
patches.sort((a, b) => a.at - b.at);
|
|
@@ -49513,19 +49513,19 @@ function expandSdkRelocations(bytes, section2, patches) {
|
|
|
49513
49513
|
if (!patches[next] || patches[next].at >= end) {
|
|
49514
49514
|
payload.push(bytes.subarray(start, end));
|
|
49515
49515
|
} else {
|
|
49516
|
-
const
|
|
49516
|
+
const parts2 = [];
|
|
49517
49517
|
let at = r.at;
|
|
49518
49518
|
for (; patches[next] && patches[next].at < end; next++) {
|
|
49519
49519
|
const patch = patches[next];
|
|
49520
49520
|
if (patch.at < at || patch.at + patch.length > end)
|
|
49521
49521
|
throw new Error("Swift SDK relocations overlap a function boundary");
|
|
49522
|
-
|
|
49522
|
+
parts2.push(bytes.subarray(at, patch.at), patch.code);
|
|
49523
49523
|
at = patch.at + patch.length;
|
|
49524
49524
|
}
|
|
49525
|
-
|
|
49525
|
+
parts2.push(bytes.subarray(at, end));
|
|
49526
49526
|
payload.push(
|
|
49527
|
-
Uint8Array.from(uleb4(
|
|
49528
|
-
...
|
|
49527
|
+
Uint8Array.from(uleb4(parts2.reduce((size3, part) => size3 + part.length, 0))),
|
|
49528
|
+
...parts2
|
|
49529
49529
|
);
|
|
49530
49530
|
}
|
|
49531
49531
|
r.at = end;
|
|
@@ -51052,22 +51052,22 @@ function swiftIcuLayout(head, blobBytes) {
|
|
|
51052
51052
|
}
|
|
51053
51053
|
function swiftIcuPack(blob, deflate2) {
|
|
51054
51054
|
const layout2 = swiftIcuLayout(blob, blob.byteLength);
|
|
51055
|
-
const
|
|
51055
|
+
const parts2 = [
|
|
51056
51056
|
deflate2(blob.subarray(0, layout2.headBytes)),
|
|
51057
51057
|
...layout2.packs.map(([start, end]) => deflate2(blob.subarray(start, end)))
|
|
51058
51058
|
];
|
|
51059
|
-
const index = new DataView(new ArrayBuffer(16 +
|
|
51059
|
+
const index = new DataView(new ArrayBuffer(16 + parts2.length * 4));
|
|
51060
51060
|
index.setUint32(0, MAGIC, true);
|
|
51061
51061
|
index.setUint32(4, VERSION, true);
|
|
51062
51062
|
index.setUint32(8, blob.byteLength, true);
|
|
51063
51063
|
index.setUint32(12, layout2.packs.length, true);
|
|
51064
|
-
|
|
51064
|
+
parts2.forEach((part, at2) => index.setUint32(16 + at2 * 4, part.byteLength, true));
|
|
51065
51065
|
const packed = new Uint8Array(
|
|
51066
|
-
index.byteLength +
|
|
51066
|
+
index.byteLength + parts2.reduce((total, part) => total + part.byteLength, 0)
|
|
51067
51067
|
);
|
|
51068
51068
|
packed.set(new Uint8Array(index.buffer));
|
|
51069
51069
|
let at = index.byteLength;
|
|
51070
|
-
for (const part of
|
|
51070
|
+
for (const part of parts2) {
|
|
51071
51071
|
packed.set(part, at);
|
|
51072
51072
|
at += part.byteLength;
|
|
51073
51073
|
}
|
|
@@ -52669,13 +52669,13 @@ function swiftSdkPaths(moduleRoot, toolchainBin, options2 = swiftCompileSdkOptio
|
|
|
52669
52669
|
const key2 = JSON.stringify([toolchainBin, sdk2, options2]);
|
|
52670
52670
|
const cached4 = sdkPaths.get(key2);
|
|
52671
52671
|
if (cached4) return cached4;
|
|
52672
|
-
const
|
|
52672
|
+
const configuration2 = (0, import_node_child_process40.execFileSync)(
|
|
52673
52673
|
import_node_path80.default.join(toolchainBin, "swift"),
|
|
52674
52674
|
["sdk", "configure", ...options2, "--show-configuration", sdk2, SWIFT_WASM_TRIPLE],
|
|
52675
52675
|
{ encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
|
|
52676
52676
|
);
|
|
52677
52677
|
const field = (name3) => {
|
|
52678
|
-
const value = new RegExp(`^${name3}:\\s*(.+)$`, "m").exec(
|
|
52678
|
+
const value = new RegExp(`^${name3}:\\s*(.+)$`, "m").exec(configuration2)?.[1]?.trim();
|
|
52679
52679
|
if (!value) throw new Error(`swift sdk ${sdk2} reports no ${name3}`);
|
|
52680
52680
|
return value;
|
|
52681
52681
|
};
|
|
@@ -62319,7 +62319,7 @@ var init_pods_targets = __esm({
|
|
|
62319
62319
|
return this.fileAccessors.map((fa) => this.#headerMappings(fa, fa.publicHeaders()));
|
|
62320
62320
|
}
|
|
62321
62321
|
#recursive = /* @__PURE__ */ new Map();
|
|
62322
|
-
recursiveDependentTargets(
|
|
62322
|
+
recursiveDependentTargets(configuration2 = null) {
|
|
62323
62323
|
if (this.#recursive.size === 0) {
|
|
62324
62324
|
const byConfig = this.configVariants.map(
|
|
62325
62325
|
(config) => {
|
|
@@ -62339,8 +62339,8 @@ var init_pods_targets = __esm({
|
|
|
62339
62339
|
for (const [config, targets] of byConfig) this.#recursive.set(config, targets);
|
|
62340
62340
|
this.#recursive.set(null, [...new Set(byConfig.flatMap(([, targets]) => targets))]);
|
|
62341
62341
|
}
|
|
62342
|
-
const found2 = this.#recursive.get(
|
|
62343
|
-
if (!found2) throw new Error(`No configuration ${
|
|
62342
|
+
const found2 = this.#recursive.get(configuration2);
|
|
62343
|
+
if (!found2) throw new Error(`No configuration ${configuration2} for ${this.label}`);
|
|
62344
62344
|
return found2;
|
|
62345
62345
|
}
|
|
62346
62346
|
configurationBuildDir(dir = CONFIGURATION_BUILD_DIR_VARIABLE) {
|
|
@@ -62479,8 +62479,8 @@ var init_pods_targets = __esm({
|
|
|
62479
62479
|
get podTargets() {
|
|
62480
62480
|
return [...new Set([...this.podTargetsForBuildConfiguration.values()].flat())];
|
|
62481
62481
|
}
|
|
62482
|
-
podTargetsFor(
|
|
62483
|
-
return this.podTargetsForBuildConfiguration.get(
|
|
62482
|
+
podTargetsFor(configuration2) {
|
|
62483
|
+
return this.podTargetsForBuildConfiguration.get(configuration2) ?? [];
|
|
62484
62484
|
}
|
|
62485
62485
|
get usesSwift() {
|
|
62486
62486
|
return this.podTargets.some((target) => target.usesSwift);
|
|
@@ -62950,10 +62950,10 @@ var init_pods_build_settings = __esm({
|
|
|
62950
62950
|
};
|
|
62951
62951
|
developerFrameworkSearchPaths = (frameworks) => frameworks.includes("XCTest") || frameworks.includes("SenTestingKit") ? ["$(PLATFORM_DIR)/Developer/Library/Frameworks"] : [];
|
|
62952
62952
|
PodTargetSettings = class extends BuildSettings {
|
|
62953
|
-
constructor(target,
|
|
62953
|
+
constructor(target, configuration2, settingsFor, setArcCompatibilityFlag) {
|
|
62954
62954
|
super();
|
|
62955
62955
|
this.target = target;
|
|
62956
|
-
this.configuration =
|
|
62956
|
+
this.configuration = configuration2;
|
|
62957
62957
|
this.settingsFor = settingsFor;
|
|
62958
62958
|
this.setArcCompatibilityFlag = setArcCompatibilityFlag;
|
|
62959
62959
|
}
|
|
@@ -63489,25 +63489,25 @@ var init_pods_build_settings = __esm({
|
|
|
63489
63489
|
}
|
|
63490
63490
|
#pods = /* @__PURE__ */ new Map();
|
|
63491
63491
|
#aggregates = /* @__PURE__ */ new Map();
|
|
63492
|
-
pod = (target,
|
|
63492
|
+
pod = (target, configuration2) => {
|
|
63493
63493
|
let byConfig = this.#pods.get(target);
|
|
63494
63494
|
if (!byConfig) {
|
|
63495
63495
|
byConfig = /* @__PURE__ */ new Map();
|
|
63496
63496
|
this.#pods.set(target, byConfig);
|
|
63497
63497
|
}
|
|
63498
|
-
let settings = byConfig.get(
|
|
63498
|
+
let settings = byConfig.get(configuration2);
|
|
63499
63499
|
if (!settings) {
|
|
63500
|
-
if (!target.configVariants.includes(
|
|
63500
|
+
if (!target.configVariants.includes(configuration2))
|
|
63501
63501
|
throw new Error(
|
|
63502
|
-
`No build settings for ${target.label} (configuration ${
|
|
63502
|
+
`No build settings for ${target.label} (configuration ${configuration2})`
|
|
63503
63503
|
);
|
|
63504
63504
|
settings = new PodTargetSettings(
|
|
63505
63505
|
target,
|
|
63506
|
-
|
|
63506
|
+
configuration2,
|
|
63507
63507
|
this.pod,
|
|
63508
63508
|
this.setArcCompatibilityFlag
|
|
63509
63509
|
);
|
|
63510
|
-
byConfig.set(
|
|
63510
|
+
byConfig.set(configuration2, settings);
|
|
63511
63511
|
}
|
|
63512
63512
|
return settings;
|
|
63513
63513
|
};
|
|
@@ -63886,14 +63886,14 @@ echo "SUCCESS" > "\${SCRIPT_OUTPUT_FILE_0}"
|
|
|
63886
63886
|
} else this.table.get(config).baseConfigurationReference = ref;
|
|
63887
63887
|
}
|
|
63888
63888
|
}
|
|
63889
|
-
xcconfigRef(
|
|
63889
|
+
xcconfigRef(configuration2) {
|
|
63890
63890
|
const main = this.project.mainGroup;
|
|
63891
63891
|
const group = this.project.child(main, "Pods") ?? this.project.newGroup(
|
|
63892
63892
|
main,
|
|
63893
63893
|
"Pods",
|
|
63894
63894
|
import_node_path89.default.relative(this.target.clientRoot, this.target.sandbox.root)
|
|
63895
63895
|
);
|
|
63896
|
-
const xcconfig = this.target.xcconfigPath(
|
|
63896
|
+
const xcconfig = this.target.xcconfigPath(configuration2);
|
|
63897
63897
|
const relative5 = import_node_path89.default.relative(this.project.realPath(group), xcconfig);
|
|
63898
63898
|
const filename = import_node_path89.default.basename(relative5);
|
|
63899
63899
|
const ref = this.project.files(group).find((id) => this.project.displayName(id) === filename);
|
|
@@ -64003,10 +64003,10 @@ echo "SUCCESS" > "\${SCRIPT_OUTPUT_FILE_0}"
|
|
|
64003
64003
|
delete object8.inputFileListPaths;
|
|
64004
64004
|
delete object8.outputFileListPaths;
|
|
64005
64005
|
}
|
|
64006
|
-
fileListKey(script, kind,
|
|
64006
|
+
fileListKey(script, kind, configuration2) {
|
|
64007
64007
|
const name3 = (config) => `${this.target.label}-${script}-${config}-${kind}-files.xcfilelist`;
|
|
64008
64008
|
return {
|
|
64009
|
-
path: import_node_path89.default.join(this.target.supportFilesDir, name3(
|
|
64009
|
+
path: import_node_path89.default.join(this.target.supportFilesDir, name3(configuration2)),
|
|
64010
64010
|
relativePath: this.podsRootPath(
|
|
64011
64011
|
import_node_path89.default.join(this.target.supportFilesDir, name3("${CONFIGURATION}"))
|
|
64012
64012
|
)
|
|
@@ -68913,21 +68913,21 @@ function graphInputsDigest(root) {
|
|
|
68913
68913
|
hash.update(file).update(import_node_fs91.default.readFileSync(import_node_path93.default.join(root, file)));
|
|
68914
68914
|
return hash.digest("hex");
|
|
68915
68915
|
}
|
|
68916
|
-
function configurationFlags(
|
|
68916
|
+
function configurationFlags(configuration2) {
|
|
68917
68917
|
return [
|
|
68918
68918
|
"-c",
|
|
68919
|
-
|
|
68919
|
+
configuration2 === "Release" ? "opt" : "dbg",
|
|
68920
68920
|
"--cpu=ios_sim_arm64",
|
|
68921
68921
|
"--platforms=@build_bazel_apple_support//platforms:ios_sim_arm64",
|
|
68922
68922
|
// generators run the developer's tools, as their own builds find them
|
|
68923
68923
|
"--action_env=PATH"
|
|
68924
68924
|
];
|
|
68925
68925
|
}
|
|
68926
|
-
function bazelGraph(root, label,
|
|
68927
|
-
const key2 = JSON.stringify([root, label,
|
|
68926
|
+
function bazelGraph(root, label, configuration2) {
|
|
68927
|
+
const key2 = JSON.stringify([root, label, configuration2]);
|
|
68928
68928
|
const cached4 = graphs.get(key2);
|
|
68929
68929
|
if (cached4) return cached4;
|
|
68930
|
-
const flags = configurationFlags(
|
|
68930
|
+
const flags = configurationFlags(configuration2);
|
|
68931
68931
|
const digest3 = (0, import_node_crypto51.createHash)("sha256").update(JSON.stringify([GRAPH_FORMAT, label, flags, QUERIED_RULES])).update(graphInputsDigest(root)).digest("hex").slice(0, 24);
|
|
68932
68932
|
const file = import_node_path93.default.join(root, ".build", "peach-bazel", `graph-${digest3}.json`);
|
|
68933
68933
|
const bazel = bazelBinary(root);
|
|
@@ -69066,8 +69066,8 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options2 =
|
|
|
69066
69066
|
const root = import_node_fs91.default.realpathSync.native(workspaceRoot(import_node_fs91.default.realpathSync.native(buildFile)));
|
|
69067
69067
|
const pkg = import_node_path93.default.relative(root, import_node_path93.default.dirname(import_node_fs91.default.realpathSync.native(buildFile)));
|
|
69068
69068
|
const label = `//${pkg.split(import_node_path93.default.sep).join("/")}:${targetName}`;
|
|
69069
|
-
const
|
|
69070
|
-
const graph = bazelGraph(root, label,
|
|
69069
|
+
const configuration2 = configurationName ?? "Debug";
|
|
69070
|
+
const graph = bazelGraph(root, label, configuration2);
|
|
69071
69071
|
const files2 = new BazelFiles(graph, root);
|
|
69072
69072
|
const ruleOf = (raw2, from) => {
|
|
69073
69073
|
let rule = graph.rules.get(canonicalLabel(raw2, from));
|
|
@@ -69121,7 +69121,7 @@ function readBazelAppTarget(buildFile, targetName, configurationName, options2 =
|
|
|
69121
69121
|
propagated.set(rule.label, result);
|
|
69122
69122
|
return result;
|
|
69123
69123
|
};
|
|
69124
|
-
const debug =
|
|
69124
|
+
const debug = configuration2 !== "Release";
|
|
69125
69125
|
const products = import_node_path93.default.join(root, PRODUCTS);
|
|
69126
69126
|
const resources = [];
|
|
69127
69127
|
const resourceNames = {};
|
|
@@ -69391,7 +69391,7 @@ ${published4.map(
|
|
|
69391
69391
|
if (generators2.length > 0)
|
|
69392
69392
|
(0, import_node_child_process43.execFileSync)(
|
|
69393
69393
|
bazelBinary(root),
|
|
69394
|
-
["build", ...configurationFlags(
|
|
69394
|
+
["build", ...configurationFlags(configuration2), ...generators2],
|
|
69395
69395
|
{ cwd: root, stdio: ["ignore", "pipe", "pipe"], maxBuffer: 1 << 28 }
|
|
69396
69396
|
);
|
|
69397
69397
|
mirror();
|
|
@@ -69703,7 +69703,7 @@ ${published4.map(
|
|
|
69703
69703
|
sdkFrameworks,
|
|
69704
69704
|
packageResolved: [],
|
|
69705
69705
|
appTargets: [targetName],
|
|
69706
|
-
configuration,
|
|
69706
|
+
configuration: configuration2,
|
|
69707
69707
|
settings: (key2) => key2 === "PRODUCT_MODULE_NAME" ? appModule.moduleName : key2 === "IPHONEOS_DEPLOYMENT_TARGET" ? minimumOS : key2 === "PRODUCT_BUNDLE_IDENTIFIER" ? graph.app.attrs.get("bundle_id")?.value ?? "" : "",
|
|
69708
69708
|
cocoapods: null
|
|
69709
69709
|
};
|
|
@@ -70296,7 +70296,7 @@ function groupParentsOf(objects) {
|
|
|
70296
70296
|
groupParents.set(objects, parents);
|
|
70297
70297
|
return parents;
|
|
70298
70298
|
}
|
|
70299
|
-
function xcodePathResolver(objects, projectDir,
|
|
70299
|
+
function xcodePathResolver(objects, projectDir, join30, sourceTreeRoot) {
|
|
70300
70300
|
const parents = groupParentsOf(objects);
|
|
70301
70301
|
const paths = /* @__PURE__ */ new Map();
|
|
70302
70302
|
const resolve10 = (id) => {
|
|
@@ -70308,14 +70308,14 @@ function xcodePathResolver(objects, projectDir, join29, sourceTreeRoot) {
|
|
|
70308
70308
|
const own2 = str2(entry.path) ?? "";
|
|
70309
70309
|
const tree2 = str2(entry.sourceTree) ?? "<group>";
|
|
70310
70310
|
if (tree2 === "<absolute>") result = own2;
|
|
70311
|
-
else if (tree2 === "SOURCE_ROOT") result =
|
|
70311
|
+
else if (tree2 === "SOURCE_ROOT") result = join30(projectDir, own2);
|
|
70312
70312
|
else if (tree2 === "<group>") {
|
|
70313
70313
|
const parent = parents.get(id);
|
|
70314
70314
|
const base2 = parent ? resolve10(parent) : projectDir;
|
|
70315
|
-
if (base2 !== null) result =
|
|
70315
|
+
if (base2 !== null) result = join30(base2, own2);
|
|
70316
70316
|
} else {
|
|
70317
70317
|
const base2 = sourceTreeRoot?.(tree2);
|
|
70318
|
-
if (base2) result =
|
|
70318
|
+
if (base2) result = join30(base2, own2);
|
|
70319
70319
|
}
|
|
70320
70320
|
}
|
|
70321
70321
|
paths.set(id, result);
|
|
@@ -70337,7 +70337,7 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
70337
70337
|
if (isDict(group) && group.isa === "PBXFileSystemSynchronizedRootGroup")
|
|
70338
70338
|
synchronizedGroups.push({ id, group });
|
|
70339
70339
|
}
|
|
70340
|
-
return (targetId, resolvePath, filesUnder,
|
|
70340
|
+
return (targetId, resolvePath, filesUnder, join30, visit3) => {
|
|
70341
70341
|
const target = objects[targetId];
|
|
70342
70342
|
if (!isDict(target)) return;
|
|
70343
70343
|
for (const phaseId of list(target.buildPhases)) {
|
|
@@ -70384,7 +70384,7 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
70384
70384
|
for (const relative5 of list(exception.membershipExceptions))
|
|
70385
70385
|
exceptions.add(relative5);
|
|
70386
70386
|
}
|
|
70387
|
-
const members2 = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative5) => filesUnder(
|
|
70387
|
+
const members2 = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative5) => filesUnder(join30(folder, relative5)));
|
|
70388
70388
|
for (const file of members2) {
|
|
70389
70389
|
const relative5 = file.slice(prefix.length);
|
|
70390
70390
|
const excepted = [...exceptions].some(
|
|
@@ -72284,20 +72284,20 @@ function swiftPackageManifest(dir, platform3 = GUEST_PLATFORMS, requirePrepared
|
|
|
72284
72284
|
}
|
|
72285
72285
|
if (string6(tool) === "swift" && linksOnPlatform(condition, traits, platforms2)) {
|
|
72286
72286
|
const config = string6(record3(condition).config);
|
|
72287
|
-
const
|
|
72287
|
+
const configuration2 = config === "debug" || config === "release" ? config : null;
|
|
72288
72288
|
for (const [kind2, into] of [
|
|
72289
72289
|
["enableExperimentalFeature", experimentalFeatures],
|
|
72290
72290
|
["enableUpcomingFeature", upcomingFeatures2]
|
|
72291
72291
|
]) {
|
|
72292
72292
|
const name5 = string6(record3(settingKind[kind2])._0);
|
|
72293
72293
|
if (name5 && /^[A-Za-z_][A-Za-z0-9_]*(?:=[A-Za-z_][A-Za-z0-9_.-]*)?$/.test(name5))
|
|
72294
|
-
into.push({ name: name5, configuration });
|
|
72294
|
+
into.push({ name: name5, configuration: configuration2 });
|
|
72295
72295
|
}
|
|
72296
72296
|
const flags = record3(settingKind.unsafeFlags)._0;
|
|
72297
72297
|
if (Array.isArray(flags) && flags.every((flag) => typeof flag === "string"))
|
|
72298
72298
|
swiftFlags.push({
|
|
72299
72299
|
flags: flags.filter((flag) => typeof flag === "string"),
|
|
72300
|
-
configuration
|
|
72300
|
+
configuration: configuration2
|
|
72301
72301
|
});
|
|
72302
72302
|
}
|
|
72303
72303
|
for (const [kind2, into] of [
|
|
@@ -74636,7 +74636,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
74636
74636
|
settingsOf(entry["build-settings"]),
|
|
74637
74637
|
new Map(
|
|
74638
74638
|
items(entry["specialized-configurations"]).flatMap(
|
|
74639
|
-
(
|
|
74639
|
+
(configuration2) => isObject(configuration2) && text6(configuration2.name) ? [[text6(configuration2.name), configuration2.file]] : []
|
|
74640
74640
|
)
|
|
74641
74641
|
)
|
|
74642
74642
|
);
|
|
@@ -74851,7 +74851,7 @@ function readXcconfig(file, read) {
|
|
|
74851
74851
|
}
|
|
74852
74852
|
return settings;
|
|
74853
74853
|
}
|
|
74854
|
-
function applyConditions(raw2,
|
|
74854
|
+
function applyConditions(raw2, configuration2) {
|
|
74855
74855
|
const plain = {};
|
|
74856
74856
|
const conditional = {};
|
|
74857
74857
|
for (const [key2, value] of Object.entries(raw2)) {
|
|
@@ -74862,7 +74862,7 @@ function applyConditions(raw2, configuration) {
|
|
|
74862
74862
|
}
|
|
74863
74863
|
const matches = [...key2.slice(bracket).matchAll(/\[([^=\]]+)=([^\]]*)\]/g)].every(
|
|
74864
74864
|
([, name3, pattern]) => {
|
|
74865
|
-
const actual = name3 === "config" ?
|
|
74865
|
+
const actual = name3 === "config" ? configuration2 : CONDITIONS[name3];
|
|
74866
74866
|
return actual !== void 0 && new RegExp(
|
|
74867
74867
|
`^${pattern.replace(/[.+^${}()|\\]/g, "\\$&").replaceAll("*", ".*").replaceAll("?", ".")}$`
|
|
74868
74868
|
).test(actual);
|
|
@@ -75150,17 +75150,17 @@ function processedInfoPlist(name3, file, settings, settingKeys) {
|
|
|
75150
75150
|
}
|
|
75151
75151
|
return info;
|
|
75152
75152
|
}
|
|
75153
|
-
function targetSettings(ref,
|
|
75153
|
+
function targetSettings(ref, configuration2, builtins, options2 = {}, overrides = {}) {
|
|
75154
75154
|
const { project: project2, target } = ref;
|
|
75155
75155
|
const xcconfigs = [];
|
|
75156
75156
|
const selected = (listId) => {
|
|
75157
75157
|
const configList = project2.object(listId);
|
|
75158
75158
|
const configs = list(configList?.buildConfigurations).map(project2.object);
|
|
75159
|
-
return configs.find((entry) => entry?.name ===
|
|
75159
|
+
return configs.find((entry) => entry?.name === configuration2) ?? configs.find((entry) => entry?.name === str2(configList?.defaultConfigurationName));
|
|
75160
75160
|
};
|
|
75161
75161
|
const level = (config) => {
|
|
75162
75162
|
if (!config) return [];
|
|
75163
|
-
const name3 = str2(config.name) ??
|
|
75163
|
+
const name3 = str2(config.name) ?? configuration2;
|
|
75164
75164
|
const base2 = str2(config.baseConfigurationReference);
|
|
75165
75165
|
const anchor = str2(config.baseConfigurationReferenceAnchor);
|
|
75166
75166
|
const relative5 = str2(config.baseConfigurationReferenceRelativePath);
|
|
@@ -75188,7 +75188,7 @@ function targetSettings(ref, configuration, builtins, options2 = {}, overrides =
|
|
|
75188
75188
|
};
|
|
75189
75189
|
const targetConfig = selected(str2(target.buildConfigurationList));
|
|
75190
75190
|
const levels = [
|
|
75191
|
-
{ ...builtins, CONFIGURATION: str2(targetConfig?.name) ??
|
|
75191
|
+
{ ...builtins, CONFIGURATION: str2(targetConfig?.name) ?? configuration2 },
|
|
75192
75192
|
...level(selected(str2(project2.project.buildConfigurationList))),
|
|
75193
75193
|
...level(targetConfig),
|
|
75194
75194
|
overrides
|
|
@@ -75992,10 +75992,10 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
75992
75992
|
return value === void 0 ? void 0 : decodeXml(value);
|
|
75993
75993
|
};
|
|
75994
75994
|
const runnable = launch ? /<BuildableProductRunnable\b[\s\S]*?<BuildableReference\b([^>]*)>/.exec(launch[2]) : null;
|
|
75995
|
-
const
|
|
75995
|
+
const configuration2 = launch ? attribute2(launch[1], "buildConfiguration") : void 0;
|
|
75996
75996
|
const blueprint = runnable ? attribute2(runnable[1], "BlueprintIdentifier") : void 0;
|
|
75997
75997
|
const referenced = runnable ? attribute2(runnable[1], "ReferencedContainer") : void 0;
|
|
75998
|
-
if (!
|
|
75998
|
+
if (!configuration2 || !blueprint || !referenced?.startsWith("container:")) {
|
|
75999
75999
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
76000
76000
|
}
|
|
76001
76001
|
const projectPath = import_node_path101.default.resolve(
|
|
@@ -76018,7 +76018,7 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
76018
76018
|
`scheme ${scheme} runs blueprint ${blueprint}, which no project here declares (declared targets: ${declared.join(", ") || "none"})`
|
|
76019
76019
|
);
|
|
76020
76020
|
}
|
|
76021
|
-
return { target: name3, configuration };
|
|
76021
|
+
return { target: name3, configuration: configuration2 };
|
|
76022
76022
|
}
|
|
76023
76023
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
76024
76024
|
const nested = import_node_path101.default.join(projectRoot, "ios");
|
|
@@ -76096,10 +76096,10 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
76096
76096
|
);
|
|
76097
76097
|
return { xcodeproj, target, workspace: project2.workspace };
|
|
76098
76098
|
}
|
|
76099
|
-
async function resolveXcodeSwiftPackages(input, signal, target,
|
|
76099
|
+
async function resolveXcodeSwiftPackages(input, signal, target, configuration2) {
|
|
76100
76100
|
if (import_node_fs98.default.existsSync(workspaceResolvedFile(import_node_fs98.default.realpathSync.native(input)))) return;
|
|
76101
76101
|
try {
|
|
76102
|
-
readXcodeAppTarget(input, target,
|
|
76102
|
+
readXcodeAppTarget(input, target, configuration2, {
|
|
76103
76103
|
installedPods: true,
|
|
76104
76104
|
requireSources: false,
|
|
76105
76105
|
deferPackageResolution: true
|
|
@@ -76147,7 +76147,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
76147
76147
|
const appConfigNames = list(appConfigs?.buildConfigurations).flatMap(
|
|
76148
76148
|
(id) => str2(app.project.object(id)?.name) ?? []
|
|
76149
76149
|
);
|
|
76150
|
-
const
|
|
76150
|
+
const configuration2 = configurationName === void 0 ? defaultConfiguration(app.project) : appConfigNames.includes(configurationName) ? configurationName : str2(appConfigs?.defaultConfigurationName) ?? configurationName;
|
|
76151
76151
|
const byProduct = /* @__PURE__ */ new Map();
|
|
76152
76152
|
for (const ref of allTargets) {
|
|
76153
76153
|
const product = ref.project.object(str2(ref.target.productReference));
|
|
@@ -76272,7 +76272,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
76272
76272
|
if (cached4 !== void 0) return cached4;
|
|
76273
76273
|
const product = targetSettings(
|
|
76274
76274
|
ref,
|
|
76275
|
-
|
|
76275
|
+
configuration2,
|
|
76276
76276
|
{ TARGET_NAME: str2(ref.target.name) ?? ref.id },
|
|
76277
76277
|
options2
|
|
76278
76278
|
).get("PRODUCT_NAME");
|
|
@@ -76350,7 +76350,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
76350
76350
|
xcconfigs: read
|
|
76351
76351
|
} = targetSettings(
|
|
76352
76352
|
ref,
|
|
76353
|
-
|
|
76353
|
+
configuration2,
|
|
76354
76354
|
{
|
|
76355
76355
|
TARGET_NAME: name3,
|
|
76356
76356
|
TARGETNAME: "$(TARGET_NAME)",
|
|
@@ -77094,9 +77094,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
77094
77094
|
continue;
|
|
77095
77095
|
const resolved = fileId ? project2.resolvePath(fileId) : null;
|
|
77096
77096
|
if (fileId && resolved !== null && !import_node_fs98.default.existsSync(resolved)) {
|
|
77097
|
-
const
|
|
77098
|
-
const pods =
|
|
77099
|
-
const sandbox =
|
|
77097
|
+
const parts2 = resolved.split(import_node_path101.default.sep);
|
|
77098
|
+
const pods = parts2.lastIndexOf("Pods");
|
|
77099
|
+
const sandbox = parts2.slice(0, pods + 1).join(import_node_path101.default.sep);
|
|
77100
77100
|
if (!options2.installedPods && options2.requireSources === false && pods > 0 && import_node_fs98.default.existsSync(import_node_path101.default.join(import_node_path101.default.dirname(sandbox), "Podfile")))
|
|
77101
77101
|
continue;
|
|
77102
77102
|
if (!ios_sdk_frameworks_default.frameworks.includes(name3))
|
|
@@ -77227,7 +77227,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
77227
77227
|
).sort(),
|
|
77228
77228
|
packageResolved,
|
|
77229
77229
|
appTargets: appTargetNames,
|
|
77230
|
-
configuration,
|
|
77230
|
+
configuration: configuration2,
|
|
77231
77231
|
settings,
|
|
77232
77232
|
cocoapods
|
|
77233
77233
|
};
|
|
@@ -77635,9 +77635,9 @@ function watchRoot(root) {
|
|
|
77635
77635
|
if (existing) return existing;
|
|
77636
77636
|
const watch3 = { edits: 0 };
|
|
77637
77637
|
const watcher = import_node_fs99.default.watch(root, { recursive: true }, (_event, filename) => {
|
|
77638
|
-
const
|
|
77638
|
+
const parts2 = filename?.split(import_node_path102.default.sep) ?? [];
|
|
77639
77639
|
const { excluded } = watch3;
|
|
77640
|
-
if (excluded &&
|
|
77640
|
+
if (excluded && parts2.some((_, index) => excluded(parts2.slice(0, index + 1).join(import_node_path102.default.sep))))
|
|
77641
77641
|
return;
|
|
77642
77642
|
if (filename && watch3.ignoredLater?.(filename)) return;
|
|
77643
77643
|
watch3.edits += 1;
|
|
@@ -79123,11 +79123,11 @@ function readSources(value) {
|
|
|
79123
79123
|
});
|
|
79124
79124
|
}
|
|
79125
79125
|
function packageRootOf(appRoot, file) {
|
|
79126
|
-
const
|
|
79127
|
-
if (
|
|
79128
|
-
const at =
|
|
79129
|
-
const end = at + (
|
|
79130
|
-
return
|
|
79126
|
+
const parts2 = file.split("/");
|
|
79127
|
+
if (parts2[0] !== "node_modules") return null;
|
|
79128
|
+
const at = parts2.lastIndexOf("node_modules") + 1;
|
|
79129
|
+
const end = at + (parts2[at]?.startsWith("@") ? 2 : 1);
|
|
79130
|
+
return parts2.length > end ? import_node_path107.default.join(appRoot, ...parts2.slice(0, end)) : null;
|
|
79131
79131
|
}
|
|
79132
79132
|
async function expoNativeInputs(appRoot) {
|
|
79133
79133
|
appRoot = import_node_fs104.default.realpathSync(appRoot);
|
|
@@ -79359,8 +79359,8 @@ var init_expo_native_prebuilt = __esm({
|
|
|
79359
79359
|
|
|
79360
79360
|
// src/native-preparation.ts
|
|
79361
79361
|
function ignoredChange(relative5) {
|
|
79362
|
-
const
|
|
79363
|
-
return relative5 === import_node_path108.default.join(".git", "index") ||
|
|
79362
|
+
const parts2 = relative5.split(import_node_path108.default.sep);
|
|
79363
|
+
return relative5 === import_node_path108.default.join(".git", "index") || parts2.includes(".cache") || parts2.includes(".expo") || /(?:^|[\\/])node_modules[\\/]expo-widgets[\\/]bundle[\\/]build(?:[\\/]|$)/.test(
|
|
79364
79364
|
relative5
|
|
79365
79365
|
);
|
|
79366
79366
|
}
|
|
@@ -81678,6 +81678,16 @@ var init_swift_wasm64_native_source = __esm({
|
|
|
81678
81678
|
derivedSha256: "3df712348b50a065f465304dc7027ffbdfe8e633ba9ed535803592c3ace7f5f5",
|
|
81679
81679
|
rewrite: deriveWamrWasm64Wasi
|
|
81680
81680
|
}
|
|
81681
|
+
],
|
|
81682
|
+
[
|
|
81683
|
+
"POPAnimationExtras.mm",
|
|
81684
|
+
{
|
|
81685
|
+
upstreamCommit: "fb0e62ba8a147f0821da6aa63c09da7d79a10111",
|
|
81686
|
+
originalSha256: "9f7f063b3f7a45ebc51d35a9dcf143dd3c3348396a476e1083061578618d917b",
|
|
81687
|
+
derivedSha256: "1be70de0cb0be9950b48e1540d57da2eed46bf054d347ea0d4a75718b487947a",
|
|
81688
|
+
before: "UIKIT_EXTERN CGFloat UIAnimationDragCoefficient();",
|
|
81689
|
+
after: "UIKIT_EXTERN float UIAnimationDragCoefficient();"
|
|
81690
|
+
}
|
|
81681
81691
|
]
|
|
81682
81692
|
]);
|
|
81683
81693
|
}
|
|
@@ -81712,13 +81722,13 @@ function walk3(dir) {
|
|
|
81712
81722
|
function placeOutputs(declaration, roots, outDir) {
|
|
81713
81723
|
const built2 = roots.flatMap(walk3);
|
|
81714
81724
|
for (const output of declaration.outputs) {
|
|
81715
|
-
const
|
|
81716
|
-
const name3 =
|
|
81725
|
+
const parts2 = output.path.split(import_node_path116.default.sep);
|
|
81726
|
+
const name3 = parts2.at(-1).toLowerCase();
|
|
81717
81727
|
const candidates = built2.filter((file) => import_node_path116.default.basename(file).toLowerCase() === name3);
|
|
81718
81728
|
const score = (file) => {
|
|
81719
81729
|
const theirs = file.split(import_node_path116.default.sep);
|
|
81720
81730
|
let shared = 1;
|
|
81721
|
-
while (shared <
|
|
81731
|
+
while (shared < parts2.length && theirs.at(-1 - shared) === parts2.at(-1 - shared))
|
|
81722
81732
|
shared++;
|
|
81723
81733
|
return shared;
|
|
81724
81734
|
};
|
|
@@ -82178,7 +82188,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
|
|
|
82178
82188
|
const compiler = (name3) => {
|
|
82179
82189
|
const file = import_node_path117.default.join(root, name3);
|
|
82180
82190
|
const script = `${file}.cjs`;
|
|
82181
|
-
const
|
|
82191
|
+
const configuration2 = {
|
|
82182
82192
|
compiler: import_node_path117.default.join(toolchainBin, name3),
|
|
82183
82193
|
frameworks: frameworkResponses,
|
|
82184
82194
|
response,
|
|
@@ -82188,7 +82198,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
|
|
|
82188
82198
|
script,
|
|
82189
82199
|
`
|
|
82190
82200
|
const { spawnSync } = require('node:child_process');
|
|
82191
|
-
const config = ${JSON.stringify(
|
|
82201
|
+
const config = ${JSON.stringify(configuration2)};
|
|
82192
82202
|
const input = process.argv.slice(2), args = [], frameworks = [];
|
|
82193
82203
|
for (let i = 0; i < input.length; i++) {
|
|
82194
82204
|
if (input[i] === '-framework' || input[i] === '-weak_framework') {
|
|
@@ -82227,7 +82237,7 @@ for arg in "$@"; do
|
|
|
82227
82237
|
-framework|-weak_framework|-Wl,-framework,*|-Wl,-weak_framework,*) exec node ${shellQuote(script)} "$@" ;;
|
|
82228
82238
|
esac
|
|
82229
82239
|
done
|
|
82230
|
-
exec ${shellQuote(
|
|
82240
|
+
exec ${shellQuote(configuration2.compiler)} "$@"
|
|
82231
82241
|
`,
|
|
82232
82242
|
{ mode: 493 }
|
|
82233
82243
|
);
|
|
@@ -85544,7 +85554,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
85544
85554
|
const { moduleRoot, release } = toolchain;
|
|
85545
85555
|
const sdk2 = swiftModuleSdk(moduleRoot);
|
|
85546
85556
|
const digest3 = sourceDir === void 0 ? STANDIN_SOURCE_DIGEST : standinSourceDigest(sourceDir);
|
|
85547
|
-
const
|
|
85557
|
+
const parts2 = [
|
|
85548
85558
|
"standin/v13",
|
|
85549
85559
|
release,
|
|
85550
85560
|
sdk2.wasmSdkId,
|
|
@@ -85566,7 +85576,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
85566
85576
|
);
|
|
85567
85577
|
const selected = Object.keys(behavior).filter((name3) => modules.has(name3)).sort();
|
|
85568
85578
|
if (selected.length > 0)
|
|
85569
|
-
|
|
85579
|
+
parts2.push(
|
|
85570
85580
|
JSON.stringify(
|
|
85571
85581
|
selected.map((name3) => [
|
|
85572
85582
|
name3,
|
|
@@ -85577,7 +85587,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
85577
85587
|
for (const binary2 of binaries) {
|
|
85578
85588
|
const swiftSources = binary2.placeholder ?? binary2.moduleSources;
|
|
85579
85589
|
if (swiftSources !== void 0) {
|
|
85580
|
-
|
|
85590
|
+
parts2.push(
|
|
85581
85591
|
binary2.target,
|
|
85582
85592
|
binary2.source,
|
|
85583
85593
|
binary2.placeholder ? `placeholder/${binary2.placeholder.gap}` : `module-sources/${binary2.moduleSources?.resources}`,
|
|
@@ -85590,13 +85600,13 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
85590
85600
|
continue;
|
|
85591
85601
|
}
|
|
85592
85602
|
if (binary2.publicHeaders !== void 0 && swiftTargetModuleName(binary2.target) !== binary2.target)
|
|
85593
|
-
|
|
85603
|
+
parts2.push(`module/${swiftTargetModuleName(binary2.target)}`);
|
|
85594
85604
|
try {
|
|
85595
85605
|
if (binary2.publicHeaders === void 0 && surfaces(swiftBinaryFramework(binary2).dir, binary2.target).some(
|
|
85596
85606
|
(surface) => surface.kind === "swift"
|
|
85597
85607
|
))
|
|
85598
|
-
|
|
85599
|
-
|
|
85608
|
+
parts2.push(`interface-emulation/${WASI_EMULATION.join(",")}`);
|
|
85609
|
+
parts2.push(
|
|
85600
85610
|
binary2.target,
|
|
85601
85611
|
binary2.source,
|
|
85602
85612
|
binary2.url ?? "",
|
|
@@ -85611,7 +85621,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
85611
85621
|
].join("\0") : swiftBinaryFramework(binary2).digest
|
|
85612
85622
|
);
|
|
85613
85623
|
} catch {
|
|
85614
|
-
|
|
85624
|
+
parts2.push(
|
|
85615
85625
|
binary2.target,
|
|
85616
85626
|
binary2.source,
|
|
85617
85627
|
binary2.url ?? "",
|
|
@@ -85620,7 +85630,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
85620
85630
|
);
|
|
85621
85631
|
}
|
|
85622
85632
|
}
|
|
85623
|
-
return (0, import_node_crypto72.createHash)("sha256").update(
|
|
85633
|
+
return (0, import_node_crypto72.createHash)("sha256").update(parts2.join("\0")).digest("hex");
|
|
85624
85634
|
}
|
|
85625
85635
|
function missingArtifactGap(binary2) {
|
|
85626
85636
|
if (swiftBinaryOnDisk(binary2)) return null;
|
|
@@ -86139,7 +86149,7 @@ var init_swift_standins = __esm({
|
|
|
86139
86149
|
init_swiftTargetContract();
|
|
86140
86150
|
TRIPLE = SWIFT_WASM_TRIPLE;
|
|
86141
86151
|
cacheDir5 = import_node_path122.default.join(cacheDir(), "swift-standins");
|
|
86142
|
-
key = (...
|
|
86152
|
+
key = (...parts2) => (0, import_node_crypto72.createHash)("sha256").update(parts2.join("\0")).digest("hex").slice(0, 32);
|
|
86143
86153
|
digests = /* @__PURE__ */ new Map();
|
|
86144
86154
|
isBinaryLibraryFile = (file) => /\.(?:a|dylib|o|tbd)$/i.test(file);
|
|
86145
86155
|
OBJC_IMPORT = /#\s*(?:import|include)\s*[<"](?:[\w+-]+\/)?([\w+.-]+\.h)[>"]/g;
|
|
@@ -86430,7 +86440,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
86430
86440
|
);
|
|
86431
86441
|
const binaryFrameworks = binarySearch2.flatMap((search) => search.frameworks);
|
|
86432
86442
|
const binaryHeaders = binarySearch2.flatMap((search) => search.headers);
|
|
86433
|
-
const
|
|
86443
|
+
const configuration2 = app.configuration === "Debug" ? "debug" : "release";
|
|
86434
86444
|
for (const binary2 of binaries) {
|
|
86435
86445
|
if (!binary2.reached || binary2.publicHeaders === void 0 || binary2.unloweredSources !== void 0)
|
|
86436
86446
|
continue;
|
|
@@ -86446,7 +86456,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
86446
86456
|
for (const dependency of binary2.headerDependencies ?? [])
|
|
86447
86457
|
yield* addHeaders(import_node_path123.default.resolve(binary2.dir, dependency.path));
|
|
86448
86458
|
const settings = target.nativeSettings.filter(
|
|
86449
|
-
(setting) => setting.configuration === null || setting.configuration ===
|
|
86459
|
+
(setting) => setting.configuration === null || setting.configuration === configuration2
|
|
86450
86460
|
);
|
|
86451
86461
|
const nativeFlags = settings.flatMap((setting) => setting.flags);
|
|
86452
86462
|
for (const [index, flag] of nativeFlags.entries()) {
|
|
@@ -86476,7 +86486,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
86476
86486
|
"-fobjc-arc",
|
|
86477
86487
|
"-fmodules",
|
|
86478
86488
|
"-DSWIFT_PACKAGE",
|
|
86479
|
-
...
|
|
86489
|
+
...configuration2 === "debug" ? ["-DDEBUG"] : [],
|
|
86480
86490
|
...settings.filter((setting) => setting.tool === "c").flatMap((setting) => setting.flags)
|
|
86481
86491
|
],
|
|
86482
86492
|
cxxFlags: settings.filter((setting) => setting.tool === "cxx").flatMap((setting) => setting.flags),
|
|
@@ -89365,16 +89375,16 @@ function providesNamespace(text7) {
|
|
|
89365
89375
|
}
|
|
89366
89376
|
}
|
|
89367
89377
|
function catalogEntryName(contentsPath, kind, readText) {
|
|
89368
|
-
const
|
|
89369
|
-
const leaf2 =
|
|
89378
|
+
const parts2 = contentsPath.split("/");
|
|
89379
|
+
const leaf2 = parts2[parts2.length - 2] ?? "";
|
|
89370
89380
|
if (!leaf2.endsWith(kind)) return null;
|
|
89371
89381
|
const short = leaf2.slice(0, -kind.length) || null;
|
|
89372
89382
|
if (short === null) return null;
|
|
89373
89383
|
const segments = [short];
|
|
89374
|
-
for (let depth =
|
|
89375
|
-
const dir =
|
|
89384
|
+
for (let depth = parts2.length - 3; depth >= 0; depth -= 1) {
|
|
89385
|
+
const dir = parts2[depth] ?? "";
|
|
89376
89386
|
if (dir.endsWith(".xcassets") || dir === "" || dir === "." || dir === "..") break;
|
|
89377
|
-
const folderContents = [...
|
|
89387
|
+
const folderContents = [...parts2.slice(0, depth + 1), "Contents.json"].join("/");
|
|
89378
89388
|
if (providesNamespace(readText(folderContents))) segments.unshift(dir);
|
|
89379
89389
|
}
|
|
89380
89390
|
return segments.join("/");
|
|
@@ -89700,11 +89710,11 @@ function enumerateBundleResources(paths, { copiedBundle = false, copyLooseRaster
|
|
|
89700
89710
|
return aDepth - bDepth || (a < b ? -1 : a > b ? 1 : 0);
|
|
89701
89711
|
});
|
|
89702
89712
|
for (const file of ordered) {
|
|
89703
|
-
const
|
|
89704
|
-
const nested =
|
|
89713
|
+
const parts2 = file.split("/");
|
|
89714
|
+
const nested = parts2.findIndex(
|
|
89705
89715
|
(part) => /\.(atlasc|lproj|bundle|storyboardc|nib|momd)$/.test(part)
|
|
89706
89716
|
);
|
|
89707
|
-
const base2 = nested < 0 ? baseOf(file) :
|
|
89717
|
+
const base2 = nested < 0 ? baseOf(file) : parts2.slice(nested).join("/");
|
|
89708
89718
|
if (seen.has(base2)) continue;
|
|
89709
89719
|
seen.add(base2);
|
|
89710
89720
|
found2.push({ base: base2, file });
|
|
@@ -91794,9 +91804,9 @@ var init_core_data_model = __esm({
|
|
|
91794
91804
|
});
|
|
91795
91805
|
}
|
|
91796
91806
|
};
|
|
91797
|
-
sha2563 = (...
|
|
91807
|
+
sha2563 = (...parts2) => (0, import_node_crypto74.createHash)("sha256").update(
|
|
91798
91808
|
Buffer.concat(
|
|
91799
|
-
|
|
91809
|
+
parts2.map(
|
|
91800
91810
|
(part) => Array.isArray(part) ? Buffer.from(part) : Buffer.from(part)
|
|
91801
91811
|
)
|
|
91802
91812
|
)
|
|
@@ -94606,13 +94616,13 @@ function eagerLinkReferences(pieces, inventory) {
|
|
|
94606
94616
|
}
|
|
94607
94617
|
return references;
|
|
94608
94618
|
}
|
|
94609
|
-
function swiftSdkDeferredDataPlan(directory2, primary,
|
|
94619
|
+
function swiftSdkDeferredDataPlan(directory2, primary, parts2) {
|
|
94610
94620
|
const pieces = readSdkPieces(directory2);
|
|
94611
94621
|
const inventory = readWasmCustomSection(primary, NATIVE_LAZY_SECTION);
|
|
94612
94622
|
if (!inventory) return Buffer.alloc(pieces.starts.length);
|
|
94613
94623
|
const eager = reachedFrom(pieces, [primary]);
|
|
94614
94624
|
closeOverData(pieces, eager, eagerLinkReferences(pieces, inventory));
|
|
94615
|
-
const reaches = Array.from(
|
|
94625
|
+
const reaches = Array.from(parts2, (part) => reachedFrom(pieces, [part]));
|
|
94616
94626
|
const owner = new Int32Array(pieces.starts.length).fill(-1);
|
|
94617
94627
|
const owned = new Float64Array(reaches.length);
|
|
94618
94628
|
for (const [part, reached] of reaches.entries())
|
|
@@ -97046,11 +97056,11 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
|
|
|
97046
97056
|
if (!primaryLazy.has(lazy)) members2.push(lazy);
|
|
97047
97057
|
lazyByGroup.set(group2, members2);
|
|
97048
97058
|
}
|
|
97049
|
-
const
|
|
97059
|
+
const parts2 = slotsByPart.flatMap((slots2, id) => {
|
|
97050
97060
|
const lazy = lazyByGroup.get(id);
|
|
97051
97061
|
return slots2.length || lazy ? [{ id, slots: slots2, lazy }] : [];
|
|
97052
97062
|
});
|
|
97053
|
-
if (!
|
|
97063
|
+
if (!parts2.length) return { primary: describePart(input), sides: [] };
|
|
97054
97064
|
const admitted = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
97055
97065
|
const requested = Number(process.env.BINARYEN_CORES);
|
|
97056
97066
|
const jobs = Math.min(
|
|
@@ -97061,7 +97071,7 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
|
|
|
97061
97071
|
);
|
|
97062
97072
|
const env = jobs > 1 ? { ...process.env, BINARYEN_CORES: "1" } : void 0;
|
|
97063
97073
|
const sides = await mapLimit(
|
|
97064
|
-
|
|
97074
|
+
parts2,
|
|
97065
97075
|
jobs,
|
|
97066
97076
|
async ({ id, slots: slots2, lazy }) => {
|
|
97067
97077
|
const part = await guard((0, import_node_path131.join)(directory2, `side-${id}.wasm`), lazy, env);
|
|
@@ -97070,7 +97080,7 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
|
|
|
97070
97080
|
return { ...part, slots: slots2, sha256: (0, import_node_crypto78.createHash)("sha256").update(bytes2).digest("hex") };
|
|
97071
97081
|
}
|
|
97072
97082
|
);
|
|
97073
|
-
const dyldGroups =
|
|
97083
|
+
const dyldGroups = parts2.flatMap(
|
|
97074
97084
|
({ lazy }, part) => lazy ? [{ first: lazy[0], part }] : []
|
|
97075
97085
|
);
|
|
97076
97086
|
return {
|
|
@@ -97659,23 +97669,23 @@ function withXcodeProject(xcodeproj, options2, run17) {
|
|
|
97659
97669
|
}
|
|
97660
97670
|
);
|
|
97661
97671
|
}
|
|
97662
|
-
async function prepareXcodeSwiftPackages(input, target,
|
|
97663
|
-
await resolveXcodeSwiftPackages(input, signal, target,
|
|
97664
|
-
const app = readXcodeAppTarget(input, target,
|
|
97672
|
+
async function prepareXcodeSwiftPackages(input, target, configuration2, signal) {
|
|
97673
|
+
await resolveXcodeSwiftPackages(input, signal, target, configuration2);
|
|
97674
|
+
const app = readXcodeAppTarget(input, target, configuration2, {
|
|
97665
97675
|
installedPods: true,
|
|
97666
97676
|
requireSources: false
|
|
97667
97677
|
});
|
|
97668
97678
|
await prefetchSwiftCheckouts(app.rootDir, app.packageResolved, signal);
|
|
97669
97679
|
}
|
|
97670
|
-
function readXcodeAppTargetPrepared(input, target,
|
|
97680
|
+
function readXcodeAppTargetPrepared(input, target, configuration2, options2) {
|
|
97671
97681
|
if (options2.prepareGeneratedSources !== true)
|
|
97672
|
-
return readXcodeAppTarget(input, target,
|
|
97682
|
+
return readXcodeAppTarget(input, target, configuration2, {
|
|
97673
97683
|
...options2,
|
|
97674
97684
|
deferPackageResolution: true
|
|
97675
97685
|
});
|
|
97676
|
-
const key2 = JSON.stringify([input, target,
|
|
97686
|
+
const key2 = JSON.stringify([input, target, configuration2, options2.nativeModules]);
|
|
97677
97687
|
if (!preparedScriptInputs.has(key2)) {
|
|
97678
|
-
const probe = readXcodeAppTarget(input, target,
|
|
97688
|
+
const probe = readXcodeAppTarget(input, target, configuration2, {
|
|
97679
97689
|
...options2,
|
|
97680
97690
|
prepareGeneratedSources: false,
|
|
97681
97691
|
requireSources: false,
|
|
@@ -97705,13 +97715,13 @@ function readXcodeAppTargetPrepared(input, target, configuration, options2) {
|
|
|
97705
97715
|
}
|
|
97706
97716
|
preparedScriptInputs.add(key2);
|
|
97707
97717
|
}
|
|
97708
|
-
return readXcodeAppTarget(input, target,
|
|
97718
|
+
return readXcodeAppTarget(input, target, configuration2, {
|
|
97709
97719
|
...options2,
|
|
97710
97720
|
deferPackageResolution: true
|
|
97711
97721
|
});
|
|
97712
97722
|
}
|
|
97713
|
-
function openXcodeProject(xcodeproj, target, moduleRoot,
|
|
97714
|
-
const app = readXcodeAppTargetPrepared(xcodeproj, target,
|
|
97723
|
+
function openXcodeProject(xcodeproj, target, moduleRoot, configuration2, interfaceRoot, nativeModules) {
|
|
97724
|
+
const app = readXcodeAppTargetPrepared(xcodeproj, target, configuration2, {
|
|
97715
97725
|
prepareGeneratedSources: true,
|
|
97716
97726
|
installedPods: true,
|
|
97717
97727
|
nativeModules
|
|
@@ -97984,11 +97994,11 @@ async function buildXcodeLayout(root) {
|
|
|
97984
97994
|
project: project2,
|
|
97985
97995
|
target,
|
|
97986
97996
|
module: module2,
|
|
97987
|
-
configuration,
|
|
97997
|
+
configuration: configuration2,
|
|
97988
97998
|
machOType,
|
|
97989
97999
|
settings
|
|
97990
98000
|
}) => {
|
|
97991
|
-
const framework = readXcodeAppTarget(project2, target,
|
|
98001
|
+
const framework = readXcodeAppTarget(project2, target, configuration2, {
|
|
97992
98002
|
prepareGeneratedSources: true,
|
|
97993
98003
|
frameworkMachOType: machOType,
|
|
97994
98004
|
frameworkBuildSettings: settings
|
|
@@ -99439,8 +99449,8 @@ function xcodeArchiveSlice(root, flag) {
|
|
|
99439
99449
|
const filename = import_node_path133.default.basename(flag);
|
|
99440
99450
|
const name3 = /^lib([A-Za-z_]\w*)\.a$/.exec(filename)?.[1];
|
|
99441
99451
|
if (!name3) return null;
|
|
99442
|
-
const
|
|
99443
|
-
const target =
|
|
99452
|
+
const parts2 = flag.split(import_node_path133.default.sep);
|
|
99453
|
+
const target = parts2.findLastIndex(
|
|
99444
99454
|
(part) => /^(?:aarch64|x86_64)-apple-ios(?:-sim)?$/.test(part)
|
|
99445
99455
|
);
|
|
99446
99456
|
if (target < 0)
|
|
@@ -99448,8 +99458,8 @@ function xcodeArchiveSlice(root, flag) {
|
|
|
99448
99458
|
name: name3,
|
|
99449
99459
|
file: packageInputPath(import_node_fs132.default.realpathSync(inputPackageRoot(root, flag)), flag)
|
|
99450
99460
|
} : null;
|
|
99451
|
-
|
|
99452
|
-
const slice =
|
|
99461
|
+
parts2[target] = RUST_TARGET;
|
|
99462
|
+
const slice = parts2.join(import_node_path133.default.sep);
|
|
99453
99463
|
return import_node_fs132.default.existsSync(slice) ? { name: name3, file: packageInputPath(root, slice) } : null;
|
|
99454
99464
|
}
|
|
99455
99465
|
function xcodeArchiveLinks(layout2, moduleRoot) {
|
|
@@ -99736,12 +99746,12 @@ function swiftBuildRoot(packagePath, moduleRoot) {
|
|
|
99736
99746
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
99737
99747
|
const compilerKey = distribution ? `${distribution.release}\0${distribution.wasmSdkChecksum}` : moduleRoot;
|
|
99738
99748
|
const resolvedPath = import_node_path133.default.resolve(packagePath);
|
|
99739
|
-
const
|
|
99749
|
+
const parts2 = resolvedPath.split(import_node_path133.default.sep);
|
|
99740
99750
|
const scopedAt = Math.max(
|
|
99741
|
-
|
|
99742
|
-
|
|
99751
|
+
parts2.lastIndexOf("peach-expo-swift"),
|
|
99752
|
+
parts2.lastIndexOf("peach-nitro-swift")
|
|
99743
99753
|
);
|
|
99744
|
-
const buildKeyPath = scopedAt >= 0 &&
|
|
99754
|
+
const buildKeyPath = scopedAt >= 0 && parts2.length >= scopedAt + 3 ? parts2.slice(0, scopedAt + 2).join(import_node_path133.default.sep) : sourceEntries().get(resolvedPath) ?? resolvedPath;
|
|
99745
99755
|
return import_node_path133.default.join(
|
|
99746
99756
|
swiftCacheDir(),
|
|
99747
99757
|
"swift-builds",
|
|
@@ -108513,11 +108523,11 @@ function expoManifest(files2, generation = "", settings = /* @__PURE__ */ new Ma
|
|
|
108513
108523
|
}
|
|
108514
108524
|
const declarations = [...targets].map(([name3, dir]) => {
|
|
108515
108525
|
const declared = settings.get(name3);
|
|
108516
|
-
const
|
|
108526
|
+
const configuration2 = dir.startsWith(`${SWIFT_STANDINS_DIR}/`) ? { languageMode: 5, mainActorIsolation: false } : declared;
|
|
108517
108527
|
const dependencies = (declared?.dependencies ?? []).flatMap(
|
|
108518
108528
|
(dependency) => dependency.kind === "target" && targets.has(dependency.name) ? [dependency.name] : []
|
|
108519
108529
|
);
|
|
108520
|
-
return `.target(name: ${JSON.stringify(name3)}, dependencies: ${JSON.stringify(dependencies)}, path: ${JSON.stringify(dir)}${declared?.resources ? ", resources: []" : ""}${
|
|
108530
|
+
return `.target(name: ${JSON.stringify(name3)}, dependencies: ${JSON.stringify(dependencies)}, path: ${JSON.stringify(dir)}${declared?.resources ? ", resources: []" : ""}${configuration2 ? ", " + swiftManifestSettings(configuration2) : ""})`;
|
|
108521
108531
|
});
|
|
108522
108532
|
const appProducts = [...targets.keys()].map((name3) => JSON.stringify(name3));
|
|
108523
108533
|
appProducts.push(
|
|
@@ -113473,6 +113483,203 @@ var init_staged_host_files = __esm({
|
|
|
113473
113483
|
}
|
|
113474
113484
|
});
|
|
113475
113485
|
|
|
113486
|
+
// ../peach-globals/build/one-swift-control-source.ts
|
|
113487
|
+
function statements(body) {
|
|
113488
|
+
const found2 = [];
|
|
113489
|
+
let at = 0;
|
|
113490
|
+
while ((at = body.indexOf("[_nativeView ", at)) !== -1) {
|
|
113491
|
+
let depth = 0;
|
|
113492
|
+
let end = at;
|
|
113493
|
+
for (; end < body.length; ++end) {
|
|
113494
|
+
if (body[end] === "[") ++depth;
|
|
113495
|
+
else if (body[end] === "]" && --depth === 0) break;
|
|
113496
|
+
}
|
|
113497
|
+
found2.push(body.slice(at + "[_nativeView ".length, end));
|
|
113498
|
+
at = end;
|
|
113499
|
+
}
|
|
113500
|
+
return found2;
|
|
113501
|
+
}
|
|
113502
|
+
function parts(statement) {
|
|
113503
|
+
const result = [];
|
|
113504
|
+
let depth = 0;
|
|
113505
|
+
let start = 0;
|
|
113506
|
+
const flush = (end) => {
|
|
113507
|
+
const text7 = statement.slice(start, end).trim();
|
|
113508
|
+
const colon = text7.indexOf(":");
|
|
113509
|
+
if (colon < 0) throw new Error("unparsed selector part: " + text7);
|
|
113510
|
+
result.push({ label: text7.slice(0, colon), expression: text7.slice(colon + 1).trim() });
|
|
113511
|
+
};
|
|
113512
|
+
for (let index = 0; index < statement.length; ++index) {
|
|
113513
|
+
const char = statement[index];
|
|
113514
|
+
if (char === "[" || char === "(") ++depth;
|
|
113515
|
+
else if (char === "]" || char === ")") --depth;
|
|
113516
|
+
else if (depth === 0 && /\s/.test(char) && /^\s*[A-Za-z]\w*:/.test(statement.slice(index)) && index > start && statement.slice(start, index).includes(":")) {
|
|
113517
|
+
flush(index);
|
|
113518
|
+
start = index;
|
|
113519
|
+
}
|
|
113520
|
+
}
|
|
113521
|
+
flush(statement.length);
|
|
113522
|
+
return result;
|
|
113523
|
+
}
|
|
113524
|
+
function eventBindings(name3, source) {
|
|
113525
|
+
const bindings = [];
|
|
113526
|
+
for (const match of source.matchAll(/_nativeView\.(\w+) = \^\(([^)]*)\) \{(.*?)\};/g)) {
|
|
113527
|
+
const [, property, parameterList, body] = match;
|
|
113528
|
+
const parameters = parameterList.split(",").map((parameter) => parameter.trim()).filter(Boolean).map((parameter) => {
|
|
113529
|
+
const typed = /^(NSString \*|BOOL|NSInteger|double|CGFloat)\s*(\w+)$/.exec(
|
|
113530
|
+
parameter.replace(/NSString \* ?/, "NSString *")
|
|
113531
|
+
);
|
|
113532
|
+
if (!typed) throw new Error(`${name3}: unparsed event parameter ${parameter}`);
|
|
113533
|
+
return { type: typed[1], name: typed[2] };
|
|
113534
|
+
});
|
|
113535
|
+
if (/update(?:MeasuredHeight)?:height\]/.test(body)) {
|
|
113536
|
+
bindings.push({
|
|
113537
|
+
property,
|
|
113538
|
+
parameters,
|
|
113539
|
+
event: "height",
|
|
113540
|
+
fields: [{ field: "height", parameter: parameters[0] }],
|
|
113541
|
+
sync: false
|
|
113542
|
+
});
|
|
113543
|
+
continue;
|
|
113544
|
+
}
|
|
113545
|
+
const call = /emitter->(\w+)\( ?\{([^}]*)\} ?\)/.exec(body);
|
|
113546
|
+
if (!call) throw new Error(`${name3}: unmapped event block ${property}`);
|
|
113547
|
+
const fields = [...call[2].matchAll(/\.(\w+) = ([^,]+)/g)].map(
|
|
113548
|
+
([, field, expression]) => {
|
|
113549
|
+
const parameter = parameters.find(
|
|
113550
|
+
({ name: name4 }) => new RegExp(`\\b${name4}\\b`).test(expression)
|
|
113551
|
+
);
|
|
113552
|
+
if (!parameter)
|
|
113553
|
+
throw new Error(`${name3}: event field ${field} reads no parameter`);
|
|
113554
|
+
return { field, parameter };
|
|
113555
|
+
}
|
|
113556
|
+
);
|
|
113557
|
+
bindings.push({
|
|
113558
|
+
property,
|
|
113559
|
+
parameters,
|
|
113560
|
+
fields,
|
|
113561
|
+
event: call[1],
|
|
113562
|
+
sync: body.includes("OneNativeSyncDidSetExternally")
|
|
113563
|
+
});
|
|
113564
|
+
}
|
|
113565
|
+
if (source.includes("OneNativeForwardSwiftStyleEvents")) {
|
|
113566
|
+
const parameters = ["name", "value"].map((name4) => ({ type: "NSString *", name: name4 }));
|
|
113567
|
+
bindings.push({
|
|
113568
|
+
property: "onSwiftStyleEvent",
|
|
113569
|
+
parameters,
|
|
113570
|
+
fields: parameters.map((parameter) => ({ field: parameter.name, parameter })),
|
|
113571
|
+
event: "onNativeSDKEvent",
|
|
113572
|
+
sync: false
|
|
113573
|
+
});
|
|
113574
|
+
}
|
|
113575
|
+
return bindings;
|
|
113576
|
+
}
|
|
113577
|
+
function configuration(name3, source) {
|
|
113578
|
+
const viewClass = /_nativeView = \[(\w+) new\]/.exec(source)?.[1];
|
|
113579
|
+
if (!viewClass) throw new Error(`${name3}: no native view class`);
|
|
113580
|
+
const guard = /^#if (ONE_GROUP_\w+)$/m.exec(source)?.[1];
|
|
113581
|
+
const update = /- \(void\)updateProps:[\s\S]*?\n\}/.exec(source)?.[0]?.replace(/\s+/g, " ");
|
|
113582
|
+
if (!update) throw new Error(`${name3}: no updateProps`);
|
|
113583
|
+
return { viewClass, guard, update };
|
|
113584
|
+
}
|
|
113585
|
+
function componentViews(one, selected) {
|
|
113586
|
+
const schema4 = JSON.parse((0, import_node_fs150.readFileSync)((0, import_node_path151.join)(one, "schema.json"), "utf8"));
|
|
113587
|
+
const folders = [(0, import_node_path151.join)(one, "ios/Generated"), (0, import_node_path151.join)(one, "ios")];
|
|
113588
|
+
const files2 = folders.map((folder) => new Set((0, import_node_fs150.readdirSync)(folder)));
|
|
113589
|
+
return schema4.components.flatMap(({ name: name3, props, commands = {} }) => {
|
|
113590
|
+
if (selected && !selected.includes(name3)) return [];
|
|
113591
|
+
const file = `${name3}ComponentView.mm`;
|
|
113592
|
+
const folder = folders.find((_, index) => files2[index].has(file));
|
|
113593
|
+
if (!folder) return [];
|
|
113594
|
+
const raw2 = (0, import_node_fs150.readFileSync)((0, import_node_path151.join)(folder, file), "utf8");
|
|
113595
|
+
const view = /\b(_\w+) = \[OneNative\w+View new\]/.exec(raw2)?.[1];
|
|
113596
|
+
if (!view) return [];
|
|
113597
|
+
const source = raw2.replace(new RegExp(`\\b${view}\\b`, "g"), "_nativeView");
|
|
113598
|
+
return [{ name: name3, props, commands, source, file: (0, import_node_path151.join)(folder, file) }];
|
|
113599
|
+
});
|
|
113600
|
+
}
|
|
113601
|
+
function swiftGuestControls(one, names) {
|
|
113602
|
+
const watched = [(0, import_node_path151.join)(one, "schema.json")];
|
|
113603
|
+
const views = componentViews(one, names);
|
|
113604
|
+
const entries2 = views.map(({ name: name3, props, source, file }) => {
|
|
113605
|
+
const { viewClass, update } = configuration(name3, source);
|
|
113606
|
+
const swift = (0, import_node_path151.join)((0, import_node_path151.dirname)(file), viewClass + ".swift");
|
|
113607
|
+
const declaration = (0, import_node_fs150.readFileSync)(swift, "utf8");
|
|
113608
|
+
watched.push(file, swift);
|
|
113609
|
+
const initializer = /public (?:override )?init\(\)/.test(declaration) ? "()" : "(frame: .zero)";
|
|
113610
|
+
const lines = [
|
|
113611
|
+
` "${name3}": { existing, spec, style, emit in`,
|
|
113612
|
+
` let view = existing as? ${viewClass} ?? ${viewClass}${initializer}`
|
|
113613
|
+
];
|
|
113614
|
+
for (const statement of statements(update)) {
|
|
113615
|
+
const selector = parts(statement);
|
|
113616
|
+
const first = selector[0].label;
|
|
113617
|
+
if (first === "configureAccessibility") {
|
|
113618
|
+
lines.push(
|
|
113619
|
+
' let access = spec["accessibility"] as? Spec ?? [:]',
|
|
113620
|
+
' view.configureAccessibility(access["label"] as? String ?? "", hint: access["hint"] as? String ?? "", value: access["value"] as? String ?? "", identifier: access["identifier"] as? String ?? spec["testID"] as? String ?? "")'
|
|
113621
|
+
);
|
|
113622
|
+
continue;
|
|
113623
|
+
}
|
|
113624
|
+
const withLabel = /^(\w+)With([A-Z])(\w*)$/.exec(first);
|
|
113625
|
+
const args = selector.map(({ label, expression }, index) => {
|
|
113626
|
+
let value;
|
|
113627
|
+
if (expression === "OneNativeStyleDictionary(next.swiftStyle)") value = "style";
|
|
113628
|
+
else {
|
|
113629
|
+
const prop = /\bnext\.(\w+)/.exec(expression)?.[1];
|
|
113630
|
+
const types2 = {
|
|
113631
|
+
string: 'String ?? ""',
|
|
113632
|
+
boolean: "Bool ?? false",
|
|
113633
|
+
Double: "Double ?? 0",
|
|
113634
|
+
Int32: "Int ?? 0"
|
|
113635
|
+
};
|
|
113636
|
+
if (!prop || !types2[props[prop]?.type])
|
|
113637
|
+
throw new Error(`${name3}: unmapped guest argument ${expression}`);
|
|
113638
|
+
value = `spec["${prop}"] as? ${types2[props[prop].type]}`;
|
|
113639
|
+
}
|
|
113640
|
+
const argLabel = index ? label : withLabel ? withLabel[2].toLowerCase() + withLabel[3] : "";
|
|
113641
|
+
return argLabel ? argLabel + ": " + value : value;
|
|
113642
|
+
});
|
|
113643
|
+
lines.push(` view.${withLabel?.[1] ?? first}(${args.join(", ")})`);
|
|
113644
|
+
}
|
|
113645
|
+
for (const { property, parameters, fields, event, sync } of eventBindings(
|
|
113646
|
+
name3,
|
|
113647
|
+
source.replace(/\s+/g, " ")
|
|
113648
|
+
)) {
|
|
113649
|
+
if (sync) throw new Error(`${name3}: guest control requires native sync state`);
|
|
113650
|
+
const payload = fields.map(({ field, parameter }) => `"${field}": ${parameter.name}`).join(", ") || ":";
|
|
113651
|
+
const signature2 = parameters.map(({ name: name4 }) => name4).join(", ");
|
|
113652
|
+
lines.push(
|
|
113653
|
+
` view.${property} = { ${signature2 ? signature2 + " in " : ""}emit("${event}", [${payload}]) }`
|
|
113654
|
+
);
|
|
113655
|
+
}
|
|
113656
|
+
lines.push(" return view", " },");
|
|
113657
|
+
return lines.join("\n");
|
|
113658
|
+
});
|
|
113659
|
+
for (const name3 of names) {
|
|
113660
|
+
if (!views.some((view) => view.name === name3))
|
|
113661
|
+
throw new Error(`no generated device component for ${name3}`);
|
|
113662
|
+
}
|
|
113663
|
+
return {
|
|
113664
|
+
source: [
|
|
113665
|
+
"import UIKit",
|
|
113666
|
+
"let guestControls: [String: (UIView?, Spec, Spec, @escaping (String, Spec) -> Void) -> UIView] = [",
|
|
113667
|
+
...entries2,
|
|
113668
|
+
"]",
|
|
113669
|
+
""
|
|
113670
|
+
].join("\n"),
|
|
113671
|
+
watched
|
|
113672
|
+
};
|
|
113673
|
+
}
|
|
113674
|
+
var import_node_fs150, import_node_path151;
|
|
113675
|
+
var init_one_swift_control_source = __esm({
|
|
113676
|
+
"../peach-globals/build/one-swift-control-source.ts"() {
|
|
113677
|
+
"use strict";
|
|
113678
|
+
import_node_fs150 = require("node:fs");
|
|
113679
|
+
import_node_path151 = require("node:path");
|
|
113680
|
+
}
|
|
113681
|
+
});
|
|
113682
|
+
|
|
113476
113683
|
// ../peach-globals/src/oneNativeControlsContract.ts
|
|
113477
113684
|
var ONE_NATIVE_CONTROLS_PACKAGE, ONE_NATIVE_CONTROLS_CONTRACT, ONE_NATIVE_CONTROLS_NAVIGATION_STACK_VIEW, ONE_NATIVE_CONTROLS_NAVIGATION_SPLIT_VIEW;
|
|
113478
113685
|
var init_oneNativeControlsContract = __esm({
|
|
@@ -113495,8 +113702,8 @@ var init_oneNativeControlsContract2 = __esm({
|
|
|
113495
113702
|
|
|
113496
113703
|
// src/one-native-controls-package.ts
|
|
113497
113704
|
function resolveOneNativeAppleIosDir(appRoot) {
|
|
113498
|
-
if (appRoot &&
|
|
113499
|
-
const appRequire = (0, import_node_module21.createRequire)(
|
|
113705
|
+
if (appRoot && import_node_fs151.default.existsSync(import_node_path152.default.join(appRoot, "package.json"))) {
|
|
113706
|
+
const appRequire = (0, import_node_module21.createRequire)(import_node_path152.default.join(appRoot, "package.json"));
|
|
113500
113707
|
let oneManifest;
|
|
113501
113708
|
try {
|
|
113502
113709
|
oneManifest = appRequire.resolve("one/package.json");
|
|
@@ -113506,33 +113713,33 @@ function resolveOneNativeAppleIosDir(appRoot) {
|
|
|
113506
113713
|
}
|
|
113507
113714
|
}
|
|
113508
113715
|
if (oneManifest) {
|
|
113509
|
-
const installed2 =
|
|
113510
|
-
if (
|
|
113511
|
-
|
|
113716
|
+
const installed2 = import_node_path152.default.join(import_node_path152.default.dirname(oneManifest), "native/apple/ios");
|
|
113717
|
+
if (import_node_fs151.default.existsSync(
|
|
113718
|
+
import_node_path152.default.join(installed2, "Generated/OneNativeNavigationStackView.swift")
|
|
113512
113719
|
))
|
|
113513
113720
|
return installed2;
|
|
113514
113721
|
}
|
|
113515
113722
|
}
|
|
113516
|
-
const workspace =
|
|
113517
|
-
|
|
113723
|
+
const workspace = import_node_path152.default.resolve(
|
|
113724
|
+
import_node_path152.default.dirname((0, import_node_url8.fileURLToPath)(__sootsim_import_meta_url)),
|
|
113518
113725
|
"../../one-v3/native/apple/ios"
|
|
113519
113726
|
);
|
|
113520
|
-
if (!
|
|
113727
|
+
if (!import_node_fs151.default.existsSync(import_node_path152.default.join(workspace, "Generated/OneNativeNavigationStackView.swift"))) {
|
|
113521
113728
|
throw new Error(`One SwiftUI native sources not found at ${workspace}`);
|
|
113522
113729
|
}
|
|
113523
113730
|
return workspace;
|
|
113524
113731
|
}
|
|
113525
113732
|
async function oneNativeControlsPackage(appRoot) {
|
|
113526
113733
|
const iosDir = resolveOneNativeAppleIosDir(appRoot);
|
|
113527
|
-
const sdkDir =
|
|
113528
|
-
const sdkFiles =
|
|
113734
|
+
const sdkDir = import_node_path152.default.join(iosDir, "SDK");
|
|
113735
|
+
const sdkFiles = import_node_fs151.default.readdirSync(sdkDir).filter((name3) => name3.endsWith(".swift")).sort().map((name3) => `SDK/${name3}`);
|
|
113529
113736
|
const files2 = /* @__PURE__ */ new Map();
|
|
113530
113737
|
const watched = [];
|
|
113531
113738
|
const digest3 = (0, import_node_crypto89.createHash)("sha256");
|
|
113532
113739
|
for (const relative5 of [...ONE_CONTROL_SOURCES, ...sdkFiles]) {
|
|
113533
|
-
const full =
|
|
113534
|
-
const content =
|
|
113535
|
-
const flatName =
|
|
113740
|
+
const full = import_node_path152.default.join(iosDir, relative5);
|
|
113741
|
+
const content = import_node_fs151.default.readFileSync(full, "utf8");
|
|
113742
|
+
const flatName = import_node_path152.default.basename(relative5);
|
|
113536
113743
|
if (files2.has(flatName)) {
|
|
113537
113744
|
throw new Error(`duplicate Swift filename ${flatName} in OneNativeControls`);
|
|
113538
113745
|
}
|
|
@@ -113540,6 +113747,15 @@ async function oneNativeControlsPackage(appRoot) {
|
|
|
113540
113747
|
watched.push(full);
|
|
113541
113748
|
digest3.update(flatName).update("\0").update(content).update("\0");
|
|
113542
113749
|
}
|
|
113750
|
+
const generated = swiftGuestControls(import_node_path152.default.dirname(iosDir), [
|
|
113751
|
+
"OneNativeButton",
|
|
113752
|
+
"OneNativeLabel",
|
|
113753
|
+
"OneNativeText",
|
|
113754
|
+
"OneNativeImage"
|
|
113755
|
+
]);
|
|
113756
|
+
files2.set("OneNativeGuestControls.swift", generated.source);
|
|
113757
|
+
watched.push(...generated.watched);
|
|
113758
|
+
digest3.update("OneNativeGuestControls.swift\0").update(generated.source).update("\0");
|
|
113543
113759
|
files2.set("OneNativeControlsBridge.swift", BRIDGE_SWIFT);
|
|
113544
113760
|
digest3.update("OneNativeControlsBridge.swift\0").update(BRIDGE_SWIFT).update("\0");
|
|
113545
113761
|
const key2 = digest3.digest("hex").slice(0, 16);
|
|
@@ -113555,28 +113771,29 @@ async function oneNativeControlsPackage(appRoot) {
|
|
|
113555
113771
|
""
|
|
113556
113772
|
].join("\n")
|
|
113557
113773
|
);
|
|
113558
|
-
const packagePath =
|
|
113774
|
+
const packagePath = import_node_path152.default.join(
|
|
113559
113775
|
swiftCacheDir(),
|
|
113560
113776
|
"one-native-controls",
|
|
113561
113777
|
key2,
|
|
113562
113778
|
ONE_NATIVE_CONTROLS_PACKAGE
|
|
113563
113779
|
);
|
|
113564
|
-
|
|
113780
|
+
import_node_fs151.default.mkdirSync(packagePath, { recursive: true });
|
|
113565
113781
|
syncSwiftTree(
|
|
113566
113782
|
packagePath,
|
|
113567
|
-
new Map([...files2].map(([file, text7]) => [
|
|
113783
|
+
new Map([...files2].map(([file, text7]) => [import_node_path152.default.join(packagePath, file), text7]))
|
|
113568
113784
|
);
|
|
113569
113785
|
return { packagePath, watched };
|
|
113570
113786
|
}
|
|
113571
|
-
var import_node_crypto89,
|
|
113787
|
+
var import_node_crypto89, import_node_fs151, import_node_module21, import_node_path152, import_node_url8, ONE_CONTROL_SOURCES, ONE_SDK_DEFINES, BRIDGE_SWIFT;
|
|
113572
113788
|
var init_one_native_controls_package = __esm({
|
|
113573
113789
|
"src/one-native-controls-package.ts"() {
|
|
113574
113790
|
"use strict";
|
|
113575
113791
|
import_node_crypto89 = require("node:crypto");
|
|
113576
|
-
|
|
113792
|
+
import_node_fs151 = __toESM(require("node:fs"), 1);
|
|
113577
113793
|
import_node_module21 = require("node:module");
|
|
113578
|
-
|
|
113794
|
+
import_node_path152 = __toESM(require("node:path"), 1);
|
|
113579
113795
|
import_node_url8 = require("node:url");
|
|
113796
|
+
init_one_swift_control_source();
|
|
113580
113797
|
init_oneNativeControlsContract2();
|
|
113581
113798
|
init_swift_compile();
|
|
113582
113799
|
init_swift_host();
|
|
@@ -113585,6 +113802,7 @@ var init_one_native_controls_package = __esm({
|
|
|
113585
113802
|
ONE_CONTROL_SOURCES = [
|
|
113586
113803
|
"Generated/OneNativeNavigationSplitViewView.swift",
|
|
113587
113804
|
"Generated/OneNativeNavigationStackView.swift",
|
|
113805
|
+
"Generated/OneNativeViewSlots.swift",
|
|
113588
113806
|
"Generated/OneNativeToolbarView.swift",
|
|
113589
113807
|
"Generated/OneNativeListView.swift",
|
|
113590
113808
|
"Generated/OneNativeSectionView.swift",
|
|
@@ -113615,7 +113833,7 @@ var init_one_native_controls_package = __esm({
|
|
|
113615
113833
|
@_spi(Peach) import UIKit
|
|
113616
113834
|
import PeachJSON
|
|
113617
113835
|
|
|
113618
|
-
|
|
113836
|
+
typealias Spec = [String: Any]
|
|
113619
113837
|
|
|
113620
113838
|
private func platformColor(named name: String) -> UIColor? {
|
|
113621
113839
|
switch name {
|
|
@@ -113757,11 +113975,6 @@ private class ControlComposition {
|
|
|
113757
113975
|
let spec = node["spec"] as! Spec
|
|
113758
113976
|
let control = spec["control"] as! String
|
|
113759
113977
|
let style = normalizeStyle(spec["swiftStyle"] as? Spec)
|
|
113760
|
-
let access = spec["accessibility"] as? Spec ?? [:]
|
|
113761
|
-
let label = access["label"] as? String ?? ""
|
|
113762
|
-
let hint = access["hint"] as? String ?? ""
|
|
113763
|
-
let value = access["value"] as? String ?? ""
|
|
113764
|
-
let identifier = access["identifier"] as? String ?? spec["testID"] as? String ?? ""
|
|
113765
113978
|
let visit: (String, String) -> Void = { [weak self] name, value in
|
|
113766
113979
|
self?.send(id, "onNativeSDKEvent", ["name": name, "value": value])
|
|
113767
113980
|
}
|
|
@@ -113789,42 +114002,6 @@ private class ControlComposition {
|
|
|
113789
114002
|
marker.configureStyle(style)
|
|
113790
114003
|
marker.setOnSDKEvent(visit)
|
|
113791
114004
|
view = marker
|
|
113792
|
-
case "OneNativeButton":
|
|
113793
|
-
let button = views[id] as? OneNativeButtonView ?? OneNativeButtonView()
|
|
113794
|
-
button.configure(buttonRole: spec["buttonRole"] as? String ?? "")
|
|
113795
|
-
button.configureAccessibility(label, hint: hint, value: value, identifier: identifier)
|
|
113796
|
-
button.onAction = { [weak self] count in
|
|
113797
|
-
self?.send(id, "onNativeButtonPress", ["eventCount": count])
|
|
113798
|
-
}
|
|
113799
|
-
view = button
|
|
113800
|
-
case "OneNativeLabel":
|
|
113801
|
-
let labelView = views[id] as? OneNativeLabelView ?? OneNativeLabelView(frame: .zero)
|
|
113802
|
-
labelView.configure(spec["label"] as? String ?? "", systemImage: spec["systemImage"] as? String ?? "")
|
|
113803
|
-
labelView.configureAccessibility(label, hint: hint, value: value, identifier: identifier)
|
|
113804
|
-
labelView.configureStyle(style)
|
|
113805
|
-
labelView.onSDKEvent = visit
|
|
113806
|
-
view = labelView
|
|
113807
|
-
case "OneNativeText":
|
|
113808
|
-
let text = views[id] as? OneNativeTextView ?? OneNativeTextView(frame: .zero)
|
|
113809
|
-
text.configure(spec["text"] as? String ?? "")
|
|
113810
|
-
text.configureAccessibility(label, hint: hint, value: value, identifier: identifier)
|
|
113811
|
-
text.configureStyle(style)
|
|
113812
|
-
text.onSDKEvent = visit
|
|
113813
|
-
view = text
|
|
113814
|
-
case "OneNativeImage":
|
|
113815
|
-
let image = views[id] as? OneNativeImageView ?? OneNativeImageView(frame: .zero)
|
|
113816
|
-
image.configureAccessibility(label, hint: hint, value: value, identifier: identifier)
|
|
113817
|
-
image.configureStyle(style)
|
|
113818
|
-
image.configure(
|
|
113819
|
-
spec["systemName"] as? String ?? "",
|
|
113820
|
-
uri: spec["uri"] as? String ?? "",
|
|
113821
|
-
renderingMode: spec["renderingMode"] as? String ?? "original",
|
|
113822
|
-
variableValue: spec["variableValue"] as? Double ?? 0,
|
|
113823
|
-
hasVariableValue: spec["hasVariableValue"] as? Bool ?? false,
|
|
113824
|
-
resizable: spec["resizable"] as? Bool ?? false
|
|
113825
|
-
)
|
|
113826
|
-
image.onSDKEvent = visit
|
|
113827
|
-
view = image
|
|
113828
114005
|
case "OneNativeContainerSlot":
|
|
113829
114006
|
let slot = views[id] as? OneNativeContainerSlotView ?? OneNativeContainerSlotView(frame: .zero)
|
|
113830
114007
|
let host = slots[id] ?? UIView(frame: .zero)
|
|
@@ -113836,7 +114013,8 @@ private class ControlComposition {
|
|
|
113836
114013
|
slot.onSwiftStyleEvent = visit
|
|
113837
114014
|
view = slot
|
|
113838
114015
|
default:
|
|
113839
|
-
preconditionFailure("unsupported One toolbar child \\(control)")
|
|
114016
|
+
guard let mount = guestControls[control] else { preconditionFailure("unsupported One toolbar child \\(control)") }
|
|
114017
|
+
view = mount(views[id], spec, style) { [weak self] event, fields in self?.send(id, event, fields) }
|
|
113840
114018
|
}
|
|
113841
114019
|
views[id] = view
|
|
113842
114020
|
if let container = view as? OneNativeContainerView {
|
|
@@ -113864,13 +114042,79 @@ private class ControlComposition {
|
|
|
113864
114042
|
}
|
|
113865
114043
|
}
|
|
113866
114044
|
|
|
114045
|
+
private struct NavigationDestinationSlot: Identifiable, Equatable {
|
|
114046
|
+
let id: String
|
|
114047
|
+
let contentHost: String
|
|
114048
|
+
let slotValues: String
|
|
114049
|
+
let title: String
|
|
114050
|
+
let titleMode: String
|
|
114051
|
+
let barHidden: Bool
|
|
114052
|
+
}
|
|
114053
|
+
|
|
114054
|
+
private final class NavigationDestinationSlots: ObservableObject {
|
|
114055
|
+
@Published var slots: [NavigationDestinationSlot] = []
|
|
114056
|
+
var hosts: [String: UIView] = [:]
|
|
114057
|
+
var onSDKEvent: ((String, String, String) -> Void)?
|
|
114058
|
+
}
|
|
114059
|
+
|
|
114060
|
+
private struct NavigationDestinationModifiers: View {
|
|
114061
|
+
@ObservedObject var model: NavigationDestinationSlots
|
|
114062
|
+
|
|
114063
|
+
var body: some View {
|
|
114064
|
+
ForEach(model.slots) { slot in
|
|
114065
|
+
Color.clear.frame(width: 0, height: 0)
|
|
114066
|
+
.oneNativeViewSlot(OneNativeViewSlotName.navigationDestination, values: slot.slotValues, emit: { name, value in
|
|
114067
|
+
model.onSDKEvent?(slot.id, name, value)
|
|
114068
|
+
}) {
|
|
114069
|
+
let content = OneNativeSlot(content: model.hosts[slot.id]!, mode: .fill)
|
|
114070
|
+
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
114071
|
+
.ignoresSafeArea([.container, .keyboard], edges: .bottom)
|
|
114072
|
+
.navigationTitle(slot.title)
|
|
114073
|
+
.navigationBarTitleDisplayMode(slot.titleMode == "inline" ? .inline : slot.titleMode == "large" ? .large : .automatic)
|
|
114074
|
+
return AnyView(content.toolbarVisibility(slot.barHidden ? .hidden : .automatic, for: .navigationBar))
|
|
114075
|
+
}
|
|
114076
|
+
}
|
|
114077
|
+
}
|
|
114078
|
+
}
|
|
114079
|
+
|
|
113867
114080
|
private struct NavigationStackBridge: UIViewRepresentable {
|
|
113868
114081
|
let spec: Spec
|
|
113869
114082
|
let emit: (String, String) -> Void
|
|
113870
114083
|
|
|
113871
114084
|
final class Coordinator: ControlComposition {
|
|
113872
114085
|
let slot = UIView(frame: .zero)
|
|
114086
|
+
let destinations = NavigationDestinationSlots()
|
|
114087
|
+
var destinationController: UIHostingController<NavigationDestinationModifiers>?
|
|
113873
114088
|
var toolbars: [OneNativeToolbarView] = []
|
|
114089
|
+
|
|
114090
|
+
func updateDestinations(_ specs: [Spec]) {
|
|
114091
|
+
let next = specs.map { spec in
|
|
114092
|
+
NavigationDestinationSlot(
|
|
114093
|
+
id: spec["id"] as! String,
|
|
114094
|
+
contentHost: spec["contentHost"] as! String,
|
|
114095
|
+
slotValues: spec["slotValues"] as! String,
|
|
114096
|
+
title: spec["title"] as? String ?? "",
|
|
114097
|
+
titleMode: spec["titleMode"] as? String ?? "automatic",
|
|
114098
|
+
barHidden: spec["barHidden"] as? Bool ?? false
|
|
114099
|
+
)
|
|
114100
|
+
}
|
|
114101
|
+
guard destinations.slots != next else { return }
|
|
114102
|
+
destinations.hosts = Dictionary(uniqueKeysWithValues: next.map { item in
|
|
114103
|
+
let host = destinations.hosts[item.id] ?? UIView(frame: .zero)
|
|
114104
|
+
host._peachReactContentHost = item.contentHost
|
|
114105
|
+
return (item.id, host)
|
|
114106
|
+
})
|
|
114107
|
+
destinations.slots = next
|
|
114108
|
+
if destinationController == nil {
|
|
114109
|
+
let controller = UIHostingController(rootView: NavigationDestinationModifiers(model: destinations))
|
|
114110
|
+
controller.view.frame = .zero
|
|
114111
|
+
controller.view.isUserInteractionEnabled = false
|
|
114112
|
+
controller.view.backgroundColor = .clear
|
|
114113
|
+
slot.addSubview(controller.view)
|
|
114114
|
+
destinationController = controller
|
|
114115
|
+
}
|
|
114116
|
+
destinationController?.view.setNeedsDisplay()
|
|
114117
|
+
}
|
|
113874
114118
|
}
|
|
113875
114119
|
|
|
113876
114120
|
func makeCoordinator() -> Coordinator { Coordinator() }
|
|
@@ -113891,6 +114135,10 @@ private struct NavigationStackBridge: UIViewRepresentable {
|
|
|
113891
114135
|
let id = root["id"] as! String
|
|
113892
114136
|
let rootSpec = root["spec"] as! Spec
|
|
113893
114137
|
state.slot._peachReactContentHost = spec["contentHost"] as? String
|
|
114138
|
+
state.destinations.onSDKEvent = { [weak state] id, name, value in
|
|
114139
|
+
state?.send(id, "onNativeSDKEvent", ["name": name, "value": value])
|
|
114140
|
+
}
|
|
114141
|
+
state.updateDestinations(spec["destinationSlots"] as? [Spec] ?? [])
|
|
113894
114142
|
stack.onSDKEvent = { [weak state] name, value in
|
|
113895
114143
|
state?.send(id, "onNativeSDKEvent", ["name": name, "value": value])
|
|
113896
114144
|
}
|
|
@@ -113911,6 +114159,8 @@ private struct NavigationStackBridge: UIViewRepresentable {
|
|
|
113911
114159
|
|
|
113912
114160
|
static func dismantleUIView(_ view: OneNativeNavigationStackView, coordinator: Coordinator) {
|
|
113913
114161
|
view.unmountContent(coordinator.slot)
|
|
114162
|
+
coordinator.destinationController?.view.removeFromSuperview()
|
|
114163
|
+
coordinator.destinationController = nil
|
|
113914
114164
|
for toolbar in coordinator.toolbars { view.unmountToolbar(toolbar) }
|
|
113915
114165
|
coordinator.prune(keeping: [])
|
|
113916
114166
|
coordinator.toolbars.removeAll()
|
|
@@ -114161,13 +114411,13 @@ struct OneNativeControlsGuest: PeachPackage {
|
|
|
114161
114411
|
// src/one-native-app-config.ts
|
|
114162
114412
|
function oneConfigPath(root) {
|
|
114163
114413
|
for (const name3 of CONFIG_FILES) {
|
|
114164
|
-
const file =
|
|
114165
|
-
if (
|
|
114414
|
+
const file = import_node_path153.default.join(root, name3);
|
|
114415
|
+
if (import_node_fs152.default.existsSync(file)) return file;
|
|
114166
114416
|
}
|
|
114167
114417
|
return null;
|
|
114168
114418
|
}
|
|
114169
114419
|
function readModule2(file) {
|
|
114170
|
-
const { code } = (0, import_sucrase4.transform)(
|
|
114420
|
+
const { code } = (0, import_sucrase4.transform)(import_node_fs152.default.readFileSync(file, "utf8"), {
|
|
114171
114421
|
transforms: /\.[cm]?tsx?$/.test(file) ? ["typescript"] : [],
|
|
114172
114422
|
disableESTransforms: true
|
|
114173
114423
|
});
|
|
@@ -114190,9 +114440,9 @@ function resolveName(module2, name3, seen) {
|
|
|
114190
114440
|
if (!source.startsWith(".")) continue;
|
|
114191
114441
|
for (const specifier of statement.specifiers) {
|
|
114192
114442
|
if (specifier.type !== "ImportSpecifier" || specifier.local.name !== name3) continue;
|
|
114193
|
-
const base2 =
|
|
114443
|
+
const base2 = import_node_path153.default.resolve(import_node_path153.default.dirname(module2.file), source);
|
|
114194
114444
|
const target = MODULE_EXTENSIONS.map((ext) => base2 + ext).find(
|
|
114195
|
-
(file) =>
|
|
114445
|
+
(file) => import_node_fs152.default.existsSync(file) && import_node_fs152.default.statSync(file).isFile()
|
|
114196
114446
|
);
|
|
114197
114447
|
if (!target) return NOT_STATIC;
|
|
114198
114448
|
const imported = specifier.imported.type === "Identifier" ? specifier.imported.name : String(specifier.imported.value);
|
|
@@ -114263,12 +114513,12 @@ function readOneNativeApp(root) {
|
|
|
114263
114513
|
});
|
|
114264
114514
|
return app;
|
|
114265
114515
|
}
|
|
114266
|
-
var
|
|
114516
|
+
var import_node_fs152, import_node_path153, import_acorn3, import_sucrase4, CONFIG_FILES, MODULE_EXTENSIONS, NOT_STATIC;
|
|
114267
114517
|
var init_one_native_app_config = __esm({
|
|
114268
114518
|
"src/one-native-app-config.ts"() {
|
|
114269
114519
|
"use strict";
|
|
114270
|
-
|
|
114271
|
-
|
|
114520
|
+
import_node_fs152 = __toESM(require("node:fs"), 1);
|
|
114521
|
+
import_node_path153 = __toESM(require("node:path"), 1);
|
|
114272
114522
|
import_acorn3 = require("peachsim/vendor/acorn");
|
|
114273
114523
|
import_sucrase4 = require("peachsim/vendor/sucrase");
|
|
114274
114524
|
init_estree_walk();
|
|
@@ -114321,7 +114571,7 @@ function readConfig(root) {
|
|
|
114321
114571
|
return {
|
|
114322
114572
|
widget,
|
|
114323
114573
|
urlSchemes,
|
|
114324
|
-
watched: [
|
|
114574
|
+
watched: [import_node_path154.default.join(root, "package.json"), ...configPath ? [configPath] : []]
|
|
114325
114575
|
};
|
|
114326
114576
|
}
|
|
114327
114577
|
function declaredFamilies(source) {
|
|
@@ -114335,13 +114585,13 @@ function declaredFamilies(source) {
|
|
|
114335
114585
|
return home;
|
|
114336
114586
|
}
|
|
114337
114587
|
async function readOneWidgetSources(appRoot) {
|
|
114338
|
-
const root =
|
|
114588
|
+
const root = import_node_fs153.default.realpathSync(appRoot);
|
|
114339
114589
|
const config = readConfig(root);
|
|
114340
114590
|
if (!config.widget) return null;
|
|
114341
114591
|
const widget = config.widget;
|
|
114342
114592
|
const sourceFiles2 = {
|
|
114343
|
-
"OneWidget.swift":
|
|
114344
|
-
"OneWidgetContract.swift":
|
|
114593
|
+
"OneWidget.swift": import_node_path154.default.join(root, "ios/OneWidgets/OneWidget.swift"),
|
|
114594
|
+
"OneWidgetContract.swift": import_node_path154.default.join(
|
|
114345
114595
|
root,
|
|
114346
114596
|
"ios",
|
|
114347
114597
|
widget.appName,
|
|
@@ -114351,14 +114601,14 @@ async function readOneWidgetSources(appRoot) {
|
|
|
114351
114601
|
const files2 = /* @__PURE__ */ new Map();
|
|
114352
114602
|
const sources = {};
|
|
114353
114603
|
for (const [name3, file] of Object.entries(sourceFiles2)) {
|
|
114354
|
-
if (!
|
|
114604
|
+
if (!import_node_fs153.default.existsSync(file))
|
|
114355
114605
|
throw new Error(`missing One widget prebuild source ${file}; run one prebuild`);
|
|
114356
114606
|
const bytes = readPackageFile(root, file, MAX_SWIFT_COMPILE_SOURCE_BYTES);
|
|
114357
114607
|
const text7 = bytes.toString("utf8");
|
|
114358
114608
|
if (!Buffer.from(text7).equals(bytes))
|
|
114359
114609
|
throw new Error(`One widget prebuild source is not UTF-8: ${file}`);
|
|
114360
114610
|
files2.set(name3, text7);
|
|
114361
|
-
sources[
|
|
114611
|
+
sources[import_node_path154.default.relative(root, file).split(import_node_path154.default.sep).join("/")] = (0, import_node_crypto90.createHash)("sha256").update(bytes).digest("hex");
|
|
114362
114612
|
}
|
|
114363
114613
|
const contract = files2.get("OneWidgetContract.swift") ?? "";
|
|
114364
114614
|
const source = files2.get("OneWidget.swift") ?? "";
|
|
@@ -114388,13 +114638,13 @@ async function configuredOneWidget(appRoot, bundleUrl, packageUrl) {
|
|
|
114388
114638
|
urlSchemes: source.urlSchemes
|
|
114389
114639
|
};
|
|
114390
114640
|
}
|
|
114391
|
-
var import_node_crypto90,
|
|
114641
|
+
var import_node_crypto90, import_node_fs153, import_node_path154, ONE_WIDGET_PACKAGE, nonEmpty;
|
|
114392
114642
|
var init_one_widget_metadata = __esm({
|
|
114393
114643
|
"src/one-widget-metadata.ts"() {
|
|
114394
114644
|
"use strict";
|
|
114395
114645
|
import_node_crypto90 = require("node:crypto");
|
|
114396
|
-
|
|
114397
|
-
|
|
114646
|
+
import_node_fs153 = __toESM(require("node:fs"), 1);
|
|
114647
|
+
import_node_path154 = __toESM(require("node:path"), 1);
|
|
114398
114648
|
init_is_record();
|
|
114399
114649
|
init_one_native_app_config();
|
|
114400
114650
|
init_oneWidgetContract();
|
|
@@ -114423,16 +114673,16 @@ async function oneWidgetPackage(appRoot) {
|
|
|
114423
114673
|
""
|
|
114424
114674
|
].join("\n")
|
|
114425
114675
|
);
|
|
114426
|
-
const packagePath =
|
|
114676
|
+
const packagePath = import_node_path155.default.join(
|
|
114427
114677
|
import_node_os32.default.tmpdir(),
|
|
114428
114678
|
"peach-one-widgets",
|
|
114429
114679
|
(0, import_node_crypto91.createHash)("sha256").update(root).digest("hex"),
|
|
114430
114680
|
ONE_WIDGET_PACKAGE
|
|
114431
114681
|
);
|
|
114432
|
-
|
|
114682
|
+
import_node_fs154.default.mkdirSync(packagePath, { recursive: true });
|
|
114433
114683
|
syncSwiftTree(
|
|
114434
114684
|
packagePath,
|
|
114435
|
-
new Map([...files2].map(([file, text7]) => [
|
|
114685
|
+
new Map([...files2].map(([file, text7]) => [import_node_path155.default.join(packagePath, file), text7]))
|
|
114436
114686
|
);
|
|
114437
114687
|
return {
|
|
114438
114688
|
packagePath,
|
|
@@ -114440,14 +114690,14 @@ async function oneWidgetPackage(appRoot) {
|
|
|
114440
114690
|
widget
|
|
114441
114691
|
};
|
|
114442
114692
|
}
|
|
114443
|
-
var import_node_crypto91,
|
|
114693
|
+
var import_node_crypto91, import_node_fs154, import_node_os32, import_node_path155;
|
|
114444
114694
|
var init_one_widget_package = __esm({
|
|
114445
114695
|
"src/one-widget-package.ts"() {
|
|
114446
114696
|
"use strict";
|
|
114447
114697
|
import_node_crypto91 = require("node:crypto");
|
|
114448
|
-
|
|
114698
|
+
import_node_fs154 = __toESM(require("node:fs"), 1);
|
|
114449
114699
|
import_node_os32 = __toESM(require("node:os"), 1);
|
|
114450
|
-
|
|
114700
|
+
import_node_path155 = __toESM(require("node:path"), 1);
|
|
114451
114701
|
init_one_widget_metadata();
|
|
114452
114702
|
init_swift_compile();
|
|
114453
114703
|
init_one_widget_metadata();
|
|
@@ -114499,27 +114749,27 @@ function readBridgeFiles(output) {
|
|
|
114499
114749
|
});
|
|
114500
114750
|
}
|
|
114501
114751
|
function androidAppSources(appRoot) {
|
|
114502
|
-
const moduleDir =
|
|
114503
|
-
const gradle = ["build.gradle", "build.gradle.kts"].map((name3) =>
|
|
114752
|
+
const moduleDir = import_node_path156.default.join(appRoot, "android", "app");
|
|
114753
|
+
const gradle = ["build.gradle", "build.gradle.kts"].map((name3) => import_node_path156.default.join(moduleDir, name3)).find((file) => import_node_fs155.default.existsSync(file));
|
|
114504
114754
|
if (!gradle) return null;
|
|
114505
114755
|
const id = /\bapplicationId\s*=?\s*["']([^"']+)["']/.exec(
|
|
114506
|
-
|
|
114756
|
+
import_node_fs155.default.readFileSync(gradle, "utf8")
|
|
114507
114757
|
);
|
|
114508
114758
|
if (!id) throw new Error(`${gradle}: no applicationId`);
|
|
114509
114759
|
const kotlin = [];
|
|
114510
114760
|
const java = [];
|
|
114511
114761
|
const walk4 = (dir) => {
|
|
114512
|
-
if (!
|
|
114513
|
-
for (const child of
|
|
114514
|
-
const file =
|
|
114762
|
+
if (!import_node_fs155.default.existsSync(dir)) return;
|
|
114763
|
+
for (const child of import_node_fs155.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
114764
|
+
const file = import_node_path156.default.join(dir, child.name);
|
|
114515
114765
|
if (child.isSymbolicLink()) throw new Error(`Android source is a symlink: ${file}`);
|
|
114516
114766
|
if (child.isDirectory()) walk4(file);
|
|
114517
114767
|
else if (child.name.endsWith(".kt")) kotlin.push(file);
|
|
114518
114768
|
else if (child.name.endsWith(".java")) java.push(file);
|
|
114519
114769
|
}
|
|
114520
114770
|
};
|
|
114521
|
-
walk4(
|
|
114522
|
-
walk4(
|
|
114771
|
+
walk4(import_node_path156.default.join(moduleDir, "src", "main", "java"));
|
|
114772
|
+
walk4(import_node_path156.default.join(moduleDir, "src", "main", "kotlin"));
|
|
114523
114773
|
return { applicationId: id[1], kotlin, java };
|
|
114524
114774
|
}
|
|
114525
114775
|
function declares(source, owner, name3) {
|
|
@@ -114528,7 +114778,7 @@ function declares(source, owner, name3) {
|
|
|
114528
114778
|
}
|
|
114529
114779
|
function selectBridgePackages(applicationId, files2, javaFiles) {
|
|
114530
114780
|
const texts = new Map(
|
|
114531
|
-
files2.map((file) => [file.file,
|
|
114781
|
+
files2.map((file) => [file.file, import_node_fs155.default.readFileSync(file.file, "utf8")])
|
|
114532
114782
|
);
|
|
114533
114783
|
const owners = /* @__PURE__ */ new Map();
|
|
114534
114784
|
for (const file of files2)
|
|
@@ -114536,8 +114786,8 @@ function selectBridgePackages(applicationId, files2, javaFiles) {
|
|
|
114536
114786
|
owners.set(name3, [...owners.get(name3) ?? [], file]);
|
|
114537
114787
|
const javaDeclarations = javaFiles.map((file) => ({
|
|
114538
114788
|
file,
|
|
114539
|
-
package: /^\s*package\s+([\w.]+)\s*;/m.exec(
|
|
114540
|
-
name:
|
|
114789
|
+
package: /^\s*package\s+([\w.]+)\s*;/m.exec(import_node_fs155.default.readFileSync(file, "utf8"))?.[1] ?? "",
|
|
114790
|
+
name: import_node_path156.default.basename(file, ".java")
|
|
114541
114791
|
}));
|
|
114542
114792
|
const closure = (root) => {
|
|
114543
114793
|
const seen = /* @__PURE__ */ new Set([root]);
|
|
@@ -114610,12 +114860,12 @@ function moduleName(text7, className2) {
|
|
|
114610
114860
|
);
|
|
114611
114861
|
return match ? match[1] : null;
|
|
114612
114862
|
}
|
|
114613
|
-
var
|
|
114863
|
+
var import_node_fs155, import_node_path156, qualified2;
|
|
114614
114864
|
var init_android_bridge_packages = __esm({
|
|
114615
114865
|
"src/android-bridge-packages.ts"() {
|
|
114616
114866
|
"use strict";
|
|
114617
|
-
|
|
114618
|
-
|
|
114867
|
+
import_node_fs155 = __toESM(require("node:fs"), 1);
|
|
114868
|
+
import_node_path156 = __toESM(require("node:path"), 1);
|
|
114619
114869
|
init_is_record();
|
|
114620
114870
|
qualified2 = (file, name3) => file.package ? `${file.package}.${name3}` : name3;
|
|
114621
114871
|
}
|
|
@@ -114661,17 +114911,17 @@ var init_android_view_classes = __esm({
|
|
|
114661
114911
|
// src/java-module-abi.ts
|
|
114662
114912
|
async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
|
|
114663
114913
|
const digest3 = (0, import_node_crypto92.createHash)("sha256");
|
|
114664
|
-
const parent =
|
|
114665
|
-
|
|
114666
|
-
const work =
|
|
114914
|
+
const parent = import_node_path157.default.join(kotlinHome(), "java-specs");
|
|
114915
|
+
import_node_fs156.default.mkdirSync(parent, { recursive: true });
|
|
114916
|
+
const work = import_node_fs156.default.mkdtempSync(import_node_path157.default.join(parent, ".read-"));
|
|
114667
114917
|
try {
|
|
114668
114918
|
const origins = /* @__PURE__ */ new Map();
|
|
114669
114919
|
for (const [index, file] of files2.entries()) {
|
|
114670
|
-
const bytes =
|
|
114920
|
+
const bytes = import_node_fs156.default.readFileSync(file);
|
|
114671
114921
|
digest3.update(file).update("\0").update(bytes).update("\0");
|
|
114672
|
-
const target =
|
|
114673
|
-
|
|
114674
|
-
|
|
114922
|
+
const target = import_node_path157.default.join(work, String(index), import_node_path157.default.basename(file));
|
|
114923
|
+
import_node_fs156.default.mkdirSync(import_node_path157.default.dirname(target));
|
|
114924
|
+
import_node_fs156.default.writeFileSync(target, bytes);
|
|
114675
114925
|
origins.set(target, file);
|
|
114676
114926
|
}
|
|
114677
114927
|
const stdout = await runKotlinTool(
|
|
@@ -114704,20 +114954,20 @@ ${diagnostic.trim()}`, { cause });
|
|
|
114704
114954
|
});
|
|
114705
114955
|
return { sha256: digest3.digest("hex"), specs };
|
|
114706
114956
|
} finally {
|
|
114707
|
-
|
|
114957
|
+
import_node_fs156.default.rmSync(work, { recursive: true, force: true });
|
|
114708
114958
|
}
|
|
114709
114959
|
}
|
|
114710
114960
|
async function compileJavaModuleAbi(input) {
|
|
114711
114961
|
const { specs, work, hash, toolchain, libraries, sdkRoot, sdkLibrary, language } = input;
|
|
114712
|
-
const directory2 =
|
|
114713
|
-
|
|
114962
|
+
const directory2 = import_node_path157.default.join(work, "java-abi");
|
|
114963
|
+
import_node_fs156.default.mkdirSync(directory2);
|
|
114714
114964
|
const sources = specs.specs.map((spec, index) => {
|
|
114715
|
-
const target =
|
|
114716
|
-
|
|
114965
|
+
const target = import_node_path157.default.join(directory2, `Spec${index}.kt`);
|
|
114966
|
+
import_node_fs156.default.writeFileSync(target, spec.source);
|
|
114717
114967
|
return target;
|
|
114718
114968
|
});
|
|
114719
|
-
const initializer =
|
|
114720
|
-
|
|
114969
|
+
const initializer = import_node_path157.default.join(directory2, "Bindings.kt");
|
|
114970
|
+
import_node_fs156.default.writeFileSync(
|
|
114721
114971
|
initializer,
|
|
114722
114972
|
[
|
|
114723
114973
|
"package dev.peach.jni",
|
|
@@ -114731,8 +114981,8 @@ async function compileJavaModuleAbi(input) {
|
|
|
114731
114981
|
"-J-Xmx2g",
|
|
114732
114982
|
"-Xwasm-target=js",
|
|
114733
114983
|
"-libraries",
|
|
114734
|
-
libraries.join(
|
|
114735
|
-
`-Xplugin=${
|
|
114984
|
+
libraries.join(import_node_path157.default.delimiter),
|
|
114985
|
+
`-Xplugin=${import_node_path157.default.join(sdkRoot, "plugin.jar")}`,
|
|
114736
114986
|
`-Xfriend-modules=${sdkLibrary}`,
|
|
114737
114987
|
"-language-version",
|
|
114738
114988
|
language,
|
|
@@ -114748,23 +114998,23 @@ async function compileJavaModuleAbi(input) {
|
|
|
114748
114998
|
],
|
|
114749
114999
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
114750
115000
|
);
|
|
114751
|
-
const library =
|
|
115001
|
+
const library = import_node_path157.default.join(directory2, "java-abi.klib");
|
|
114752
115002
|
await runKotlinTool(
|
|
114753
115003
|
toolchain,
|
|
114754
115004
|
sdkRoot,
|
|
114755
115005
|
"dev.peach.tools.platform.JavaPlatformTypesKt",
|
|
114756
|
-
[
|
|
115006
|
+
[import_node_path157.default.join(directory2, `${name3}.klib`), library]
|
|
114757
115007
|
);
|
|
114758
115008
|
return library;
|
|
114759
115009
|
}
|
|
114760
|
-
var import_node_child_process72, import_node_crypto92,
|
|
115010
|
+
var import_node_child_process72, import_node_crypto92, import_node_fs156, import_node_path157, import_node_util18, run13, JAVA_BINDINGS_INITIALIZER;
|
|
114761
115011
|
var init_java_module_abi = __esm({
|
|
114762
115012
|
"src/java-module-abi.ts"() {
|
|
114763
115013
|
"use strict";
|
|
114764
115014
|
import_node_child_process72 = require("node:child_process");
|
|
114765
115015
|
import_node_crypto92 = require("node:crypto");
|
|
114766
|
-
|
|
114767
|
-
|
|
115016
|
+
import_node_fs156 = __toESM(require("node:fs"), 1);
|
|
115017
|
+
import_node_path157 = __toESM(require("node:path"), 1);
|
|
114768
115018
|
import_node_util18 = require("node:util");
|
|
114769
115019
|
init_android_bridge_packages();
|
|
114770
115020
|
init_is_record();
|
|
@@ -115002,22 +115252,22 @@ var init_kotlinSdkContract = __esm({
|
|
|
115002
115252
|
// src/kotlin-sdk.ts
|
|
115003
115253
|
function verifyKotlinSdkDirectory(root, compiler) {
|
|
115004
115254
|
const expectedNames = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
115005
|
-
const names =
|
|
115255
|
+
const names = import_node_fs157.default.readdirSync(root);
|
|
115006
115256
|
if (names.length !== expectedNames.length || names.some((name3) => !expectedNames.includes(name3)))
|
|
115007
115257
|
throw new Error("Kotlin SDK directory contains unexpected inputs");
|
|
115008
|
-
const manifestStat =
|
|
115258
|
+
const manifestStat = import_node_fs157.default.lstatSync(import_node_path158.default.join(root, "manifest.json"));
|
|
115009
115259
|
if (!manifestStat.isFile() || manifestStat.nlink !== 1)
|
|
115010
115260
|
throw new Error("Kotlin SDK manifest is not a regular file");
|
|
115011
115261
|
const manifest = readKotlinSdkManifest(
|
|
115012
|
-
|
|
115262
|
+
import_node_fs157.default.readFileSync(import_node_path158.default.join(root, "manifest.json"), "utf8"),
|
|
115013
115263
|
compiler.upstreamSha256
|
|
115014
115264
|
);
|
|
115015
115265
|
for (const [name3, expected] of Object.entries(manifest.files)) {
|
|
115016
|
-
const target =
|
|
115017
|
-
const stat2 =
|
|
115266
|
+
const target = import_node_path158.default.join(root, name3);
|
|
115267
|
+
const stat2 = import_node_fs157.default.lstatSync(target);
|
|
115018
115268
|
if (!stat2.isFile() || stat2.nlink !== 1)
|
|
115019
115269
|
throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
|
|
115020
|
-
const bytes =
|
|
115270
|
+
const bytes = import_node_fs157.default.readFileSync(target);
|
|
115021
115271
|
if (bytes.length !== expected.bytes || (0, import_node_crypto93.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
|
|
115022
115272
|
throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
|
|
115023
115273
|
}
|
|
@@ -115025,42 +115275,42 @@ function verifyKotlinSdkDirectory(root, compiler) {
|
|
|
115025
115275
|
}
|
|
115026
115276
|
async function installKotlinSdkArchive(archive, compiler) {
|
|
115027
115277
|
const sha2565 = (0, import_node_crypto93.createHash)("sha256").update(archive).digest("hex");
|
|
115028
|
-
const parent =
|
|
115029
|
-
const root =
|
|
115030
|
-
if (
|
|
115278
|
+
const parent = import_node_path158.default.join(kotlinHome(), "sdk");
|
|
115279
|
+
const root = import_node_path158.default.join(parent, sha2565);
|
|
115280
|
+
if (import_node_fs157.default.existsSync(root))
|
|
115031
115281
|
return { root, sha256: sha2565, manifest: verifyKotlinSdkDirectory(root, compiler) };
|
|
115032
|
-
|
|
115033
|
-
const work =
|
|
115282
|
+
import_node_fs157.default.mkdirSync(parent, { recursive: true });
|
|
115283
|
+
const work = import_node_fs157.default.mkdtempSync(import_node_path158.default.join(parent, ".install-"));
|
|
115034
115284
|
try {
|
|
115035
|
-
const packed =
|
|
115036
|
-
|
|
115285
|
+
const packed = import_node_path158.default.join(work, "sdk.tar.gz");
|
|
115286
|
+
import_node_fs157.default.writeFileSync(packed, archive);
|
|
115037
115287
|
const { stdout } = await run14("tar", ["-tzf", packed]);
|
|
115038
115288
|
const names = stdout.trim().split("\n");
|
|
115039
115289
|
const expected = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
115040
115290
|
if (names.length !== expected.length || new Set(names).size !== names.length || names.some((name3) => !expected.includes(name3)))
|
|
115041
115291
|
throw new Error("Kotlin SDK archive contains unexpected inputs");
|
|
115042
115292
|
await run14("tar", ["-xzf", packed, "-C", work, "--", ...expected]);
|
|
115043
|
-
|
|
115293
|
+
import_node_fs157.default.rmSync(packed);
|
|
115044
115294
|
const manifest = verifyKotlinSdkDirectory(work, compiler);
|
|
115045
115295
|
try {
|
|
115046
|
-
|
|
115296
|
+
import_node_fs157.default.renameSync(work, root);
|
|
115047
115297
|
} catch (error) {
|
|
115048
|
-
if (!
|
|
115298
|
+
if (!import_node_fs157.default.existsSync(root)) throw error;
|
|
115049
115299
|
verifyKotlinSdkDirectory(root, compiler);
|
|
115050
115300
|
}
|
|
115051
115301
|
return { root, sha256: sha2565, manifest };
|
|
115052
115302
|
} finally {
|
|
115053
|
-
|
|
115303
|
+
import_node_fs157.default.rmSync(work, { recursive: true, force: true });
|
|
115054
115304
|
}
|
|
115055
115305
|
}
|
|
115056
|
-
var import_node_child_process73, import_node_crypto93,
|
|
115306
|
+
var import_node_child_process73, import_node_crypto93, import_node_fs157, import_node_path158, import_node_util19, run14;
|
|
115057
115307
|
var init_kotlin_sdk = __esm({
|
|
115058
115308
|
"src/kotlin-sdk.ts"() {
|
|
115059
115309
|
"use strict";
|
|
115060
115310
|
import_node_child_process73 = require("node:child_process");
|
|
115061
115311
|
import_node_crypto93 = require("node:crypto");
|
|
115062
|
-
|
|
115063
|
-
|
|
115312
|
+
import_node_fs157 = __toESM(require("node:fs"), 1);
|
|
115313
|
+
import_node_path158 = __toESM(require("node:path"), 1);
|
|
115064
115314
|
import_node_util19 = require("node:util");
|
|
115065
115315
|
init_kotlin_toolchain();
|
|
115066
115316
|
init_kotlinSdkContract();
|
|
@@ -115191,45 +115441,45 @@ var init_kotlin_view_models = __esm({
|
|
|
115191
115441
|
|
|
115192
115442
|
// src/kotlin-module.ts
|
|
115193
115443
|
function peachKotlinModuleRoot() {
|
|
115194
|
-
if (!IS_STANDALONE) return
|
|
115444
|
+
if (!IS_STANDALONE) return import_node_path159.default.join(peachsimPackageRoot(), "kotlin");
|
|
115195
115445
|
if (installedRoot) return installedRoot;
|
|
115196
115446
|
const files2 = JSON.parse(__PEACH_BUNDLED_KOTLIN__);
|
|
115197
115447
|
const digest3 = (0, import_node_crypto94.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
|
|
115198
|
-
const parent =
|
|
115199
|
-
const root =
|
|
115200
|
-
|
|
115201
|
-
if (!
|
|
115202
|
-
const pending =
|
|
115448
|
+
const parent = import_node_path159.default.join(rnxHomeDir(), "kotlin", "modules");
|
|
115449
|
+
const root = import_node_path159.default.join(parent, digest3);
|
|
115450
|
+
import_node_fs158.default.mkdirSync(parent, { recursive: true });
|
|
115451
|
+
if (!import_node_fs158.default.existsSync(root)) {
|
|
115452
|
+
const pending = import_node_fs158.default.mkdtempSync(import_node_path159.default.join(parent, ".install-"));
|
|
115203
115453
|
try {
|
|
115204
115454
|
for (const [name3, contents2] of Object.entries(files2)) {
|
|
115205
|
-
const file =
|
|
115206
|
-
|
|
115207
|
-
|
|
115455
|
+
const file = import_node_path159.default.join(pending, name3);
|
|
115456
|
+
import_node_fs158.default.mkdirSync(import_node_path159.default.dirname(file), { recursive: true });
|
|
115457
|
+
import_node_fs158.default.writeFileSync(file, Buffer.from(contents2, "base64"));
|
|
115208
115458
|
}
|
|
115209
115459
|
try {
|
|
115210
|
-
|
|
115460
|
+
import_node_fs158.default.renameSync(pending, root);
|
|
115211
115461
|
} catch (error) {
|
|
115212
115462
|
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY")
|
|
115213
115463
|
throw error;
|
|
115214
115464
|
}
|
|
115215
115465
|
} finally {
|
|
115216
|
-
|
|
115466
|
+
import_node_fs158.default.rmSync(pending, { recursive: true, force: true });
|
|
115217
115467
|
}
|
|
115218
115468
|
}
|
|
115219
115469
|
for (const [name3, contents2] of Object.entries(files2)) {
|
|
115220
|
-
if (!
|
|
115470
|
+
if (!import_node_fs158.default.readFileSync(import_node_path159.default.join(root, name3)).equals(Buffer.from(contents2, "base64")))
|
|
115221
115471
|
throw new Error(`packaged Kotlin module differs from this CLI: ${name3}`);
|
|
115222
115472
|
}
|
|
115223
115473
|
installedRoot = root;
|
|
115224
115474
|
return root;
|
|
115225
115475
|
}
|
|
115226
|
-
var import_node_crypto94,
|
|
115476
|
+
var import_node_crypto94, import_node_fs158, import_node_path159, installedRoot;
|
|
115227
115477
|
var init_kotlin_module = __esm({
|
|
115228
115478
|
"src/kotlin-module.ts"() {
|
|
115229
115479
|
"use strict";
|
|
115230
115480
|
import_node_crypto94 = require("node:crypto");
|
|
115231
|
-
|
|
115232
|
-
|
|
115481
|
+
import_node_fs158 = __toESM(require("node:fs"), 1);
|
|
115482
|
+
import_node_path159 = __toESM(require("node:path"), 1);
|
|
115233
115483
|
init_standalone();
|
|
115234
115484
|
init_home_paths();
|
|
115235
115485
|
init_is_record();
|
|
@@ -115253,16 +115503,16 @@ async function resolveAndroidGradleSources(request) {
|
|
|
115253
115503
|
includeDependencySources = false
|
|
115254
115504
|
} = request;
|
|
115255
115505
|
if (projectDirs.length === 0) return [];
|
|
115256
|
-
if (!
|
|
115506
|
+
if (!import_node_path160.default.isAbsolute(root) || projectDirs.some((dir) => !import_node_path160.default.isAbsolute(dir)))
|
|
115257
115507
|
throw new Error("Android Gradle source selection requires absolute project paths");
|
|
115258
115508
|
if (!variant2) throw new Error("Android Gradle source selection requires a variant");
|
|
115259
|
-
root =
|
|
115260
|
-
const projects2 = [...new Set(projectDirs.map((dir) =>
|
|
115261
|
-
const parent =
|
|
115262
|
-
|
|
115263
|
-
const work =
|
|
115509
|
+
root = import_node_fs159.default.realpathSync(root);
|
|
115510
|
+
const projects2 = [...new Set(projectDirs.map((dir) => import_node_fs159.default.realpathSync(dir)))];
|
|
115511
|
+
const parent = import_node_path160.default.join(kotlinHome(), "gradle-sources");
|
|
115512
|
+
import_node_fs159.default.mkdirSync(parent, { recursive: true });
|
|
115513
|
+
const work = import_node_fs159.default.mkdtempSync(import_node_path160.default.join(parent, ".query-"));
|
|
115264
115514
|
const task = `peachAndroidSources${(0, import_node_crypto95.randomBytes)(8).toString("hex")}`;
|
|
115265
|
-
const script =
|
|
115515
|
+
const script = import_node_path160.default.join(work, "sources.gradle");
|
|
115266
115516
|
const encoded = Buffer.from(
|
|
115267
115517
|
JSON.stringify({
|
|
115268
115518
|
root,
|
|
@@ -115276,12 +115526,12 @@ async function resolveAndroidGradleSources(request) {
|
|
|
115276
115526
|
task
|
|
115277
115527
|
})
|
|
115278
115528
|
).toString("base64");
|
|
115279
|
-
|
|
115529
|
+
import_node_fs159.default.writeFileSync(script, modelQuery.replace("__PEACH_REQUEST__", encoded));
|
|
115280
115530
|
try {
|
|
115281
115531
|
await run15(
|
|
115282
115532
|
"bash",
|
|
115283
115533
|
[
|
|
115284
|
-
|
|
115534
|
+
import_node_path160.default.join(root, "gradlew"),
|
|
115285
115535
|
"--init-script",
|
|
115286
115536
|
script,
|
|
115287
115537
|
`${task}All`,
|
|
@@ -115300,19 +115550,19 @@ async function resolveAndroidGradleSources(request) {
|
|
|
115300
115550
|
);
|
|
115301
115551
|
return projects2.map((projectDir, index) => {
|
|
115302
115552
|
const value = JSON.parse(
|
|
115303
|
-
|
|
115553
|
+
import_node_fs159.default.readFileSync(import_node_path160.default.join(work, `${index}.json`), "utf8")
|
|
115304
115554
|
);
|
|
115305
115555
|
if (!isRecord(value) || value.projectDir !== projectDir || value.variant !== variant2 || typeof value.projectPath !== "string" || value.applicationId !== null && typeof value.applicationId !== "string" || typeof value.namespace !== "string" || !value.namespace || value.targetSdk !== null && (typeof value.targetSdk !== "number" || !Number.isInteger(value.targetSdk) || value.targetSdk <= 0))
|
|
115306
115556
|
throw new Error("Gradle printed an invalid Android project source model");
|
|
115307
115557
|
const paths = (field) => {
|
|
115308
115558
|
const list2 = value[field];
|
|
115309
|
-
if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" &&
|
|
115559
|
+
if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" && import_node_path160.default.isAbsolute(file)))
|
|
115310
115560
|
throw new Error(`Gradle printed invalid Android ${field} paths`);
|
|
115311
115561
|
return list2.map(String);
|
|
115312
115562
|
};
|
|
115313
115563
|
const linkedResource = (field) => {
|
|
115314
115564
|
const file = value[field];
|
|
115315
|
-
if (typeof file !== "string" || !
|
|
115565
|
+
if (typeof file !== "string" || !import_node_path160.default.isAbsolute(file) || !import_node_fs159.default.statSync(file, { throwIfNoEntry: false })?.isFile())
|
|
115316
115566
|
throw new Error(`Gradle did not produce ${field} for ${projectDir}:${variant2}`);
|
|
115317
115567
|
return file;
|
|
115318
115568
|
};
|
|
@@ -115361,14 +115611,14 @@ async function resolveAndroidGradleSources(request) {
|
|
|
115361
115611
|
};
|
|
115362
115612
|
});
|
|
115363
115613
|
} finally {
|
|
115364
|
-
|
|
115614
|
+
import_node_fs159.default.rmSync(work, { recursive: true, force: true });
|
|
115365
115615
|
}
|
|
115366
115616
|
}
|
|
115367
115617
|
function readDependencySources(value) {
|
|
115368
115618
|
if (!Array.isArray(value)) throw new Error("Gradle printed invalid dependency sources");
|
|
115369
115619
|
const coordinates = /* @__PURE__ */ new Set();
|
|
115370
115620
|
return value.map((entry) => {
|
|
115371
|
-
if (!isRecord(entry) || typeof entry.group !== "string" || !entry.group || typeof entry.name !== "string" || !entry.name || typeof entry.version !== "string" || !entry.version || typeof entry.archive !== "string" || !
|
|
115621
|
+
if (!isRecord(entry) || typeof entry.group !== "string" || !entry.group || typeof entry.name !== "string" || !entry.name || typeof entry.version !== "string" || !entry.version || typeof entry.archive !== "string" || !import_node_path160.default.isAbsolute(entry.archive) || !import_node_fs159.default.statSync(entry.archive, { throwIfNoEntry: false })?.isFile())
|
|
115372
115622
|
throw new Error("Gradle printed an invalid dependency sources archive");
|
|
115373
115623
|
const coordinate = `${entry.group}:${entry.name}:${entry.version}`;
|
|
115374
115624
|
if (coordinates.has(coordinate))
|
|
@@ -115382,14 +115632,14 @@ function readDependencySources(value) {
|
|
|
115382
115632
|
};
|
|
115383
115633
|
});
|
|
115384
115634
|
}
|
|
115385
|
-
var import_node_child_process74, import_node_crypto95,
|
|
115635
|
+
var import_node_child_process74, import_node_crypto95, import_node_fs159, import_node_path160, import_node_util20, run15, modelQuery;
|
|
115386
115636
|
var init_android_gradle_sources = __esm({
|
|
115387
115637
|
"src/android-gradle-sources.ts"() {
|
|
115388
115638
|
"use strict";
|
|
115389
115639
|
import_node_child_process74 = require("node:child_process");
|
|
115390
115640
|
import_node_crypto95 = require("node:crypto");
|
|
115391
|
-
|
|
115392
|
-
|
|
115641
|
+
import_node_fs159 = __toESM(require("node:fs"), 1);
|
|
115642
|
+
import_node_path160 = __toESM(require("node:path"), 1);
|
|
115393
115643
|
import_node_util20 = require("node:util");
|
|
115394
115644
|
init_forked_script_contract();
|
|
115395
115645
|
init_is_record();
|
|
@@ -115577,16 +115827,16 @@ __export(kotlin_host_exports, {
|
|
|
115577
115827
|
});
|
|
115578
115828
|
function loadKotlinSdk(moduleRoot, toolchain) {
|
|
115579
115829
|
return installKotlinSdkArchive(
|
|
115580
|
-
|
|
115830
|
+
import_node_fs160.default.readFileSync(import_node_path161.default.join(moduleRoot, "sdk.tar.gz")),
|
|
115581
115831
|
toolchain.compiler
|
|
115582
115832
|
);
|
|
115583
115833
|
}
|
|
115584
115834
|
function appKotlinLanguage(root) {
|
|
115585
|
-
const reactNative =
|
|
115586
|
-
(0, import_node_module22.createRequire)(
|
|
115835
|
+
const reactNative = import_node_path161.default.dirname(
|
|
115836
|
+
(0, import_node_module22.createRequire)(import_node_path161.default.join(root, "package.json")).resolve("react-native/package.json")
|
|
115587
115837
|
);
|
|
115588
|
-
const versions =
|
|
115589
|
-
|
|
115838
|
+
const versions = import_node_fs160.default.readFileSync(
|
|
115839
|
+
import_node_path161.default.join(reactNative, "gradle", "libs.versions.toml"),
|
|
115590
115840
|
"utf8"
|
|
115591
115841
|
);
|
|
115592
115842
|
const match = /^kotlin\s*=\s*"(\d+)\.(\d+)/m.exec(versions);
|
|
@@ -115597,9 +115847,9 @@ function appKotlinLanguage(root) {
|
|
|
115597
115847
|
function kotlinSources(root, skip = SKIP_DIRS) {
|
|
115598
115848
|
const sources = [];
|
|
115599
115849
|
const walk4 = (dir) => {
|
|
115600
|
-
for (const entry of
|
|
115850
|
+
for (const entry of import_node_fs160.default.readdirSync(dir, { withFileTypes: true })) {
|
|
115601
115851
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
115602
|
-
const full =
|
|
115852
|
+
const full = import_node_path161.default.join(dir, entry.name);
|
|
115603
115853
|
if (entry.isDirectory()) walk4(full);
|
|
115604
115854
|
else if (entry.isFile() && entry.name.endsWith(".kt")) sources.push(full);
|
|
115605
115855
|
}
|
|
@@ -115656,7 +115906,7 @@ function entrySource(ids) {
|
|
|
115656
115906
|
].join("\n");
|
|
115657
115907
|
}
|
|
115658
115908
|
function buildsDir() {
|
|
115659
|
-
return
|
|
115909
|
+
return import_node_path161.default.join(kotlinHome(), "builds");
|
|
115660
115910
|
}
|
|
115661
115911
|
async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
|
|
115662
115912
|
const { kotlinSourceId, nativeSourceContract, renderKotlinSourceGlue } = await import("vxrn/native-source-contract");
|
|
@@ -115669,7 +115919,7 @@ async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
|
|
|
115669
115919
|
const viewIds = [];
|
|
115670
115920
|
let usesCompose = false;
|
|
115671
115921
|
for (const file of sources) {
|
|
115672
|
-
const source =
|
|
115922
|
+
const source = import_node_fs160.default.readFileSync(file, "utf8");
|
|
115673
115923
|
if (/\bandroidx\.compose\./.test(source)) usesCompose = true;
|
|
115674
115924
|
const contract = nativeSourceContract(file, source);
|
|
115675
115925
|
if (contract.modules.length === 0 && contract.views.length === 0) continue;
|
|
@@ -115760,9 +116010,9 @@ function readExpoTypes(output) {
|
|
|
115760
116010
|
async function scanSources(tool, parse17, toolchain, moduleRoot, files2) {
|
|
115761
116011
|
const digest3 = (0, import_node_crypto96.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
|
|
115762
116012
|
const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
|
|
115763
|
-
digest3.update(
|
|
116013
|
+
digest3.update(import_node_fs160.default.readFileSync(import_node_path161.default.join(moduleRoot, "sdk.tar.gz")));
|
|
115764
116014
|
digest3.update(tool);
|
|
115765
|
-
for (const file of files2) digest3.update(`${file}\0${
|
|
116015
|
+
for (const file of files2) digest3.update(`${file}\0${import_node_fs160.default.readFileSync(file, "utf8")}\0`);
|
|
115766
116016
|
const key2 = digest3.digest("hex");
|
|
115767
116017
|
let scan3 = toolScans.get(key2);
|
|
115768
116018
|
if (!scan3) {
|
|
@@ -115777,7 +116027,7 @@ async function scanSources(tool, parse17, toolchain, moduleRoot, files2) {
|
|
|
115777
116027
|
async function scanExpoTypes(toolchain, moduleRoot, sources) {
|
|
115778
116028
|
const candidates = sources.filter(
|
|
115779
116029
|
(file) => /\bRecord\b|\benum\s+class\b|\bExpoComposeView\b|\bExpoView\b|\bComposeProps\b|:\s*(?:[A-Za-z0-9_.]+\.)?(?:View|FrameLayout|LinearLayout|ViewGroup)\b/.test(
|
|
115780
|
-
|
|
116030
|
+
import_node_fs160.default.readFileSync(file, "utf8")
|
|
115781
116031
|
)
|
|
115782
116032
|
);
|
|
115783
116033
|
if (candidates.length === 0) return [];
|
|
@@ -115921,7 +116171,7 @@ function expoTypeSources(files2) {
|
|
|
115921
116171
|
)
|
|
115922
116172
|
];
|
|
115923
116173
|
if (edits.length > 0 || views.length > 0) {
|
|
115924
|
-
let text7 =
|
|
116174
|
+
let text7 = import_node_fs160.default.readFileSync(file.file, "utf8").replaceAll("\r\n", "\n");
|
|
115925
116175
|
for (const { range: range3, owner, field } of edits.sort((a, b) => b.range[0] - a.range[0]))
|
|
115926
116176
|
text7 = `${text7.slice(0, range3[0])}dev.peach.expo.PeachExpoTypes.initial(${owner}::class, ${literal3(field.key)}, ${field.required}) { ${text7.slice(range3[0], range3[1])} }${text7.slice(range3[1])}`;
|
|
115927
116177
|
if (views.length > 0) {
|
|
@@ -115937,7 +116187,7 @@ function expoTypeSources(files2) {
|
|
|
115937
116187
|
`${file.package ? `${file.package}.` : ""}peachExpoViews${index}()`
|
|
115938
116188
|
);
|
|
115939
116189
|
}
|
|
115940
|
-
const name3 = `PeachExpoSource_${index}_${
|
|
116190
|
+
const name3 = `PeachExpoSource_${index}_${import_node_path161.default.basename(file.file)}`;
|
|
115941
116191
|
generated[name3] = text7;
|
|
115942
116192
|
origins[name3] = file.file;
|
|
115943
116193
|
}
|
|
@@ -115979,7 +116229,7 @@ async function expoKotlinArtifact(root, moduleRoot, origin, modules) {
|
|
|
115979
116229
|
const language = appKotlinLanguage(root);
|
|
115980
116230
|
const scanned = await scanExpoTypes(toolchain, moduleRoot, modules.sources);
|
|
115981
116231
|
const usesCompose = scanned.some((file) => file.views.length > 0) || modules.sources.some(
|
|
115982
|
-
(file) => /\bandroidx\.compose\./.test(
|
|
116232
|
+
(file) => /\bandroidx\.compose\./.test(import_node_fs160.default.readFileSync(file, "utf8"))
|
|
115983
116233
|
);
|
|
115984
116234
|
const types2 = expoTypeSources(scanned);
|
|
115985
116235
|
const rewritten = new Set(Object.values(types2.origins));
|
|
@@ -116197,7 +116447,7 @@ function appResourceSources(app) {
|
|
|
116197
116447
|
entries: app.drawables.map((drawable) => ({
|
|
116198
116448
|
name: drawable.name,
|
|
116199
116449
|
init: `listOf(
|
|
116200
|
-
${drawable.files.map((file) => drawableInit(file,
|
|
116450
|
+
${drawable.files.map((file) => drawableInit(file, import_node_path161.default.relative(app.moduleDir, file.file))).join(",\n")}
|
|
116201
116451
|
)`
|
|
116202
116452
|
}))
|
|
116203
116453
|
},
|
|
@@ -116321,7 +116571,7 @@ function drawableInit(drawable, file) {
|
|
|
116321
116571
|
if (drawable.kind === "xml") return `PeachDrawable.Xml(${where})`;
|
|
116322
116572
|
if (drawable.kind === "bitmap")
|
|
116323
116573
|
return `PeachDrawable.Bitmap(${where}, ${drawable.ninePatch}, ${literal3(
|
|
116324
|
-
|
|
116574
|
+
import_node_fs160.default.readFileSync(drawable.file).toString("base64")
|
|
116325
116575
|
)})`;
|
|
116326
116576
|
const vector = drawable.vector;
|
|
116327
116577
|
const float3 = (value) => `${value}f`;
|
|
@@ -116386,8 +116636,8 @@ async function compileKotlin(input, origin) {
|
|
|
116386
116636
|
javaSpecs = []
|
|
116387
116637
|
} = input;
|
|
116388
116638
|
const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
|
|
116389
|
-
const plugin =
|
|
116390
|
-
const sdkLibrary =
|
|
116639
|
+
const plugin = import_node_path161.default.join(sdk2.root, "plugin.jar");
|
|
116640
|
+
const sdkLibrary = import_node_path161.default.join(sdk2.root, `${sdkProfile}.klib`);
|
|
116391
116641
|
const javaRead = javaSpecs.length ? await readJavaModuleSpecs(javaSpecs, sdk2.root, await ensureToolchain(toolchain)) : null;
|
|
116392
116642
|
const java = javaRead && javaRead.specs.some((spec) => !spec.application) ? { ...javaRead, specs: javaRead.specs.filter((spec) => !spec.application) } : null;
|
|
116393
116643
|
const applicationJava = javaRead?.specs.filter((spec) => spec.application) ?? [];
|
|
@@ -116415,7 +116665,7 @@ async function compileKotlin(input, origin) {
|
|
|
116415
116665
|
};
|
|
116416
116666
|
const inputs2 = sources.map((file) => ({
|
|
116417
116667
|
file,
|
|
116418
|
-
bytes:
|
|
116668
|
+
bytes: import_node_fs160.default.readFileSync(file)
|
|
116419
116669
|
}));
|
|
116420
116670
|
const { composeArchive, ...compilerInputs } = toolchain;
|
|
116421
116671
|
const digest3 = (0, import_node_crypto96.createHash)("sha256");
|
|
@@ -116432,7 +116682,7 @@ async function compileKotlin(input, origin) {
|
|
|
116432
116682
|
})
|
|
116433
116683
|
);
|
|
116434
116684
|
for (const { file, bytes } of inputs2)
|
|
116435
|
-
digest3.update(
|
|
116685
|
+
digest3.update(import_node_path161.default.relative(root, file)).update("\0").update(bytes).update("\0");
|
|
116436
116686
|
if (viewModels) digest3.update(viewModels.toolClass);
|
|
116437
116687
|
for (const [name3, text7] of Object.entries(generated))
|
|
116438
116688
|
digest3.update(`${name3}\0${text7}\0`);
|
|
@@ -116441,28 +116691,28 @@ async function compileKotlin(input, origin) {
|
|
|
116441
116691
|
url: `${origin}${KOTLIN_ARTIFACT_PREFIX}${hash}/app.mjs`,
|
|
116442
116692
|
hash
|
|
116443
116693
|
};
|
|
116444
|
-
const out =
|
|
116445
|
-
if (
|
|
116694
|
+
const out = import_node_path161.default.join(buildsDir(), hash);
|
|
116695
|
+
if (import_node_fs160.default.existsSync(import_node_path161.default.join(out, "js", "app.wasm"))) return artifact;
|
|
116446
116696
|
const pending = builds.get(hash);
|
|
116447
116697
|
if (pending) return pending;
|
|
116448
116698
|
const build2 = (async () => {
|
|
116449
116699
|
const ready = await ensureToolchain(toolchain);
|
|
116450
116700
|
const { kotlinc } = ready;
|
|
116451
|
-
const libraries = [...ready.libraries, sdkLibrary,
|
|
116701
|
+
const libraries = [...ready.libraries, sdkLibrary, import_node_path161.default.join(sdk2.root, "java.klib")];
|
|
116452
116702
|
const compose = usesCompose ? await ensureCompose(toolchain) : null;
|
|
116453
116703
|
if (compose) libraries.push(...compose.libraries);
|
|
116454
|
-
|
|
116455
|
-
const work =
|
|
116456
|
-
const javaLibrary = java ?
|
|
116704
|
+
import_node_fs160.default.mkdirSync(buildsDir(), { recursive: true });
|
|
116705
|
+
const work = import_node_fs160.default.mkdtempSync(import_node_path161.default.join(buildsDir(), `${hash}-`));
|
|
116706
|
+
const javaLibrary = java ? import_node_path161.default.join(work, "java-abi", "java-abi.klib") : null;
|
|
116457
116707
|
if (javaLibrary) libraries.push(javaLibrary);
|
|
116458
|
-
const generatedDir =
|
|
116459
|
-
|
|
116708
|
+
const generatedDir = import_node_path161.default.join(work, "generated");
|
|
116709
|
+
import_node_fs160.default.mkdirSync(generatedDir);
|
|
116460
116710
|
for (const [name3, text7] of Object.entries(generated))
|
|
116461
|
-
|
|
116711
|
+
import_node_fs160.default.writeFileSync(import_node_path161.default.join(generatedDir, name3), text7);
|
|
116462
116712
|
const compiledSources = inputs2.map(({ file, bytes }, index) => {
|
|
116463
|
-
const target =
|
|
116464
|
-
|
|
116465
|
-
|
|
116713
|
+
const target = import_node_path161.default.join(work, "sources", String(index), import_node_path161.default.basename(file));
|
|
116714
|
+
import_node_fs160.default.mkdirSync(import_node_path161.default.dirname(target), { recursive: true });
|
|
116715
|
+
import_node_fs160.default.writeFileSync(target, bytes);
|
|
116466
116716
|
return { file, target };
|
|
116467
116717
|
});
|
|
116468
116718
|
const common2 = [
|
|
@@ -116471,19 +116721,19 @@ async function compileKotlin(input, origin) {
|
|
|
116471
116721
|
"-Xallow-kotlin-package",
|
|
116472
116722
|
"-Xwasm-target=js",
|
|
116473
116723
|
"-libraries",
|
|
116474
|
-
libraries.join(
|
|
116724
|
+
libraries.join(import_node_path161.default.delimiter)
|
|
116475
116725
|
];
|
|
116476
116726
|
const compileKlib = (outputDir) => run16(
|
|
116477
116727
|
kotlinc,
|
|
116478
116728
|
[
|
|
116479
116729
|
...common2,
|
|
116480
116730
|
`-Xplugin=${plugin}`,
|
|
116481
|
-
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(
|
|
116731
|
+
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path161.default.delimiter)}`,
|
|
116482
116732
|
...usesCompose ? [
|
|
116483
|
-
`-Xplugin=${
|
|
116733
|
+
`-Xplugin=${import_node_path161.default.resolve(import_node_path161.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
|
|
116484
116734
|
] : [],
|
|
116485
116735
|
...usesSerialization ? [
|
|
116486
|
-
`-Xplugin=${
|
|
116736
|
+
`-Xplugin=${import_node_path161.default.resolve(import_node_path161.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
|
|
116487
116737
|
] : [],
|
|
116488
116738
|
"-language-version",
|
|
116489
116739
|
language,
|
|
@@ -116497,7 +116747,7 @@ async function compileKotlin(input, origin) {
|
|
|
116497
116747
|
"-ir-output-name",
|
|
116498
116748
|
"app",
|
|
116499
116749
|
...compiledSources.map(({ target }) => target),
|
|
116500
|
-
...Object.keys(generated).map((name3) =>
|
|
116750
|
+
...Object.keys(generated).map((name3) => import_node_path161.default.join(generatedDir, name3))
|
|
116501
116751
|
],
|
|
116502
116752
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
116503
116753
|
);
|
|
@@ -116516,49 +116766,49 @@ async function compileKotlin(input, origin) {
|
|
|
116516
116766
|
if (viewModels && inputs2.some(
|
|
116517
116767
|
({ file, bytes }) => sources.includes(file) && bytes.includes("ViewModel")
|
|
116518
116768
|
)) {
|
|
116519
|
-
await compileKlib(
|
|
116769
|
+
await compileKlib(import_node_path161.default.join(work, "abi"));
|
|
116520
116770
|
const stdout = await runKotlinTool(
|
|
116521
116771
|
ready,
|
|
116522
116772
|
sdk2.root,
|
|
116523
116773
|
viewModels.toolClass,
|
|
116524
|
-
[
|
|
116774
|
+
[import_node_path161.default.join(work, "abi")],
|
|
116525
116775
|
64 * 1024 * 1024
|
|
116526
116776
|
);
|
|
116527
|
-
|
|
116528
|
-
|
|
116777
|
+
import_node_fs160.default.writeFileSync(
|
|
116778
|
+
import_node_path161.default.join(generatedDir, viewModels.file),
|
|
116529
116779
|
viewModels.render(viewModelClasses(readAbiClasses(stdout)))
|
|
116530
116780
|
);
|
|
116531
116781
|
}
|
|
116532
|
-
await compileKlib(
|
|
116782
|
+
await compileKlib(import_node_path161.default.join(work, "klib"));
|
|
116533
116783
|
await run16(
|
|
116534
116784
|
kotlinc,
|
|
116535
116785
|
[
|
|
116536
116786
|
...common2,
|
|
116537
116787
|
"-nowarn",
|
|
116538
116788
|
"-Xpartial-linkage-loglevel=error",
|
|
116539
|
-
`-Xinclude=${
|
|
116789
|
+
`-Xinclude=${import_node_path161.default.join(work, "klib")}`,
|
|
116540
116790
|
"-Xir-produce-js",
|
|
116541
116791
|
"-Xir-dce",
|
|
116542
116792
|
"-ir-output-dir",
|
|
116543
|
-
|
|
116793
|
+
import_node_path161.default.join(work, "js"),
|
|
116544
116794
|
"-ir-output-name",
|
|
116545
116795
|
"app"
|
|
116546
116796
|
],
|
|
116547
116797
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
116548
116798
|
);
|
|
116549
116799
|
if (compose) {
|
|
116550
|
-
|
|
116551
|
-
|
|
116552
|
-
kotlinSkikoSource(
|
|
116800
|
+
import_node_fs160.default.writeFileSync(
|
|
116801
|
+
import_node_path161.default.join(work, "js", "skiko.mjs"),
|
|
116802
|
+
kotlinSkikoSource(import_node_fs160.default.readFileSync(compose.loader))
|
|
116553
116803
|
);
|
|
116554
116804
|
}
|
|
116555
116805
|
if (usesCompose) {
|
|
116556
116806
|
for (const library of toolchain.composeJsLibraries) {
|
|
116557
116807
|
let imported = false;
|
|
116558
|
-
for (const file of
|
|
116808
|
+
for (const file of import_node_fs160.default.readdirSync(import_node_path161.default.join(work, "js"))) {
|
|
116559
116809
|
if (!file.endsWith(".mjs")) continue;
|
|
116560
|
-
const target =
|
|
116561
|
-
const source =
|
|
116810
|
+
const target = import_node_path161.default.join(work, "js", file);
|
|
116811
|
+
const source = import_node_fs160.default.readFileSync(target, "utf8");
|
|
116562
116812
|
let next = source;
|
|
116563
116813
|
for (const quote3 of ["'", '"'])
|
|
116564
116814
|
next = next.replaceAll(
|
|
@@ -116566,11 +116816,11 @@ async function compileKotlin(input, origin) {
|
|
|
116566
116816
|
`from ${quote3}./${library.file}${quote3}`
|
|
116567
116817
|
);
|
|
116568
116818
|
if (next === source) continue;
|
|
116569
|
-
|
|
116819
|
+
import_node_fs160.default.writeFileSync(target, next);
|
|
116570
116820
|
imported = true;
|
|
116571
116821
|
}
|
|
116572
116822
|
if (!imported) continue;
|
|
116573
|
-
const archive =
|
|
116823
|
+
const archive = import_node_path161.default.join(
|
|
116574
116824
|
kotlinHome(),
|
|
116575
116825
|
toolchain.compiler.version,
|
|
116576
116826
|
library.name
|
|
@@ -116579,24 +116829,24 @@ async function compileKotlin(input, origin) {
|
|
|
116579
116829
|
const { stdout } = await run16("tar", ["-xOf", archive, library.archiveEntry], {
|
|
116580
116830
|
maxBuffer: 16 * 1024 * 1024
|
|
116581
116831
|
});
|
|
116582
|
-
|
|
116832
|
+
import_node_fs160.default.writeFileSync(import_node_path161.default.join(work, "js", library.file), stdout);
|
|
116583
116833
|
}
|
|
116584
116834
|
}
|
|
116585
116835
|
} catch (error) {
|
|
116586
|
-
|
|
116836
|
+
import_node_fs160.default.rmSync(work, { recursive: true, force: true });
|
|
116587
116837
|
let output = isRecord(error) ? `${String(error.stderr ?? "")}${String(error.stdout ?? "")}` : "";
|
|
116588
116838
|
for (const [name3, source] of Object.entries(origins))
|
|
116589
|
-
output = output.replaceAll(
|
|
116839
|
+
output = output.replaceAll(import_node_path161.default.join(generatedDir, name3), source);
|
|
116590
116840
|
for (const [index, spec] of applicationJava.entries())
|
|
116591
116841
|
output = output.replaceAll(
|
|
116592
|
-
|
|
116842
|
+
import_node_path161.default.join(generatedDir, `JavaApplication${index}.kt`),
|
|
116593
116843
|
spec.file
|
|
116594
116844
|
);
|
|
116595
116845
|
for (const { file, target } of compiledSources)
|
|
116596
|
-
output = output.replaceAll(target, file).replaceAll(
|
|
116846
|
+
output = output.replaceAll(target, file).replaceAll(import_node_path161.default.relative(process.cwd(), target), file);
|
|
116597
116847
|
for (const [index, spec] of (java?.specs ?? []).entries())
|
|
116598
116848
|
output = output.replaceAll(
|
|
116599
|
-
|
|
116849
|
+
import_node_path161.default.join(work, "java-abi", `Spec${index}.kt`),
|
|
116600
116850
|
spec.file
|
|
116601
116851
|
);
|
|
116602
116852
|
output = output.replace(
|
|
@@ -116609,20 +116859,20 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
116609
116859
|
);
|
|
116610
116860
|
}
|
|
116611
116861
|
const seams = [kotlinNodeDetection];
|
|
116612
|
-
const js =
|
|
116862
|
+
const js = import_node_fs160.default.readdirSync(import_node_path161.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
|
|
116613
116863
|
if (js.some(
|
|
116614
|
-
(file) =>
|
|
116864
|
+
(file) => import_node_fs160.default.readFileSync(import_node_path161.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
|
|
116615
116865
|
))
|
|
116616
116866
|
seams.push(kotlinCoroutineDispatcher);
|
|
116617
116867
|
for (const [from, to] of seams) {
|
|
116618
116868
|
let patched = 0;
|
|
116619
116869
|
for (const file of js) {
|
|
116620
|
-
const target =
|
|
116621
|
-
const text7 =
|
|
116870
|
+
const target = import_node_path161.default.join(work, "js", file);
|
|
116871
|
+
const text7 = import_node_fs160.default.readFileSync(target, "utf8");
|
|
116622
116872
|
const next = text7.replaceAll(from, to);
|
|
116623
116873
|
if (next !== text7) {
|
|
116624
116874
|
patched++;
|
|
116625
|
-
|
|
116875
|
+
import_node_fs160.default.writeFileSync(target, next);
|
|
116626
116876
|
}
|
|
116627
116877
|
}
|
|
116628
116878
|
if (patched === 0)
|
|
@@ -116630,11 +116880,11 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
116630
116880
|
`kotlin output no longer contains ${from}; recheck how it detects its host in Peach`
|
|
116631
116881
|
);
|
|
116632
116882
|
}
|
|
116633
|
-
const entry =
|
|
116634
|
-
const entrySource2 =
|
|
116635
|
-
const importsPath =
|
|
116883
|
+
const entry = import_node_path161.default.join(work, "js/app.mjs");
|
|
116884
|
+
const entrySource2 = import_node_fs160.default.readFileSync(entry, "utf8");
|
|
116885
|
+
const importsPath = import_node_path161.default.join(work, "js/app.import-object.mjs");
|
|
116636
116886
|
const importsFactory = kotlinInstanceSource(
|
|
116637
|
-
|
|
116887
|
+
import_node_fs160.default.readFileSync(importsPath, "utf8"),
|
|
116638
116888
|
"createKotlinImportObject"
|
|
116639
116889
|
);
|
|
116640
116890
|
const runtimeFactory = kotlinInstanceSource(
|
|
@@ -116642,9 +116892,9 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
116642
116892
|
"createKotlinInstance",
|
|
116643
116893
|
/* @__PURE__ */ new Map([["./app.import-object.mjs", "createKotlinImportObject"]])
|
|
116644
116894
|
);
|
|
116645
|
-
|
|
116646
|
-
|
|
116647
|
-
|
|
116895
|
+
import_node_fs160.default.writeFileSync(importsPath, importsFactory.source);
|
|
116896
|
+
import_node_fs160.default.writeFileSync(import_node_path161.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
|
|
116897
|
+
import_node_fs160.default.writeFileSync(
|
|
116648
116898
|
entry,
|
|
116649
116899
|
[
|
|
116650
116900
|
"import { createKotlinInstance } from './app-runtime.mjs';",
|
|
@@ -116657,10 +116907,10 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
116657
116907
|
].join("\n")
|
|
116658
116908
|
);
|
|
116659
116909
|
try {
|
|
116660
|
-
|
|
116910
|
+
import_node_fs160.default.renameSync(work, out);
|
|
116661
116911
|
} catch (error) {
|
|
116662
|
-
if (!
|
|
116663
|
-
|
|
116912
|
+
if (!import_node_fs160.default.existsSync(import_node_path161.default.join(out, "js", "app.wasm"))) throw error;
|
|
116913
|
+
import_node_fs160.default.rmSync(work, { recursive: true, force: true });
|
|
116664
116914
|
}
|
|
116665
116915
|
return artifact;
|
|
116666
116916
|
})().finally(() => builds.delete(hash));
|
|
@@ -116668,24 +116918,24 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
116668
116918
|
return build2;
|
|
116669
116919
|
}
|
|
116670
116920
|
function kotlinArtifactFiles(hash) {
|
|
116671
|
-
const dir =
|
|
116672
|
-
return
|
|
116673
|
-
const contentType2 = CONTENT_TYPES[
|
|
116921
|
+
const dir = import_node_path161.default.join(buildsDir(), hash, "js");
|
|
116922
|
+
return import_node_fs160.default.readdirSync(dir).sort().map((name3) => {
|
|
116923
|
+
const contentType2 = CONTENT_TYPES[import_node_path161.default.extname(name3)];
|
|
116674
116924
|
if (!contentType2) throw new Error(`unexpected kotlin artifact file ${name3}`);
|
|
116675
|
-
return { name: name3, bytes:
|
|
116925
|
+
return { name: name3, bytes: import_node_fs160.default.readFileSync(import_node_path161.default.join(dir, name3)), contentType: contentType2 };
|
|
116676
116926
|
});
|
|
116677
116927
|
}
|
|
116678
116928
|
function serveKotlinArtifact(pathname, res) {
|
|
116679
116929
|
if (!pathname.startsWith(KOTLIN_ARTIFACT_PREFIX)) return false;
|
|
116680
116930
|
const [hash, file, ...rest] = pathname.slice(KOTLIN_ARTIFACT_PREFIX.length).split("/");
|
|
116681
|
-
const type = file ? CONTENT_TYPES[
|
|
116931
|
+
const type = file ? CONTENT_TYPES[import_node_path161.default.extname(file)] : void 0;
|
|
116682
116932
|
if (!hash || !/^[0-9a-f]+$/.test(hash) || !file || rest.length > 0 || !type || file.includes("..")) {
|
|
116683
116933
|
res.statusCode = 404;
|
|
116684
116934
|
res.end("not a kotlin artifact");
|
|
116685
116935
|
return true;
|
|
116686
116936
|
}
|
|
116687
|
-
const target =
|
|
116688
|
-
if (!
|
|
116937
|
+
const target = import_node_path161.default.join(buildsDir(), hash, "js", file);
|
|
116938
|
+
if (!import_node_fs160.default.existsSync(target)) {
|
|
116689
116939
|
res.statusCode = 404;
|
|
116690
116940
|
res.end(`kotlin artifact ${hash}/${file} was not built`);
|
|
116691
116941
|
return true;
|
|
@@ -116693,7 +116943,7 @@ function serveKotlinArtifact(pathname, res) {
|
|
|
116693
116943
|
res.setHeader("access-control-allow-origin", "*");
|
|
116694
116944
|
res.setHeader("content-type", type);
|
|
116695
116945
|
res.setHeader("cache-control", "public, max-age=31536000, immutable");
|
|
116696
|
-
res.end(
|
|
116946
|
+
res.end(import_node_fs160.default.readFileSync(target));
|
|
116697
116947
|
return true;
|
|
116698
116948
|
}
|
|
116699
116949
|
async function serveKotlinRequest(pathname, res, app) {
|
|
@@ -116710,15 +116960,15 @@ async function serveKotlinRequest(pathname, res, app) {
|
|
|
116710
116960
|
}
|
|
116711
116961
|
return true;
|
|
116712
116962
|
}
|
|
116713
|
-
var import_node_child_process75, import_node_crypto96,
|
|
116963
|
+
var import_node_child_process75, import_node_crypto96, import_node_fs160, import_node_module22, import_node_path161, import_node_util21, run16, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal3, CONTENT_TYPES;
|
|
116714
116964
|
var init_kotlin_host = __esm({
|
|
116715
116965
|
"src/kotlin-host.ts"() {
|
|
116716
116966
|
"use strict";
|
|
116717
116967
|
import_node_child_process75 = require("node:child_process");
|
|
116718
116968
|
import_node_crypto96 = require("node:crypto");
|
|
116719
|
-
|
|
116969
|
+
import_node_fs160 = __toESM(require("node:fs"), 1);
|
|
116720
116970
|
import_node_module22 = require("node:module");
|
|
116721
|
-
|
|
116971
|
+
import_node_path161 = __toESM(require("node:path"), 1);
|
|
116722
116972
|
import_node_util21 = require("node:util");
|
|
116723
116973
|
init_kotlinDiscoveryContract();
|
|
116724
116974
|
init_android_bridge_packages();
|
|
@@ -116832,9 +117082,9 @@ __export(one_native_source_exports, {
|
|
|
116832
117082
|
});
|
|
116833
117083
|
function appFor(url, origin, allowRootless) {
|
|
116834
117084
|
const requested = url.searchParams.get("root");
|
|
116835
|
-
if (requested === null ? !allowRootless : !
|
|
117085
|
+
if (requested === null ? !allowRootless : !import_node_path162.default.isAbsolute(requested) || !import_node_fs161.default.existsSync(requested))
|
|
116836
117086
|
return null;
|
|
116837
|
-
const root = requested === null ? "" :
|
|
117087
|
+
const root = requested === null ? "" : import_node_fs161.default.realpathSync(requested);
|
|
116838
117088
|
let app = apps.get(root);
|
|
116839
117089
|
if (!app) {
|
|
116840
117090
|
app = {
|
|
@@ -116856,7 +117106,7 @@ function send2(app, change) {
|
|
|
116856
117106
|
if (client2.readyState === import_ws2.WebSocket.OPEN) client2.send(message);
|
|
116857
117107
|
}
|
|
116858
117108
|
async function swiftPackages2(root) {
|
|
116859
|
-
const resolved = (0, import_node_module23.createRequire)(
|
|
117109
|
+
const resolved = (0, import_node_module23.createRequire)(import_node_path162.default.join(root, "package.json")).resolve(
|
|
116860
117110
|
"vxrn/swift-package-id"
|
|
116861
117111
|
);
|
|
116862
117112
|
const loaded4 = await import((0, import_node_url9.pathToFileURL)(resolved).href);
|
|
@@ -116884,7 +117134,11 @@ async function packageMetadata(app, packageName2) {
|
|
|
116884
117134
|
packagePath,
|
|
116885
117135
|
packageName2,
|
|
116886
117136
|
moduleRoot,
|
|
116887
|
-
app.origin
|
|
117137
|
+
app.origin,
|
|
117138
|
+
void 0,
|
|
117139
|
+
void 0,
|
|
117140
|
+
[],
|
|
117141
|
+
app.startupRuntimeUrl
|
|
116888
117142
|
);
|
|
116889
117143
|
if (!app.active.has(packageName2)) {
|
|
116890
117144
|
const files2 = [
|
|
@@ -116895,7 +117149,7 @@ async function packageMetadata(app, packageName2) {
|
|
|
116895
117149
|
app.active.set(packageName2, { packagePath, files: new Set(files2) });
|
|
116896
117150
|
watch(app, packagePath, true);
|
|
116897
117151
|
for (const file of files2)
|
|
116898
|
-
if (!file.startsWith(`${packagePath}${
|
|
117152
|
+
if (!file.startsWith(`${packagePath}${import_node_path162.default.sep}`)) watch(app, import_node_path162.default.dirname(file));
|
|
116899
117153
|
}
|
|
116900
117154
|
return {
|
|
116901
117155
|
...built2,
|
|
@@ -116904,9 +117158,9 @@ async function packageMetadata(app, packageName2) {
|
|
|
116904
117158
|
};
|
|
116905
117159
|
}
|
|
116906
117160
|
function changed(app, file) {
|
|
116907
|
-
if (
|
|
117161
|
+
if (import_node_path162.default.basename(file) === "Package.swift") app.packages = void 0;
|
|
116908
117162
|
for (const [packageName2, { packagePath, files: files2 }] of app.active) {
|
|
116909
|
-
if (!files2.has(file) && !file.startsWith(`${packagePath}${
|
|
117163
|
+
if (!files2.has(file) && !file.startsWith(`${packagePath}${import_node_path162.default.sep}`)) continue;
|
|
116910
117164
|
packageMetadata(app, packageName2).then(
|
|
116911
117165
|
(metadata) => send2(app, { type: "package", packageName: packageName2, metadata }),
|
|
116912
117166
|
(error) => send2(app, {
|
|
@@ -116917,15 +117171,15 @@ function changed(app, file) {
|
|
|
116917
117171
|
);
|
|
116918
117172
|
}
|
|
116919
117173
|
const kotlinModule = app.kotlinModule;
|
|
116920
|
-
if (kotlinModule && (file.endsWith(".kt") || file.startsWith(`${kotlinModule}${
|
|
117174
|
+
if (kotlinModule && (file.endsWith(".kt") || file.startsWith(`${kotlinModule}${import_node_path162.default.sep}`)))
|
|
116921
117175
|
send2(app, { type: "kotlin", packageName: "kotlin" });
|
|
116922
117176
|
}
|
|
116923
117177
|
function watch(app, directory2, recursive = false) {
|
|
116924
|
-
if (app.watched.has(directory2) || !
|
|
117178
|
+
if (app.watched.has(directory2) || !import_node_fs161.default.existsSync(directory2)) return;
|
|
116925
117179
|
app.watched.add(directory2);
|
|
116926
|
-
|
|
116927
|
-
if (name3 && !name3.split(
|
|
116928
|
-
changed(app,
|
|
117180
|
+
import_node_fs161.default.watch(directory2, { recursive }, (_event, name3) => {
|
|
117181
|
+
if (name3 && !name3.split(import_node_path162.default.sep).includes("node_modules"))
|
|
117182
|
+
changed(app, import_node_path162.default.join(directory2, name3));
|
|
116929
117183
|
});
|
|
116930
117184
|
}
|
|
116931
117185
|
function loopbackClient(req) {
|
|
@@ -116933,7 +117187,7 @@ function loopbackClient(req) {
|
|
|
116933
117187
|
const origin = req.headers.origin;
|
|
116934
117188
|
return !!remote && isLoopbackHost(remote) && (!origin || isLoopbackHost(new URL(origin).hostname));
|
|
116935
117189
|
}
|
|
116936
|
-
async function handleOneNativeSourceRequest(req, res) {
|
|
117190
|
+
async function handleOneNativeSourceRequest(req, res, startupRuntimeUrl) {
|
|
116937
117191
|
const url = new URL(req.url ?? "/", "http://localhost");
|
|
116938
117192
|
const isSwift = url.pathname.startsWith(SWIFT_PACKAGE_PATH);
|
|
116939
117193
|
if (!isSwift && url.pathname !== KOTLIN_PACKAGE_PATH && url.pathname !== ONE_WIDGET_PATH)
|
|
@@ -116953,6 +117207,7 @@ async function handleOneNativeSourceRequest(req, res) {
|
|
|
116953
117207
|
res.end("missing absolute app root");
|
|
116954
117208
|
return true;
|
|
116955
117209
|
}
|
|
117210
|
+
if (startupRuntimeUrl) app.startupRuntimeUrl = startupRuntimeUrl;
|
|
116956
117211
|
try {
|
|
116957
117212
|
if (url.pathname === ONE_WIDGET_PATH) {
|
|
116958
117213
|
const bundle = url.searchParams.get("bundle");
|
|
@@ -117017,13 +117272,13 @@ function handleOneNativeSourceUpgrade(req, socket, head) {
|
|
|
117017
117272
|
});
|
|
117018
117273
|
return true;
|
|
117019
117274
|
}
|
|
117020
|
-
var
|
|
117275
|
+
var import_node_fs161, import_node_module23, import_node_path162, import_node_url9, import_node_util22, import_node_zlib10, import_ws2, apps, compressMetadata;
|
|
117021
117276
|
var init_one_native_source = __esm({
|
|
117022
117277
|
"src/one-native-source.ts"() {
|
|
117023
117278
|
"use strict";
|
|
117024
|
-
|
|
117279
|
+
import_node_fs161 = __toESM(require("node:fs"), 1);
|
|
117025
117280
|
import_node_module23 = require("node:module");
|
|
117026
|
-
|
|
117281
|
+
import_node_path162 = __toESM(require("node:path"), 1);
|
|
117027
117282
|
import_node_url9 = require("node:url");
|
|
117028
117283
|
import_node_util22 = require("node:util");
|
|
117029
117284
|
import_node_zlib10 = require("node:zlib");
|
|
@@ -117105,12 +117360,12 @@ function handleManagedExpoInputs(req, res, url) {
|
|
|
117105
117360
|
return;
|
|
117106
117361
|
}
|
|
117107
117362
|
const source = url.searchParams.get("root");
|
|
117108
|
-
if (!source || !
|
|
117363
|
+
if (!source || !import_node_path163.default.isAbsolute(source)) {
|
|
117109
117364
|
res.writeHead(400);
|
|
117110
117365
|
res.end("Missing absolute app root");
|
|
117111
117366
|
return;
|
|
117112
117367
|
}
|
|
117113
|
-
const root =
|
|
117368
|
+
const root = import_node_fs162.default.realpathSync(source);
|
|
117114
117369
|
const revision = nativeInputRevision(root);
|
|
117115
117370
|
res.setHeader("Cache-Control", "no-store");
|
|
117116
117371
|
if (!revision) {
|
|
@@ -117121,13 +117376,13 @@ function handleManagedExpoInputs(req, res, url) {
|
|
|
117121
117376
|
res.writeHead(200, { "Content-Type": revisionType });
|
|
117122
117377
|
res.end(revision);
|
|
117123
117378
|
}
|
|
117124
|
-
var import_node_crypto97,
|
|
117379
|
+
var import_node_crypto97, import_node_fs162, import_node_path163, revisionType;
|
|
117125
117380
|
var init_managed_expo_identity = __esm({
|
|
117126
117381
|
"src/managed-expo-identity.ts"() {
|
|
117127
117382
|
"use strict";
|
|
117128
117383
|
import_node_crypto97 = require("node:crypto");
|
|
117129
|
-
|
|
117130
|
-
|
|
117384
|
+
import_node_fs162 = __toESM(require("node:fs"), 1);
|
|
117385
|
+
import_node_path163 = __toESM(require("node:path"), 1);
|
|
117131
117386
|
init_backend_origin();
|
|
117132
117387
|
init_cli_version();
|
|
117133
117388
|
init_expo_native_prebuilt();
|
|
@@ -117143,11 +117398,11 @@ var init_managed_expo_identity = __esm({
|
|
|
117143
117398
|
});
|
|
117144
117399
|
|
|
117145
117400
|
// src/one-native-app-catalog.ts
|
|
117146
|
-
var
|
|
117401
|
+
var import_node_path164;
|
|
117147
117402
|
var init_one_native_app_catalog = __esm({
|
|
117148
117403
|
"src/one-native-app-catalog.ts"() {
|
|
117149
117404
|
"use strict";
|
|
117150
|
-
|
|
117405
|
+
import_node_path164 = __toESM(require("node:path"), 1);
|
|
117151
117406
|
init_is_record();
|
|
117152
117407
|
init_one_native_app_config();
|
|
117153
117408
|
}
|
|
@@ -117196,12 +117451,12 @@ async function stageCatalogSvg(file, scale, origin, bytes) {
|
|
|
117196
117451
|
}
|
|
117197
117452
|
);
|
|
117198
117453
|
}
|
|
117199
|
-
var
|
|
117454
|
+
var import_node_fs163, import_node_path165;
|
|
117200
117455
|
var init_app_catalog = __esm({
|
|
117201
117456
|
"cli/app-catalog.ts"() {
|
|
117202
117457
|
"use strict";
|
|
117203
|
-
|
|
117204
|
-
|
|
117458
|
+
import_node_fs163 = __toESM(require("node:fs"), 1);
|
|
117459
|
+
import_node_path165 = __toESM(require("node:path"), 1);
|
|
117205
117460
|
init_bundleAssets();
|
|
117206
117461
|
init_expo_native_workspace();
|
|
117207
117462
|
init_staged_host_files();
|
|
@@ -117212,17 +117467,17 @@ var init_app_catalog = __esm({
|
|
|
117212
117467
|
|
|
117213
117468
|
// src/expo-widget-assets.ts
|
|
117214
117469
|
async function stagePreparedExpoWidgetAssets(preparedApp, origin) {
|
|
117215
|
-
const ios =
|
|
117216
|
-
const targets =
|
|
117470
|
+
const ios = import_node_path166.default.join(preparedApp, "ios");
|
|
117471
|
+
const targets = import_node_fs164.default.readdirSync(ios, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).flatMap((entry) => readXcodeExtensionTargets(import_node_path166.default.join(ios, entry.name))).filter(
|
|
117217
117472
|
({ infoPlist: infoPlist2 }) => isRecord(infoPlist2.NSExtension) && infoPlist2.NSExtension.NSExtensionPointIdentifier === "com.apple.widgetkit-extension" && typeof infoPlist2.ExpoWidgetsAppGroupIdentifier === "string"
|
|
117218
117473
|
);
|
|
117219
117474
|
if (targets.length === 0) return null;
|
|
117220
117475
|
if (targets.length !== 1) throw new Error("expected one Expo Widgets extension target");
|
|
117221
117476
|
const target = targets[0];
|
|
117222
|
-
const root =
|
|
117477
|
+
const root = import_node_fs164.default.realpathSync(findWorkspaceRoot(preparedApp));
|
|
117223
117478
|
const members2 = new Map(
|
|
117224
117479
|
target.resources.map((file) => [
|
|
117225
|
-
|
|
117480
|
+
import_node_path166.default.relative(root, file).split(import_node_path166.default.sep).join("/"),
|
|
117226
117481
|
file
|
|
117227
117482
|
])
|
|
117228
117483
|
);
|
|
@@ -117237,7 +117492,7 @@ async function stagePreparedExpoWidgetAssets(preparedApp, origin) {
|
|
|
117237
117492
|
(file) => members2.has(file) ? read(file).toString("utf8") : null,
|
|
117238
117493
|
(file, scale) => {
|
|
117239
117494
|
const bytes = read(file);
|
|
117240
|
-
const ext =
|
|
117495
|
+
const ext = import_node_path166.default.extname(file);
|
|
117241
117496
|
if (ext.toLowerCase() === ".svg") return stageCatalogSvg(file, scale, origin, bytes);
|
|
117242
117497
|
if (ext.toLowerCase() === ".pdf") {
|
|
117243
117498
|
const sha2565 = (0, import_node_crypto98.createHash)("sha256").update(bytes).digest("hex");
|
|
@@ -117253,13 +117508,13 @@ async function stageExpoWidgetAssets(appRoot, origin) {
|
|
|
117253
117508
|
const prepared = await prepareExpoNativeProject(appRoot);
|
|
117254
117509
|
return stagePreparedExpoWidgetAssets(prepared.app, origin);
|
|
117255
117510
|
}
|
|
117256
|
-
var import_node_crypto98,
|
|
117511
|
+
var import_node_crypto98, import_node_fs164, import_node_path166;
|
|
117257
117512
|
var init_expo_widget_assets = __esm({
|
|
117258
117513
|
"src/expo-widget-assets.ts"() {
|
|
117259
117514
|
"use strict";
|
|
117260
117515
|
import_node_crypto98 = require("node:crypto");
|
|
117261
|
-
|
|
117262
|
-
|
|
117516
|
+
import_node_fs164 = __toESM(require("node:fs"), 1);
|
|
117517
|
+
import_node_path166 = __toESM(require("node:path"), 1);
|
|
117263
117518
|
init_app_catalog();
|
|
117264
117519
|
init_expo_native_workspace();
|
|
117265
117520
|
init_staged_host_files();
|
|
@@ -117306,7 +117561,7 @@ var init_nitro_app_providers = __esm({
|
|
|
117306
117561
|
async function trunkSpecification(lockFile, root, version2, checksum) {
|
|
117307
117562
|
if (typeof checksum !== "string" || !/^[a-f0-9]{40}$/.test(checksum))
|
|
117308
117563
|
throw new Error(`${lockFile}: missing checksum for ${root}`);
|
|
117309
|
-
const file =
|
|
117564
|
+
const file = import_node_path167.default.join(
|
|
117310
117565
|
cacheDir(),
|
|
117311
117566
|
"swift-source-pods",
|
|
117312
117567
|
"specifications",
|
|
@@ -117314,7 +117569,7 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
|
|
|
117314
117569
|
);
|
|
117315
117570
|
const sha1 = (value) => (0, import_node_crypto99.createHash)("sha1").update(value).digest("hex");
|
|
117316
117571
|
let text7;
|
|
117317
|
-
if (
|
|
117572
|
+
if (import_node_fs165.default.existsSync(file)) text7 = import_node_fs165.default.readFileSync(file, "utf8");
|
|
117318
117573
|
else {
|
|
117319
117574
|
const shard2 = (0, import_node_crypto99.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
|
|
117320
117575
|
const specPath = `Specs/${shard2}/${root}/${version2}/${root}.podspec.json`;
|
|
@@ -117351,21 +117606,21 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
|
|
|
117351
117606
|
const spec = JSON.parse(text7);
|
|
117352
117607
|
if (!record5(spec) || spec.name !== root || spec.version !== version2)
|
|
117353
117608
|
throw new Error(`specification identity differs for ${root} ${version2}`);
|
|
117354
|
-
if (!
|
|
117355
|
-
|
|
117356
|
-
|
|
117609
|
+
if (!import_node_fs165.default.existsSync(file)) {
|
|
117610
|
+
import_node_fs165.default.mkdirSync(import_node_path167.default.dirname(file), { recursive: true });
|
|
117611
|
+
import_node_fs165.default.writeFileSync(file, text7);
|
|
117357
117612
|
}
|
|
117358
117613
|
return { text: text7, spec };
|
|
117359
117614
|
}
|
|
117360
117615
|
function appPodfileLock(appRoot) {
|
|
117361
117616
|
return [
|
|
117362
|
-
|
|
117363
|
-
|
|
117364
|
-
].find((file) =>
|
|
117617
|
+
import_node_path167.default.join(appRoot, "ios", "Podfile.lock"),
|
|
117618
|
+
import_node_path167.default.join(appRoot, "Podfile.lock")
|
|
117619
|
+
].find((file) => import_node_fs165.default.existsSync(file));
|
|
117365
117620
|
}
|
|
117366
117621
|
async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModules = []) {
|
|
117367
117622
|
if (modules.length === 0 && headerModules.length === 0) return null;
|
|
117368
|
-
const original =
|
|
117623
|
+
const original = import_node_fs165.default.readFileSync(lockFile, "utf8");
|
|
117369
117624
|
const lock = browser_default.parse(original);
|
|
117370
117625
|
const pods = lockedPods(lock);
|
|
117371
117626
|
if (!record5(lock) || !record5(lock["SPEC CHECKSUMS"]))
|
|
@@ -117450,12 +117705,12 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
117450
117705
|
Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b))
|
|
117451
117706
|
)
|
|
117452
117707
|
).digest("hex");
|
|
117453
|
-
const work =
|
|
117708
|
+
const work = import_node_path167.default.join(cacheDir(), "swift-source-pods", key2);
|
|
117454
117709
|
return withSwiftRootLock(work, async () => {
|
|
117455
|
-
const ios =
|
|
117456
|
-
const complete =
|
|
117457
|
-
if (!
|
|
117458
|
-
|
|
117710
|
+
const ios = import_node_path167.default.join(work, "ios");
|
|
117711
|
+
const complete = import_node_path167.default.join(work, "pods-installed");
|
|
117712
|
+
if (!import_node_fs165.default.existsSync(complete)) {
|
|
117713
|
+
import_node_fs165.default.mkdirSync(import_node_path167.default.join(ios, `${APP}.xcodeproj`), { recursive: true });
|
|
117459
117714
|
for (const root of [...roots].sort()) {
|
|
117460
117715
|
const { text: text7 } = await trunkSpecification(
|
|
117461
117716
|
lockFile,
|
|
@@ -117463,26 +117718,26 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
117463
117718
|
rootVersion(root),
|
|
117464
117719
|
specificationChecksums[root]
|
|
117465
117720
|
);
|
|
117466
|
-
|
|
117721
|
+
import_node_fs165.default.writeFileSync(import_node_path167.default.join(ios, `${root}.podspec.json`), text7);
|
|
117467
117722
|
}
|
|
117468
|
-
|
|
117469
|
-
|
|
117470
|
-
|
|
117723
|
+
import_node_fs165.default.writeFileSync(import_node_path167.default.join(ios, `${APP}.xcodeproj/project.pbxproj`), project);
|
|
117724
|
+
import_node_fs165.default.writeFileSync(import_node_path167.default.join(ios, "main.swift"), "import Foundation\n");
|
|
117725
|
+
import_node_fs165.default.writeFileSync(import_node_path167.default.join(ios, "Podfile"), podfile);
|
|
117471
117726
|
await installPods(
|
|
117472
117727
|
work,
|
|
117473
117728
|
{ ...process.env, LANG: "en_US.UTF-8", LC_ALL: "en_US.UTF-8" },
|
|
117474
117729
|
work
|
|
117475
117730
|
);
|
|
117476
|
-
|
|
117731
|
+
import_node_fs165.default.writeFileSync(complete, key2);
|
|
117477
117732
|
}
|
|
117478
117733
|
const actual = lockedPods(
|
|
117479
|
-
browser_default.parse(
|
|
117734
|
+
browser_default.parse(import_node_fs165.default.readFileSync(import_node_path167.default.join(ios, "Pods/Manifest.lock"), "utf8"))
|
|
117480
117735
|
);
|
|
117481
117736
|
if (JSON.stringify([...actual].sort(([a], [b]) => a.localeCompare(b))) !== JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b))))
|
|
117482
117737
|
throw new Error(
|
|
117483
117738
|
`${work}: installed pod versions or dependencies differ from ${lockFile}`
|
|
117484
117739
|
);
|
|
117485
|
-
const workspace =
|
|
117740
|
+
const workspace = import_node_path167.default.join(ios, `${APP}.xcworkspace`);
|
|
117486
117741
|
await prepareXcodeSwiftPackages(workspace, APP, "Release");
|
|
117487
117742
|
const app = readXcodeAppTarget(workspace, APP, "Release", { installedPods: true });
|
|
117488
117743
|
if (app.binaryFrameworks.length > 0)
|
|
@@ -117514,13 +117769,13 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
117514
117769
|
);
|
|
117515
117770
|
});
|
|
117516
117771
|
}
|
|
117517
|
-
var import_node_crypto99,
|
|
117772
|
+
var import_node_crypto99, import_node_fs165, import_node_path167, APP, record5, project, podModuleName;
|
|
117518
117773
|
var init_swift_source_pods = __esm({
|
|
117519
117774
|
"src/swift-source-pods.ts"() {
|
|
117520
117775
|
"use strict";
|
|
117521
117776
|
import_node_crypto99 = require("node:crypto");
|
|
117522
|
-
|
|
117523
|
-
|
|
117777
|
+
import_node_fs165 = __toESM(require("node:fs"), 1);
|
|
117778
|
+
import_node_path167 = __toESM(require("node:path"), 1);
|
|
117524
117779
|
init_browser();
|
|
117525
117780
|
init_home_paths();
|
|
117526
117781
|
init_pod_lockfile();
|
|
@@ -117575,8 +117830,8 @@ function bundledNamespaceDefines(target, targetPath, files2) {
|
|
|
117575
117830
|
);
|
|
117576
117831
|
});
|
|
117577
117832
|
}
|
|
117578
|
-
function collectNitroCompileInput(collection, adapter, dependencies, iosDeploymentTarget,
|
|
117579
|
-
const ndebug =
|
|
117833
|
+
function collectNitroCompileInput(collection, adapter, dependencies, iosDeploymentTarget, configuration2) {
|
|
117834
|
+
const ndebug = configuration2 === "Release" ? ["-DNDEBUG"] : [];
|
|
117580
117835
|
const files2 = { ...collection.files };
|
|
117581
117836
|
const headerAliases = {
|
|
117582
117837
|
...dependencies?.headerAliases,
|
|
@@ -117711,7 +117966,7 @@ function collectNitroCompileInput(collection, adapter, dependencies, iosDeployme
|
|
|
117711
117966
|
"FOLLY_USE_LIBCPP=1"
|
|
117712
117967
|
] : [],
|
|
117713
117968
|
...!hasClangDefines ? ["DEBUG"] : [],
|
|
117714
|
-
...
|
|
117969
|
+
...configuration2 === "Release" ? ["NDEBUG"] : []
|
|
117715
117970
|
]);
|
|
117716
117971
|
const nativeSettings = `cSettings: [${[...cDefines, ...prefixFlags, ...turboSupport.cEntries, ...clangSettingEntries(target.clangSettings, "c")].join(", ")}], cxxSettings: [${[...cxxDefines, ...bundledNamespaceDefines(target.name, target.path, files2), ...prefixFlags, ...turboSupport.cxxEntries, ...clangSettingEntries(target.clangSettings, "cxx")].join(", ")}]`;
|
|
117717
117972
|
const swift2 = Object.keys(files2).some(
|
|
@@ -117780,11 +118035,11 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
117780
118035
|
const coreUpstream = `Sources/${TURBO_CORE_TARGET}/upstream/react-native`;
|
|
117781
118036
|
const flatMap = /* @__PURE__ */ new Map();
|
|
117782
118037
|
for (const { from, to } of RN_HEADER_DIR_MAP) {
|
|
117783
|
-
const dir =
|
|
117784
|
-
if (!
|
|
117785
|
-
for (const entry of
|
|
118038
|
+
const dir = import_node_path168.default.join(reactNativeRoot, from);
|
|
118039
|
+
if (!import_node_fs166.default.existsSync(dir)) continue;
|
|
118040
|
+
for (const entry of import_node_fs166.default.readdirSync(dir, { recursive: true, withFileTypes: true })) {
|
|
117786
118041
|
if (!entry.isFile() || !/\.(?:h|hpp)$/.test(entry.name)) continue;
|
|
117787
|
-
const rel =
|
|
118042
|
+
const rel = import_node_path168.default.relative(reactNativeRoot, import_node_path168.default.join(entry.parentPath, entry.name)).split(import_node_path168.default.sep).join("/");
|
|
117788
118043
|
const key2 = `${to}/${entry.name}`;
|
|
117789
118044
|
if (!flatMap.has(key2)) flatMap.set(key2, rel);
|
|
117790
118045
|
}
|
|
@@ -117793,12 +118048,12 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
117793
118048
|
const scanQueue = [];
|
|
117794
118049
|
const stageRelative = (rel) => {
|
|
117795
118050
|
const clean2 = rel.replace(/^\//, "");
|
|
117796
|
-
const full =
|
|
117797
|
-
if (!
|
|
118051
|
+
const full = import_node_path168.default.join(reactNativeRoot, clean2);
|
|
118052
|
+
if (!import_node_fs166.default.statSync(full, { throwIfNoEntry: false })?.isFile()) return null;
|
|
117798
118053
|
const targetKey = `${coreUpstream}/${clean2}`;
|
|
117799
118054
|
if (!Object.hasOwn(supportFiles, targetKey)) {
|
|
117800
|
-
supportFiles[targetKey] =
|
|
117801
|
-
scanQueue.push({ key: targetKey, dir:
|
|
118055
|
+
supportFiles[targetKey] = import_node_fs166.default.readFileSync(full, "utf8");
|
|
118056
|
+
scanQueue.push({ key: targetKey, dir: import_node_path168.default.posix.dirname(clean2) });
|
|
117802
118057
|
}
|
|
117803
118058
|
return targetKey;
|
|
117804
118059
|
};
|
|
@@ -117807,7 +118062,7 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
117807
118062
|
if (Object.hasOwn(supportFiles, outKey)) return;
|
|
117808
118063
|
let targetKey = null;
|
|
117809
118064
|
if (fromDir) {
|
|
117810
|
-
const candidate =
|
|
118065
|
+
const candidate = import_node_path168.default.posix.normalize(import_node_path168.default.posix.join(fromDir, include));
|
|
117811
118066
|
if (!candidate.startsWith("..")) targetKey = stageRelative(candidate);
|
|
117812
118067
|
}
|
|
117813
118068
|
if (!targetKey && flatMap.has(include)) {
|
|
@@ -117815,12 +118070,12 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
117815
118070
|
}
|
|
117816
118071
|
if (!targetKey) {
|
|
117817
118072
|
for (const root of RN_COMMON_ROOTS) {
|
|
117818
|
-
targetKey = stageRelative(
|
|
118073
|
+
targetKey = stageRelative(import_node_path168.default.posix.join(root, include));
|
|
117819
118074
|
if (targetKey) break;
|
|
117820
118075
|
}
|
|
117821
118076
|
}
|
|
117822
118077
|
if (targetKey) {
|
|
117823
|
-
const rel =
|
|
118078
|
+
const rel = import_node_path168.default.posix.relative(import_node_path168.default.posix.dirname(outKey), targetKey);
|
|
117824
118079
|
supportFiles[outKey] = `#pragma once
|
|
117825
118080
|
#ifdef __OBJC__
|
|
117826
118081
|
#import ${JSON.stringify(rel)}
|
|
@@ -117833,7 +118088,7 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
117833
118088
|
const dep = dependencyHeader(include);
|
|
117834
118089
|
if (dep) {
|
|
117835
118090
|
supportFiles[outKey] = dep.text;
|
|
117836
|
-
scanQueue.push({ key: outKey, dir:
|
|
118091
|
+
scanQueue.push({ key: outKey, dir: import_node_path168.default.posix.dirname(include) });
|
|
117837
118092
|
for (const extra of nitroDependencyIncludes(
|
|
117838
118093
|
reactNativeVersion,
|
|
117839
118094
|
reactNativeRoot,
|
|
@@ -117844,7 +118099,7 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
117844
118099
|
const extraDep = dependencyHeader(extra);
|
|
117845
118100
|
if (extraDep) {
|
|
117846
118101
|
supportFiles[extraOut] = extraDep.text;
|
|
117847
|
-
scanQueue.push({ key: extraOut, dir:
|
|
118102
|
+
scanQueue.push({ key: extraOut, dir: import_node_path168.default.posix.dirname(extra) });
|
|
117848
118103
|
}
|
|
117849
118104
|
}
|
|
117850
118105
|
}
|
|
@@ -117888,7 +118143,7 @@ function nitroDependencyHeaderSettings(target, dependencies, files2) {
|
|
|
117888
118143
|
return { extraDeps: [], cEntries: [], cxxEntries: [], usesTurboCore: false };
|
|
117889
118144
|
}
|
|
117890
118145
|
const turboInclude = `.headerSearchPath(${JSON.stringify(
|
|
117891
|
-
|
|
118146
|
+
import_node_path168.default.posix.relative(target.path, `Sources/${TURBO_CORE_TARGET}/include`)
|
|
117892
118147
|
)})`;
|
|
117893
118148
|
const pchPath = `Sources/${TURBO_CORE_TARGET}/include/PeachTurboPrefix.pch`;
|
|
117894
118149
|
const pchFlag = files2[pchPath] ? [`.unsafeFlags(${JSON.stringify(["-include", pchPath])})`] : [];
|
|
@@ -117924,7 +118179,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
117924
118179
|
const ndebug = options2.configuration === "Release" ? ["-DNDEBUG"] : [];
|
|
117925
118180
|
await prepareNitroSourceDependencies(options2);
|
|
117926
118181
|
const workspace = installedXcodeWorkspace(options2.projectRoot);
|
|
117927
|
-
const installedRoot2 =
|
|
118182
|
+
const installedRoot2 = import_node_fs166.default.realpathSync(options2.projectRoot);
|
|
117928
118183
|
const autolinked = await iosAutolinkedDependencies(
|
|
117929
118184
|
options2.appRoot ?? options2.projectRoot
|
|
117930
118185
|
);
|
|
@@ -117939,11 +118194,11 @@ async function prepareNitroCompileInput(options2) {
|
|
|
117939
118194
|
peerPackageRoots: autolinked.map(({ root }) => root)
|
|
117940
118195
|
});
|
|
117941
118196
|
const activePods = autolinked.flatMap(
|
|
117942
|
-
({ name: name3, root, podspecPath }) => !answered.has(name3) && podspecPath !== null && activeNitroRoots.has(
|
|
118197
|
+
({ name: name3, root, podspecPath }) => !answered.has(name3) && podspecPath !== null && activeNitroRoots.has(import_node_fs166.default.realpathSync(root)) ? [{ name: name3, root, podspecPath }] : []
|
|
117943
118198
|
);
|
|
117944
118199
|
const podSources = (pod) => [
|
|
117945
118200
|
...podspecSourceFiles2(pod, options2.appRoot ?? options2.projectRoot),
|
|
117946
|
-
...nitrogenGeneratedSources(
|
|
118201
|
+
...nitrogenGeneratedSources(import_node_path168.default.dirname(pod.podspecPath))
|
|
117947
118202
|
].map((file) => projectSourceKey([installedRoot2], file));
|
|
117948
118203
|
let nativeSourceKeys;
|
|
117949
118204
|
if (workspace) {
|
|
@@ -117965,7 +118220,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
117965
118220
|
const collection = collectNitroSources(
|
|
117966
118221
|
{ ...options2, peerPackageRoots: autolinked.map(({ root }) => root) },
|
|
117967
118222
|
nativeSourceKeys,
|
|
117968
|
-
|
|
118223
|
+
import_node_fs166.default.realpathSync(options2.appRoot ?? options2.projectRoot)
|
|
117969
118224
|
);
|
|
117970
118225
|
const providerNames = new Set(collection.providers.map(({ name: name3 }) => name3));
|
|
117971
118226
|
const installedLibraries = workspace ? installedNativeLibraries(
|
|
@@ -118036,7 +118291,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
118036
118291
|
)
|
|
118037
118292
|
);
|
|
118038
118293
|
const views = new Set(
|
|
118039
|
-
|
|
118294
|
+
import_node_fs166.default.readdirSync(import_node_path168.default.join(collection.nitro.root, "cpp/views"))
|
|
118040
118295
|
);
|
|
118041
118296
|
for (const [file, source] of Object.entries(collection.files))
|
|
118042
118297
|
if (file.endsWith("/NitroModules-umbrella.h"))
|
|
@@ -118105,8 +118360,8 @@ async function prepareNitroCompileInput(options2) {
|
|
|
118105
118360
|
([file, text7]) => /\.(?:h|hh|hpp|hxx|c|cc|cpp|cxx|m|mm)$/.test(file) && REACT_VERSION_PATTERN.test(text7)
|
|
118106
118361
|
);
|
|
118107
118362
|
if (reactProviders.length > 0 || usesReactHeaders) {
|
|
118108
|
-
const nitroReactCodegenDir =
|
|
118109
|
-
|
|
118363
|
+
const nitroReactCodegenDir = import_node_fs166.default.mkdtempSync(
|
|
118364
|
+
import_node_path168.default.join(import_node_os33.default.tmpdir(), "peach-nitro-react-")
|
|
118110
118365
|
);
|
|
118111
118366
|
let support;
|
|
118112
118367
|
try {
|
|
@@ -118121,7 +118376,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
118121
118376
|
installedPods: nativeLibraries
|
|
118122
118377
|
});
|
|
118123
118378
|
} finally {
|
|
118124
|
-
|
|
118379
|
+
import_node_fs166.default.rmSync(nitroReactCodegenDir, { recursive: true, force: true });
|
|
118125
118380
|
}
|
|
118126
118381
|
if (support.providers.length > 0 || usesReactHeaders && support.targets.some(({ name: name3 }) => name3 === TURBO_CORE_TARGET)) {
|
|
118127
118382
|
linkReactNativeCore(
|
|
@@ -118191,23 +118446,23 @@ async function prepareNitroCompileInput(options2) {
|
|
|
118191
118446
|
);
|
|
118192
118447
|
for (const [name3, pod] of nativeLibraries) {
|
|
118193
118448
|
if (pod.library === void 0) continue;
|
|
118194
|
-
const library =
|
|
118449
|
+
const library = import_node_fs166.default.readFileSync(pod.library).toString("base64");
|
|
118195
118450
|
input.libraries ??= {};
|
|
118196
118451
|
input.libraries[nitroProviderTarget({ name: name3 })] = library;
|
|
118197
118452
|
}
|
|
118198
118453
|
const key2 = (0, import_node_crypto100.createHash)("sha256").update(
|
|
118199
118454
|
collection.providers.map(({ root, hybridObjects }) => `${root}\0${hybridObjects.join(",")}`).join("\0")
|
|
118200
|
-
).update("\0").update(
|
|
118201
|
-
const packagePath =
|
|
118455
|
+
).update("\0").update(import_node_fs166.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
|
|
118456
|
+
const packagePath = import_node_path168.default.join(import_node_os33.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
|
|
118202
118457
|
const sharedLibrary = [...nativeLibraries.values()].find(
|
|
118203
118458
|
(pod) => pod.sharedLibrary
|
|
118204
118459
|
)?.sharedLibrary;
|
|
118205
118460
|
if (sharedLibrary) {
|
|
118206
|
-
|
|
118207
|
-
const core =
|
|
118208
|
-
|
|
118461
|
+
import_node_fs166.default.mkdirSync(packagePath, { recursive: true });
|
|
118462
|
+
const core = import_node_path168.default.join(packagePath, "adapter.a");
|
|
118463
|
+
import_node_fs166.default.writeFileSync(core, Buffer.from(adapter.base64, "base64"));
|
|
118209
118464
|
input.libraries ??= {};
|
|
118210
|
-
input.libraries.NitroCore =
|
|
118465
|
+
input.libraries.NitroCore = import_node_fs166.default.readFileSync(
|
|
118211
118466
|
combineNativeStaticLibraries([core, sharedLibrary], options2.moduleRoot)
|
|
118212
118467
|
).toString("base64");
|
|
118213
118468
|
}
|
|
@@ -118219,7 +118474,7 @@ async function compileNitroModule(options2) {
|
|
|
118219
118474
|
packagePath,
|
|
118220
118475
|
new Map(
|
|
118221
118476
|
Object.entries(input.files).map(([file, source]) => [
|
|
118222
|
-
|
|
118477
|
+
import_node_path168.default.join(packagePath, file),
|
|
118223
118478
|
source
|
|
118224
118479
|
])
|
|
118225
118480
|
)
|
|
@@ -118245,21 +118500,21 @@ async function compileNitroModule(options2) {
|
|
|
118245
118500
|
};
|
|
118246
118501
|
}
|
|
118247
118502
|
function nitrogenGeneratedSources(podDirectory) {
|
|
118248
|
-
const generated =
|
|
118249
|
-
const sources = (directory2, extension) =>
|
|
118503
|
+
const generated = import_node_path168.default.join(podDirectory, "nitrogen", "generated");
|
|
118504
|
+
const sources = (directory2, extension) => import_node_fs166.default.existsSync(directory2) ? import_node_fs166.default.readdirSync(directory2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile() && extension.test(entry.name)).map((entry) => import_node_path168.default.join(entry.parentPath, entry.name)) : [];
|
|
118250
118505
|
return [
|
|
118251
|
-
...sources(
|
|
118252
|
-
...sources(
|
|
118506
|
+
...sources(import_node_path168.default.join(generated, "shared"), /\.(h|hpp|c|cpp|swift)$/),
|
|
118507
|
+
...sources(import_node_path168.default.join(generated, "ios"), /\.(h|hpp|c|cpp|mm|swift)$/)
|
|
118253
118508
|
];
|
|
118254
118509
|
}
|
|
118255
|
-
var import_node_crypto100,
|
|
118510
|
+
var import_node_crypto100, import_node_fs166, import_node_os33, import_node_path168, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
|
|
118256
118511
|
var init_nitro_compile = __esm({
|
|
118257
118512
|
"src/nitro-compile.ts"() {
|
|
118258
118513
|
"use strict";
|
|
118259
118514
|
import_node_crypto100 = require("node:crypto");
|
|
118260
|
-
|
|
118515
|
+
import_node_fs166 = __toESM(require("node:fs"), 1);
|
|
118261
118516
|
import_node_os33 = __toESM(require("node:os"), 1);
|
|
118262
|
-
|
|
118517
|
+
import_node_path168 = __toESM(require("node:path"), 1);
|
|
118263
118518
|
init_answeredNativePackages();
|
|
118264
118519
|
init_installed_native_libraries();
|
|
118265
118520
|
init_native_app_identity_project();
|
|
@@ -118333,29 +118588,29 @@ var init_nitro_compile = __esm({
|
|
|
118333
118588
|
});
|
|
118334
118589
|
|
|
118335
118590
|
// src/nitro-compiler-digest.ts
|
|
118336
|
-
var import_node_crypto101,
|
|
118591
|
+
var import_node_crypto101, import_node_fs167, import_node_path169;
|
|
118337
118592
|
var init_nitro_compiler_digest = __esm({
|
|
118338
118593
|
"src/nitro-compiler-digest.ts"() {
|
|
118339
118594
|
"use strict";
|
|
118340
118595
|
import_node_crypto101 = require("node:crypto");
|
|
118341
|
-
|
|
118342
|
-
|
|
118596
|
+
import_node_fs167 = require("node:fs");
|
|
118597
|
+
import_node_path169 = __toESM(require("node:path"), 1);
|
|
118343
118598
|
init_swift_compiler_digest();
|
|
118344
118599
|
}
|
|
118345
118600
|
});
|
|
118346
118601
|
|
|
118347
118602
|
// src/nitro-superset-inputs.ts
|
|
118348
118603
|
async function nitroSupersetInputs(options2) {
|
|
118349
|
-
const resolve10 = (0, import_node_module24.createRequire)((0,
|
|
118604
|
+
const resolve10 = (0, import_node_module24.createRequire)((0, import_node_path170.join)(options2.appRoot, "package.json")).resolve;
|
|
118350
118605
|
const pin2 = swiftNativePin();
|
|
118351
118606
|
const inputs2 = {
|
|
118352
118607
|
configuration: options2.configuration,
|
|
118353
118608
|
"ios-deployment-target": options2.iosDeploymentTarget,
|
|
118354
|
-
"react-native": packageVersion((0,
|
|
118609
|
+
"react-native": packageVersion((0, import_node_path170.dirname)(resolve10("react-native/package.json"))),
|
|
118355
118610
|
"swift-distribution": pin2.distribution.id,
|
|
118356
118611
|
"nitro-runtime": JSON.stringify(pin2.adapters.nitro)
|
|
118357
118612
|
};
|
|
118358
|
-
const nitroModules = (0,
|
|
118613
|
+
const nitroModules = (0, import_node_path170.dirname)(resolve10("react-native-nitro-modules/package.json"));
|
|
118359
118614
|
for (const { name: name3, root } of [
|
|
118360
118615
|
...options2.providers,
|
|
118361
118616
|
{ name: "react-native-nitro-modules", root: nitroModules }
|
|
@@ -118363,16 +118618,16 @@ async function nitroSupersetInputs(options2) {
|
|
|
118363
118618
|
inputs2[`provider:${name3}`] = `${packageVersion(root)}\0${await packageTreeDigest(root)}`;
|
|
118364
118619
|
return inputs2;
|
|
118365
118620
|
}
|
|
118366
|
-
var
|
|
118621
|
+
var import_node_fs168, import_node_module24, import_node_path170, packageVersion;
|
|
118367
118622
|
var init_nitro_superset_inputs = __esm({
|
|
118368
118623
|
"src/nitro-superset-inputs.ts"() {
|
|
118369
118624
|
"use strict";
|
|
118370
|
-
|
|
118625
|
+
import_node_fs168 = require("node:fs");
|
|
118371
118626
|
import_node_module24 = require("node:module");
|
|
118372
|
-
|
|
118627
|
+
import_node_path170 = require("node:path");
|
|
118373
118628
|
init_package_tree_digest();
|
|
118374
118629
|
init_swift_native_pin();
|
|
118375
|
-
packageVersion = (root) => JSON.parse((0,
|
|
118630
|
+
packageVersion = (root) => JSON.parse((0, import_node_fs168.readFileSync)((0, import_node_path170.join)(root, "package.json"), "utf8")).version;
|
|
118376
118631
|
}
|
|
118377
118632
|
});
|
|
118378
118633
|
|
|
@@ -118475,7 +118730,7 @@ var init_nitro_superset = __esm({
|
|
|
118475
118730
|
init_nitroContract();
|
|
118476
118731
|
init_swift_standin_digest();
|
|
118477
118732
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
118478
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
118733
|
+
NITRO_COMPILER_DIGEST = true ? "d7332e8094966a9964f28748a0f8eb19acb8509eca15e182bea368f0cc6b6f13" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
118479
118734
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
118480
118735
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
118481
118736
|
published3 = /* @__PURE__ */ new Map();
|
|
@@ -118503,7 +118758,7 @@ __export(nitro_bundle_exports, {
|
|
|
118503
118758
|
handleNitroRequest: () => handleNitroRequest
|
|
118504
118759
|
});
|
|
118505
118760
|
async function compileNitroApp(appRoot, origin, configure, moduleRoot, shared = true, iosTarget, answered) {
|
|
118506
|
-
appRoot =
|
|
118761
|
+
appRoot = import_node_fs169.default.realpathSync(appRoot);
|
|
118507
118762
|
const selection = await selectCompiledNitroProviders(appRoot, answered);
|
|
118508
118763
|
if (!selection) return null;
|
|
118509
118764
|
const { packageRoots, answers: answers2 } = selection;
|
|
@@ -118512,10 +118767,10 @@ async function compileNitroApp(appRoot, origin, configure, moduleRoot, shared =
|
|
|
118512
118767
|
projectRoot,
|
|
118513
118768
|
iosTarget
|
|
118514
118769
|
)?.iosDeploymentTarget;
|
|
118515
|
-
const
|
|
118770
|
+
const configuration2 = typeof configure === "function" ? await configure() : configure;
|
|
118516
118771
|
const sharedModule = shared && !moduleRoot && iosDeploymentTarget ? await (await Promise.resolve().then(() => (init_nitro_superset(), nitro_superset_exports))).sharedNitroModule({
|
|
118517
118772
|
appRoot,
|
|
118518
|
-
configuration,
|
|
118773
|
+
configuration: configuration2,
|
|
118519
118774
|
iosDeploymentTarget,
|
|
118520
118775
|
providers: selection.providers,
|
|
118521
118776
|
answers: answers2
|
|
@@ -118526,13 +118781,13 @@ async function compileNitroApp(appRoot, origin, configure, moduleRoot, shared =
|
|
|
118526
118781
|
const { artifact, collection } = await compileNitroModule({
|
|
118527
118782
|
appRoot: projectRoot,
|
|
118528
118783
|
packageRoots: packageRoots.map(
|
|
118529
|
-
(root) =>
|
|
118784
|
+
(root) => import_node_path171.default.resolve(projectRoot, import_node_path171.default.relative(appRoot, root))
|
|
118530
118785
|
),
|
|
118531
118786
|
answers: answers2,
|
|
118532
118787
|
moduleRoot: module2,
|
|
118533
118788
|
projectRoot,
|
|
118534
118789
|
iosTarget,
|
|
118535
|
-
configuration,
|
|
118790
|
+
configuration: configuration2,
|
|
118536
118791
|
answeredPackages: answered
|
|
118537
118792
|
});
|
|
118538
118793
|
return {
|
|
@@ -118564,8 +118819,8 @@ async function compiledModuleAssets(artifact) {
|
|
|
118564
118819
|
..."gzip" in artifact.icu ? [await swiftIcuBundleAsset(artifact.icu)] : []
|
|
118565
118820
|
];
|
|
118566
118821
|
}
|
|
118567
|
-
async function buildNitroBundle(appRoot,
|
|
118568
|
-
const compiled = await compileNitroApp(appRoot, "",
|
|
118822
|
+
async function buildNitroBundle(appRoot, configuration2, moduleRoot, shared = true) {
|
|
118823
|
+
const compiled = await compileNitroApp(appRoot, "", configuration2, moduleRoot, shared);
|
|
118569
118824
|
if (!compiled) return null;
|
|
118570
118825
|
return {
|
|
118571
118826
|
metadata: compiled.metadata,
|
|
@@ -118588,14 +118843,14 @@ function compiledModuleRequestHandler(label, compile2, options2) {
|
|
|
118588
118843
|
res.setHeader("Cross-Origin-Resource-Policy", "cross-origin");
|
|
118589
118844
|
const root = url.searchParams.get("root");
|
|
118590
118845
|
const host2 = req.headers.host;
|
|
118591
|
-
if (req.method !== "GET" || !root || !
|
|
118846
|
+
if (req.method !== "GET" || !root || !import_node_path171.default.isAbsolute(root) || !host2) {
|
|
118592
118847
|
res.writeHead(400);
|
|
118593
118848
|
res.end(`${label} compilation needs GET with an absolute app root`);
|
|
118594
118849
|
return;
|
|
118595
118850
|
}
|
|
118596
118851
|
try {
|
|
118597
118852
|
const iosTarget = url.searchParams.get("iosTarget") ?? void 0;
|
|
118598
|
-
const app =
|
|
118853
|
+
const app = import_node_fs169.default.realpathSync(root);
|
|
118599
118854
|
const key2 = `${host2}\0${app}\0${iosTarget ?? ""}\0${url.searchParams.get("configuration") ?? ""}`;
|
|
118600
118855
|
const assetOrigin = `http://${host2}`;
|
|
118601
118856
|
const build2 = () => compile2(app, assetOrigin, iosTarget, url.searchParams);
|
|
@@ -118622,12 +118877,12 @@ function compiledModuleRequestHandler(label, compile2, options2) {
|
|
|
118622
118877
|
}
|
|
118623
118878
|
};
|
|
118624
118879
|
}
|
|
118625
|
-
var
|
|
118880
|
+
var import_node_fs169, import_node_path171, NITRO_ROUTE, handleNitroRequest;
|
|
118626
118881
|
var init_nitro_bundle = __esm({
|
|
118627
118882
|
"src/nitro-bundle.ts"() {
|
|
118628
118883
|
"use strict";
|
|
118629
|
-
|
|
118630
|
-
|
|
118884
|
+
import_node_fs169 = __toESM(require("node:fs"), 1);
|
|
118885
|
+
import_node_path171 = __toESM(require("node:path"), 1);
|
|
118631
118886
|
init_app_config();
|
|
118632
118887
|
init_backend_origin();
|
|
118633
118888
|
init_expo_native_workspace();
|
|
@@ -118642,10 +118897,10 @@ var init_nitro_bundle = __esm({
|
|
|
118642
118897
|
handleNitroRequest = compiledModuleRequestHandler(
|
|
118643
118898
|
"Nitro",
|
|
118644
118899
|
(root, origin, iosTarget, params) => {
|
|
118645
|
-
const
|
|
118646
|
-
if (
|
|
118900
|
+
const configuration2 = params.get("configuration");
|
|
118901
|
+
if (configuration2 !== "Debug" && configuration2 !== "Release")
|
|
118647
118902
|
throw new Error("Nitro compilation needs configuration=Debug or Release");
|
|
118648
|
-
return compileNitroApp(root, origin,
|
|
118903
|
+
return compileNitroApp(root, origin, configuration2, void 0, true, iosTarget);
|
|
118649
118904
|
},
|
|
118650
118905
|
{
|
|
118651
118906
|
configuredNativeSources: true,
|
|
@@ -118663,7 +118918,7 @@ __export(expo_widgets_bundle_exports, {
|
|
|
118663
118918
|
handleExpoWidgetsRequest: () => handleExpoWidgetsRequest
|
|
118664
118919
|
});
|
|
118665
118920
|
async function buildExpoWidgetsBundle(appRoot, origin = "") {
|
|
118666
|
-
const require2 = (0, import_node_module25.createRequire)(
|
|
118921
|
+
const require2 = (0, import_node_module25.createRequire)(import_node_path172.default.join(appRoot, "package.json"));
|
|
118667
118922
|
let manifest;
|
|
118668
118923
|
try {
|
|
118669
118924
|
manifest = require2.resolve("expo-widgets/package.json");
|
|
@@ -118672,16 +118927,16 @@ async function buildExpoWidgetsBundle(appRoot, origin = "") {
|
|
|
118672
118927
|
return null;
|
|
118673
118928
|
throw error;
|
|
118674
118929
|
}
|
|
118675
|
-
const packageDir =
|
|
118930
|
+
const packageDir = import_node_path172.default.dirname(manifest);
|
|
118676
118931
|
const runtimeBundle = await withSwiftRootLock(
|
|
118677
|
-
|
|
118932
|
+
import_node_path172.default.join(await import_promises19.default.realpath(packageDir), "bundle"),
|
|
118678
118933
|
async () => {
|
|
118679
118934
|
await (0, import_node_util23.promisify)(import_node_child_process76.execFile)(
|
|
118680
118935
|
process.env.NODE_BINARY || "node",
|
|
118681
|
-
[
|
|
118936
|
+
[import_node_path172.default.join(packageDir, "scripts/build-bundle.mjs"), appRoot],
|
|
118682
118937
|
{ cwd: appRoot, maxBuffer: 16 * 1024 * 1024 }
|
|
118683
118938
|
);
|
|
118684
|
-
return import_promises19.default.readFile(
|
|
118939
|
+
return import_promises19.default.readFile(import_node_path172.default.join(packageDir, "bundle/build/ExpoWidgets.bundle"), "utf8");
|
|
118685
118940
|
}
|
|
118686
118941
|
);
|
|
118687
118942
|
const catalog = await stageExpoWidgetAssets(appRoot, origin);
|
|
@@ -118692,14 +118947,14 @@ async function buildExpoWidgetsBundle(appRoot, origin = "") {
|
|
|
118692
118947
|
}
|
|
118693
118948
|
};
|
|
118694
118949
|
}
|
|
118695
|
-
var import_node_child_process76, import_promises19, import_node_module25,
|
|
118950
|
+
var import_node_child_process76, import_promises19, import_node_module25, import_node_path172, import_node_util23, EXPO_WIDGETS_ROUTE, handleExpoWidgetsRequest;
|
|
118696
118951
|
var init_expo_widgets_bundle = __esm({
|
|
118697
118952
|
"src/expo-widgets-bundle.ts"() {
|
|
118698
118953
|
"use strict";
|
|
118699
118954
|
import_node_child_process76 = require("node:child_process");
|
|
118700
118955
|
import_promises19 = __toESM(require("node:fs/promises"), 1);
|
|
118701
118956
|
import_node_module25 = require("node:module");
|
|
118702
|
-
|
|
118957
|
+
import_node_path172 = __toESM(require("node:path"), 1);
|
|
118703
118958
|
import_node_util23 = require("node:util");
|
|
118704
118959
|
init_expo_widget_assets();
|
|
118705
118960
|
init_staged_host_files();
|
|
@@ -119258,12 +119513,12 @@ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SH
|
|
|
119258
119513
|
if (current2.length > 0) buckets.push(current2);
|
|
119259
119514
|
const stem2 = name3.slice(0, -".swift".length);
|
|
119260
119515
|
return buckets.map((bucket, shardIndex) => {
|
|
119261
|
-
const
|
|
119516
|
+
const parts2 = [];
|
|
119262
119517
|
let openEnum = null;
|
|
119263
119518
|
let enumBody = [];
|
|
119264
119519
|
const flushEnum = () => {
|
|
119265
119520
|
if (!openEnum) return;
|
|
119266
|
-
|
|
119521
|
+
parts2.push(`extension ${openEnum} {
|
|
119267
119522
|
${enumBody.join("\n\n")}
|
|
119268
119523
|
}`);
|
|
119269
119524
|
openEnum = null;
|
|
@@ -119278,11 +119533,11 @@ ${enumBody.join("\n\n")}
|
|
|
119278
119533
|
enumBody.push(chunk.text);
|
|
119279
119534
|
} else {
|
|
119280
119535
|
flushEnum();
|
|
119281
|
-
|
|
119536
|
+
parts2.push(chunk.text);
|
|
119282
119537
|
}
|
|
119283
119538
|
}
|
|
119284
119539
|
flushEnum();
|
|
119285
|
-
return [`${stem2}_${shardIndex}.swift`, `${header}${
|
|
119540
|
+
return [`${stem2}_${shardIndex}.swift`, `${header}${parts2.join("\n\n")}
|
|
119286
119541
|
`];
|
|
119287
119542
|
});
|
|
119288
119543
|
}
|
|
@@ -119290,16 +119545,16 @@ async function oneSDKLinkSources(appRoot, preparedRoot, options2 = {}) {
|
|
|
119290
119545
|
const selected = await selectOneSDK(appRoot);
|
|
119291
119546
|
if (!selected) throw new Error("prepared app has no One SDK imports");
|
|
119292
119547
|
const { one, frameworks } = selected;
|
|
119293
|
-
const sourceRoot =
|
|
119548
|
+
const sourceRoot = import_node_path173.default.join(preparedRoot, ONE_SDK_SOURCE_DIRECTORY);
|
|
119294
119549
|
const generated = readOneSDKSourceManifest(
|
|
119295
|
-
JSON.parse(
|
|
119550
|
+
JSON.parse(import_node_fs170.default.readFileSync(import_node_path173.default.join(sourceRoot, "manifest.json"), "utf8"))
|
|
119296
119551
|
);
|
|
119297
119552
|
const { generation } = JSON.parse(
|
|
119298
|
-
|
|
119553
|
+
import_node_fs170.default.readFileSync(import_node_path173.default.join(one, "ios-bindings/manifest.json"), "utf8")
|
|
119299
119554
|
);
|
|
119300
119555
|
if (generated.generation !== generation) {
|
|
119301
119556
|
const { version: version2 } = JSON.parse(
|
|
119302
|
-
|
|
119557
|
+
import_node_fs170.default.readFileSync(import_node_path173.default.join(one, "package.json"), "utf8")
|
|
119303
119558
|
);
|
|
119304
119559
|
throw new Error(
|
|
119305
119560
|
`${appRoot} has One ${version2} installed, which differs from the One its lockfile resolves. Install its dependencies, restart its dev server and open it again.`
|
|
@@ -119319,12 +119574,12 @@ async function oneSDKLinkSources(appRoot, preparedRoot, options2 = {}) {
|
|
|
119319
119574
|
"SDKViews/OneNativeViewsTable.swift"
|
|
119320
119575
|
])
|
|
119321
119576
|
targets.set(
|
|
119322
|
-
`Sources/One/${
|
|
119323
|
-
|
|
119577
|
+
`Sources/One/${import_node_path173.default.basename(source)}`,
|
|
119578
|
+
import_node_fs170.default.readFileSync(import_node_path173.default.join(one, "ios", source), "utf8")
|
|
119324
119579
|
);
|
|
119325
119580
|
for (const name3 of generated.files) {
|
|
119326
119581
|
const filePath = `Sources/OneSDKBindings/${name3}`;
|
|
119327
|
-
const source =
|
|
119582
|
+
const source = import_node_fs170.default.readFileSync(import_node_path173.default.join(sourceRoot, name3), "utf8");
|
|
119328
119583
|
if (options2.shard) {
|
|
119329
119584
|
for (const [shardedName, shardedSource] of shardOneSDKBindingSource(
|
|
119330
119585
|
filePath,
|
|
@@ -119352,10 +119607,10 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
|
|
|
119352
119607
|
const optimize = options2.optimize ?? true;
|
|
119353
119608
|
const sources = await oneSDKLinkSources(appRoot, preparedRoot, { shard: !optimize });
|
|
119354
119609
|
const moduleRoot = moduleRootOverride ?? (await resolveSwiftModule()).root;
|
|
119355
|
-
const packagePath =
|
|
119610
|
+
const packagePath = import_node_path173.default.join(
|
|
119356
119611
|
swiftCacheDir(),
|
|
119357
119612
|
"peach-one-sdk-swift",
|
|
119358
|
-
(0, import_node_crypto102.createHash)("sha256").update(
|
|
119613
|
+
(0, import_node_crypto102.createHash)("sha256").update(import_node_fs170.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
|
|
119359
119614
|
"sdk"
|
|
119360
119615
|
);
|
|
119361
119616
|
const bindingFlags = optimize ? '["-suppress-warnings"]' : '["-suppress-warnings", "-Onone", "-no-whole-module-optimization"]';
|
|
@@ -119374,10 +119629,10 @@ let package = Package(name: "OneSDKGuest", targets: [
|
|
|
119374
119629
|
for (const [name3, source] of sources.targets) files2.set(name3, source);
|
|
119375
119630
|
for (const [name3, source] of sources.entry) files2.set(`Sources/App/${name3}`, source);
|
|
119376
119631
|
files2.set("Sources/App/App.swift", oneSDKApp);
|
|
119377
|
-
|
|
119632
|
+
import_node_fs170.default.mkdirSync(packagePath, { recursive: true });
|
|
119378
119633
|
syncSwiftTree(
|
|
119379
119634
|
packagePath,
|
|
119380
|
-
new Map([...files2].map(([name3, source]) => [
|
|
119635
|
+
new Map([...files2].map(([name3, source]) => [import_node_path173.default.join(packagePath, name3), source]))
|
|
119381
119636
|
);
|
|
119382
119637
|
const project2 = projectFor(packagePath);
|
|
119383
119638
|
project2.oneModule = false;
|
|
@@ -119402,13 +119657,13 @@ async function buildOneSDKBundle(appRoot) {
|
|
|
119402
119657
|
assets: await compiledModuleAssets(compiled.artifact)
|
|
119403
119658
|
};
|
|
119404
119659
|
}
|
|
119405
|
-
var import_node_crypto102,
|
|
119660
|
+
var import_node_crypto102, import_node_fs170, import_node_path173, ONE_SDK_ROUTE, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES, handleOneSDKRequest;
|
|
119406
119661
|
var init_one_sdk_bundle = __esm({
|
|
119407
119662
|
"src/one-sdk-bundle.ts"() {
|
|
119408
119663
|
"use strict";
|
|
119409
119664
|
import_node_crypto102 = require("node:crypto");
|
|
119410
|
-
|
|
119411
|
-
|
|
119665
|
+
import_node_fs170 = __toESM(require("node:fs"), 1);
|
|
119666
|
+
import_node_path173 = __toESM(require("node:path"), 1);
|
|
119412
119667
|
init_expo_native_workspace();
|
|
119413
119668
|
init_nitro_bundle();
|
|
119414
119669
|
init_one_sdk_preparation();
|
|
@@ -119485,8 +119740,8 @@ async function compileTurboApp(appRoot, origin, moduleRoot, iosTarget, prepareRe
|
|
|
119485
119740
|
}
|
|
119486
119741
|
const { artifact, collection } = await compileTurboModule({
|
|
119487
119742
|
appRoot,
|
|
119488
|
-
reactNativeRoot:
|
|
119489
|
-
(0, import_node_module26.createRequire)(
|
|
119743
|
+
reactNativeRoot: import_node_path174.default.dirname(
|
|
119744
|
+
(0, import_node_module26.createRequire)(import_node_path174.default.join(projectRoot, "package.json")).resolve(
|
|
119490
119745
|
"react-native/package.json"
|
|
119491
119746
|
)
|
|
119492
119747
|
),
|
|
@@ -119524,12 +119779,12 @@ async function buildTurboBundle(appRoot, moduleRoot, prepareReactNativeCore) {
|
|
|
119524
119779
|
assets: compiled.artifact ? await compiledModuleAssets(compiled.artifact) : []
|
|
119525
119780
|
};
|
|
119526
119781
|
}
|
|
119527
|
-
var import_node_module26,
|
|
119782
|
+
var import_node_module26, import_node_path174, TURBO_ROUTE, handleTurboRequest;
|
|
119528
119783
|
var init_turbo_bundle = __esm({
|
|
119529
119784
|
"src/turbo-bundle.ts"() {
|
|
119530
119785
|
"use strict";
|
|
119531
119786
|
import_node_module26 = require("node:module");
|
|
119532
|
-
|
|
119787
|
+
import_node_path174 = __toESM(require("node:path"), 1);
|
|
119533
119788
|
init_app_project();
|
|
119534
119789
|
init_app_config();
|
|
119535
119790
|
init_expo_native_prebuilt();
|
|
@@ -119581,7 +119836,7 @@ var init_androidAutolinkingContract = __esm({
|
|
|
119581
119836
|
|
|
119582
119837
|
// src/android-autolinking.ts
|
|
119583
119838
|
async function resolveExpoAndroidAutolinking(appRoot) {
|
|
119584
|
-
const root =
|
|
119839
|
+
const root = import_node_fs171.default.realpathSync(appRoot);
|
|
119585
119840
|
const existing = resolving.get(root);
|
|
119586
119841
|
if (existing) return existing;
|
|
119587
119842
|
const pending = resolveAndroidModules(root);
|
|
@@ -119595,7 +119850,7 @@ async function resolveExpoAndroidAutolinking(appRoot) {
|
|
|
119595
119850
|
async function resolveAndroidModules(appRoot) {
|
|
119596
119851
|
let autolinker;
|
|
119597
119852
|
try {
|
|
119598
|
-
autolinker = (0, import_node_module27.createRequire)(
|
|
119853
|
+
autolinker = (0, import_node_module27.createRequire)(import_node_path175.default.join(appRoot, "package.json")).resolve(
|
|
119599
119854
|
"expo-modules-autolinking/package.json"
|
|
119600
119855
|
);
|
|
119601
119856
|
} catch (error) {
|
|
@@ -119603,7 +119858,7 @@ async function resolveAndroidModules(appRoot) {
|
|
|
119603
119858
|
throw error;
|
|
119604
119859
|
}
|
|
119605
119860
|
const output = await runAutolinker(
|
|
119606
|
-
|
|
119861
|
+
import_node_path175.default.join(import_node_path175.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
|
|
119607
119862
|
["resolve", "--platform", "android", "--project-root", appRoot, "--json"],
|
|
119608
119863
|
{
|
|
119609
119864
|
timeout: 3e4,
|
|
@@ -119649,13 +119904,13 @@ async function resolveReactNativeAndroidAutolinking(appRoot) {
|
|
|
119649
119904
|
}
|
|
119650
119905
|
return linked;
|
|
119651
119906
|
}
|
|
119652
|
-
var
|
|
119907
|
+
var import_node_fs171, import_node_module27, import_node_path175, resolving;
|
|
119653
119908
|
var init_android_autolinking = __esm({
|
|
119654
119909
|
"src/android-autolinking.ts"() {
|
|
119655
119910
|
"use strict";
|
|
119656
|
-
|
|
119911
|
+
import_node_fs171 = __toESM(require("node:fs"), 1);
|
|
119657
119912
|
import_node_module27 = require("node:module");
|
|
119658
|
-
|
|
119913
|
+
import_node_path175 = __toESM(require("node:path"), 1);
|
|
119659
119914
|
init_androidAutolinkingContract();
|
|
119660
119915
|
init_autolinker_process();
|
|
119661
119916
|
init_is_record();
|
|
@@ -119666,8 +119921,8 @@ var init_android_autolinking = __esm({
|
|
|
119666
119921
|
|
|
119667
119922
|
// src/android-bridge-dependencies.ts
|
|
119668
119923
|
async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
119669
|
-
const root =
|
|
119670
|
-
if (!
|
|
119924
|
+
const root = import_node_path176.default.join(appRoot, "android");
|
|
119925
|
+
if (!import_node_fs172.default.existsSync(import_node_path176.default.join(root, "gradlew"))) return null;
|
|
119671
119926
|
const dependencies = (await resolveReactNativeAndroidAutolinking(appRoot)).flatMap(
|
|
119672
119927
|
(dependency) => dependency.sourceDir === null || dependency.packageInstance === null ? [] : [
|
|
119673
119928
|
{
|
|
@@ -119681,7 +119936,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
119681
119936
|
const models = await resolveAndroidGradleSources({
|
|
119682
119937
|
root,
|
|
119683
119938
|
projects: [
|
|
119684
|
-
|
|
119939
|
+
import_node_path176.default.join(root, "app"),
|
|
119685
119940
|
...dependencies.map((dependency) => dependency.sourceDir)
|
|
119686
119941
|
],
|
|
119687
119942
|
variant: "debug"
|
|
@@ -119691,7 +119946,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
119691
119946
|
const toolchain = readToolchain(moduleRoot);
|
|
119692
119947
|
const [sdk2, ready] = await Promise.all([
|
|
119693
119948
|
installKotlinSdkArchive(
|
|
119694
|
-
|
|
119949
|
+
import_node_fs172.default.readFileSync(import_node_path176.default.join(moduleRoot, "sdk.tar.gz")),
|
|
119695
119950
|
toolchain.compiler
|
|
119696
119951
|
),
|
|
119697
119952
|
ensureToolchain(toolchain)
|
|
@@ -119699,7 +119954,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
119699
119954
|
const packages = [];
|
|
119700
119955
|
for (const dependency of dependencies) {
|
|
119701
119956
|
const model = models.find(
|
|
119702
|
-
(entry) => entry.projectDir ===
|
|
119957
|
+
(entry) => entry.projectDir === import_node_fs172.default.realpathSync(dependency.sourceDir)
|
|
119703
119958
|
);
|
|
119704
119959
|
try {
|
|
119705
119960
|
const className2 = /^import\s+([\w.]+)\s*;$/.exec(
|
|
@@ -119738,12 +119993,12 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
119738
119993
|
}
|
|
119739
119994
|
return packages.length ? { applicationId, packages } : null;
|
|
119740
119995
|
}
|
|
119741
|
-
var
|
|
119996
|
+
var import_node_fs172, import_node_path176;
|
|
119742
119997
|
var init_android_bridge_dependencies = __esm({
|
|
119743
119998
|
"src/android-bridge-dependencies.ts"() {
|
|
119744
119999
|
"use strict";
|
|
119745
|
-
|
|
119746
|
-
|
|
120000
|
+
import_node_fs172 = __toESM(require("node:fs"), 1);
|
|
120001
|
+
import_node_path176 = __toESM(require("node:path"), 1);
|
|
119747
120002
|
init_android_autolinking();
|
|
119748
120003
|
init_android_gradle_sources();
|
|
119749
120004
|
init_java_module_abi();
|
|
@@ -119771,8 +120026,8 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
119771
120026
|
for (const project2 of entry.projects) {
|
|
119772
120027
|
if (!isRecord(project2) || typeof project2.sourceDir !== "string" || !Array.isArray(project2.modules))
|
|
119773
120028
|
throw new Error("invalid Expo Android project");
|
|
119774
|
-
const sourceDir =
|
|
119775
|
-
const installed2 = sourceDir.split(
|
|
120029
|
+
const sourceDir = import_node_fs173.default.realpathSync(project2.sourceDir);
|
|
120030
|
+
const installed2 = sourceDir.split(import_node_path177.default.sep).includes("node_modules");
|
|
119776
120031
|
if (installed2) {
|
|
119777
120032
|
if (typeof entry.packageName !== "string") continue;
|
|
119778
120033
|
if (peachAnsweredNativePackages().has(entry.packageName)) {
|
|
@@ -119800,9 +120055,9 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
119800
120055
|
group.unsupported ??= reason;
|
|
119801
120056
|
};
|
|
119802
120057
|
const walk4 = (dir) => {
|
|
119803
|
-
if (!
|
|
119804
|
-
for (const child of
|
|
119805
|
-
const file =
|
|
120058
|
+
if (!import_node_fs173.default.existsSync(dir)) return;
|
|
120059
|
+
for (const child of import_node_fs173.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
120060
|
+
const file = import_node_path177.default.join(dir, child.name);
|
|
119806
120061
|
if (child.isSymbolicLink()) reject(`Expo Kotlin source is a symlink: ${file}`);
|
|
119807
120062
|
else if (child.isDirectory()) walk4(file);
|
|
119808
120063
|
else if (child.name.endsWith(".java"))
|
|
@@ -119810,8 +120065,8 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
119810
120065
|
else if (child.name.endsWith(".kt")) group.sources.push(file);
|
|
119811
120066
|
}
|
|
119812
120067
|
};
|
|
119813
|
-
walk4(
|
|
119814
|
-
walk4(
|
|
120068
|
+
walk4(import_node_path177.default.join(sourceDir, "src", "main", "java"));
|
|
120069
|
+
walk4(import_node_path177.default.join(sourceDir, "src", "main", "kotlin"));
|
|
119815
120070
|
result.push(group);
|
|
119816
120071
|
}
|
|
119817
120072
|
}
|
|
@@ -119824,7 +120079,7 @@ async function collectBridgePackages(appRoot) {
|
|
|
119824
120079
|
);
|
|
119825
120080
|
const app = androidAppSources(appRoot);
|
|
119826
120081
|
if (!app || !app.kotlin.some(
|
|
119827
|
-
(file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(
|
|
120082
|
+
(file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(import_node_fs173.default.readFileSync(file, "utf8"))
|
|
119828
120083
|
))
|
|
119829
120084
|
return dependencies;
|
|
119830
120085
|
const { scanBridgeFiles: scanBridgeFiles2 } = await Promise.resolve().then(() => (init_kotlin_host(), kotlin_host_exports));
|
|
@@ -119939,7 +120194,7 @@ async function handleExpoKotlinRequest(req, res) {
|
|
|
119939
120194
|
return true;
|
|
119940
120195
|
}
|
|
119941
120196
|
const root = url.searchParams.get("root");
|
|
119942
|
-
if (!root || !
|
|
120197
|
+
if (!root || !import_node_path177.default.isAbsolute(root)) {
|
|
119943
120198
|
res.writeHead(400);
|
|
119944
120199
|
res.end("missing absolute app root");
|
|
119945
120200
|
return true;
|
|
@@ -119970,12 +120225,12 @@ async function handleExpoKotlinRequest(req, res) {
|
|
|
119970
120225
|
}
|
|
119971
120226
|
return true;
|
|
119972
120227
|
}
|
|
119973
|
-
var
|
|
120228
|
+
var import_node_fs173, import_node_path177, EXPO_KOTLIN_ROUTE, compiling;
|
|
119974
120229
|
var init_expo_kotlin_host = __esm({
|
|
119975
120230
|
"src/expo-kotlin-host.ts"() {
|
|
119976
120231
|
"use strict";
|
|
119977
|
-
|
|
119978
|
-
|
|
120232
|
+
import_node_fs173 = __toESM(require("node:fs"), 1);
|
|
120233
|
+
import_node_path177 = __toESM(require("node:path"), 1);
|
|
119979
120234
|
init_android_autolinking();
|
|
119980
120235
|
init_android_bridge_dependencies();
|
|
119981
120236
|
init_android_bridge_packages();
|
|
@@ -119998,14 +120253,14 @@ function sharedDesktopAuthAccounts(user) {
|
|
|
119998
120253
|
function getBaseDir() {
|
|
119999
120254
|
const explicit = process.env[SESSION_FILE_ENV];
|
|
120000
120255
|
if (explicit?.trim()) {
|
|
120001
|
-
return (0,
|
|
120256
|
+
return (0, import_node_path178.dirname)((0, import_node_path178.resolve)(explicit));
|
|
120002
120257
|
}
|
|
120003
120258
|
return electronUserDataDir();
|
|
120004
120259
|
}
|
|
120005
120260
|
function getSharedDesktopAuthFilePath() {
|
|
120006
120261
|
const explicit = process.env[SESSION_FILE_ENV];
|
|
120007
|
-
if (explicit?.trim()) return (0,
|
|
120008
|
-
return (0,
|
|
120262
|
+
if (explicit?.trim()) return (0, import_node_path178.resolve)(explicit);
|
|
120263
|
+
return (0, import_node_path178.join)(getBaseDir(), "desktop-auth.json");
|
|
120009
120264
|
}
|
|
120010
120265
|
function normalizeUser(input) {
|
|
120011
120266
|
if (!input || typeof input !== "object") return null;
|
|
@@ -120055,27 +120310,27 @@ function normalizeSession(input) {
|
|
|
120055
120310
|
}
|
|
120056
120311
|
function readSharedDesktopAuthSession() {
|
|
120057
120312
|
const filepath = getSharedDesktopAuthFilePath();
|
|
120058
|
-
if (!(0,
|
|
120313
|
+
if (!(0, import_node_fs174.existsSync)(filepath)) return null;
|
|
120059
120314
|
try {
|
|
120060
|
-
const parsed2 = JSON.parse((0,
|
|
120315
|
+
const parsed2 = JSON.parse((0, import_node_fs174.readFileSync)(filepath, "utf8"));
|
|
120061
120316
|
const normalized = normalizeSession(parsed2);
|
|
120062
120317
|
if (!normalized) {
|
|
120063
|
-
(0,
|
|
120318
|
+
(0, import_node_fs174.rmSync)(filepath, { force: true });
|
|
120064
120319
|
return null;
|
|
120065
120320
|
}
|
|
120066
120321
|
return normalized;
|
|
120067
120322
|
} catch {
|
|
120068
|
-
(0,
|
|
120323
|
+
(0, import_node_fs174.rmSync)(filepath, { force: true });
|
|
120069
120324
|
return null;
|
|
120070
120325
|
}
|
|
120071
120326
|
}
|
|
120072
|
-
var import_node_crypto103,
|
|
120327
|
+
var import_node_crypto103, import_node_fs174, import_node_path178, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
|
|
120073
120328
|
var init_shared_session = __esm({
|
|
120074
120329
|
"src/auth/shared-session.ts"() {
|
|
120075
120330
|
"use strict";
|
|
120076
120331
|
import_node_crypto103 = require("node:crypto");
|
|
120077
|
-
|
|
120078
|
-
|
|
120332
|
+
import_node_fs174 = require("node:fs");
|
|
120333
|
+
import_node_path178 = require("node:path");
|
|
120079
120334
|
init_home_paths();
|
|
120080
120335
|
init_public_brand();
|
|
120081
120336
|
SESSION_VERSION = 1;
|
|
@@ -120110,31 +120365,31 @@ var init_run_rnx = __esm({
|
|
|
120110
120365
|
|
|
120111
120366
|
// cli/secure-file.ts
|
|
120112
120367
|
function writeSecureJsonAtomic(filepath, value, { durable = true } = {}) {
|
|
120113
|
-
(0,
|
|
120368
|
+
(0, import_node_fs175.mkdirSync)((0, import_node_path179.dirname)(filepath), { recursive: true });
|
|
120114
120369
|
const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto104.randomUUID)()}`;
|
|
120115
120370
|
let descriptor = null;
|
|
120116
120371
|
try {
|
|
120117
|
-
descriptor = (0,
|
|
120118
|
-
(0,
|
|
120119
|
-
(0,
|
|
120372
|
+
descriptor = (0, import_node_fs175.openSync)(temporary, "wx", 384);
|
|
120373
|
+
(0, import_node_fs175.fchmodSync)(descriptor, 384);
|
|
120374
|
+
(0, import_node_fs175.writeFileSync)(descriptor, `${JSON.stringify(value, null, 2)}
|
|
120120
120375
|
`);
|
|
120121
|
-
if (durable) (0,
|
|
120122
|
-
(0,
|
|
120376
|
+
if (durable) (0, import_node_fs175.fsyncSync)(descriptor);
|
|
120377
|
+
(0, import_node_fs175.closeSync)(descriptor);
|
|
120123
120378
|
descriptor = null;
|
|
120124
|
-
(0,
|
|
120379
|
+
(0, import_node_fs175.renameSync)(temporary, filepath);
|
|
120125
120380
|
} catch (error) {
|
|
120126
|
-
if (descriptor !== null) (0,
|
|
120127
|
-
(0,
|
|
120381
|
+
if (descriptor !== null) (0, import_node_fs175.closeSync)(descriptor);
|
|
120382
|
+
(0, import_node_fs175.rmSync)(temporary, { force: true });
|
|
120128
120383
|
throw error;
|
|
120129
120384
|
}
|
|
120130
120385
|
}
|
|
120131
|
-
var import_node_crypto104,
|
|
120386
|
+
var import_node_crypto104, import_node_fs175, import_node_path179;
|
|
120132
120387
|
var init_secure_file = __esm({
|
|
120133
120388
|
"cli/secure-file.ts"() {
|
|
120134
120389
|
"use strict";
|
|
120135
120390
|
import_node_crypto104 = require("node:crypto");
|
|
120136
|
-
|
|
120137
|
-
|
|
120391
|
+
import_node_fs175 = require("node:fs");
|
|
120392
|
+
import_node_path179 = require("node:path");
|
|
120138
120393
|
}
|
|
120139
120394
|
});
|
|
120140
120395
|
|
|
@@ -120184,25 +120439,25 @@ function isCliApiKeySecret(secret) {
|
|
|
120184
120439
|
return secret.startsWith("sk_rnx_");
|
|
120185
120440
|
}
|
|
120186
120441
|
function savedApiKeyFile() {
|
|
120187
|
-
return
|
|
120442
|
+
return import_node_path180.default.join(rnxHomeDir(), "api-key.json");
|
|
120188
120443
|
}
|
|
120189
120444
|
function readApiKeyFile(file) {
|
|
120190
|
-
if (!(0,
|
|
120191
|
-
const secret = (0,
|
|
120445
|
+
if (!(0, import_node_fs176.existsSync)(file)) return null;
|
|
120446
|
+
const secret = (0, import_node_fs176.readFileSync)(file, "utf8").trim();
|
|
120192
120447
|
return isCliApiKeySecret(secret) ? secret : null;
|
|
120193
120448
|
}
|
|
120194
120449
|
function saveApiKey(secret) {
|
|
120195
120450
|
writeSecureJsonAtomic(savedApiKeyFile(), { secret });
|
|
120196
120451
|
}
|
|
120197
120452
|
function forgetApiKey() {
|
|
120198
|
-
if (!(0,
|
|
120199
|
-
(0,
|
|
120453
|
+
if (!(0, import_node_fs176.existsSync)(savedApiKeyFile())) return false;
|
|
120454
|
+
(0, import_node_fs176.rmSync)(savedApiKeyFile());
|
|
120200
120455
|
return true;
|
|
120201
120456
|
}
|
|
120202
120457
|
function readSavedApiKey() {
|
|
120203
|
-
if (!(0,
|
|
120458
|
+
if (!(0, import_node_fs176.existsSync)(savedApiKeyFile())) return null;
|
|
120204
120459
|
const saved = savedKeySchema.safeParse(
|
|
120205
|
-
JSON.parse((0,
|
|
120460
|
+
JSON.parse((0, import_node_fs176.readFileSync)(savedApiKeyFile(), "utf8"))
|
|
120206
120461
|
);
|
|
120207
120462
|
return saved.success && isCliApiKeySecret(saved.data.secret) ? saved.data.secret : null;
|
|
120208
120463
|
}
|
|
@@ -120260,12 +120515,12 @@ function authHeaderOrExit(commandLabel) {
|
|
|
120260
120515
|
);
|
|
120261
120516
|
rnxExit(1);
|
|
120262
120517
|
}
|
|
120263
|
-
var
|
|
120518
|
+
var import_node_fs176, import_node_path180, import_zod3, GITHUB_TOKEN_PREFIXES, DOWNLOADED_API_KEY_FILE, savedKeySchema, CHOOSE_ACCOUNT_HINT;
|
|
120264
120519
|
var init_auth = __esm({
|
|
120265
120520
|
"cli/auth.ts"() {
|
|
120266
120521
|
"use strict";
|
|
120267
|
-
|
|
120268
|
-
|
|
120522
|
+
import_node_fs176 = require("node:fs");
|
|
120523
|
+
import_node_path180 = __toESM(require("node:path"), 1);
|
|
120269
120524
|
import_zod3 = require("peachsim/vendor/zod");
|
|
120270
120525
|
init_shared_session();
|
|
120271
120526
|
init_home_paths();
|
|
@@ -121080,9 +121335,9 @@ function metroIosAssetLocationSuffixes(httpServerLocation) {
|
|
|
121080
121335
|
const variants = [dropped];
|
|
121081
121336
|
if (dropped[0] === "assets" && dropped.length > 1) variants.push(dropped.slice(1));
|
|
121082
121337
|
const suffixes = [];
|
|
121083
|
-
for (const
|
|
121084
|
-
const swapped =
|
|
121085
|
-
for (const candidate of [
|
|
121338
|
+
for (const parts2 of variants) {
|
|
121339
|
+
const swapped = parts2.map(swapNodeModulesPrefix);
|
|
121340
|
+
for (const candidate of [parts2, swapped]) {
|
|
121086
121341
|
const suffix = candidate.join("/");
|
|
121087
121342
|
if (suffix && !suffixes.includes(suffix)) suffixes.push(suffix);
|
|
121088
121343
|
}
|
|
@@ -121181,17 +121436,17 @@ async function embedMetroAssetFiles(bundle, sites, read) {
|
|
|
121181
121436
|
});
|
|
121182
121437
|
embedded.set(key2, { fileUris, fileHashes: fileHashes2, scales });
|
|
121183
121438
|
}
|
|
121184
|
-
const
|
|
121439
|
+
const parts2 = [];
|
|
121185
121440
|
let cursor = 0;
|
|
121186
121441
|
for (const site of sites) {
|
|
121187
121442
|
const entry = embedded.get(assetDescriptorKey(site.descriptor));
|
|
121188
121443
|
if (!entry) continue;
|
|
121189
|
-
|
|
121190
|
-
|
|
121444
|
+
parts2.push(bundle.slice(cursor, site.start));
|
|
121445
|
+
parts2.push(rewriteDescriptorObject(bundle, site, entry));
|
|
121191
121446
|
cursor = site.end;
|
|
121192
121447
|
}
|
|
121193
|
-
|
|
121194
|
-
const code =
|
|
121448
|
+
parts2.push(bundle.slice(cursor));
|
|
121449
|
+
const code = parts2.join("");
|
|
121195
121450
|
if (countNewlines(code) !== countNewlines(bundle)) {
|
|
121196
121451
|
throw new Error(
|
|
121197
121452
|
"peach Cloud asset embedding changed the bundle line count, which invalidates its source map"
|
|
@@ -122494,13 +122749,13 @@ function createCloudSession(input) {
|
|
|
122494
122749
|
}
|
|
122495
122750
|
return session;
|
|
122496
122751
|
}
|
|
122497
|
-
var import_node_crypto105,
|
|
122752
|
+
var import_node_crypto105, import_node_fs177, import_node_path181, CLOUD_SESSION_VERSION, MAX_ENCODED_SESSION_BYTES, RNX_SHELL_UPDATE_PREFIX, RNX_SHELL_UPDATE_SET_PREFIX, RNX_SHELL_UPDATE_UNSET;
|
|
122498
122753
|
var init_cloud_session = __esm({
|
|
122499
122754
|
"cli/cloud-session.ts"() {
|
|
122500
122755
|
"use strict";
|
|
122501
122756
|
import_node_crypto105 = require("node:crypto");
|
|
122502
|
-
|
|
122503
|
-
|
|
122757
|
+
import_node_fs177 = require("node:fs");
|
|
122758
|
+
import_node_path181 = require("node:path");
|
|
122504
122759
|
init_backend_origin();
|
|
122505
122760
|
init_home_paths();
|
|
122506
122761
|
init_is_record();
|
|
@@ -122583,12 +122838,12 @@ var init_run_registry = __esm({
|
|
|
122583
122838
|
});
|
|
122584
122839
|
|
|
122585
122840
|
// cli/stream-record.ts
|
|
122586
|
-
var
|
|
122841
|
+
var import_node_fs178, import_node_path182, import_zod4, sceneCommandEndpoint, streamRecord;
|
|
122587
122842
|
var init_stream_record = __esm({
|
|
122588
122843
|
"cli/stream-record.ts"() {
|
|
122589
122844
|
"use strict";
|
|
122590
|
-
|
|
122591
|
-
|
|
122845
|
+
import_node_fs178 = require("node:fs");
|
|
122846
|
+
import_node_path182 = require("node:path");
|
|
122592
122847
|
import_zod4 = require("peachsim/vendor/zod");
|
|
122593
122848
|
init_home_paths();
|
|
122594
122849
|
init_secure_file();
|
|
@@ -122644,27 +122899,27 @@ function resolveCloudOrigin(value) {
|
|
|
122644
122899
|
return normalizeCloudOrigin(source);
|
|
122645
122900
|
}
|
|
122646
122901
|
function readImmutableBundleSource(bundlePath, command) {
|
|
122647
|
-
const filepath = (0,
|
|
122648
|
-
if ((0,
|
|
122902
|
+
const filepath = (0, import_node_path183.resolve)(bundlePath);
|
|
122903
|
+
if ((0, import_node_path183.extname)(filepath) === ".hbc") {
|
|
122649
122904
|
const platform3 = filepath.includes("/android/") ? "android" : "ios";
|
|
122650
122905
|
throw new Error(
|
|
122651
122906
|
`${command} cannot preview Hermes bytecode (${bundlePath}). Export plain JavaScript with \`npx expo export --platform ${platform3} --no-bytecode\` and preview the .js bundle instead.`
|
|
122652
122907
|
);
|
|
122653
122908
|
}
|
|
122654
|
-
if ((0,
|
|
122909
|
+
if ((0, import_node_path183.extname)(filepath) !== ".js") {
|
|
122655
122910
|
throw new Error(`${command} requires one local .js bundle`);
|
|
122656
122911
|
}
|
|
122657
|
-
const descriptor = (0,
|
|
122912
|
+
const descriptor = (0, import_node_fs179.openSync)(filepath, "r");
|
|
122658
122913
|
try {
|
|
122659
|
-
const before = (0,
|
|
122914
|
+
const before = (0, import_node_fs179.fstatSync)(descriptor, { bigint: true });
|
|
122660
122915
|
if (!before.isFile()) {
|
|
122661
122916
|
throw new Error(`${command} bundle must be a regular local file`);
|
|
122662
122917
|
}
|
|
122663
122918
|
if (before.size <= 0n) {
|
|
122664
122919
|
throw new Error(`${command} bundle is empty`);
|
|
122665
122920
|
}
|
|
122666
|
-
const bytes = (0,
|
|
122667
|
-
const after = (0,
|
|
122921
|
+
const bytes = (0, import_node_fs179.readFileSync)(descriptor);
|
|
122922
|
+
const after = (0, import_node_fs179.fstatSync)(descriptor, { bigint: true });
|
|
122668
122923
|
if (before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeNs !== after.mtimeNs || bytes.length !== Number(before.size)) {
|
|
122669
122924
|
throw new Error(`${command} bundle changed while it was being read`);
|
|
122670
122925
|
}
|
|
@@ -122676,7 +122931,7 @@ function readImmutableBundleSource(bundlePath, command) {
|
|
|
122676
122931
|
}
|
|
122677
122932
|
return source;
|
|
122678
122933
|
} finally {
|
|
122679
|
-
(0,
|
|
122934
|
+
(0, import_node_fs179.closeSync)(descriptor);
|
|
122680
122935
|
}
|
|
122681
122936
|
}
|
|
122682
122937
|
async function fetchBundleSource(bundleUrl, command) {
|
|
@@ -122730,15 +122985,15 @@ async function loadBundleSource(bundleInput, command) {
|
|
|
122730
122985
|
return source;
|
|
122731
122986
|
}
|
|
122732
122987
|
function listMetroAssetDest(assetsPath) {
|
|
122733
|
-
const directory2 = (0,
|
|
122734
|
-
if (!(0,
|
|
122735
|
-
const skipNested = (0,
|
|
122988
|
+
const directory2 = (0, import_node_path183.resolve)(assetsPath);
|
|
122989
|
+
if (!(0, import_node_fs179.existsSync)(directory2)) return { directory: directory2, files: [], truncated: false };
|
|
122990
|
+
const skipNested = (0, import_node_fs179.existsSync)((0, import_node_path183.join)(directory2, "package.json"));
|
|
122736
122991
|
const files2 = [];
|
|
122737
122992
|
let truncated = false;
|
|
122738
122993
|
const walk4 = (dir, prefix) => {
|
|
122739
122994
|
let entries2;
|
|
122740
122995
|
try {
|
|
122741
|
-
entries2 = (0,
|
|
122996
|
+
entries2 = (0, import_node_fs179.readdirSync)(dir, { withFileTypes: true });
|
|
122742
122997
|
} catch {
|
|
122743
122998
|
return;
|
|
122744
122999
|
}
|
|
@@ -122750,7 +123005,7 @@ function listMetroAssetDest(assetsPath) {
|
|
|
122750
123005
|
if (entry.isDirectory()) {
|
|
122751
123006
|
if (entry.name === ".git") continue;
|
|
122752
123007
|
if (skipNested && PROJECT_ONLY_DIRECTORIES.has(entry.name)) continue;
|
|
122753
|
-
walk4((0,
|
|
123008
|
+
walk4((0, import_node_path183.join)(dir, entry.name), prefix ? `${prefix}/${entry.name}` : entry.name);
|
|
122754
123009
|
} else if (entry.isFile()) {
|
|
122755
123010
|
files2.push(prefix ? `${prefix}/${entry.name}` : entry.name);
|
|
122756
123011
|
}
|
|
@@ -122785,7 +123040,7 @@ function distinctByContent(directory2, options2) {
|
|
|
122785
123040
|
for (const relative5 of options2) {
|
|
122786
123041
|
let bytes;
|
|
122787
123042
|
try {
|
|
122788
|
-
bytes = (0,
|
|
123043
|
+
bytes = (0, import_node_fs179.readFileSync)((0, import_node_path183.join)(directory2, relative5));
|
|
122789
123044
|
} catch {
|
|
122790
123045
|
continue;
|
|
122791
123046
|
}
|
|
@@ -122831,7 +123086,7 @@ function placeMetroDescriptor(listing, descriptor) {
|
|
|
122831
123086
|
let bytes;
|
|
122832
123087
|
try {
|
|
122833
123088
|
bytes = combination.map(
|
|
122834
|
-
(relative5) => (0,
|
|
123089
|
+
(relative5) => (0, import_node_fs179.readFileSync)((0, import_node_path183.join)(listing.directory, relative5))
|
|
122835
123090
|
);
|
|
122836
123091
|
} catch {
|
|
122837
123092
|
continue;
|
|
@@ -122859,10 +123114,10 @@ function unverifiedContentKey(dest, fileDigests2) {
|
|
|
122859
123114
|
return JSON.stringify(
|
|
122860
123115
|
dest.placements.map(
|
|
122861
123116
|
(placement) => placement.verified ? null : [...placement.files].map(([scale, relative5]) => {
|
|
122862
|
-
const file = (0,
|
|
123117
|
+
const file = (0, import_node_path183.join)(dest.directory, relative5);
|
|
122863
123118
|
let digest3 = fileDigests2.get(file);
|
|
122864
123119
|
if (digest3 === void 0) {
|
|
122865
|
-
digest3 = (0, import_node_crypto106.createHash)("sha256").update((0,
|
|
123120
|
+
digest3 = (0, import_node_crypto106.createHash)("sha256").update((0, import_node_fs179.readFileSync)(file)).digest("hex");
|
|
122866
123121
|
fileDigests2.set(file, digest3);
|
|
122867
123122
|
}
|
|
122868
123123
|
return [scale, digest3];
|
|
@@ -122871,42 +123126,42 @@ function unverifiedContentKey(dest, fileDigests2) {
|
|
|
122871
123126
|
);
|
|
122872
123127
|
}
|
|
122873
123128
|
function findExpoExportRoot(bundleDirectory) {
|
|
122874
|
-
let directory2 = (0,
|
|
123129
|
+
let directory2 = (0, import_node_path183.resolve)(bundleDirectory);
|
|
122875
123130
|
for (let depth = 0; depth < 6; depth++) {
|
|
122876
|
-
const metadata = (0,
|
|
122877
|
-
if ((0,
|
|
123131
|
+
const metadata = (0, import_node_path183.join)(directory2, "metadata.json");
|
|
123132
|
+
if ((0, import_node_fs179.existsSync)(metadata) && (0, import_node_fs179.existsSync)((0, import_node_path183.join)(directory2, "assets"))) {
|
|
122878
123133
|
try {
|
|
122879
|
-
if ((0,
|
|
123134
|
+
if ((0, import_node_fs179.readFileSync)(metadata, "utf8").includes('"fileMetadata"')) {
|
|
122880
123135
|
return directory2;
|
|
122881
123136
|
}
|
|
122882
123137
|
} catch {
|
|
122883
123138
|
}
|
|
122884
123139
|
}
|
|
122885
|
-
const parent = (0,
|
|
123140
|
+
const parent = (0, import_node_path183.dirname)(directory2);
|
|
122886
123141
|
if (parent === directory2) return null;
|
|
122887
123142
|
directory2 = parent;
|
|
122888
123143
|
}
|
|
122889
123144
|
return null;
|
|
122890
123145
|
}
|
|
122891
123146
|
function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory) {
|
|
122892
|
-
const bundleDirectory = (0,
|
|
123147
|
+
const bundleDirectory = (0, import_node_path183.dirname)((0, import_node_path183.resolve)(bundlePath));
|
|
122893
123148
|
const expoRoot = assetsDirectory || isRemoteBundleInput(bundlePath) ? null : findExpoExportRoot(bundleDirectory);
|
|
122894
|
-
const candidates = assetsDirectory ? [(0,
|
|
122895
|
-
...expoRoot ? [(0,
|
|
122896
|
-
(0,
|
|
123149
|
+
const candidates = assetsDirectory ? [(0, import_node_path183.resolve)(assetsDirectory)] : [
|
|
123150
|
+
...expoRoot ? [(0, import_node_path183.join)(expoRoot, "assets")] : [],
|
|
123151
|
+
(0, import_node_path183.join)(bundleDirectory, "assets"),
|
|
122897
123152
|
bundleDirectory,
|
|
122898
|
-
(0,
|
|
123153
|
+
(0, import_node_path183.resolve)(bundleDirectory, "..", "assets")
|
|
122899
123154
|
];
|
|
122900
123155
|
const cwd = process.cwd();
|
|
122901
123156
|
let projectDirectory = null;
|
|
122902
123157
|
for (const start of assetsDirectory ? [] : [bundleDirectory, cwd]) {
|
|
122903
|
-
let directory2 = (0,
|
|
123158
|
+
let directory2 = (0, import_node_path183.resolve)(start);
|
|
122904
123159
|
while (true) {
|
|
122905
123160
|
if (detectProject(directory2)?.hasMetroConfig) {
|
|
122906
123161
|
projectDirectory = directory2;
|
|
122907
123162
|
break;
|
|
122908
123163
|
}
|
|
122909
|
-
const parent = (0,
|
|
123164
|
+
const parent = (0, import_node_path183.dirname)(directory2);
|
|
122910
123165
|
if (parent === directory2) break;
|
|
122911
123166
|
directory2 = parent;
|
|
122912
123167
|
}
|
|
@@ -122914,11 +123169,11 @@ function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory)
|
|
|
122914
123169
|
}
|
|
122915
123170
|
if (projectDirectory) {
|
|
122916
123171
|
candidates.push(
|
|
122917
|
-
(0,
|
|
122918
|
-
(0,
|
|
122919
|
-
(0,
|
|
122920
|
-
(0,
|
|
122921
|
-
(0,
|
|
123172
|
+
(0, import_node_path183.join)(projectDirectory, "assets"),
|
|
123173
|
+
(0, import_node_path183.join)(projectDirectory, "dist"),
|
|
123174
|
+
(0, import_node_path183.join)(projectDirectory, "dist", "assets"),
|
|
123175
|
+
(0, import_node_path183.join)(projectDirectory, "build"),
|
|
123176
|
+
(0, import_node_path183.join)(projectDirectory, "build", "assets")
|
|
122922
123177
|
);
|
|
122923
123178
|
}
|
|
122924
123179
|
const searched = [];
|
|
@@ -122926,7 +123181,7 @@ function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory)
|
|
|
122926
123181
|
const stale = [];
|
|
122927
123182
|
let truncated = false;
|
|
122928
123183
|
for (const candidate of candidates) {
|
|
122929
|
-
const directory2 = (0,
|
|
123184
|
+
const directory2 = (0, import_node_path183.resolve)(candidate);
|
|
122930
123185
|
if (searched.includes(directory2)) continue;
|
|
122931
123186
|
searched.push(directory2);
|
|
122932
123187
|
const listing = listMetroAssetDest(directory2);
|
|
@@ -123007,20 +123262,20 @@ async function produceCloudArtifact(bundlePath, maxBytes = MAX_RNX_CLOUD_BUNDLE_
|
|
|
123007
123262
|
}
|
|
123008
123263
|
function bundleAppProject(bundlePath) {
|
|
123009
123264
|
if (isRemoteBundleInput(bundlePath)) return null;
|
|
123010
|
-
for (let dir = (0,
|
|
123011
|
-
const manifest = (0,
|
|
123012
|
-
if ((0,
|
|
123013
|
-
const json = JSON.parse((0,
|
|
123265
|
+
for (let dir = (0, import_node_path183.dirname)((0, import_node_path183.resolve)(bundlePath)); ; dir = (0, import_node_path183.dirname)(dir)) {
|
|
123266
|
+
const manifest = (0, import_node_path183.join)(dir, "package.json");
|
|
123267
|
+
if ((0, import_node_fs179.existsSync)(manifest)) {
|
|
123268
|
+
const json = JSON.parse((0, import_node_fs179.readFileSync)(manifest, "utf8"));
|
|
123014
123269
|
if (isRecord(json) && [json.dependencies, json.devDependencies].some(
|
|
123015
123270
|
(dependencies) => isRecord(dependencies) && "react-native" in dependencies
|
|
123016
123271
|
))
|
|
123017
123272
|
return dir;
|
|
123018
123273
|
}
|
|
123019
|
-
if ((0,
|
|
123274
|
+
if ((0, import_node_path183.dirname)(dir) === dir) return null;
|
|
123020
123275
|
}
|
|
123021
123276
|
}
|
|
123022
123277
|
async function embedBundleAssets(bundlePath, command, assetPolicy, assetsDirectory, assetServer, nativeProjectDir) {
|
|
123023
|
-
const project2 = nativeProjectDir ? (0,
|
|
123278
|
+
const project2 = nativeProjectDir ? (0, import_node_path183.resolve)(nativeProjectDir) : bundleAppProject(bundlePath);
|
|
123024
123279
|
const loaded4 = await loadBundleSource(bundlePath, command);
|
|
123025
123280
|
const source = project2 && !readPackageVersionsFooter(loaded4)?.["react-native"] ? insertPackageVersionsFooter(
|
|
123026
123281
|
loaded4,
|
|
@@ -123061,7 +123316,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy, assetsDirecto
|
|
|
123061
123316
|
);
|
|
123062
123317
|
}
|
|
123063
123318
|
const relative5 = placement?.files.get(variant2.scale);
|
|
123064
|
-
if (relative5 && dest) return (0,
|
|
123319
|
+
if (relative5 && dest) return (0, import_node_fs179.readFileSync)((0, import_node_path183.join)(dest.directory, relative5));
|
|
123065
123320
|
if (assetServer) {
|
|
123066
123321
|
const filename2 = metroAssetScaleFilename(
|
|
123067
123322
|
variant2.descriptor.name,
|
|
@@ -123109,7 +123364,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy, assetsDirecto
|
|
|
123109
123364
|
);
|
|
123110
123365
|
const classic = metroIosAssetDestRelatives(variant2.descriptor.httpServerLocation, filename)[0] ?? filename;
|
|
123111
123366
|
throw new Error(
|
|
123112
|
-
`${command} could not read ${(0,
|
|
123367
|
+
`${command} could not read ${(0, import_node_path183.join)(dest?.directory ?? ".", classic)} for ${variant2.descriptor.name}.${variant2.descriptor.type} at scale ${variant2.scale}, and has no stand-in for a .${variant2.descriptor.type} asset. Rebuild with \`react-native bundle --assets-dest\`.`
|
|
123113
123368
|
);
|
|
123114
123369
|
});
|
|
123115
123370
|
return {
|
|
@@ -123256,13 +123511,13 @@ async function createCloudBox(options2) {
|
|
|
123256
123511
|
warnings: artifact.warnings
|
|
123257
123512
|
};
|
|
123258
123513
|
}
|
|
123259
|
-
var import_node_crypto106,
|
|
123514
|
+
var import_node_crypto106, import_node_fs179, import_node_path183, import_node_vm, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, PREVIEW_COMMAND, NanoDevelopmentOnlyError, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS;
|
|
123260
123515
|
var init_cloud_client = __esm({
|
|
123261
123516
|
"cli/cloud-client.ts"() {
|
|
123262
123517
|
"use strict";
|
|
123263
123518
|
import_node_crypto106 = require("node:crypto");
|
|
123264
|
-
|
|
123265
|
-
|
|
123519
|
+
import_node_fs179 = require("node:fs");
|
|
123520
|
+
import_node_path183 = require("node:path");
|
|
123266
123521
|
import_node_vm = require("node:vm");
|
|
123267
123522
|
init_package_versions();
|
|
123268
123523
|
init_metroAssetArtifact();
|
|
@@ -125656,9 +125911,9 @@ var delimiter = ":";
|
|
|
125656
125911
|
function isAbsolute3(p) {
|
|
125657
125912
|
return p.charCodeAt(0) === 47;
|
|
125658
125913
|
}
|
|
125659
|
-
function normalizeSegments(
|
|
125914
|
+
function normalizeSegments(parts2, allowAboveRoot) {
|
|
125660
125915
|
const out = [];
|
|
125661
|
-
for (const part of
|
|
125916
|
+
for (const part of parts2) {
|
|
125662
125917
|
if (part === "" || part === ".") continue;
|
|
125663
125918
|
if (part === "..") {
|
|
125664
125919
|
if (out.length > 0 && out[out.length - 1] !== "..") out.pop();
|
|
@@ -125682,23 +125937,23 @@ function normalize(p) {
|
|
|
125682
125937
|
if (trailingSlash) joined += "/";
|
|
125683
125938
|
return absolute ? "/" + joined : joined;
|
|
125684
125939
|
}
|
|
125685
|
-
function join22(...
|
|
125686
|
-
const present =
|
|
125940
|
+
function join22(...parts2) {
|
|
125941
|
+
const present = parts2.filter((part) => part.length > 0);
|
|
125687
125942
|
if (present.length === 0) return ".";
|
|
125688
125943
|
return normalize(present.join("/"));
|
|
125689
125944
|
}
|
|
125690
|
-
function resolve5(...
|
|
125945
|
+
function resolve5(...parts2) {
|
|
125691
125946
|
let resolved = "";
|
|
125692
125947
|
let absolute = false;
|
|
125693
|
-
for (let i =
|
|
125694
|
-
const part =
|
|
125948
|
+
for (let i = parts2.length - 1; i >= 0 && !absolute; i--) {
|
|
125949
|
+
const part = parts2[i];
|
|
125695
125950
|
if (part.length === 0) continue;
|
|
125696
125951
|
resolved = resolved.length > 0 ? `${part}/${resolved}` : part;
|
|
125697
125952
|
absolute = isAbsolute3(part);
|
|
125698
125953
|
}
|
|
125699
125954
|
if (!absolute)
|
|
125700
125955
|
throw new Error(
|
|
125701
|
-
`posixPath.resolve needs an absolute segment, got: ${
|
|
125956
|
+
`posixPath.resolve needs an absolute segment, got: ${parts2.join(", ")}`
|
|
125702
125957
|
);
|
|
125703
125958
|
const normalized = normalizeSegments(resolved.split("/"), false).join("/");
|
|
125704
125959
|
return normalized.length > 0 ? "/" + normalized : "/";
|
|
@@ -127828,8 +128083,8 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
127828
128083
|
});
|
|
127829
128084
|
const envEditor = process.env.REACT_EDITOR || process.env.EDITOR;
|
|
127830
128085
|
if (envEditor) {
|
|
127831
|
-
const
|
|
127832
|
-
if (
|
|
128086
|
+
const parts2 = envEditor.split(" ").filter(Boolean);
|
|
128087
|
+
if (parts2.length && await trySpawn(parts2[0], [...parts2.slice(1), "-g", target]))
|
|
127833
128088
|
return;
|
|
127834
128089
|
}
|
|
127835
128090
|
if (await trySpawn("cursor", ["-g", target])) return;
|
|
@@ -128320,17 +128575,17 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
128320
128575
|
this.writeConnectedRuntimeSnapshot();
|
|
128321
128576
|
}
|
|
128322
128577
|
describeSimLoss(sim, code, reason) {
|
|
128323
|
-
const
|
|
128578
|
+
const parts2 = [];
|
|
128324
128579
|
const hostInitiated = this.hostCloseCauseBySocket.get(sim.ws);
|
|
128325
|
-
if (hostInitiated)
|
|
128580
|
+
if (hostInitiated) parts2.push(hostInitiated);
|
|
128326
128581
|
if (typeof code === "number") {
|
|
128327
128582
|
const trimmed = reason?.trim();
|
|
128328
128583
|
const socket = code === SOOTSIM_BRIDGE_SIM_CLOSE_CODE ? `bridge closed sim socket (${code})` : `sim socket closed (${code}${trimmed ? `, ${trimmed}` : ""})`;
|
|
128329
|
-
|
|
128584
|
+
parts2.push(socket);
|
|
128330
128585
|
} else {
|
|
128331
|
-
|
|
128586
|
+
parts2.push("sim socket closed");
|
|
128332
128587
|
}
|
|
128333
|
-
return
|
|
128588
|
+
return parts2.join("; ");
|
|
128334
128589
|
}
|
|
128335
128590
|
getRestorableSimState(simId) {
|
|
128336
128591
|
const snapshot = this.restorableSims.get(simId);
|