peachsim 0.1.2633 → 0.1.2635
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 +1027 -900
- 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-G52HY6SM.mjs → acorn-ZUYXI5AL.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-RFOIAO3R.mjs → chunk-2WKODWW2.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-RDKGAR7Q.mjs → chunk-45KWNAQZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-53O5O5G3.mjs → chunk-5H6XV6MH.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-XIIMFZNV.mjs → chunk-6LSTK2UZ.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-RK7OADCF.mjs → chunk-BDDOD223.mjs} +42 -32
- package/dist-lib/esm-chunks/{chunk-QG5X4QGH.mjs → chunk-CHBIOTOU.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-UIWCC5CL.mjs → chunk-D6JBYJK5.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-2HONUZR5.mjs → chunk-FR3MMNYM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-5G5JC3BO.mjs → chunk-FTEMA7JL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FMPZXHCH.mjs → chunk-HPUCZYDZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GOOWNGNO.mjs → chunk-HULUKI32.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YGGDE6F4.mjs → chunk-JEM666RM.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-QRIQ2Z7A.mjs → chunk-MY2EI7XX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-F3YEDOHY.mjs → chunk-NIALPJQY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JXGUFZNW.mjs → chunk-O45S4BVV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-IYR6EA7F.mjs → chunk-O63VTURH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6QNPQ4SG.mjs → chunk-PFCT5XAG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YX3KDBUQ.mjs → chunk-PZKU54NZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QNJWVYGV.mjs → chunk-QVVJOFD5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RMO7B3V3.mjs → chunk-RVNVUWSB.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JXAUTMVF.mjs → chunk-RYVMVNBJ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GFBC7EHF.mjs → chunk-SEMEF7CC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OOH2FHFR.mjs → chunk-XLUNYYS3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-AF22LKX3.mjs → chunk-XN2XKGGC.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-PQYC5COZ.mjs → metro-layout-parser-4JTPL4KD.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-5XWQHVOU.mjs → swift-package-prebuilt-ZATCVVZB.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-ICX3VS5Z.mjs → swift-sdk-app-module-PVK73UKJ.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-KI37XSBI.mjs → swift-sdk-image-PIXWKN64.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-G5HVINR2.mjs → swift-sdk-image-producer-TGRFG2MU.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +31 -21
- 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 +7575 -7354
- 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 +15 -15
- 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 +85 -85
- package/dist-lib/public-origins-lib.json +89 -82
- 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 +8181 -7950
- package/dist-lib/swift-compile.cjs +29 -19
- package/dist-lib/swift-compile.mjs +12 -12
- 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/acorn.cjs +1 -1
- package/dist-lib/vendor/magic-string.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/dist-types/packages/peach-engine/src/engine/native-node-queries.d.ts +1 -0
- package/package.json +1 -1
- package/src/host/bridge-host.ts +42 -20
- package/src/native-package-slice-build.ts +44 -31
- package/src/one-native-controls-package.ts +80 -14
- package/src/one-native-controls-release.ts +69 -0
- package/src/one-sdk/shard.ts +382 -0
- package/src/one-sdk-bundle.ts +4 -208
- package/src/swift-compile.ts +44 -19
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2635 | (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;
|
|
@@ -273,8 +273,8 @@ function getDefaultPortForProtocol(protocol) {
|
|
|
273
273
|
return protocol === "https:" ? 443 : 80;
|
|
274
274
|
}
|
|
275
275
|
function isBaseServerUrl(url) {
|
|
276
|
-
const
|
|
277
|
-
return (
|
|
276
|
+
const path145 = url.pathname || "/";
|
|
277
|
+
return (path145 === "/" || path145 === "") && !url.search && !url.hash;
|
|
278
278
|
}
|
|
279
279
|
async function resolvePortViaServerScan(port) {
|
|
280
280
|
try {
|
|
@@ -5813,8 +5813,8 @@ function metadataValue(value, key2) {
|
|
|
5813
5813
|
if (!value || typeof value !== "object") return void 0;
|
|
5814
5814
|
return Object.getOwnPropertyDescriptor(value, key2)?.value;
|
|
5815
5815
|
}
|
|
5816
|
-
function readProjectJson(
|
|
5817
|
-
const text7 = readProjectMetadata(
|
|
5816
|
+
function readProjectJson(path145, files2 = nodeRepoFileReader) {
|
|
5817
|
+
const text7 = readProjectMetadata(path145, files2);
|
|
5818
5818
|
if (text7 === null) return null;
|
|
5819
5819
|
try {
|
|
5820
5820
|
const value = JSON.parse(text7);
|
|
@@ -6071,16 +6071,16 @@ function createGitignoreMatcher() {
|
|
|
6071
6071
|
return matcher;
|
|
6072
6072
|
},
|
|
6073
6073
|
test(relativePath2) {
|
|
6074
|
-
const { path:
|
|
6075
|
-
if (!
|
|
6076
|
-
const parts =
|
|
6074
|
+
const { path: path145, isDirectory: isDirectory5 } = normalizePath(relativePath2);
|
|
6075
|
+
if (!path145) return { ignored: false, unignored: false };
|
|
6076
|
+
const parts = path145.split("/");
|
|
6077
6077
|
let prefix = "";
|
|
6078
6078
|
for (let i = 0; i < parts.length - 1; i++) {
|
|
6079
6079
|
prefix = prefix ? `${prefix}/${parts[i]}` : parts[i];
|
|
6080
6080
|
const parent = matchSingle(prefix, true);
|
|
6081
6081
|
if (parent.ignored) return { ignored: true, unignored: false };
|
|
6082
6082
|
}
|
|
6083
|
-
return matchSingle(
|
|
6083
|
+
return matchSingle(path145, isDirectory5);
|
|
6084
6084
|
},
|
|
6085
6085
|
ignores(relativePath2) {
|
|
6086
6086
|
return matcher.test(relativePath2).ignored;
|
|
@@ -10069,7 +10069,7 @@ var init_swift_objc_sdk_tree = __esm({
|
|
|
10069
10069
|
|
|
10070
10070
|
// src/swift-compiler-digest.ts
|
|
10071
10071
|
function swiftArchiveCompilerDigestValue() {
|
|
10072
|
-
return true ? "
|
|
10072
|
+
return true ? "7e04deb5ae5724cfafa726c1b8cf34d77f6eaf28d372c40e46314e2543a5b653" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname, "archive");
|
|
10073
10073
|
}
|
|
10074
10074
|
var import_node_crypto9, import_node_fs20, import_node_path16, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
|
|
10075
10075
|
var init_swift_compiler_digest = __esm({
|
|
@@ -10689,8 +10689,8 @@ export *
|
|
|
10689
10689
|
}`;
|
|
10690
10690
|
}
|
|
10691
10691
|
function swiftPackageIdentity(url) {
|
|
10692
|
-
const
|
|
10693
|
-
return (
|
|
10692
|
+
const path145 = url.endsWith("/") ? url.slice(0, -1) : url;
|
|
10693
|
+
return (path145.split("/").pop() ?? path145).replace(/\.git$/, "").toLowerCase();
|
|
10694
10694
|
}
|
|
10695
10695
|
function clangSettingEntries(settings, tool) {
|
|
10696
10696
|
return (settings ?? []).flatMap(
|
|
@@ -11336,10 +11336,10 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
|
|
|
11336
11336
|
const enclosing = scopes.length > 0 ? scopes[scopes.length - 1].prefix : [];
|
|
11337
11337
|
if (scope2?.[3] === "enum" && opens > 0 && /(^|\s)(public|open)\s/.test(scope2[2] ?? "") && !/\bwhere\b/.test(first.masked) && first.masked[scope2.index + scope2[0].length] !== "<") {
|
|
11338
11338
|
const name3 = scope2[4];
|
|
11339
|
-
const
|
|
11340
|
-
if (!byPath.has(
|
|
11339
|
+
const path145 = scopeOf(name3, enclosing, false);
|
|
11340
|
+
if (!byPath.has(path145.join(".")) && (path145.length === 1 || byPath.has(path145.slice(0, -1).join(".")))) {
|
|
11341
11341
|
const keptAttrs = [...(scope2[1] ?? "").matchAll(/@\w+(?:\([^)]*\))?/g)].map((attr) => attr[0]).filter((attr) => !attr.startsWith("@objc"));
|
|
11342
|
-
const id = `s:peach-synthesized-${module2}-${
|
|
11342
|
+
const id = `s:peach-synthesized-${module2}-${path145.join(".")}`;
|
|
11343
11343
|
const body = [];
|
|
11344
11344
|
let inner = 1;
|
|
11345
11345
|
let closed = false;
|
|
@@ -11394,15 +11394,15 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
|
|
|
11394
11394
|
symbols.push({
|
|
11395
11395
|
kind: { identifier: "swift.enum" },
|
|
11396
11396
|
identifier: { precise: id },
|
|
11397
|
-
pathComponents:
|
|
11397
|
+
pathComponents: path145,
|
|
11398
11398
|
declarationFragments: fragments,
|
|
11399
11399
|
accessLevel: "public"
|
|
11400
11400
|
});
|
|
11401
|
-
if (
|
|
11401
|
+
if (path145.length > 1)
|
|
11402
11402
|
relationships.push({
|
|
11403
11403
|
kind: "memberOf",
|
|
11404
11404
|
source: id,
|
|
11405
|
-
target: byPath.get(
|
|
11405
|
+
target: byPath.get(path145.slice(0, -1).join("."))
|
|
11406
11406
|
});
|
|
11407
11407
|
for (const kase of cases) {
|
|
11408
11408
|
const memberId = `${id}-${kase.leaf}`;
|
|
@@ -11411,7 +11411,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
|
|
|
11411
11411
|
symbols.push({
|
|
11412
11412
|
kind: { identifier: "swift.enum.case" },
|
|
11413
11413
|
identifier: { precise: memberId },
|
|
11414
|
-
pathComponents: [...
|
|
11414
|
+
pathComponents: [...path145, kase.leaf],
|
|
11415
11415
|
declarationFragments: [
|
|
11416
11416
|
{ kind: "keyword", spelling: "case" },
|
|
11417
11417
|
{ kind: "text", spelling: " " },
|
|
@@ -11427,7 +11427,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
|
|
|
11427
11427
|
symbols.push({
|
|
11428
11428
|
kind: { identifier: "swift.init" },
|
|
11429
11429
|
identifier: { precise: initId },
|
|
11430
|
-
pathComponents: [...
|
|
11430
|
+
pathComponents: [...path145, "init(rawValue:)"],
|
|
11431
11431
|
declarationFragments: [
|
|
11432
11432
|
{ kind: "keyword", spelling: "init" },
|
|
11433
11433
|
{ kind: "text", spelling: "?(" },
|
|
@@ -11506,7 +11506,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
11506
11506
|
})
|
|
11507
11507
|
)
|
|
11508
11508
|
);
|
|
11509
|
-
const trap = (
|
|
11509
|
+
const trap = (path145) => `fatalError("${path145} is ${options2.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
|
|
11510
11510
|
const skipped = [];
|
|
11511
11511
|
const behavior = options2.behavior ?? /* @__PURE__ */ new Map();
|
|
11512
11512
|
const used = /* @__PURE__ */ new Set();
|
|
@@ -11857,34 +11857,34 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
11857
11857
|
lines.push(...physical);
|
|
11858
11858
|
owners.push(...physical.map(() => current2));
|
|
11859
11859
|
};
|
|
11860
|
-
const emitAt = (
|
|
11861
|
-
if (omit.has(
|
|
11860
|
+
const emitAt = (path145, line) => {
|
|
11861
|
+
if (omit.has(path145)) return;
|
|
11862
11862
|
const previous = current2;
|
|
11863
|
-
current2 =
|
|
11863
|
+
current2 = path145;
|
|
11864
11864
|
emit(line);
|
|
11865
11865
|
current2 = previous;
|
|
11866
11866
|
};
|
|
11867
11867
|
const emitInertState = (id, indent2, build2) => {
|
|
11868
|
-
const
|
|
11868
|
+
const path145 = pathOf(byId.get(id));
|
|
11869
11869
|
emitAt(hiddenInit(id), `${indent2}init(_peachInert: Void) { ${build2} }`);
|
|
11870
11870
|
const list2 = conforms.get(id) ?? [];
|
|
11871
11871
|
const has = (name3) => (children.get(id) ?? []).some((member) => leaf(member) === name3);
|
|
11872
11872
|
if (list2.includes("Encodable") && !has("encode(to:)"))
|
|
11873
11873
|
emitAt(
|
|
11874
|
-
`${
|
|
11874
|
+
`${path145}.encode(to:)`,
|
|
11875
11875
|
`${indent2}public func encode(to encoder: Encoder) throws {}`
|
|
11876
11876
|
);
|
|
11877
11877
|
if (list2.includes("Decodable") && !has("init(from:)"))
|
|
11878
11878
|
emitAt(
|
|
11879
|
-
`${
|
|
11879
|
+
`${path145}.init(from:)`,
|
|
11880
11880
|
`${indent2}public init(from decoder: Decoder) throws { self.init(_peachInert: ()) }`
|
|
11881
11881
|
);
|
|
11882
11882
|
};
|
|
11883
11883
|
const scoped = (body) => (symbol2, ...rest) => {
|
|
11884
|
-
const
|
|
11885
|
-
if (omit.has(
|
|
11884
|
+
const path145 = pathOf(symbol2);
|
|
11885
|
+
if (omit.has(path145)) return void skipped.push({ path: path145, reason: omit.get(path145) });
|
|
11886
11886
|
const previous = current2;
|
|
11887
|
-
current2 =
|
|
11887
|
+
current2 = path145;
|
|
11888
11888
|
try {
|
|
11889
11889
|
body(symbol2, ...rest);
|
|
11890
11890
|
} finally {
|
|
@@ -11916,7 +11916,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
11916
11916
|
};
|
|
11917
11917
|
const emitMember = scoped(
|
|
11918
11918
|
(member, indent2, context) => {
|
|
11919
|
-
const
|
|
11919
|
+
const path145 = pathOf(member);
|
|
11920
11920
|
if (TYPE_KINDS.has(member.kind.identifier)) {
|
|
11921
11921
|
const origin = origins.get(member.identifier.precise)?.split(".")[0];
|
|
11922
11922
|
const parent = owner.get(member.identifier.precise);
|
|
@@ -11933,7 +11933,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
11933
11933
|
))
|
|
11934
11934
|
return;
|
|
11935
11935
|
if (!MEMBER_KINDS.has(member.kind.identifier)) {
|
|
11936
|
-
skipped.push({ path:
|
|
11936
|
+
skipped.push({ path: path145, reason: `unhandled ${member.kind.identifier}` });
|
|
11937
11937
|
return;
|
|
11938
11938
|
}
|
|
11939
11939
|
const { 1: spelledAttrs, 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
@@ -11944,15 +11944,15 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
11944
11944
|
const selector = context.inClass && !options2.inert && member.kind.identifier === "swift.type.method" && !/\basync\b/.test(rest) ? /^c:objc\(cs\)\w+\(cm\)([A-Za-z_][A-Za-z_0-9:]*)$/.exec(
|
|
11945
11945
|
member.identifier.precise
|
|
11946
11946
|
)?.[1] : void 0;
|
|
11947
|
-
const attrs = options2.unobjc?.has(
|
|
11947
|
+
const attrs = options2.unobjc?.has(path145) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : `${wrapped}${selector ? `@objc(${selector}) ` : ""}`;
|
|
11948
11948
|
const modifiers = /^((?:(?:required|final|override|convenience|unowned(?:\(\w+\))?|weak|lazy|nonisolated|mutating|nonmutating) )*)(.*)$/s.exec(
|
|
11949
11949
|
rest
|
|
11950
11950
|
);
|
|
11951
11951
|
const flags = new Set(
|
|
11952
11952
|
modifiers[1].trim().split(/\s+/).filter(Boolean).map((flag) => flag.replace(/\(.*/, ""))
|
|
11953
11953
|
);
|
|
11954
|
-
const requiredInit = context.inClass && !!options2.requiredInits?.has(
|
|
11955
|
-
const restatesRequired = context.inClass &&
|
|
11954
|
+
const requiredInit = context.inClass && !!options2.requiredInits?.has(path145);
|
|
11955
|
+
const restatesRequired = context.inClass && path145.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
|
|
11956
11956
|
(at) => options2.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
11957
11957
|
);
|
|
11958
11958
|
const protocolInit = member.kind.identifier === "swift.init" && /^c:objc\(pl\)\w+\(im\).*::SYNTHESIZED::c:objc\(cs\)/.test(
|
|
@@ -11962,7 +11962,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
11962
11962
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
11963
11963
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
11964
11964
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
11965
|
-
for (const type of options2.unwrappedParameters?.get(
|
|
11965
|
+
for (const type of options2.unwrappedParameters?.get(path145) ?? [])
|
|
11966
11966
|
core = core.replace(
|
|
11967
11967
|
new RegExp(
|
|
11968
11968
|
`(:\\s*(?:\\w+\\.)*${type.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})(?=\\s*[,)])`,
|
|
@@ -11970,12 +11970,12 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
11970
11970
|
),
|
|
11971
11971
|
"$1!"
|
|
11972
11972
|
);
|
|
11973
|
-
const override = context.inClass && !options2.plain?.has(
|
|
11973
|
+
const override = context.inClass && !options2.plain?.has(path145) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options2.forcedOverride?.has(path145) || isObjC(member) && path145.endsWith(".init()")) ? "override " : "";
|
|
11974
11974
|
const head = `${indent2}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
11975
|
-
const measured = behavior.get(
|
|
11976
|
-
if (measured) used.add(
|
|
11975
|
+
const measured = behavior.get(path145);
|
|
11976
|
+
if (measured) used.add(path145);
|
|
11977
11977
|
const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
|
|
11978
|
-
const body = overloadBody ?? measured?.body ?? (options2.inert ? inertBody(member) : trap(
|
|
11978
|
+
const body = overloadBody ?? measured?.body ?? (options2.inert ? inertBody(member) : trap(path145));
|
|
11979
11979
|
switch (member.kind.identifier) {
|
|
11980
11980
|
case "swift.property":
|
|
11981
11981
|
case "swift.type.property":
|
|
@@ -11988,13 +11988,13 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
11988
11988
|
const parameter = !measured && !options2.inert && !settable && /:\s*some\s/.test(decl) ? opaqueParameter(member) : void 0;
|
|
11989
11989
|
const getter = parameter ? `return ({ () -> ${parameter} in ${body} })()` : body;
|
|
11990
11990
|
const computed = decl.replace(/^((?:static |class )*)let /, "$1var ");
|
|
11991
|
-
const wrapper = options2.projections?.get(
|
|
11991
|
+
const wrapper = options2.projections?.get(path145);
|
|
11992
11992
|
if (wrapper) {
|
|
11993
11993
|
const type = /^var\s+`?\w+`?\s*:\s*(.+)$/s.exec(computed)?.[1];
|
|
11994
|
-
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [
|
|
11994
|
+
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path145]);
|
|
11995
11995
|
if (!initial)
|
|
11996
11996
|
return void skipped.push({
|
|
11997
|
-
path:
|
|
11997
|
+
path: path145,
|
|
11998
11998
|
reason: `wrapped by ${wrapper} with no inert initial value`
|
|
11999
11999
|
});
|
|
12000
12000
|
const own2 = new RegExp(
|
|
@@ -12015,7 +12015,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12015
12015
|
return;
|
|
12016
12016
|
}
|
|
12017
12017
|
emit(
|
|
12018
|
-
`${head.replace(/@NSCopying\b\s*/g, "")}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed2.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options2.inert ? "" : trap(
|
|
12018
|
+
`${head.replace(/@NSCopying\b\s*/g, "")}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed2.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options2.inert ? "" : trap(path145))} }` : ""} }`
|
|
12019
12019
|
);
|
|
12020
12020
|
return;
|
|
12021
12021
|
}
|
|
@@ -12074,7 +12074,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12074
12074
|
};
|
|
12075
12075
|
const emitType = scoped(
|
|
12076
12076
|
(symbol2, indent2) => {
|
|
12077
|
-
const
|
|
12077
|
+
const path145 = pathOf(symbol2);
|
|
12078
12078
|
const id = symbol2.identifier.precise;
|
|
12079
12079
|
const inner = `${indent2} `;
|
|
12080
12080
|
switch (symbol2.kind.identifier) {
|
|
@@ -12091,10 +12091,10 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12091
12091
|
case "swift.class": {
|
|
12092
12092
|
const shape = header(symbol2, "class", indent2);
|
|
12093
12093
|
if (!shape)
|
|
12094
|
-
return void skipped.push({ path:
|
|
12095
|
-
const parent = options2.superclasses?.get(
|
|
12094
|
+
return void skipped.push({ path: path145, reason: `unparsed class ${text(symbol2)}` });
|
|
12095
|
+
const parent = options2.superclasses?.get(path145) ?? superclass.get(id);
|
|
12096
12096
|
const blocked = classBlocked(id);
|
|
12097
|
-
if (blocked) return void skipped.push({ path:
|
|
12097
|
+
if (blocked) return void skipped.push({ path: path145, reason: blocked });
|
|
12098
12098
|
const ancestors = /* @__PURE__ */ new Set();
|
|
12099
12099
|
const inherited = /* @__PURE__ */ new Set();
|
|
12100
12100
|
for (let at = superId.get(id); at; at = superId.get(at)) {
|
|
@@ -12110,7 +12110,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12110
12110
|
"Equatable",
|
|
12111
12111
|
"CustomStringConvertible",
|
|
12112
12112
|
"CustomDebugStringConvertible"
|
|
12113
|
-
].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options2.unconformed?.get(
|
|
12113
|
+
].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options2.unconformed?.get(path145)?.has(name3.split(/::|\./).pop()) && !options2.unconformed?.get(path145)?.has(name3)
|
|
12114
12114
|
)
|
|
12115
12115
|
].filter((name3, at, all2) => all2.indexOf(name3) === at);
|
|
12116
12116
|
const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
|
|
@@ -12122,9 +12122,9 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12122
12122
|
`${indent2}${shape.attrs}${objcName ? `@objc(${objcName}) ` : ""}${shape.final}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
|
|
12123
12123
|
);
|
|
12124
12124
|
const members2 = membersOf(id);
|
|
12125
|
-
const extra = options2.behavior?.get(
|
|
12125
|
+
const extra = options2.behavior?.get(path145)?.members;
|
|
12126
12126
|
if (extra) {
|
|
12127
|
-
used.add(
|
|
12127
|
+
used.add(path145);
|
|
12128
12128
|
emit(`${inner}${extra}`);
|
|
12129
12129
|
}
|
|
12130
12130
|
for (const member of members2)
|
|
@@ -12180,11 +12180,11 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12180
12180
|
if (protocol && member.kind.identifier === "swift.method" && leaf(member).endsWith("()") && have.has(`instance|leaf|${leaf(member).slice(0, -2)}`))
|
|
12181
12181
|
propertyWitnesses.push({
|
|
12182
12182
|
owner: current2,
|
|
12183
|
-
head: `extension ${pathOf(protocol)} where Self: ${
|
|
12183
|
+
head: `extension ${pathOf(protocol)} where Self: ${path145} {`,
|
|
12184
12184
|
member,
|
|
12185
|
-
path:
|
|
12185
|
+
path: path145
|
|
12186
12186
|
});
|
|
12187
|
-
else emitWitness(member, inner,
|
|
12187
|
+
else emitWitness(member, inner, path145, open && isObjC(member));
|
|
12188
12188
|
}
|
|
12189
12189
|
}
|
|
12190
12190
|
if (options2.inert && designated2 && classBuild(id) === "hidden")
|
|
@@ -12192,13 +12192,13 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12192
12192
|
const coder = members2.some((member) => leaf(member) === "init(coder:)");
|
|
12193
12193
|
if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
12194
12194
|
emit(
|
|
12195
|
-
`${inner}public required init${options2.coderNonfailable?.has(
|
|
12195
|
+
`${inner}public required init${options2.coderNonfailable?.has(path145) ? "" : "?"}(coder: NSCoder) { ${options2.inert && !options2.coderNonfailable?.has(path145) ? "return nil" : trap(`${path145}.init(coder:)`)} }`
|
|
12196
12196
|
);
|
|
12197
12197
|
if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
|
|
12198
12198
|
(at) => options2.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
12199
12199
|
))
|
|
12200
12200
|
emit(
|
|
12201
|
-
`${inner}public required init() { ${options2.inert ? superInit(id) : trap(`${
|
|
12201
|
+
`${inner}public required init() { ${options2.inert ? superInit(id) : trap(`${path145}.init()`)} }`
|
|
12202
12202
|
);
|
|
12203
12203
|
emit(`${indent2}}`);
|
|
12204
12204
|
return;
|
|
@@ -12206,7 +12206,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12206
12206
|
case "swift.struct": {
|
|
12207
12207
|
const shape = header(symbol2, "struct", indent2);
|
|
12208
12208
|
if (!shape)
|
|
12209
|
-
return void skipped.push({ path:
|
|
12209
|
+
return void skipped.push({ path: path145, reason: `unparsed struct ${text(symbol2)}` });
|
|
12210
12210
|
const members2 = membersOf(id);
|
|
12211
12211
|
const raw2 = rawType(members2);
|
|
12212
12212
|
const list2 = inheritance(id);
|
|
@@ -12246,7 +12246,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12246
12246
|
emitInertState(
|
|
12247
12247
|
id,
|
|
12248
12248
|
inner,
|
|
12249
|
-
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [
|
|
12249
|
+
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path145]) ?? "0"}` : ""
|
|
12250
12250
|
);
|
|
12251
12251
|
emit(`${indent2}}`);
|
|
12252
12252
|
return;
|
|
@@ -12254,7 +12254,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12254
12254
|
case "swift.enum": {
|
|
12255
12255
|
const shape = header(symbol2, "enum", indent2);
|
|
12256
12256
|
if (!shape)
|
|
12257
|
-
return void skipped.push({ path:
|
|
12257
|
+
return void skipped.push({ path: path145, reason: `unparsed enum ${text(symbol2)}` });
|
|
12258
12258
|
const members2 = membersOf(id);
|
|
12259
12259
|
const cases = members2.filter(
|
|
12260
12260
|
(member) => member.kind.identifier === "swift.enum.case"
|
|
@@ -12264,7 +12264,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12264
12264
|
const missing2 = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
|
|
12265
12265
|
if (raw2 && (isObjC(symbol2) || /^c:@C?M@[^@]+@E@/.test(id)) && missing2.length > 0)
|
|
12266
12266
|
return void skipped.push({
|
|
12267
|
-
path:
|
|
12267
|
+
path: path145,
|
|
12268
12268
|
reason: `no header value for ${missing2.map(leaf).join(", ")}`
|
|
12269
12269
|
});
|
|
12270
12270
|
const list2 = inheritance(id, raw2 ?? void 0).filter(
|
|
@@ -12303,8 +12303,8 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12303
12303
|
});
|
|
12304
12304
|
}
|
|
12305
12305
|
if (options2.inert) {
|
|
12306
|
-
const value = options2.trapped?.has(hiddenInit(id)) ? null : inertValue(
|
|
12307
|
-
emitInertState(id, inner, value === null ? trap(
|
|
12306
|
+
const value = options2.trapped?.has(hiddenInit(id)) ? null : inertValue(path145, /* @__PURE__ */ new Set(), []);
|
|
12307
|
+
emitInertState(id, inner, value === null ? trap(path145) : `self = ${value}`);
|
|
12308
12308
|
}
|
|
12309
12309
|
emit(`${indent2}}`);
|
|
12310
12310
|
return;
|
|
@@ -12313,14 +12313,14 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12313
12313
|
const shape = header(symbol2, "protocol", indent2);
|
|
12314
12314
|
if (!shape)
|
|
12315
12315
|
return void skipped.push({
|
|
12316
|
-
path:
|
|
12316
|
+
path: path145,
|
|
12317
12317
|
reason: `unparsed protocol ${text(symbol2)}`
|
|
12318
12318
|
});
|
|
12319
12319
|
const native = nativeObjcProtocols.has(id);
|
|
12320
12320
|
const objcName = native ? /^c:objc\(pl\)(\w+)$/.exec(id)?.[1] : void 0;
|
|
12321
12321
|
if (native && !objcName)
|
|
12322
12322
|
return void skipped.push({
|
|
12323
|
-
path:
|
|
12323
|
+
path: path145,
|
|
12324
12324
|
reason: `unknown Objective-C protocol identity ${id}`
|
|
12325
12325
|
});
|
|
12326
12326
|
const list2 = [
|
|
@@ -12348,7 +12348,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12348
12348
|
}
|
|
12349
12349
|
emit(`${indent2}}`);
|
|
12350
12350
|
if (defaults.length > 0) {
|
|
12351
|
-
emit(`${indent2}extension ${
|
|
12351
|
+
emit(`${indent2}extension ${path145} {`);
|
|
12352
12352
|
for (const member of defaults) {
|
|
12353
12353
|
const decl = text(member);
|
|
12354
12354
|
if (optional3.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
|
|
@@ -12442,7 +12442,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12442
12442
|
return null;
|
|
12443
12443
|
};
|
|
12444
12444
|
const emitGlobal = scoped((symbol2) => {
|
|
12445
|
-
const
|
|
12445
|
+
const path145 = pathOf(symbol2);
|
|
12446
12446
|
const kind = symbol2.kind.identifier;
|
|
12447
12447
|
if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
|
|
12448
12448
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol2));
|
|
@@ -12451,20 +12451,20 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12451
12451
|
if (leaf(symbol2).endsWith("(_:)") && !/^(?:prefix|infix|postfix)\b/.test(spelled2))
|
|
12452
12452
|
spelled2 = `prefix ${spelled2}`;
|
|
12453
12453
|
}
|
|
12454
|
-
const measured = behavior.get(
|
|
12455
|
-
if (measured) used.add(
|
|
12454
|
+
const measured = behavior.get(path145);
|
|
12455
|
+
if (measured) used.add(path145);
|
|
12456
12456
|
const overloadBody = /\basync\b/.test(spelled2) ? measured?.asyncBody : /\bResult</.test(spelled2) ? measured?.resultBody : void 0;
|
|
12457
12457
|
emit(
|
|
12458
|
-
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(
|
|
12458
|
+
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path145))} }`
|
|
12459
12459
|
);
|
|
12460
12460
|
} else if (kind === "swift.var") {
|
|
12461
12461
|
const parsed2 = splitAccessors(text(symbol2).replace(/^let /, "var "));
|
|
12462
|
-
const measured = behavior.get(
|
|
12463
|
-
if (measured) used.add(
|
|
12462
|
+
const measured = behavior.get(path145);
|
|
12463
|
+
if (measured) used.add(path145);
|
|
12464
12464
|
emit(
|
|
12465
|
-
`public ${parsed2.decl} { ${measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(
|
|
12465
|
+
`public ${parsed2.decl} { ${measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path145))} }`
|
|
12466
12466
|
);
|
|
12467
|
-
} else skipped.push({ path:
|
|
12467
|
+
} else skipped.push({ path: path145, reason: `unhandled top-level ${kind}` });
|
|
12468
12468
|
});
|
|
12469
12469
|
const cExports = new Set(
|
|
12470
12470
|
[...byId.values()].flatMap((symbol2) => {
|
|
@@ -12481,7 +12481,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12481
12481
|
return !name3 || !cExports.has(`${name3}|${text(symbol2)}`);
|
|
12482
12482
|
}).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
|
|
12483
12483
|
for (const symbol2 of roots) {
|
|
12484
|
-
const
|
|
12484
|
+
const path145 = pathOf(symbol2);
|
|
12485
12485
|
if (TYPE_KINDS.has(symbol2.kind.identifier)) emitType(symbol2, "");
|
|
12486
12486
|
else emitGlobal(symbol2);
|
|
12487
12487
|
}
|
|
@@ -12561,9 +12561,9 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
12561
12561
|
"#endif",
|
|
12562
12562
|
""
|
|
12563
12563
|
];
|
|
12564
|
-
for (const
|
|
12565
|
-
if (!used.has(
|
|
12566
|
-
skipped.push({ path:
|
|
12564
|
+
for (const path145 of behavior.keys())
|
|
12565
|
+
if (!used.has(path145))
|
|
12566
|
+
skipped.push({ path: path145, reason: "behavior names no emitted declaration" });
|
|
12567
12567
|
return {
|
|
12568
12568
|
source: `${[...banner, ...lines].join("\n")}
|
|
12569
12569
|
`,
|
|
@@ -14854,9 +14854,9 @@ function originalColumn(line, column) {
|
|
|
14854
14854
|
}
|
|
14855
14855
|
function designTimeDiagnostic(output, files2) {
|
|
14856
14856
|
const rewritten = /* @__PURE__ */ new Map();
|
|
14857
|
-
const linesOf = (
|
|
14857
|
+
const linesOf = (path145) => {
|
|
14858
14858
|
const file = Object.keys(files2).find(
|
|
14859
|
-
(name3) => name3.endsWith(".swift") && (
|
|
14859
|
+
(name3) => name3.endsWith(".swift") && (path145 === name3 || path145.endsWith(`/${name3}`))
|
|
14860
14860
|
);
|
|
14861
14861
|
if (file === void 0) return null;
|
|
14862
14862
|
let lines = rewritten.get(file);
|
|
@@ -26242,13 +26242,13 @@ function swiftSdkGuestLookups(moduleRoot, sdkRoot, objects) {
|
|
|
26242
26242
|
const shared = /* @__PURE__ */ new Set();
|
|
26243
26243
|
const sdkWeakReferences = /* @__PURE__ */ new Map();
|
|
26244
26244
|
for (const objects2 of groups.values())
|
|
26245
|
-
for (const { path:
|
|
26245
|
+
for (const { path: path145, bytes } of objects2) {
|
|
26246
26246
|
const defined = guestWasmSymbols(bytes);
|
|
26247
26247
|
for (const name3 of defined.defined) symbols.add(name3);
|
|
26248
26248
|
for (const name3 of defined.tags) shared.add(name3);
|
|
26249
26249
|
for (const name3 of defined.globals) shared.add(name3);
|
|
26250
26250
|
if (defined.weakUndefined.length)
|
|
26251
|
-
sdkWeakReferences.set(
|
|
26251
|
+
sdkWeakReferences.set(path145, new Set(defined.weakUndefined));
|
|
26252
26252
|
}
|
|
26253
26253
|
return createGuestImageLedger({
|
|
26254
26254
|
images,
|
|
@@ -33754,7 +33754,7 @@ async function compileGuestLink(options2) {
|
|
|
33754
33754
|
let lazyFunctions = [];
|
|
33755
33755
|
let dyldSymbols = [];
|
|
33756
33756
|
const bundlePaths = new Map(
|
|
33757
|
-
options2.resourceBundles.map(({ target, path:
|
|
33757
|
+
options2.resourceBundles.map(({ target, path: path145 }) => [target, path145])
|
|
33758
33758
|
);
|
|
33759
33759
|
const imageMetadata = (products) => {
|
|
33760
33760
|
const source = sourceImages.map((image) => {
|
|
@@ -35027,8 +35027,8 @@ function sourceEntryPath() {
|
|
|
35027
35027
|
return null;
|
|
35028
35028
|
}
|
|
35029
35029
|
}
|
|
35030
|
-
function isCliEntry(
|
|
35031
|
-
const name3 = (0, import_node_path49.basename)(
|
|
35030
|
+
function isCliEntry(path145) {
|
|
35031
|
+
const name3 = (0, import_node_path49.basename)(path145);
|
|
35032
35032
|
return name3 === "bin.ts" || name3 === "bin.js";
|
|
35033
35033
|
}
|
|
35034
35034
|
function rnxSelfInvocation() {
|
|
@@ -35986,7 +35986,7 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
|
|
|
35986
35986
|
);
|
|
35987
35987
|
const names = /* @__PURE__ */ new Set([...frameworks, ...targets.map((target) => target.name)]);
|
|
35988
35988
|
const entriesByPrefix = new Map(
|
|
35989
|
-
targets.map(({ path:
|
|
35989
|
+
targets.map(({ path: path145 }) => [path145 === "." ? "" : `${path145}/`, []])
|
|
35990
35990
|
);
|
|
35991
35991
|
const targetByPrefix = /* @__PURE__ */ new Map();
|
|
35992
35992
|
for (const target of targets) {
|
|
@@ -36663,7 +36663,7 @@ function syncSwiftTree(base2, files2, alreadySynced) {
|
|
|
36663
36663
|
const full = import_node_path55.default.join(dir, entry.name);
|
|
36664
36664
|
if (dir === base2 && (entry.name === ".build" || entry.name === SWIFT_CACHE_HOLD_MARKER || entry.name.startsWith(".peach-modules-") || // distribution clang maps are written beside the project, so a sync
|
|
36665
36665
|
// must not remove them.
|
|
36666
|
-
entry.name === CLANG_DISTRIBUTION_MODULES || entry.name === SWIFT_DISTRIBUTION_MIRROR || entry.name === SWIFT_LINK_STAMP))
|
|
36666
|
+
entry.name === CLANG_DISTRIBUTION_MODULES || entry.name === SWIFT_DISTRIBUTION_MIRROR || entry.name === SWIFT_LINK_STAMP || entry.name === SWIFT_BUILD_ROOT_SHAPE))
|
|
36667
36667
|
continue;
|
|
36668
36668
|
if (entry.isDirectory()) walk4(full);
|
|
36669
36669
|
else if (!files2.has(full) && (!kept || !kept.has((0, import_node_fs55.lstatSync)(full).ino)))
|
|
@@ -39935,7 +39935,7 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
|
|
|
39935
39935
|
const nearest = ranked[0].slot;
|
|
39936
39936
|
return withSwiftRootLock(nearest, run16(nearest), signal);
|
|
39937
39937
|
}
|
|
39938
|
-
async function withSwiftBuildRootSlot(baseRoot,
|
|
39938
|
+
async function withSwiftBuildRootSlot(baseRoot, exactShape, compatShape, signal, work) {
|
|
39939
39939
|
const slots = Array.from({ length: SWIFT_BUILD_ROOT_SLOTS }, (_, index) => {
|
|
39940
39940
|
const slot = index === 0 ? baseRoot : `${baseRoot}-s${index}`;
|
|
39941
39941
|
(0, import_node_fs55.mkdirSync)(slot, { recursive: true });
|
|
@@ -39949,14 +39949,15 @@ async function withSwiftBuildRootSlot(baseRoot, buildShape, signal, work) {
|
|
|
39949
39949
|
};
|
|
39950
39950
|
const built2 = new Map(slots.map((slot) => [slot, (0, import_node_fs55.statSync)(slot).mtimeMs]));
|
|
39951
39951
|
const ranked = slots.map((slot, index) => {
|
|
39952
|
-
const
|
|
39953
|
-
const
|
|
39952
|
+
const record5 = swiftFrameworkSlotRecord(slot, SWIFT_BUILD_ROOT_SHAPE);
|
|
39953
|
+
const [slotExact, slotCompat] = record5 ? record5.split("\n") : [null, null];
|
|
39954
|
+
const tier = slotExact === exactShape ? 0 : slotCompat === compatShape ? 1 : record5 === null ? 2 : 3;
|
|
39954
39955
|
return { slot, index, tier };
|
|
39955
39956
|
}).sort((left, right) => {
|
|
39956
39957
|
if (left.tier !== right.tier) return left.tier - right.tier;
|
|
39957
|
-
if (left.tier
|
|
39958
|
+
if (left.tier <= 1)
|
|
39958
39959
|
return (built2.get(right.slot) ?? 0) - (built2.get(left.slot) ?? 0);
|
|
39959
|
-
if (left.tier ===
|
|
39960
|
+
if (left.tier === 2) return left.index - right.index;
|
|
39960
39961
|
return (built2.get(left.slot) ?? 0) - (built2.get(right.slot) ?? 0);
|
|
39961
39962
|
});
|
|
39962
39963
|
for (const { slot } of ranked) {
|
|
@@ -40286,17 +40287,20 @@ ${cap}` : "";
|
|
|
40286
40287
|
}
|
|
40287
40288
|
const baseRoot = root;
|
|
40288
40289
|
const canPoolBuildRoot = !options2.intermediates && !options2.project && !options2.linkOnly && import_node_path55.default.basename(import_node_path55.default.dirname(baseRoot)) === "swift-builds";
|
|
40289
|
-
const
|
|
40290
|
-
|
|
40291
|
-
|
|
40292
|
-
|
|
40293
|
-
|
|
40294
|
-
|
|
40295
|
-
|
|
40296
|
-
|
|
40297
|
-
|
|
40298
|
-
|
|
40290
|
+
const compatShapeParts = canPoolBuildRoot ? [
|
|
40291
|
+
frameworkKey,
|
|
40292
|
+
Boolean(sdkImage),
|
|
40293
|
+
compileTargets(input).map((target) => target.name).sort(),
|
|
40294
|
+
input.oneModule === true,
|
|
40295
|
+
input.optimize === true,
|
|
40296
|
+
input.unoptimized === true
|
|
40297
|
+
] : null;
|
|
40298
|
+
const compatShape = compatShapeParts ? (0, import_node_crypto35.createHash)("sha256").update(JSON.stringify(compatShapeParts)).digest("hex").slice(0, 16) : "";
|
|
40299
|
+
const exactShape = compatShapeParts ? (0, import_node_crypto35.createHash)("sha256").update(
|
|
40300
|
+
JSON.stringify([...compatShapeParts, Object.keys(input.files).sort()])
|
|
40299
40301
|
).digest("hex").slice(0, 16) : "";
|
|
40302
|
+
const buildShape = compatShapeParts ? `${exactShape}
|
|
40303
|
+
${compatShape}` : "";
|
|
40300
40304
|
return withSwiftCompileBudget(options2.timeoutMs, options2.signal, async (budget) => {
|
|
40301
40305
|
const stage = (message) => {
|
|
40302
40306
|
budget.progress();
|
|
@@ -40316,7 +40320,13 @@ ${cap}` : "";
|
|
|
40316
40320
|
stage("reusing verified disk artifact");
|
|
40317
40321
|
return retain(baseRoot, built2);
|
|
40318
40322
|
}
|
|
40319
|
-
return withSwiftBuildRootSlot(
|
|
40323
|
+
return withSwiftBuildRootSlot(
|
|
40324
|
+
baseRoot,
|
|
40325
|
+
exactShape,
|
|
40326
|
+
compatShape,
|
|
40327
|
+
budget.signal,
|
|
40328
|
+
work
|
|
40329
|
+
);
|
|
40320
40330
|
},
|
|
40321
40331
|
budget.signal
|
|
40322
40332
|
);
|
|
@@ -41231,7 +41241,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
|
|
|
41231
41241
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
41232
41242
|
MULTI_MANIFEST_VERSION = 76;
|
|
41233
41243
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
41234
|
-
compilerSourceDigest = true ? "
|
|
41244
|
+
compilerSourceDigest = true ? "e940aeb81a0b92721d57e565a80702fb97e179762fa151bee7da6b537730ed36" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
41235
41245
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
41236
41246
|
MODULE_MAP_RESPONSE_FILE_RUN = 16;
|
|
41237
41247
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
@@ -42020,17 +42030,17 @@ function visit(node, visitor) {
|
|
|
42020
42030
|
} else
|
|
42021
42031
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
42022
42032
|
}
|
|
42023
|
-
function visit_(key2, node, visitor,
|
|
42024
|
-
const ctrl = callVisitor(key2, node, visitor,
|
|
42033
|
+
function visit_(key2, node, visitor, path145) {
|
|
42034
|
+
const ctrl = callVisitor(key2, node, visitor, path145);
|
|
42025
42035
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
42026
|
-
replaceNode(key2,
|
|
42027
|
-
return visit_(key2, ctrl, visitor,
|
|
42036
|
+
replaceNode(key2, path145, ctrl);
|
|
42037
|
+
return visit_(key2, ctrl, visitor, path145);
|
|
42028
42038
|
}
|
|
42029
42039
|
if (typeof ctrl !== "symbol") {
|
|
42030
42040
|
if (isCollection(node)) {
|
|
42031
|
-
|
|
42041
|
+
path145 = Object.freeze(path145.concat(node));
|
|
42032
42042
|
for (let i = 0; i < node.items.length; ++i) {
|
|
42033
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
42043
|
+
const ci = visit_(i, node.items[i], visitor, path145);
|
|
42034
42044
|
if (typeof ci === "number")
|
|
42035
42045
|
i = ci - 1;
|
|
42036
42046
|
else if (ci === BREAK)
|
|
@@ -42041,13 +42051,13 @@ function visit_(key2, node, visitor, path144) {
|
|
|
42041
42051
|
}
|
|
42042
42052
|
}
|
|
42043
42053
|
} else if (isPair(node)) {
|
|
42044
|
-
|
|
42045
|
-
const ck = visit_("key", node.key, visitor,
|
|
42054
|
+
path145 = Object.freeze(path145.concat(node));
|
|
42055
|
+
const ck = visit_("key", node.key, visitor, path145);
|
|
42046
42056
|
if (ck === BREAK)
|
|
42047
42057
|
return BREAK;
|
|
42048
42058
|
else if (ck === REMOVE)
|
|
42049
42059
|
node.key = null;
|
|
42050
|
-
const cv = visit_("value", node.value, visitor,
|
|
42060
|
+
const cv = visit_("value", node.value, visitor, path145);
|
|
42051
42061
|
if (cv === BREAK)
|
|
42052
42062
|
return BREAK;
|
|
42053
42063
|
else if (cv === REMOVE)
|
|
@@ -42065,17 +42075,17 @@ async function visitAsync(node, visitor) {
|
|
|
42065
42075
|
} else
|
|
42066
42076
|
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
42067
42077
|
}
|
|
42068
|
-
async function visitAsync_(key2, node, visitor,
|
|
42069
|
-
const ctrl = await callVisitor(key2, node, visitor,
|
|
42078
|
+
async function visitAsync_(key2, node, visitor, path145) {
|
|
42079
|
+
const ctrl = await callVisitor(key2, node, visitor, path145);
|
|
42070
42080
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
42071
|
-
replaceNode(key2,
|
|
42072
|
-
return visitAsync_(key2, ctrl, visitor,
|
|
42081
|
+
replaceNode(key2, path145, ctrl);
|
|
42082
|
+
return visitAsync_(key2, ctrl, visitor, path145);
|
|
42073
42083
|
}
|
|
42074
42084
|
if (typeof ctrl !== "symbol") {
|
|
42075
42085
|
if (isCollection(node)) {
|
|
42076
|
-
|
|
42086
|
+
path145 = Object.freeze(path145.concat(node));
|
|
42077
42087
|
for (let i = 0; i < node.items.length; ++i) {
|
|
42078
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
42088
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path145);
|
|
42079
42089
|
if (typeof ci === "number")
|
|
42080
42090
|
i = ci - 1;
|
|
42081
42091
|
else if (ci === BREAK)
|
|
@@ -42086,13 +42096,13 @@ async function visitAsync_(key2, node, visitor, path144) {
|
|
|
42086
42096
|
}
|
|
42087
42097
|
}
|
|
42088
42098
|
} else if (isPair(node)) {
|
|
42089
|
-
|
|
42090
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
42099
|
+
path145 = Object.freeze(path145.concat(node));
|
|
42100
|
+
const ck = await visitAsync_("key", node.key, visitor, path145);
|
|
42091
42101
|
if (ck === BREAK)
|
|
42092
42102
|
return BREAK;
|
|
42093
42103
|
else if (ck === REMOVE)
|
|
42094
42104
|
node.key = null;
|
|
42095
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
42105
|
+
const cv = await visitAsync_("value", node.value, visitor, path145);
|
|
42096
42106
|
if (cv === BREAK)
|
|
42097
42107
|
return BREAK;
|
|
42098
42108
|
else if (cv === REMOVE)
|
|
@@ -42119,23 +42129,23 @@ function initVisitor(visitor) {
|
|
|
42119
42129
|
}
|
|
42120
42130
|
return visitor;
|
|
42121
42131
|
}
|
|
42122
|
-
function callVisitor(key2, node, visitor,
|
|
42132
|
+
function callVisitor(key2, node, visitor, path145) {
|
|
42123
42133
|
if (typeof visitor === "function")
|
|
42124
|
-
return visitor(key2, node,
|
|
42134
|
+
return visitor(key2, node, path145);
|
|
42125
42135
|
if (isMap(node))
|
|
42126
|
-
return visitor.Map?.(key2, node,
|
|
42136
|
+
return visitor.Map?.(key2, node, path145);
|
|
42127
42137
|
if (isSeq(node))
|
|
42128
|
-
return visitor.Seq?.(key2, node,
|
|
42138
|
+
return visitor.Seq?.(key2, node, path145);
|
|
42129
42139
|
if (isPair(node))
|
|
42130
|
-
return visitor.Pair?.(key2, node,
|
|
42140
|
+
return visitor.Pair?.(key2, node, path145);
|
|
42131
42141
|
if (isScalar(node))
|
|
42132
|
-
return visitor.Scalar?.(key2, node,
|
|
42142
|
+
return visitor.Scalar?.(key2, node, path145);
|
|
42133
42143
|
if (isAlias(node))
|
|
42134
|
-
return visitor.Alias?.(key2, node,
|
|
42144
|
+
return visitor.Alias?.(key2, node, path145);
|
|
42135
42145
|
return void 0;
|
|
42136
42146
|
}
|
|
42137
|
-
function replaceNode(key2,
|
|
42138
|
-
const parent =
|
|
42147
|
+
function replaceNode(key2, path145, node) {
|
|
42148
|
+
const parent = path145[path145.length - 1];
|
|
42139
42149
|
if (isCollection(parent)) {
|
|
42140
42150
|
parent.items[key2] = node;
|
|
42141
42151
|
} else if (isPair(parent)) {
|
|
@@ -42735,10 +42745,10 @@ var init_createNode = __esm({
|
|
|
42735
42745
|
});
|
|
42736
42746
|
|
|
42737
42747
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
42738
|
-
function collectionFromPath(schema4,
|
|
42748
|
+
function collectionFromPath(schema4, path145, value) {
|
|
42739
42749
|
let v9 = value;
|
|
42740
|
-
for (let i =
|
|
42741
|
-
const k =
|
|
42750
|
+
for (let i = path145.length - 1; i >= 0; --i) {
|
|
42751
|
+
const k = path145[i];
|
|
42742
42752
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
42743
42753
|
const a = [];
|
|
42744
42754
|
a[k] = v9;
|
|
@@ -42763,7 +42773,7 @@ var init_Collection = __esm({
|
|
|
42763
42773
|
init_createNode();
|
|
42764
42774
|
init_identity();
|
|
42765
42775
|
init_Node();
|
|
42766
|
-
isEmptyPath = (
|
|
42776
|
+
isEmptyPath = (path145) => path145 == null || typeof path145 === "object" && !!path145[Symbol.iterator]().next().done;
|
|
42767
42777
|
Collection = class extends NodeBase {
|
|
42768
42778
|
constructor(type, schema4) {
|
|
42769
42779
|
super(type);
|
|
@@ -42793,11 +42803,11 @@ var init_Collection = __esm({
|
|
|
42793
42803
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
42794
42804
|
* that already exists in the map.
|
|
42795
42805
|
*/
|
|
42796
|
-
addIn(
|
|
42797
|
-
if (isEmptyPath(
|
|
42806
|
+
addIn(path145, value) {
|
|
42807
|
+
if (isEmptyPath(path145))
|
|
42798
42808
|
this.add(value);
|
|
42799
42809
|
else {
|
|
42800
|
-
const [key2, ...rest] =
|
|
42810
|
+
const [key2, ...rest] = path145;
|
|
42801
42811
|
const node = this.get(key2, true);
|
|
42802
42812
|
if (isCollection(node))
|
|
42803
42813
|
node.addIn(rest, value);
|
|
@@ -42811,8 +42821,8 @@ var init_Collection = __esm({
|
|
|
42811
42821
|
* Removes a value from the collection.
|
|
42812
42822
|
* @returns `true` if the item was found and removed.
|
|
42813
42823
|
*/
|
|
42814
|
-
deleteIn(
|
|
42815
|
-
const [key2, ...rest] =
|
|
42824
|
+
deleteIn(path145) {
|
|
42825
|
+
const [key2, ...rest] = path145;
|
|
42816
42826
|
if (rest.length === 0)
|
|
42817
42827
|
return this.delete(key2);
|
|
42818
42828
|
const node = this.get(key2, true);
|
|
@@ -42826,8 +42836,8 @@ var init_Collection = __esm({
|
|
|
42826
42836
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
42827
42837
|
* `true` (collections are always returned intact).
|
|
42828
42838
|
*/
|
|
42829
|
-
getIn(
|
|
42830
|
-
const [key2, ...rest] =
|
|
42839
|
+
getIn(path145, keepScalar) {
|
|
42840
|
+
const [key2, ...rest] = path145;
|
|
42831
42841
|
const node = this.get(key2, true);
|
|
42832
42842
|
if (rest.length === 0)
|
|
42833
42843
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -42845,8 +42855,8 @@ var init_Collection = __esm({
|
|
|
42845
42855
|
/**
|
|
42846
42856
|
* Checks if the collection includes a value with the key `key`.
|
|
42847
42857
|
*/
|
|
42848
|
-
hasIn(
|
|
42849
|
-
const [key2, ...rest] =
|
|
42858
|
+
hasIn(path145) {
|
|
42859
|
+
const [key2, ...rest] = path145;
|
|
42850
42860
|
if (rest.length === 0)
|
|
42851
42861
|
return this.has(key2);
|
|
42852
42862
|
const node = this.get(key2, true);
|
|
@@ -42856,8 +42866,8 @@ var init_Collection = __esm({
|
|
|
42856
42866
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
42857
42867
|
* boolean to add/remove the item from the set.
|
|
42858
42868
|
*/
|
|
42859
|
-
setIn(
|
|
42860
|
-
const [key2, ...rest] =
|
|
42869
|
+
setIn(path145, value) {
|
|
42870
|
+
const [key2, ...rest] = path145;
|
|
42861
42871
|
if (rest.length === 0) {
|
|
42862
42872
|
this.set(key2, value);
|
|
42863
42873
|
} else {
|
|
@@ -45291,9 +45301,9 @@ var init_Document = __esm({
|
|
|
45291
45301
|
this.contents.add(value);
|
|
45292
45302
|
}
|
|
45293
45303
|
/** Adds a value to the document. */
|
|
45294
|
-
addIn(
|
|
45304
|
+
addIn(path145, value) {
|
|
45295
45305
|
if (assertCollection(this.contents))
|
|
45296
|
-
this.contents.addIn(
|
|
45306
|
+
this.contents.addIn(path145, value);
|
|
45297
45307
|
}
|
|
45298
45308
|
/**
|
|
45299
45309
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -45368,14 +45378,14 @@ var init_Document = __esm({
|
|
|
45368
45378
|
* Removes a value from the document.
|
|
45369
45379
|
* @returns `true` if the item was found and removed.
|
|
45370
45380
|
*/
|
|
45371
|
-
deleteIn(
|
|
45372
|
-
if (isEmptyPath(
|
|
45381
|
+
deleteIn(path145) {
|
|
45382
|
+
if (isEmptyPath(path145)) {
|
|
45373
45383
|
if (this.contents == null)
|
|
45374
45384
|
return false;
|
|
45375
45385
|
this.contents = null;
|
|
45376
45386
|
return true;
|
|
45377
45387
|
}
|
|
45378
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
45388
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path145) : false;
|
|
45379
45389
|
}
|
|
45380
45390
|
/**
|
|
45381
45391
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -45390,10 +45400,10 @@ var init_Document = __esm({
|
|
|
45390
45400
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
45391
45401
|
* `true` (collections are always returned intact).
|
|
45392
45402
|
*/
|
|
45393
|
-
getIn(
|
|
45394
|
-
if (isEmptyPath(
|
|
45403
|
+
getIn(path145, keepScalar) {
|
|
45404
|
+
if (isEmptyPath(path145))
|
|
45395
45405
|
return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
|
|
45396
|
-
return isCollection(this.contents) ? this.contents.getIn(
|
|
45406
|
+
return isCollection(this.contents) ? this.contents.getIn(path145, keepScalar) : void 0;
|
|
45397
45407
|
}
|
|
45398
45408
|
/**
|
|
45399
45409
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -45404,10 +45414,10 @@ var init_Document = __esm({
|
|
|
45404
45414
|
/**
|
|
45405
45415
|
* Checks if the document includes a value at `path`.
|
|
45406
45416
|
*/
|
|
45407
|
-
hasIn(
|
|
45408
|
-
if (isEmptyPath(
|
|
45417
|
+
hasIn(path145) {
|
|
45418
|
+
if (isEmptyPath(path145))
|
|
45409
45419
|
return this.contents !== void 0;
|
|
45410
|
-
return isCollection(this.contents) ? this.contents.hasIn(
|
|
45420
|
+
return isCollection(this.contents) ? this.contents.hasIn(path145) : false;
|
|
45411
45421
|
}
|
|
45412
45422
|
/**
|
|
45413
45423
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -45424,13 +45434,13 @@ var init_Document = __esm({
|
|
|
45424
45434
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
45425
45435
|
* boolean to add/remove the item from the set.
|
|
45426
45436
|
*/
|
|
45427
|
-
setIn(
|
|
45428
|
-
if (isEmptyPath(
|
|
45437
|
+
setIn(path145, value) {
|
|
45438
|
+
if (isEmptyPath(path145)) {
|
|
45429
45439
|
this.contents = value;
|
|
45430
45440
|
} else if (this.contents == null) {
|
|
45431
|
-
this.contents = collectionFromPath(this.schema, Array.from(
|
|
45441
|
+
this.contents = collectionFromPath(this.schema, Array.from(path145), value);
|
|
45432
45442
|
} else if (assertCollection(this.contents)) {
|
|
45433
|
-
this.contents.setIn(
|
|
45443
|
+
this.contents.setIn(path145, value);
|
|
45434
45444
|
}
|
|
45435
45445
|
}
|
|
45436
45446
|
/**
|
|
@@ -47335,15 +47345,15 @@ function visit2(cst, visitor) {
|
|
|
47335
47345
|
cst = { start: cst.start, value: cst.value };
|
|
47336
47346
|
_visit(Object.freeze([]), cst, visitor);
|
|
47337
47347
|
}
|
|
47338
|
-
function _visit(
|
|
47339
|
-
let ctrl = visitor(item,
|
|
47348
|
+
function _visit(path145, item, visitor) {
|
|
47349
|
+
let ctrl = visitor(item, path145);
|
|
47340
47350
|
if (typeof ctrl === "symbol")
|
|
47341
47351
|
return ctrl;
|
|
47342
47352
|
for (const field of ["key", "value"]) {
|
|
47343
47353
|
const token = item[field];
|
|
47344
47354
|
if (token && "items" in token) {
|
|
47345
47355
|
for (let i = 0; i < token.items.length; ++i) {
|
|
47346
|
-
const ci = _visit(Object.freeze(
|
|
47356
|
+
const ci = _visit(Object.freeze(path145.concat([[field, i]])), token.items[i], visitor);
|
|
47347
47357
|
if (typeof ci === "number")
|
|
47348
47358
|
i = ci - 1;
|
|
47349
47359
|
else if (ci === BREAK2)
|
|
@@ -47354,10 +47364,10 @@ function _visit(path144, item, visitor) {
|
|
|
47354
47364
|
}
|
|
47355
47365
|
}
|
|
47356
47366
|
if (typeof ctrl === "function" && field === "key")
|
|
47357
|
-
ctrl = ctrl(item,
|
|
47367
|
+
ctrl = ctrl(item, path145);
|
|
47358
47368
|
}
|
|
47359
47369
|
}
|
|
47360
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
47370
|
+
return typeof ctrl === "function" ? ctrl(item, path145) : ctrl;
|
|
47361
47371
|
}
|
|
47362
47372
|
var BREAK2, SKIP2, REMOVE2;
|
|
47363
47373
|
var init_cst_visit = __esm({
|
|
@@ -47368,9 +47378,9 @@ var init_cst_visit = __esm({
|
|
|
47368
47378
|
visit2.BREAK = BREAK2;
|
|
47369
47379
|
visit2.SKIP = SKIP2;
|
|
47370
47380
|
visit2.REMOVE = REMOVE2;
|
|
47371
|
-
visit2.itemAtPath = (cst,
|
|
47381
|
+
visit2.itemAtPath = (cst, path145) => {
|
|
47372
47382
|
let item = cst;
|
|
47373
|
-
for (const [field, index] of
|
|
47383
|
+
for (const [field, index] of path145) {
|
|
47374
47384
|
const tok = item?.[field];
|
|
47375
47385
|
if (tok && "items" in tok) {
|
|
47376
47386
|
item = tok.items[index];
|
|
@@ -47379,9 +47389,9 @@ var init_cst_visit = __esm({
|
|
|
47379
47389
|
}
|
|
47380
47390
|
return item;
|
|
47381
47391
|
};
|
|
47382
|
-
visit2.parentCollection = (cst,
|
|
47383
|
-
const parent = visit2.itemAtPath(cst,
|
|
47384
|
-
const field =
|
|
47392
|
+
visit2.parentCollection = (cst, path145) => {
|
|
47393
|
+
const parent = visit2.itemAtPath(cst, path145.slice(0, -1));
|
|
47394
|
+
const field = path145[path145.length - 1][0];
|
|
47385
47395
|
const coll = parent?.[field];
|
|
47386
47396
|
if (coll && "items" in coll)
|
|
47387
47397
|
return coll;
|
|
@@ -52639,9 +52649,9 @@ var init_podspec_ruby = __esm({
|
|
|
52639
52649
|
}
|
|
52640
52650
|
// ---- errors
|
|
52641
52651
|
exceptionClass(name3) {
|
|
52642
|
-
const
|
|
52652
|
+
const path145 = name3.split("::");
|
|
52643
52653
|
let module2 = this.object;
|
|
52644
|
-
for (const part of
|
|
52654
|
+
for (const part of path145) {
|
|
52645
52655
|
const next = module2.consts.get(part);
|
|
52646
52656
|
if (!(next instanceof RModule))
|
|
52647
52657
|
throw new UnsupportedRuby(`no exception class ${name3}`);
|
|
@@ -59422,16 +59432,16 @@ var init_pods_files = __esm({
|
|
|
59422
59432
|
};
|
|
59423
59433
|
unique = (values) => [...new Set(values)];
|
|
59424
59434
|
XCFramework = class {
|
|
59425
|
-
constructor(targetName,
|
|
59435
|
+
constructor(targetName, path145) {
|
|
59426
59436
|
this.targetName = targetName;
|
|
59427
|
-
this.path =
|
|
59428
|
-
const plist2 = parsePlistBytes(import_node_fs65.default.readFileSync(`${
|
|
59437
|
+
this.path = path145;
|
|
59438
|
+
const plist2 = parsePlistBytes(import_node_fs65.default.readFileSync(`${path145}/Info.plist`));
|
|
59429
59439
|
if (!isRecord(plist2) || !Array.isArray(plist2.AvailableLibraries))
|
|
59430
|
-
throw new Error(`${
|
|
59440
|
+
throw new Error(`${path145}/Info.plist declares no AvailableLibraries`);
|
|
59431
59441
|
this.slices = plist2.AvailableLibraries.map((library) => {
|
|
59432
59442
|
if (!isRecord(library) || typeof library.LibraryIdentifier !== "string" || typeof library.LibraryPath !== "string" || typeof library.SupportedPlatform !== "string")
|
|
59433
|
-
throw new Error(`${
|
|
59434
|
-
const root = `${
|
|
59443
|
+
throw new Error(`${path145}/Info.plist has an invalid library entry`);
|
|
59444
|
+
const root = `${path145}/${library.LibraryIdentifier}`;
|
|
59435
59445
|
const slicePath = `${root}/${library.LibraryPath}`;
|
|
59436
59446
|
const extension = slicePath.slice(slicePath.lastIndexOf("."));
|
|
59437
59447
|
const packaging = extension === ".framework" ? "framework" : extension === ".a" || extension === ".dylib" ? "library" : null;
|
|
@@ -59453,7 +59463,7 @@ var init_pods_files = __esm({
|
|
|
59453
59463
|
}).sort((a, b) => byBytes2(a.identifier, b.identifier));
|
|
59454
59464
|
if (this.slices.length === 0)
|
|
59455
59465
|
throw new Error(
|
|
59456
|
-
`XCFramework at ${
|
|
59466
|
+
`XCFramework at ${path145} does not contain any frameworks or libraries.`
|
|
59457
59467
|
);
|
|
59458
59468
|
}
|
|
59459
59469
|
slices;
|
|
@@ -61307,9 +61317,9 @@ echo "SUCCESS" > "\${SCRIPT_OUTPUT_FILE_0}"
|
|
|
61307
61317
|
DEFAULT_SHELL_SCRIPT = "# Type a script or drag a script file from your workspace to insert its path.\n";
|
|
61308
61318
|
stringList2 = (value) => Array.isArray(value) && value.every((item) => typeof item === "string") ? value : null;
|
|
61309
61319
|
UserProject = class {
|
|
61310
|
-
constructor(table,
|
|
61320
|
+
constructor(table, path145, objectVersion) {
|
|
61311
61321
|
this.table = table;
|
|
61312
|
-
this.path =
|
|
61322
|
+
this.path = path145;
|
|
61313
61323
|
this.objectVersion = objectVersion;
|
|
61314
61324
|
}
|
|
61315
61325
|
get projectDir() {
|
|
@@ -68415,14 +68425,14 @@ function addAsset(into, asset) {
|
|
|
68415
68425
|
function checkStack(dir, type, devices2) {
|
|
68416
68426
|
const sets = (parent, allowed) => (0, import_node_fs76.readdirSync)(parent, { withFileTypes: true }).flatMap((entry) => {
|
|
68417
68427
|
if (entry.name.startsWith(".") || entry.isFile()) return [];
|
|
68418
|
-
const
|
|
68428
|
+
const path145 = (0, import_node_path76.join)(parent, entry.name);
|
|
68419
68429
|
const extension = (0, import_node_path76.extname)(entry.name);
|
|
68420
68430
|
if (!entry.isDirectory() || !allowed.includes(extension))
|
|
68421
68431
|
return refuse(
|
|
68422
|
-
|
|
68432
|
+
path145,
|
|
68423
68433
|
`image stack content other than ${allowed.join(", ")} is unproven`
|
|
68424
68434
|
);
|
|
68425
|
-
return [{ path:
|
|
68435
|
+
return [{ path: path145, extension }];
|
|
68426
68436
|
});
|
|
68427
68437
|
for (const layer of sets(dir, [`.${type}layer`, ".imageset", ".colorset"])) {
|
|
68428
68438
|
if (layer.extension !== `.${type}layer`) continue;
|
|
@@ -68434,37 +68444,37 @@ function checkStack(dir, type, devices2) {
|
|
|
68434
68444
|
function walk2(dir, into, devices2, extensions) {
|
|
68435
68445
|
for (const entry of (0, import_node_fs76.readdirSync)(dir, { withFileTypes: true })) {
|
|
68436
68446
|
if (entry.name.startsWith(".") || entry.isFile()) continue;
|
|
68437
|
-
const
|
|
68438
|
-
if (!entry.isDirectory()) return refuse(
|
|
68447
|
+
const path145 = (0, import_node_path76.join)(dir, entry.name);
|
|
68448
|
+
if (!entry.isDirectory()) return refuse(path145, "it is neither a file nor a directory");
|
|
68439
68449
|
const extension = (0, import_node_path76.extname)(entry.name).slice(1);
|
|
68440
68450
|
const type = extension.toLowerCase();
|
|
68441
68451
|
const base2 = entry.name.slice(0, entry.name.length - extension.length - 1);
|
|
68442
68452
|
if (type !== extension && knownTypes.has(type))
|
|
68443
|
-
return refuse(
|
|
68453
|
+
return refuse(path145, "its type extension is not lowercase");
|
|
68444
68454
|
if (type === "colorset" || type === "imageset" || type === "symbolset") {
|
|
68445
68455
|
addAsset(into, {
|
|
68446
68456
|
kind: type === "colorset" ? "color" : "image",
|
|
68447
68457
|
name: base2,
|
|
68448
|
-
...assetState(
|
|
68458
|
+
...assetState(path145, type, devices2),
|
|
68449
68459
|
extensions,
|
|
68450
|
-
source:
|
|
68460
|
+
source: path145
|
|
68451
68461
|
});
|
|
68452
68462
|
continue;
|
|
68453
68463
|
}
|
|
68454
68464
|
if (silentTypes.has(type)) continue;
|
|
68455
68465
|
if (stackTypes.has(type)) {
|
|
68456
|
-
checkStack(
|
|
68466
|
+
checkStack(path145, type, devices2);
|
|
68457
68467
|
continue;
|
|
68458
68468
|
}
|
|
68459
|
-
if (unprovenTypes.has(type)) return refuse(
|
|
68469
|
+
if (unprovenTypes.has(type)) return refuse(path145, `${type} assets are unproven`);
|
|
68460
68470
|
const name3 = type === "spriteatlas" ? base2 : entry.name;
|
|
68461
|
-
if (!folderProperties((0, import_node_path76.join)(
|
|
68462
|
-
walk2(
|
|
68471
|
+
if (!folderProperties((0, import_node_path76.join)(path145, "Contents.json")).namespace) {
|
|
68472
|
+
walk2(path145, into, devices2, extensions);
|
|
68463
68473
|
continue;
|
|
68464
68474
|
}
|
|
68465
|
-
const child = into.namespaces.get(name3) ?? scope(
|
|
68475
|
+
const child = into.namespaces.get(name3) ?? scope(path145);
|
|
68466
68476
|
into.namespaces.set(name3, child);
|
|
68467
|
-
walk2(
|
|
68477
|
+
walk2(path145, child, devices2, extensions);
|
|
68468
68478
|
}
|
|
68469
68479
|
}
|
|
68470
68480
|
function words(name3) {
|
|
@@ -68511,11 +68521,11 @@ function members(into, kind, prefix, extensions) {
|
|
|
68511
68521
|
const assets2 = /* @__PURE__ */ new Set();
|
|
68512
68522
|
const out = [];
|
|
68513
68523
|
for (const entry of entries2) {
|
|
68514
|
-
const
|
|
68524
|
+
const path145 = `${prefix}${entry.name}`;
|
|
68515
68525
|
const source = entry.child ? entry.child.source : entry.asset.source;
|
|
68516
68526
|
if (Array.from(entry.name).some((char) => char.charCodeAt(0) > 127))
|
|
68517
68527
|
refuse(source, "its name is not ASCII");
|
|
68518
|
-
const named = (text8) => `The \\"${escape(
|
|
68528
|
+
const named = (text8) => `The \\"${escape(path145)}\\" ${text8}`;
|
|
68519
68529
|
if (entry.child) {
|
|
68520
68530
|
const text8 = symbol(entry.name, true);
|
|
68521
68531
|
if (!text8)
|
|
@@ -68538,9 +68548,9 @@ function members(into, kind, prefix, extensions) {
|
|
|
68538
68548
|
namespaces.add(text8);
|
|
68539
68549
|
out.push({
|
|
68540
68550
|
type: "namespace",
|
|
68541
|
-
path:
|
|
68551
|
+
path: path145,
|
|
68542
68552
|
symbol: spelled(text8),
|
|
68543
|
-
members: members(entry.child, kind, `${
|
|
68553
|
+
members: members(entry.child, kind, `${path145}/`, extensions)
|
|
68544
68554
|
});
|
|
68545
68555
|
}
|
|
68546
68556
|
continue;
|
|
@@ -68567,7 +68577,7 @@ function members(into, kind, prefix, extensions) {
|
|
|
68567
68577
|
else if (!omitted)
|
|
68568
68578
|
out.push({
|
|
68569
68579
|
type: "asset",
|
|
68570
|
-
path:
|
|
68580
|
+
path: path145,
|
|
68571
68581
|
name: entry.name,
|
|
68572
68582
|
symbol: spelled(text7),
|
|
68573
68583
|
thinnable: asset.thinnable,
|
|
@@ -68848,8 +68858,8 @@ var init_xcode_asset_symbols = __esm({
|
|
|
68848
68858
|
import_node_path76 = require("node:path");
|
|
68849
68859
|
Refusal = class extends Error {
|
|
68850
68860
|
};
|
|
68851
|
-
refuse = (
|
|
68852
|
-
throw new Refusal(`Generated asset symbols are unproven for ${
|
|
68861
|
+
refuse = (path145, reason) => {
|
|
68862
|
+
throw new Refusal(`Generated asset symbols are unproven for ${path145}: ${reason}`);
|
|
68853
68863
|
};
|
|
68854
68864
|
isRecord5 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
68855
68865
|
scope = (source) => ({
|
|
@@ -69295,11 +69305,11 @@ function catalogDigest(directory2) {
|
|
|
69295
69305
|
for (const entry of (0, import_node_fs77.readdirSync)(dir, { withFileTypes: true }).sort(
|
|
69296
69306
|
(a, b) => a.name.localeCompare(b.name)
|
|
69297
69307
|
)) {
|
|
69298
|
-
const
|
|
69299
|
-
if (entry.isDirectory()) walk4(
|
|
69300
|
-
else if (entry.isFile() && (0, import_node_fs77.statSync)(
|
|
69301
|
-
hashes.push([(0, import_node_path77.relative)(directory2,
|
|
69302
|
-
else throw new Error(`Unsupported asset catalog entry: ${
|
|
69308
|
+
const path145 = (0, import_node_path77.join)(dir, entry.name);
|
|
69309
|
+
if (entry.isDirectory()) walk4(path145);
|
|
69310
|
+
else if (entry.isFile() && (0, import_node_fs77.statSync)(path145).size <= 64 * 1024 * 1024)
|
|
69311
|
+
hashes.push([(0, import_node_path77.relative)(directory2, path145), sha2562((0, import_node_fs77.readFileSync)(path145))]);
|
|
69312
|
+
else throw new Error(`Unsupported asset catalog entry: ${path145}`);
|
|
69303
69313
|
}
|
|
69304
69314
|
};
|
|
69305
69315
|
walk4(directory2);
|
|
@@ -69310,7 +69320,7 @@ function symbolSource(plan, root) {
|
|
|
69310
69320
|
const known = symbolTexts.get(key2);
|
|
69311
69321
|
if (known !== void 0) return { status: "source", text: known };
|
|
69312
69322
|
const source = assetSymbolSource(
|
|
69313
|
-
plan.catalogs.map(({ path:
|
|
69323
|
+
plan.catalogs.map(({ path: path145 }) => (0, import_node_path77.join)(root, path145)),
|
|
69314
69324
|
plan.settings
|
|
69315
69325
|
);
|
|
69316
69326
|
if (source.status === "source") symbolTexts.set(key2, source.text);
|
|
@@ -69369,9 +69379,9 @@ function planAssetSymbols(resources, root, settings) {
|
|
|
69369
69379
|
`Generated asset symbols are proven only for TARGETED_DEVICE_FAMILY 1, 2, 1,2, 1,7, 1,3,7, 1,2,6 or 1,2,7; this target resolves to "${families}".`
|
|
69370
69380
|
);
|
|
69371
69381
|
const plan = {
|
|
69372
|
-
catalogs: catalogs.map((
|
|
69373
|
-
path:
|
|
69374
|
-
sha256: catalogDigest((0, import_node_path77.join)(root,
|
|
69382
|
+
catalogs: catalogs.map((path145) => ({
|
|
69383
|
+
path: path145,
|
|
69384
|
+
sha256: catalogDigest((0, import_node_path77.join)(root, path145))
|
|
69375
69385
|
})),
|
|
69376
69386
|
settings: { deployment: target, devices: devices2, extensions: extensions === "YES" }
|
|
69377
69387
|
};
|
|
@@ -77936,7 +77946,7 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
|
|
|
77936
77946
|
expoModule: moduleDir ? (0, import_node_path88.relative)(appDir, moduleDir) || "." : null,
|
|
77937
77947
|
optional: optional3,
|
|
77938
77948
|
swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
|
|
77939
|
-
(
|
|
77949
|
+
(path145) => path145.endsWith(".swift") && [...(readSmallFile(path145) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
|
|
77940
77950
|
(match) => match[1] === name3
|
|
77941
77951
|
)
|
|
77942
77952
|
) : false,
|
|
@@ -81181,10 +81191,10 @@ var require_path_parse = __commonJS({
|
|
|
81181
81191
|
code === 45 || /* - */
|
|
81182
81192
|
code === 46;
|
|
81183
81193
|
}
|
|
81184
|
-
function State(
|
|
81194
|
+
function State(path145) {
|
|
81185
81195
|
this.index = 0;
|
|
81186
|
-
this.path =
|
|
81187
|
-
this.max =
|
|
81196
|
+
this.path = path145;
|
|
81197
|
+
this.max = path145.length;
|
|
81188
81198
|
this.result = [];
|
|
81189
81199
|
this.param = 0;
|
|
81190
81200
|
this.err = "";
|
|
@@ -81704,11 +81714,11 @@ var require_svgpath = __commonJS({
|
|
|
81704
81714
|
var matrix = require_matrix();
|
|
81705
81715
|
var a2c = require_a2c();
|
|
81706
81716
|
var ellipse = require_ellipse();
|
|
81707
|
-
function SvgPath(
|
|
81717
|
+
function SvgPath(path145) {
|
|
81708
81718
|
if (!(this instanceof SvgPath)) {
|
|
81709
|
-
return new SvgPath(
|
|
81719
|
+
return new SvgPath(path145);
|
|
81710
81720
|
}
|
|
81711
|
-
var pstate = pathParse(
|
|
81721
|
+
var pstate = pathParse(path145);
|
|
81712
81722
|
this.segments = pstate.segments;
|
|
81713
81723
|
this.err = pstate.err;
|
|
81714
81724
|
this.__stack = [];
|
|
@@ -82191,8 +82201,8 @@ function imagesetFiles(images) {
|
|
|
82191
82201
|
function bundleImageRenditionKey(file, scale) {
|
|
82192
82202
|
return extOf(file) === ".svg" ? `${file}/${scale}x.png` : file;
|
|
82193
82203
|
}
|
|
82194
|
-
function flatScale(
|
|
82195
|
-
const match = /@([23])x\.[^./]+$/.exec(
|
|
82204
|
+
function flatScale(path145) {
|
|
82205
|
+
const match = /@([23])x\.[^./]+$/.exec(path145);
|
|
82196
82206
|
return match ? Number(match[1]) : 1;
|
|
82197
82207
|
}
|
|
82198
82208
|
function providesNamespace(text7) {
|
|
@@ -82219,8 +82229,8 @@ function catalogEntryName(contentsPath, kind, readText2) {
|
|
|
82219
82229
|
}
|
|
82220
82230
|
return segments.join("/");
|
|
82221
82231
|
}
|
|
82222
|
-
function isFlatResourceImage(
|
|
82223
|
-
return
|
|
82232
|
+
function isFlatResourceImage(path145) {
|
|
82233
|
+
return path145.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path145));
|
|
82224
82234
|
}
|
|
82225
82235
|
function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
82226
82236
|
const table = [];
|
|
@@ -82233,7 +82243,7 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
|
82233
82243
|
seen.set(bundlePath, names);
|
|
82234
82244
|
return { bundlePath, names };
|
|
82235
82245
|
};
|
|
82236
|
-
const catalogs = paths.filter((
|
|
82246
|
+
const catalogs = paths.filter((path145) => baseOf(path145) === "Contents.json");
|
|
82237
82247
|
for (const contentsPath of catalogs) {
|
|
82238
82248
|
const name3 = catalogEntryName(contentsPath, ".imageset", readText2);
|
|
82239
82249
|
if (name3 === null) continue;
|
|
@@ -82266,16 +82276,16 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
|
82266
82276
|
...intent === "template" || intent === "original" ? { renderingMode: intent } : {}
|
|
82267
82277
|
});
|
|
82268
82278
|
}
|
|
82269
|
-
for (const
|
|
82270
|
-
if (!isFlatResourceImage(
|
|
82271
|
-
const filename = baseOf(
|
|
82279
|
+
for (const path145 of paths) {
|
|
82280
|
+
if (!isFlatResourceImage(path145)) continue;
|
|
82281
|
+
const filename = baseOf(path145);
|
|
82272
82282
|
const name3 = filename.slice(0, -extOf(filename).length);
|
|
82273
|
-
const { bundlePath, names } = namesFor(
|
|
82283
|
+
const { bundlePath, names } = namesFor(path145);
|
|
82274
82284
|
if (name3 === "" || names.has(name3)) continue;
|
|
82275
82285
|
names.add(name3);
|
|
82276
82286
|
const scaledFilename = filename.replace(/@[23]x(?=\.[^./]+$)/, "");
|
|
82277
82287
|
const fileNames = (scaledFilename === filename ? [filename] : [filename, scaledFilename]).filter((lookup2) => !names.has(lookup2));
|
|
82278
|
-
table.push({ name: name3, file:
|
|
82288
|
+
table.push({ name: name3, file: path145, scale: flatScale(path145), bundlePath, fileNames });
|
|
82279
82289
|
}
|
|
82280
82290
|
return table;
|
|
82281
82291
|
}
|
|
@@ -82310,7 +82320,7 @@ function colorsetValue(color) {
|
|
|
82310
82320
|
}
|
|
82311
82321
|
function enumerateBundleColors(paths, readText2) {
|
|
82312
82322
|
const table = {};
|
|
82313
|
-
for (const contentsPath of paths.filter((
|
|
82323
|
+
for (const contentsPath of paths.filter((path145) => baseOf(path145) === "Contents.json")) {
|
|
82314
82324
|
const name3 = catalogEntryName(contentsPath, ".colorset", readText2);
|
|
82315
82325
|
if (name3 === null || name3 in table) continue;
|
|
82316
82326
|
let colors;
|
|
@@ -82374,8 +82384,8 @@ function axisExtremes(points) {
|
|
|
82374
82384
|
function pathBounds(d) {
|
|
82375
82385
|
const xs = [];
|
|
82376
82386
|
const ys = [];
|
|
82377
|
-
for (const
|
|
82378
|
-
(0, import_svgpath.default)(
|
|
82387
|
+
for (const path145 of d)
|
|
82388
|
+
(0, import_svgpath.default)(path145).abs().unshort().unarc().iterate((segment3, _index, x, y) => {
|
|
82379
82389
|
const [command, ...args] = segment3;
|
|
82380
82390
|
if (command === "M" || command === "L") {
|
|
82381
82391
|
xs.push(Number(args[0]));
|
|
@@ -82441,7 +82451,7 @@ function guide(elements, id, axis) {
|
|
|
82441
82451
|
}
|
|
82442
82452
|
function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
82443
82453
|
const table = {};
|
|
82444
|
-
for (const contentsPath of paths.filter((
|
|
82454
|
+
for (const contentsPath of paths.filter((path145) => baseOf(path145) === "Contents.json")) {
|
|
82445
82455
|
const name3 = catalogEntryName(contentsPath, ".symbolset", readText2);
|
|
82446
82456
|
if (name3 === null) continue;
|
|
82447
82457
|
const bundle = bundleForFile(contentsPath);
|
|
@@ -82507,8 +82517,8 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
|
82507
82517
|
advance,
|
|
82508
82518
|
box: [12 - wide2 / 2, 12 - tall / 2, wide2, tall],
|
|
82509
82519
|
...bearings ? { customLayout: { bearings, verticalOutset, descent } } : {},
|
|
82510
|
-
layers: d.map((
|
|
82511
|
-
d: (0, import_svgpath.default)(
|
|
82520
|
+
layers: d.map((path145) => ({
|
|
82521
|
+
d: (0, import_svgpath.default)(path145).abs().scale(em).translate(translateX, translateY).round(3).toString()
|
|
82512
82522
|
}))
|
|
82513
82523
|
};
|
|
82514
82524
|
table[vectorKey] = vector;
|
|
@@ -82519,13 +82529,13 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
|
82519
82529
|
}
|
|
82520
82530
|
return table;
|
|
82521
82531
|
}
|
|
82522
|
-
function isCopiedResource(
|
|
82523
|
-
const segments =
|
|
82532
|
+
function isCopiedResource(path145, copiedBundle, copyLooseRasters) {
|
|
82533
|
+
const segments = path145.split("/");
|
|
82524
82534
|
if (segments.some((segment3) => /\.(atlasc|bundle|storyboardc|nib|momd)$/.test(segment3)))
|
|
82525
82535
|
return true;
|
|
82526
82536
|
if (segments.some((segment3) => /\.xcdatamodeld?$/.test(segment3))) return false;
|
|
82527
82537
|
if (copiedBundle) return true;
|
|
82528
|
-
const ext = extOf(
|
|
82538
|
+
const ext = extOf(path145);
|
|
82529
82539
|
if (ext === ".json" || ext === ".xcstrings") return true;
|
|
82530
82540
|
return !COMPILED_EXTENSIONS.has(ext) && (copyLooseRasters || !RASTER_EXTENSIONS.has(ext)) && !segments.some((segment3) => segment3.endsWith(".xcassets"));
|
|
82531
82541
|
}
|
|
@@ -82533,7 +82543,7 @@ function enumerateBundleResources(paths, { copiedBundle = false, copyLooseRaster
|
|
|
82533
82543
|
const found = [];
|
|
82534
82544
|
const seen = /* @__PURE__ */ new Set();
|
|
82535
82545
|
const ordered = [...paths].filter(
|
|
82536
|
-
(
|
|
82546
|
+
(path145) => path145.split("/").includes("Resources") && path145.split("/").every((segment3) => segment3 !== "" && segment3 !== "..") && isCopiedResource(path145, copiedBundle, copyLooseRasters)
|
|
82537
82547
|
).sort((a, b) => {
|
|
82538
82548
|
const aDepth = a.split("/").length;
|
|
82539
82549
|
const bDepth = b.split("/").length;
|
|
@@ -82681,31 +82691,31 @@ function tokens(text7) {
|
|
|
82681
82691
|
}
|
|
82682
82692
|
return result;
|
|
82683
82693
|
}
|
|
82684
|
-
function qualified(language, key2,
|
|
82685
|
-
return `(${language}: ${key2}${
|
|
82694
|
+
function qualified(language, key2, path145) {
|
|
82695
|
+
return `(${language}: ${key2}${path145 === "" ? "" : "|==|" + path145})`;
|
|
82686
82696
|
}
|
|
82687
|
-
function requiresNumber(language, key2,
|
|
82697
|
+
function requiresNumber(language, key2, path145) {
|
|
82688
82698
|
return Error(
|
|
82689
|
-
"Plural variation requires referencing the number in the string. To maintain grammatical correctness for strings that do not reference the number of items, use separate top-level strings for one and greater than one. " + qualified(language, key2,
|
|
82699
|
+
"Plural variation requires referencing the number in the string. To maintain grammatical correctness for strings that do not reference the number of items, use separate top-level strings for one and greater than one. " + qualified(language, key2, path145)
|
|
82690
82700
|
);
|
|
82691
82701
|
}
|
|
82692
|
-
function moreThanOne(language, key2,
|
|
82702
|
+
function moreThanOne(language, key2, path145) {
|
|
82693
82703
|
return Error(
|
|
82694
|
-
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2,
|
|
82704
|
+
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path145)
|
|
82695
82705
|
);
|
|
82696
82706
|
}
|
|
82697
82707
|
function schemaPath(segments) {
|
|
82698
82708
|
return segments.map((segment3) => `'${segment3}'`).join(" -> ");
|
|
82699
82709
|
}
|
|
82700
|
-
function checkUnitShape(node,
|
|
82710
|
+
function checkUnitShape(node, path145) {
|
|
82701
82711
|
const raw2 = node.stringUnit;
|
|
82702
82712
|
if (raw2 === void 0)
|
|
82703
|
-
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(
|
|
82713
|
+
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path145)}`);
|
|
82704
82714
|
if (raw2 === null)
|
|
82705
|
-
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(
|
|
82715
|
+
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path145)}`);
|
|
82706
82716
|
if (!isRecord6(raw2))
|
|
82707
|
-
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(
|
|
82708
|
-
const unitPath = [...
|
|
82717
|
+
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path145)}`);
|
|
82718
|
+
const unitPath = [...path145, "stringUnit"];
|
|
82709
82719
|
if (!Object.hasOwn(raw2, "state"))
|
|
82710
82720
|
throw Error(`Missing required key 'state' inside ${schemaPath(unitPath)}`);
|
|
82711
82721
|
const state = raw2.state;
|
|
@@ -82722,38 +82732,38 @@ function checkUnitShape(node, path144) {
|
|
|
82722
82732
|
throw Error(`Expected string for key 'value' inside ${schemaPath(unitPath)}`);
|
|
82723
82733
|
return value;
|
|
82724
82734
|
}
|
|
82725
|
-
function checkPluralShape(node,
|
|
82735
|
+
function checkPluralShape(node, path145) {
|
|
82726
82736
|
for (const [category, raw2] of Object.entries(node)) {
|
|
82727
|
-
const categoryPath = [...
|
|
82737
|
+
const categoryPath = [...path145, category];
|
|
82728
82738
|
if (raw2 === null)
|
|
82729
82739
|
throw Error(
|
|
82730
|
-
`Missing required value for key '${category}' inside ${schemaPath(
|
|
82740
|
+
`Missing required value for key '${category}' inside ${schemaPath(path145)}`
|
|
82731
82741
|
);
|
|
82732
82742
|
if (!isRecord6(raw2))
|
|
82733
|
-
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(
|
|
82743
|
+
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path145)}`);
|
|
82734
82744
|
checkUnitShape(raw2, categoryPath);
|
|
82735
82745
|
}
|
|
82736
82746
|
}
|
|
82737
|
-
function checkLocalizationShape(node,
|
|
82747
|
+
function checkLocalizationShape(node, path145, deviceValue = false) {
|
|
82738
82748
|
if (node === null)
|
|
82739
82749
|
throw Error(
|
|
82740
|
-
`Missing required value for key '${
|
|
82750
|
+
`Missing required value for key '${path145[path145.length - 1]}' inside ${schemaPath(path145.slice(0, -1))}`
|
|
82741
82751
|
);
|
|
82742
82752
|
if (!isRecord6(node))
|
|
82743
82753
|
throw Error(
|
|
82744
|
-
`Expected dictionary for key '${
|
|
82754
|
+
`Expected dictionary for key '${path145[path145.length - 1]}' inside ${schemaPath(path145.slice(0, -1))}`
|
|
82745
82755
|
);
|
|
82746
|
-
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations,
|
|
82756
|
+
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path145);
|
|
82747
82757
|
if (!deviceValue && Object.hasOwn(node, "substitutions"))
|
|
82748
|
-
checkSubstitutionsShape(node.substitutions,
|
|
82749
|
-
if (!Object.hasOwn(node, "variations")) checkUnitShape(node,
|
|
82758
|
+
checkSubstitutionsShape(node.substitutions, path145);
|
|
82759
|
+
if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path145);
|
|
82750
82760
|
}
|
|
82751
|
-
function checkVariationsShape(variations,
|
|
82761
|
+
function checkVariationsShape(variations, path145) {
|
|
82752
82762
|
if (variations === null)
|
|
82753
|
-
throw Error(`Missing required value for key 'variations' inside ${schemaPath(
|
|
82763
|
+
throw Error(`Missing required value for key 'variations' inside ${schemaPath(path145)}`);
|
|
82754
82764
|
if (!isRecord6(variations))
|
|
82755
|
-
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(
|
|
82756
|
-
const variationsPath = [...
|
|
82765
|
+
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path145)}`);
|
|
82766
|
+
const variationsPath = [...path145, "variations"];
|
|
82757
82767
|
for (const [type, raw2] of Object.entries(variations)) {
|
|
82758
82768
|
if (raw2 === null)
|
|
82759
82769
|
throw Error(
|
|
@@ -82779,11 +82789,11 @@ function checkVariationsShape(variations, path144) {
|
|
|
82779
82789
|
}
|
|
82780
82790
|
}
|
|
82781
82791
|
}
|
|
82782
|
-
function checkSubstitutionsShape(substitutions,
|
|
82792
|
+
function checkSubstitutionsShape(substitutions, path145) {
|
|
82783
82793
|
if (substitutions === null) return;
|
|
82784
82794
|
if (!isRecord6(substitutions))
|
|
82785
|
-
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(
|
|
82786
|
-
const substitutionsPath = [...
|
|
82795
|
+
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path145)}`);
|
|
82796
|
+
const substitutionsPath = [...path145, "substitutions"];
|
|
82787
82797
|
for (const [name3, raw2] of Object.entries(substitutions)) {
|
|
82788
82798
|
const subPath = [...substitutionsPath, name3];
|
|
82789
82799
|
if (raw2 === null)
|
|
@@ -82825,10 +82835,10 @@ function scanSpecs(forms) {
|
|
|
82825
82835
|
}
|
|
82826
82836
|
return specs;
|
|
82827
82837
|
}
|
|
82828
|
-
function inferPlural(forms, language, key2,
|
|
82838
|
+
function inferPlural(forms, language, key2, path145) {
|
|
82829
82839
|
const specs = scanSpecs(forms);
|
|
82830
|
-
if (specs.size === 0) throw requiresNumber(language, key2,
|
|
82831
|
-
if (specs.size > 1) throw moreThanOne(language, key2,
|
|
82840
|
+
if (specs.size === 0) throw requiresNumber(language, key2, path145);
|
|
82841
|
+
if (specs.size > 1) throw moreThanOne(language, key2, path145);
|
|
82832
82842
|
return [...specs.values()][0] ?? { specifier: "", argument: 0 };
|
|
82833
82843
|
}
|
|
82834
82844
|
function unit(value) {
|
|
@@ -83297,8 +83307,8 @@ function plist(value, depth) {
|
|
|
83297
83307
|
}
|
|
83298
83308
|
function compileStringCatalog(source, name3) {
|
|
83299
83309
|
return Object.fromEntries(
|
|
83300
|
-
Object.entries(compileCatalogTables(source, name3)).map(([
|
|
83301
|
-
|
|
83310
|
+
Object.entries(compileCatalogTables(source, name3)).map(([path145, table]) => [
|
|
83311
|
+
path145,
|
|
83302
83312
|
'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n' + plist(table, 0) + "</plist>\n"
|
|
83303
83313
|
])
|
|
83304
83314
|
);
|
|
@@ -88864,8 +88874,8 @@ function withBuiltinStandinBehavior(behavior) {
|
|
|
88864
88874
|
for (const [module2, members2] of Object.entries(BUILTIN_STANDIN_BEHAVIOR))
|
|
88865
88875
|
merged[module2] = {
|
|
88866
88876
|
...Object.fromEntries(
|
|
88867
|
-
Object.entries(members2).map(([
|
|
88868
|
-
|
|
88877
|
+
Object.entries(members2).map(([path145, entry]) => [
|
|
88878
|
+
path145,
|
|
88869
88879
|
{ ...entry, builtin: true }
|
|
88870
88880
|
])
|
|
88871
88881
|
),
|
|
@@ -94223,7 +94233,7 @@ function resolveSwiftPackages(options2) {
|
|
|
94223
94233
|
headers.set(name3, import_node_path113.default.relative(binary2.dir, dir));
|
|
94224
94234
|
};
|
|
94225
94235
|
visit3(pkg, binary2.target);
|
|
94226
|
-
binary2.headerDependencies = [...headers].map(([module2,
|
|
94236
|
+
binary2.headerDependencies = [...headers].map(([module2, path145]) => ({ module: module2, path: path145 }));
|
|
94227
94237
|
}
|
|
94228
94238
|
for (const owner of options2.owners ?? []) {
|
|
94229
94239
|
const found = productClosure(owner.products);
|
|
@@ -95254,7 +95264,7 @@ async function buildXcodeLayout(root) {
|
|
|
95254
95264
|
});
|
|
95255
95265
|
if (framework.moduleName !== module2 || framework.allSources.length === 0)
|
|
95256
95266
|
throw new Error(`${project2}: ${target} did not produce source module ${module2}`);
|
|
95257
|
-
if (framework.linkedProducts.length > 0 || framework.binaryFrameworks.some(({ path:
|
|
95267
|
+
if (framework.linkedProducts.length > 0 || framework.binaryFrameworks.some(({ path: path145 }) => path145))
|
|
95258
95268
|
throw new Error(
|
|
95259
95269
|
`${project2}: ${target} has external dependencies outside the source framework build`
|
|
95260
95270
|
);
|
|
@@ -98261,11 +98271,11 @@ function stringList3(value) {
|
|
|
98261
98271
|
function externalSpecMembers(root, requested) {
|
|
98262
98272
|
const children = (spec) => Array.isArray(spec.subspecs) ? spec.subspecs.filter(object7) : [];
|
|
98263
98273
|
const chains = /* @__PURE__ */ new Map();
|
|
98264
|
-
const select = (
|
|
98265
|
-
const key2 =
|
|
98274
|
+
const select = (path145) => {
|
|
98275
|
+
const key2 = path145.join("/");
|
|
98266
98276
|
if (chains.has(key2)) return;
|
|
98267
98277
|
const chain = [root];
|
|
98268
|
-
for (const part of
|
|
98278
|
+
for (const part of path145) {
|
|
98269
98279
|
const child = children(chain.at(-1)).find((sub) => sub.name === part);
|
|
98270
98280
|
if (!child) throw new Error(`${String(root.name)} has no subspec ${key2}`);
|
|
98271
98281
|
chain.push(child);
|
|
@@ -98274,7 +98284,7 @@ function externalSpecMembers(root, requested) {
|
|
|
98274
98284
|
const spec = chain.at(-1);
|
|
98275
98285
|
const defaults = stringList3(spec.default_subspecs ?? spec.default_subspec);
|
|
98276
98286
|
const activated = defaults[0] === "none" ? [] : defaults.length > 0 ? defaults : children(spec).map((sub) => String(sub.name));
|
|
98277
|
-
for (const name3 of activated) select([...
|
|
98287
|
+
for (const name3 of activated) select([...path145, ...name3.split("/")]);
|
|
98278
98288
|
for (const member of chain)
|
|
98279
98289
|
for (const dependencies of [member.dependencies, iosOf(member)?.dependencies])
|
|
98280
98290
|
for (const dependency of object7(dependencies) ? Object.keys(dependencies) : []) {
|
|
@@ -104512,9 +104522,9 @@ function hashPackageTree(root, options2) {
|
|
|
104512
104522
|
(a, b) => options2.compareNames(a.name, b.name)
|
|
104513
104523
|
)) {
|
|
104514
104524
|
if (entry.name === "node_modules") continue;
|
|
104515
|
-
const
|
|
104516
|
-
if (entry.isDirectory()) walk4((0, import_node_path127.join)(directory2, entry.name), `${
|
|
104517
|
-
else if (entry.isFile() && !options2.skipFile?.(entry.name)) files2.push(
|
|
104525
|
+
const path145 = `${relative4}${entry.name}`;
|
|
104526
|
+
if (entry.isDirectory()) walk4((0, import_node_path127.join)(directory2, entry.name), `${path145}/`);
|
|
104527
|
+
else if (entry.isFile() && !options2.skipFile?.(entry.name)) files2.push(path145);
|
|
104518
104528
|
}
|
|
104519
104529
|
};
|
|
104520
104530
|
walk4(root, "");
|
|
@@ -104676,7 +104686,7 @@ var init_nitro_superset = __esm({
|
|
|
104676
104686
|
init_nitroContract();
|
|
104677
104687
|
init_swift_standin_digest();
|
|
104678
104688
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
104679
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
104689
|
+
NITRO_COMPILER_DIGEST = true ? "016cea19f1cc5d555e76902ec405d21614342592970543f33474e806c2cb73e8" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
104680
104690
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
104681
104691
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
104682
104692
|
published = /* @__PURE__ */ new Map();
|
|
@@ -104856,6 +104866,282 @@ var init_nitro_bundle = __esm({
|
|
|
104856
104866
|
}
|
|
104857
104867
|
});
|
|
104858
104868
|
|
|
104869
|
+
// src/one-sdk/shard.ts
|
|
104870
|
+
function unsharded(name3, source) {
|
|
104871
|
+
const lineCount = source.split("\n").length;
|
|
104872
|
+
return [
|
|
104873
|
+
{
|
|
104874
|
+
name: name3,
|
|
104875
|
+
source,
|
|
104876
|
+
originalName: name3,
|
|
104877
|
+
lineMap: Array.from({ length: lineCount }, (_, index) => index + 1)
|
|
104878
|
+
}
|
|
104879
|
+
];
|
|
104880
|
+
}
|
|
104881
|
+
function chunkKey2(lines) {
|
|
104882
|
+
for (const { text: text7 } of lines) {
|
|
104883
|
+
const trimmed = text7.trim();
|
|
104884
|
+
if (trimmed !== "" && !trimmed.startsWith("//")) return trimmed;
|
|
104885
|
+
}
|
|
104886
|
+
return lines.map((item) => item.text).join("\n");
|
|
104887
|
+
}
|
|
104888
|
+
function stableShardIndex(key2, shardCount) {
|
|
104889
|
+
return (0, import_node_crypto78.createHash)("sha256").update(key2).digest().readUInt32BE(0) % shardCount;
|
|
104890
|
+
}
|
|
104891
|
+
function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SHARDS) {
|
|
104892
|
+
if (shardCount <= 1 || !name3.endsWith(".swift") || name3.endsWith(".types.swift") || source.length < ONE_SDK_BINDING_SHARD_MIN_BYTES) {
|
|
104893
|
+
return unsharded(name3, source);
|
|
104894
|
+
}
|
|
104895
|
+
const masked = swiftCodeMask(source);
|
|
104896
|
+
if (/\bfileprivate\b/.test(masked)) return unsharded(name3, source);
|
|
104897
|
+
const lines = source.split("\n");
|
|
104898
|
+
const maskedLines = masked.split("\n");
|
|
104899
|
+
if (lines.length !== maskedLines.length) return unsharded(name3, source);
|
|
104900
|
+
const headerLines = [];
|
|
104901
|
+
let index = 0;
|
|
104902
|
+
let headerIfDepth = 0;
|
|
104903
|
+
while (index < lines.length) {
|
|
104904
|
+
const text7 = lines[index];
|
|
104905
|
+
const trimmed = text7.trim();
|
|
104906
|
+
if (trimmed === "" || trimmed.startsWith("// generated ") || trimmed.startsWith("import ")) {
|
|
104907
|
+
headerLines.push({ text: text7, line: index + 1 });
|
|
104908
|
+
index++;
|
|
104909
|
+
continue;
|
|
104910
|
+
}
|
|
104911
|
+
if (trimmed.startsWith("#if ")) {
|
|
104912
|
+
headerIfDepth++;
|
|
104913
|
+
headerLines.push({ text: text7, line: index + 1 });
|
|
104914
|
+
index++;
|
|
104915
|
+
continue;
|
|
104916
|
+
}
|
|
104917
|
+
if (headerIfDepth > 0 && (trimmed.startsWith("#elseif ") || trimmed === "#else" || trimmed === "#endif")) {
|
|
104918
|
+
if (trimmed === "#endif") headerIfDepth--;
|
|
104919
|
+
headerLines.push({ text: text7, line: index + 1 });
|
|
104920
|
+
index++;
|
|
104921
|
+
continue;
|
|
104922
|
+
}
|
|
104923
|
+
break;
|
|
104924
|
+
}
|
|
104925
|
+
if (headerIfDepth !== 0) return unsharded(name3, source);
|
|
104926
|
+
while (headerLines.length > 0 && headerLines.at(-1).text.trim() === "") {
|
|
104927
|
+
headerLines.pop();
|
|
104928
|
+
}
|
|
104929
|
+
const chunks = [];
|
|
104930
|
+
let depth = 0;
|
|
104931
|
+
let pending2 = [];
|
|
104932
|
+
let hadBrace = false;
|
|
104933
|
+
let inImplementation = false;
|
|
104934
|
+
let inOpen = false;
|
|
104935
|
+
let openDeclarations = 0;
|
|
104936
|
+
let activeEnum = null;
|
|
104937
|
+
let enumDeclLine = 0;
|
|
104938
|
+
let memberLines = [];
|
|
104939
|
+
let memberHadBrace = false;
|
|
104940
|
+
for (; index < lines.length; index++) {
|
|
104941
|
+
const text7 = lines[index];
|
|
104942
|
+
const lineNo = index + 1;
|
|
104943
|
+
const maskedLine = maskedLines[index];
|
|
104944
|
+
if (depth <= 1 && /^\s*#/.test(maskedLine)) return unsharded(name3, source);
|
|
104945
|
+
let delta = 0;
|
|
104946
|
+
for (let i = 0; i < maskedLine.length; i++) {
|
|
104947
|
+
const ch = maskedLine[i];
|
|
104948
|
+
if (ch === "{") delta++;
|
|
104949
|
+
else if (ch === "}") delta--;
|
|
104950
|
+
}
|
|
104951
|
+
if (activeEnum === null) {
|
|
104952
|
+
if (depth === 0 && !hadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
|
|
104953
|
+
return unsharded(name3, source);
|
|
104954
|
+
}
|
|
104955
|
+
if (depth === 0 && !hadBrace && !inImplementation && text7.startsWith("// implementation ")) {
|
|
104956
|
+
inImplementation = true;
|
|
104957
|
+
pending2.push({ text: text7, line: lineNo });
|
|
104958
|
+
continue;
|
|
104959
|
+
}
|
|
104960
|
+
if (inImplementation) {
|
|
104961
|
+
pending2.push({ text: text7, line: lineNo });
|
|
104962
|
+
depth += delta;
|
|
104963
|
+
if (depth < 0) return unsharded(name3, source);
|
|
104964
|
+
if (depth === 0 && text7 === "// end implementation") {
|
|
104965
|
+
chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
|
|
104966
|
+
pending2 = [];
|
|
104967
|
+
hadBrace = false;
|
|
104968
|
+
inImplementation = false;
|
|
104969
|
+
}
|
|
104970
|
+
continue;
|
|
104971
|
+
}
|
|
104972
|
+
if (depth === 0 && !hadBrace && !inOpen && text7.startsWith("// open ")) {
|
|
104973
|
+
inOpen = true;
|
|
104974
|
+
openDeclarations = 0;
|
|
104975
|
+
pending2.push({ text: text7, line: lineNo });
|
|
104976
|
+
continue;
|
|
104977
|
+
}
|
|
104978
|
+
if (inOpen) {
|
|
104979
|
+
pending2.push({ text: text7, line: lineNo });
|
|
104980
|
+
if (delta !== 0 || depth > 0) hadBrace = true;
|
|
104981
|
+
depth += delta;
|
|
104982
|
+
if (depth < 0) return unsharded(name3, source);
|
|
104983
|
+
if (hadBrace && depth === 0) {
|
|
104984
|
+
openDeclarations++;
|
|
104985
|
+
hadBrace = false;
|
|
104986
|
+
if (openDeclarations === 2) {
|
|
104987
|
+
chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
|
|
104988
|
+
pending2 = [];
|
|
104989
|
+
inOpen = false;
|
|
104990
|
+
openDeclarations = 0;
|
|
104991
|
+
}
|
|
104992
|
+
}
|
|
104993
|
+
continue;
|
|
104994
|
+
}
|
|
104995
|
+
const enumMatch = depth === 0 && !hadBrace && pending2.every(
|
|
104996
|
+
(item) => item.text.trim() === "" || item.text.trim().startsWith("//")
|
|
104997
|
+
) ? /^enum (OneSDK_\w+)\s*\{\s*$/.exec(maskedLine) : null;
|
|
104998
|
+
if (enumMatch && delta === 1) {
|
|
104999
|
+
const enumName = enumMatch[1];
|
|
105000
|
+
const prefix = pending2.filter((item) => item.text.trim() !== "");
|
|
105001
|
+
enumDeclLine = lineNo;
|
|
105002
|
+
chunks.push({
|
|
105003
|
+
kind: "enumDecl",
|
|
105004
|
+
enumName,
|
|
105005
|
+
lines: [...prefix, { text: `enum ${enumName} {}`, line: lineNo }]
|
|
105006
|
+
});
|
|
105007
|
+
pending2 = [];
|
|
105008
|
+
activeEnum = enumName;
|
|
105009
|
+
depth = 1;
|
|
105010
|
+
continue;
|
|
105011
|
+
}
|
|
105012
|
+
if (depth === 0 && !hadBrace && text7.trim() === "" && pending2.length === 0) {
|
|
105013
|
+
continue;
|
|
105014
|
+
}
|
|
105015
|
+
pending2.push({ text: text7, line: lineNo });
|
|
105016
|
+
if (delta !== 0 || depth > 0) hadBrace = true;
|
|
105017
|
+
depth += delta;
|
|
105018
|
+
if (depth < 0) return unsharded(name3, source);
|
|
105019
|
+
if (hadBrace && depth === 0) {
|
|
105020
|
+
chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
|
|
105021
|
+
pending2 = [];
|
|
105022
|
+
hadBrace = false;
|
|
105023
|
+
}
|
|
105024
|
+
} else {
|
|
105025
|
+
const nextDepth = depth + delta;
|
|
105026
|
+
if (nextDepth < 0) return unsharded(name3, source);
|
|
105027
|
+
if (depth === 1 && nextDepth === 0) {
|
|
105028
|
+
if (memberHadBrace || maskedLine.trim() !== "}") return unsharded(name3, source);
|
|
105029
|
+
if (memberLines.some(
|
|
105030
|
+
(item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
|
|
105031
|
+
)) {
|
|
105032
|
+
chunks.push({
|
|
105033
|
+
kind: "enumMember",
|
|
105034
|
+
enumName: activeEnum,
|
|
105035
|
+
key: chunkKey2(memberLines),
|
|
105036
|
+
lines: memberLines
|
|
105037
|
+
});
|
|
105038
|
+
}
|
|
105039
|
+
activeEnum = null;
|
|
105040
|
+
depth = 0;
|
|
105041
|
+
memberLines = [];
|
|
105042
|
+
continue;
|
|
105043
|
+
}
|
|
105044
|
+
if (depth === 1 && !memberHadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
|
|
105045
|
+
return unsharded(name3, source);
|
|
105046
|
+
}
|
|
105047
|
+
if (depth === 1 && !memberHadBrace && text7.trim() === "") {
|
|
105048
|
+
depth = nextDepth;
|
|
105049
|
+
continue;
|
|
105050
|
+
}
|
|
105051
|
+
memberLines.push({ text: text7, line: lineNo });
|
|
105052
|
+
if (nextDepth > 1 || delta !== 0) memberHadBrace = true;
|
|
105053
|
+
depth = nextDepth;
|
|
105054
|
+
if (memberHadBrace && depth === 1 || !memberHadBrace && depth === 1 && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*static\s+let\b/.test(maskedLine)) {
|
|
105055
|
+
chunks.push({
|
|
105056
|
+
kind: "enumMember",
|
|
105057
|
+
enumName: activeEnum,
|
|
105058
|
+
key: chunkKey2(memberLines),
|
|
105059
|
+
lines: memberLines
|
|
105060
|
+
});
|
|
105061
|
+
memberLines = [];
|
|
105062
|
+
memberHadBrace = false;
|
|
105063
|
+
}
|
|
105064
|
+
}
|
|
105065
|
+
}
|
|
105066
|
+
if (depth !== 0 || activeEnum !== null || inImplementation || inOpen || pending2.some(
|
|
105067
|
+
(item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
|
|
105068
|
+
) || chunks.length < shardCount) {
|
|
105069
|
+
return unsharded(name3, source);
|
|
105070
|
+
}
|
|
105071
|
+
const buckets = Array.from({ length: shardCount }, () => []);
|
|
105072
|
+
for (const chunk of chunks) {
|
|
105073
|
+
if (chunk.kind === "enumDecl") {
|
|
105074
|
+
buckets[0].push(chunk);
|
|
105075
|
+
} else {
|
|
105076
|
+
buckets[stableShardIndex(chunk.key, shardCount)].push(chunk);
|
|
105077
|
+
}
|
|
105078
|
+
}
|
|
105079
|
+
const nonEmpty = buckets.map((bucket, index2) => ({ bucket, index: index2 })).filter(({ bucket }) => bucket.length > 0);
|
|
105080
|
+
if (nonEmpty.length < 2) return unsharded(name3, source);
|
|
105081
|
+
const stem2 = name3.slice(0, -".swift".length);
|
|
105082
|
+
return nonEmpty.map(({ bucket, index: shardIndex }) => {
|
|
105083
|
+
const outLines = [];
|
|
105084
|
+
const lineMap = [];
|
|
105085
|
+
const pushLine = (text7, origLine) => {
|
|
105086
|
+
outLines.push(text7);
|
|
105087
|
+
lineMap.push(origLine);
|
|
105088
|
+
};
|
|
105089
|
+
for (const item of headerLines) pushLine(item.text, item.line);
|
|
105090
|
+
pushLine("", 0);
|
|
105091
|
+
let openEnum = null;
|
|
105092
|
+
let enumBody = [];
|
|
105093
|
+
let hasPart = false;
|
|
105094
|
+
const startPart = () => {
|
|
105095
|
+
if (hasPart) pushLine("", 0);
|
|
105096
|
+
hasPart = true;
|
|
105097
|
+
};
|
|
105098
|
+
const flushEnum = () => {
|
|
105099
|
+
if (!openEnum) return;
|
|
105100
|
+
startPart();
|
|
105101
|
+
pushLine(`extension ${openEnum} {`, enumDeclLine);
|
|
105102
|
+
for (let i = 0; i < enumBody.length; i++) {
|
|
105103
|
+
if (i > 0) pushLine("", 0);
|
|
105104
|
+
for (const item of enumBody[i]) pushLine(item.text, item.line);
|
|
105105
|
+
}
|
|
105106
|
+
pushLine("}", enumDeclLine);
|
|
105107
|
+
openEnum = null;
|
|
105108
|
+
enumBody = [];
|
|
105109
|
+
};
|
|
105110
|
+
for (const chunk of bucket) {
|
|
105111
|
+
if (chunk.kind === "enumMember") {
|
|
105112
|
+
if (openEnum !== chunk.enumName) {
|
|
105113
|
+
flushEnum();
|
|
105114
|
+
openEnum = chunk.enumName;
|
|
105115
|
+
}
|
|
105116
|
+
enumBody.push(chunk.lines);
|
|
105117
|
+
} else {
|
|
105118
|
+
flushEnum();
|
|
105119
|
+
startPart();
|
|
105120
|
+
for (const item of chunk.lines) pushLine(item.text, item.line);
|
|
105121
|
+
}
|
|
105122
|
+
}
|
|
105123
|
+
flushEnum();
|
|
105124
|
+
pushLine("", 0);
|
|
105125
|
+
return {
|
|
105126
|
+
name: `${stem2}_${shardIndex}.swift`,
|
|
105127
|
+
source: outLines.join("\n"),
|
|
105128
|
+
originalName: name3,
|
|
105129
|
+
lineMap
|
|
105130
|
+
};
|
|
105131
|
+
});
|
|
105132
|
+
}
|
|
105133
|
+
var import_node_crypto78, import_node_path130, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES;
|
|
105134
|
+
var init_shard = __esm({
|
|
105135
|
+
"src/one-sdk/shard.ts"() {
|
|
105136
|
+
"use strict";
|
|
105137
|
+
import_node_crypto78 = require("node:crypto");
|
|
105138
|
+
import_node_path130 = __toESM(require("node:path"), 1);
|
|
105139
|
+
init_swift_compile();
|
|
105140
|
+
ONE_SDK_BINDING_SHARDS = 8;
|
|
105141
|
+
ONE_SDK_BINDING_SHARD_MIN_BYTES = 256 * 1024;
|
|
105142
|
+
}
|
|
105143
|
+
});
|
|
105144
|
+
|
|
104859
105145
|
// src/one-sdk/source.ts
|
|
104860
105146
|
var oneSDKModule, oneSDKHost, oneSDKApp, oneSDKTransport;
|
|
104861
105147
|
var init_source2 = __esm({
|
|
@@ -105225,175 +105511,20 @@ async function compileOneSDKApp(appRoot, origin, moduleRootOverride) {
|
|
|
105225
105511
|
const prepared = await prepareExpoNativeProject(appRoot);
|
|
105226
105512
|
return compilePreparedOneSDKApp(appRoot, prepared.app, origin, moduleRootOverride);
|
|
105227
105513
|
}
|
|
105228
|
-
function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SHARDS) {
|
|
105229
|
-
if (shardCount <= 1 || !name3.endsWith(".swift") || name3.endsWith(".types.swift") || source.length < ONE_SDK_BINDING_SHARD_MIN_BYTES) {
|
|
105230
|
-
return [[name3, source]];
|
|
105231
|
-
}
|
|
105232
|
-
const masked = swiftCodeMask(source);
|
|
105233
|
-
if (/\bfileprivate\b/.test(masked)) return [[name3, source]];
|
|
105234
|
-
const lines = source.split("\n");
|
|
105235
|
-
const maskedLines = masked.split("\n");
|
|
105236
|
-
if (lines.length !== maskedLines.length) return [[name3, source]];
|
|
105237
|
-
const headerLines = [];
|
|
105238
|
-
let index = 0;
|
|
105239
|
-
while (index < lines.length) {
|
|
105240
|
-
const trimmed = lines[index].trim();
|
|
105241
|
-
if (trimmed === "" || trimmed.startsWith("// generated ") || trimmed.startsWith("import ")) {
|
|
105242
|
-
headerLines.push(lines[index]);
|
|
105243
|
-
index++;
|
|
105244
|
-
continue;
|
|
105245
|
-
}
|
|
105246
|
-
break;
|
|
105247
|
-
}
|
|
105248
|
-
const header = `${headerLines.join("\n").trimEnd()}
|
|
105249
|
-
|
|
105250
|
-
`;
|
|
105251
|
-
const chunks = [];
|
|
105252
|
-
let depth = 0;
|
|
105253
|
-
let pending2 = [];
|
|
105254
|
-
let hadBrace = false;
|
|
105255
|
-
let activeEnum = null;
|
|
105256
|
-
let memberLines = [];
|
|
105257
|
-
let memberHadBrace = false;
|
|
105258
|
-
for (; index < lines.length; index++) {
|
|
105259
|
-
const line = lines[index];
|
|
105260
|
-
const maskedLine = maskedLines[index];
|
|
105261
|
-
if (depth <= 1 && /^\s*#/.test(maskedLine)) return [[name3, source]];
|
|
105262
|
-
let delta = 0;
|
|
105263
|
-
for (let i = 0; i < maskedLine.length; i++) {
|
|
105264
|
-
const ch = maskedLine[i];
|
|
105265
|
-
if (ch === "{") delta++;
|
|
105266
|
-
else if (ch === "}") delta--;
|
|
105267
|
-
}
|
|
105268
|
-
if (activeEnum === null) {
|
|
105269
|
-
if (depth === 0 && !hadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
|
|
105270
|
-
return [[name3, source]];
|
|
105271
|
-
}
|
|
105272
|
-
const enumMatch = depth === 0 && !hadBrace && pending2.every((item) => item.trim() === "" || item.trim().startsWith("//")) ? /^enum (OneSDK_\w+)\s*\{\s*$/.exec(maskedLine) : null;
|
|
105273
|
-
if (enumMatch && delta === 1) {
|
|
105274
|
-
const enumName = enumMatch[1];
|
|
105275
|
-
const prefix = pending2.filter((item) => item.trim() !== "");
|
|
105276
|
-
chunks.push({
|
|
105277
|
-
kind: "top",
|
|
105278
|
-
text: [...prefix, `enum ${enumName} {}`].join("\n")
|
|
105279
|
-
});
|
|
105280
|
-
pending2 = [];
|
|
105281
|
-
activeEnum = enumName;
|
|
105282
|
-
depth = 1;
|
|
105283
|
-
continue;
|
|
105284
|
-
}
|
|
105285
|
-
if (depth === 0 && !hadBrace && line.trim() === "" && pending2.length === 0) {
|
|
105286
|
-
continue;
|
|
105287
|
-
}
|
|
105288
|
-
pending2.push(line);
|
|
105289
|
-
if (delta !== 0 || depth > 0) hadBrace = true;
|
|
105290
|
-
depth += delta;
|
|
105291
|
-
if (depth < 0) return [[name3, source]];
|
|
105292
|
-
if (hadBrace && depth === 0) {
|
|
105293
|
-
chunks.push({ kind: "top", text: pending2.join("\n") });
|
|
105294
|
-
pending2 = [];
|
|
105295
|
-
hadBrace = false;
|
|
105296
|
-
}
|
|
105297
|
-
} else {
|
|
105298
|
-
const nextDepth = depth + delta;
|
|
105299
|
-
if (nextDepth < 0) return [[name3, source]];
|
|
105300
|
-
if (depth === 1 && nextDepth === 0) {
|
|
105301
|
-
if (memberHadBrace || maskedLine.trim() !== "}") return [[name3, source]];
|
|
105302
|
-
if (memberLines.some((item) => item.trim() !== "" && !item.trim().startsWith("//"))) {
|
|
105303
|
-
chunks.push({
|
|
105304
|
-
kind: "enumMember",
|
|
105305
|
-
enumName: activeEnum,
|
|
105306
|
-
text: memberLines.join("\n")
|
|
105307
|
-
});
|
|
105308
|
-
}
|
|
105309
|
-
activeEnum = null;
|
|
105310
|
-
depth = 0;
|
|
105311
|
-
memberLines = [];
|
|
105312
|
-
continue;
|
|
105313
|
-
}
|
|
105314
|
-
if (depth === 1 && !memberHadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
|
|
105315
|
-
return [[name3, source]];
|
|
105316
|
-
}
|
|
105317
|
-
if (depth === 1 && !memberHadBrace && line.trim() === "") {
|
|
105318
|
-
depth = nextDepth;
|
|
105319
|
-
continue;
|
|
105320
|
-
}
|
|
105321
|
-
memberLines.push(line);
|
|
105322
|
-
if (nextDepth > 1 || delta !== 0) memberHadBrace = true;
|
|
105323
|
-
depth = nextDepth;
|
|
105324
|
-
if (memberHadBrace && depth === 1) {
|
|
105325
|
-
chunks.push({
|
|
105326
|
-
kind: "enumMember",
|
|
105327
|
-
enumName: activeEnum,
|
|
105328
|
-
text: memberLines.join("\n")
|
|
105329
|
-
});
|
|
105330
|
-
memberLines = [];
|
|
105331
|
-
memberHadBrace = false;
|
|
105332
|
-
}
|
|
105333
|
-
}
|
|
105334
|
-
}
|
|
105335
|
-
if (depth !== 0 || activeEnum !== null || pending2.some((item) => item.trim() !== "" && !item.trim().startsWith("//")) || chunks.length < shardCount) {
|
|
105336
|
-
return [[name3, source]];
|
|
105337
|
-
}
|
|
105338
|
-
const totalChars = chunks.reduce((sum, chunk) => sum + chunk.text.length, 0);
|
|
105339
|
-
const targetChars = Math.ceil(totalChars / shardCount);
|
|
105340
|
-
const buckets = [];
|
|
105341
|
-
let current2 = [];
|
|
105342
|
-
let currentChars = 0;
|
|
105343
|
-
for (const chunk of chunks) {
|
|
105344
|
-
if (current2.length > 0 && currentChars + chunk.text.length > targetChars && buckets.length + 1 < shardCount) {
|
|
105345
|
-
buckets.push(current2);
|
|
105346
|
-
current2 = [];
|
|
105347
|
-
currentChars = 0;
|
|
105348
|
-
}
|
|
105349
|
-
current2.push(chunk);
|
|
105350
|
-
currentChars += chunk.text.length;
|
|
105351
|
-
}
|
|
105352
|
-
if (current2.length > 0) buckets.push(current2);
|
|
105353
|
-
const stem2 = name3.slice(0, -".swift".length);
|
|
105354
|
-
return buckets.map((bucket, shardIndex) => {
|
|
105355
|
-
const parts = [];
|
|
105356
|
-
let openEnum = null;
|
|
105357
|
-
let enumBody = [];
|
|
105358
|
-
const flushEnum = () => {
|
|
105359
|
-
if (!openEnum) return;
|
|
105360
|
-
parts.push(`extension ${openEnum} {
|
|
105361
|
-
${enumBody.join("\n\n")}
|
|
105362
|
-
}`);
|
|
105363
|
-
openEnum = null;
|
|
105364
|
-
enumBody = [];
|
|
105365
|
-
};
|
|
105366
|
-
for (const chunk of bucket) {
|
|
105367
|
-
if (chunk.kind === "enumMember") {
|
|
105368
|
-
if (openEnum !== chunk.enumName) {
|
|
105369
|
-
flushEnum();
|
|
105370
|
-
openEnum = chunk.enumName;
|
|
105371
|
-
}
|
|
105372
|
-
enumBody.push(chunk.text);
|
|
105373
|
-
} else {
|
|
105374
|
-
flushEnum();
|
|
105375
|
-
parts.push(chunk.text);
|
|
105376
|
-
}
|
|
105377
|
-
}
|
|
105378
|
-
flushEnum();
|
|
105379
|
-
return [`${stem2}_${shardIndex}.swift`, `${header}${parts.join("\n\n")}
|
|
105380
|
-
`];
|
|
105381
|
-
});
|
|
105382
|
-
}
|
|
105383
105514
|
async function oneSDKLinkSources(appRoot, preparedRoot, options2 = {}) {
|
|
105384
105515
|
const selected = await selectOneSDK(appRoot);
|
|
105385
105516
|
if (!selected) throw new Error("prepared app has no One SDK imports");
|
|
105386
105517
|
const { one, frameworks } = selected;
|
|
105387
|
-
const sourceRoot =
|
|
105518
|
+
const sourceRoot = import_node_path131.default.join(preparedRoot, ONE_SDK_SOURCE_DIRECTORY);
|
|
105388
105519
|
const generated = readOneSDKSourceManifest(
|
|
105389
|
-
JSON.parse(import_node_fs128.default.readFileSync(
|
|
105520
|
+
JSON.parse(import_node_fs128.default.readFileSync(import_node_path131.default.join(sourceRoot, "manifest.json"), "utf8"))
|
|
105390
105521
|
);
|
|
105391
105522
|
const { generation } = JSON.parse(
|
|
105392
|
-
import_node_fs128.default.readFileSync(
|
|
105523
|
+
import_node_fs128.default.readFileSync(import_node_path131.default.join(one, "ios-bindings/manifest.json"), "utf8")
|
|
105393
105524
|
);
|
|
105394
105525
|
if (generated.generation !== generation) {
|
|
105395
105526
|
const { version: version2 } = JSON.parse(
|
|
105396
|
-
import_node_fs128.default.readFileSync(
|
|
105527
|
+
import_node_fs128.default.readFileSync(import_node_path131.default.join(one, "package.json"), "utf8")
|
|
105397
105528
|
);
|
|
105398
105529
|
throw new Error(
|
|
105399
105530
|
`${appRoot} has One ${version2} installed, which differs from the One its lockfile resolves. Install its dependencies, restart its dev server and open it again.`
|
|
@@ -105413,18 +105544,15 @@ async function oneSDKLinkSources(appRoot, preparedRoot, options2 = {}) {
|
|
|
105413
105544
|
"SDKViews/OneNativeViewsTable.swift"
|
|
105414
105545
|
])
|
|
105415
105546
|
targets.set(
|
|
105416
|
-
`Sources/One/${
|
|
105417
|
-
import_node_fs128.default.readFileSync(
|
|
105547
|
+
`Sources/One/${import_node_path131.default.basename(source)}`,
|
|
105548
|
+
import_node_fs128.default.readFileSync(import_node_path131.default.join(one, "ios", source), "utf8")
|
|
105418
105549
|
);
|
|
105419
105550
|
for (const name3 of generated.files) {
|
|
105420
105551
|
const filePath = `Sources/OneSDKBindings/${name3}`;
|
|
105421
|
-
const source = import_node_fs128.default.readFileSync(
|
|
105552
|
+
const source = import_node_fs128.default.readFileSync(import_node_path131.default.join(sourceRoot, name3), "utf8");
|
|
105422
105553
|
if (options2.shard) {
|
|
105423
|
-
for (const
|
|
105424
|
-
|
|
105425
|
-
source
|
|
105426
|
-
))
|
|
105427
|
-
targets.set(shardedName, shardedSource);
|
|
105554
|
+
for (const shard2 of shardOneSDKBindingSource(filePath, source))
|
|
105555
|
+
targets.set(shard2.name, shard2.source);
|
|
105428
105556
|
} else {
|
|
105429
105557
|
targets.set(filePath, source);
|
|
105430
105558
|
}
|
|
@@ -105446,10 +105574,10 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
|
|
|
105446
105574
|
const optimize = options2.optimize ?? true;
|
|
105447
105575
|
const sources = await oneSDKLinkSources(appRoot, preparedRoot, { shard: !optimize });
|
|
105448
105576
|
const moduleRoot = moduleRootOverride ?? (await resolveSwiftModule()).root;
|
|
105449
|
-
const packagePath =
|
|
105577
|
+
const packagePath = import_node_path131.default.join(
|
|
105450
105578
|
swiftCacheDir(),
|
|
105451
105579
|
"peach-one-sdk-swift",
|
|
105452
|
-
(0,
|
|
105580
|
+
(0, import_node_crypto79.createHash)("sha256").update(import_node_fs128.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
|
|
105453
105581
|
"sdk"
|
|
105454
105582
|
);
|
|
105455
105583
|
const bindingFlags = optimize ? '["-suppress-warnings"]' : '["-suppress-warnings", "-Onone", "-no-whole-module-optimization"]';
|
|
@@ -105471,7 +105599,7 @@ let package = Package(name: "OneSDKGuest", targets: [
|
|
|
105471
105599
|
import_node_fs128.default.mkdirSync(packagePath, { recursive: true });
|
|
105472
105600
|
syncSwiftTree(
|
|
105473
105601
|
packagePath,
|
|
105474
|
-
new Map([...files2].map(([name3, source]) => [
|
|
105602
|
+
new Map([...files2].map(([name3, source]) => [import_node_path131.default.join(packagePath, name3), source]))
|
|
105475
105603
|
);
|
|
105476
105604
|
const project2 = projectFor(packagePath);
|
|
105477
105605
|
project2.oneModule = false;
|
|
@@ -105496,16 +105624,17 @@ async function buildOneSDKBundle(appRoot) {
|
|
|
105496
105624
|
assets: await compiledModuleAssets(compiled.artifact)
|
|
105497
105625
|
};
|
|
105498
105626
|
}
|
|
105499
|
-
var
|
|
105627
|
+
var import_node_crypto79, import_node_fs128, import_node_path131, ONE_SDK_ROUTE, handleOneSDKRequest;
|
|
105500
105628
|
var init_one_sdk_bundle = __esm({
|
|
105501
105629
|
"src/one-sdk-bundle.ts"() {
|
|
105502
105630
|
"use strict";
|
|
105503
|
-
|
|
105631
|
+
import_node_crypto79 = require("node:crypto");
|
|
105504
105632
|
import_node_fs128 = __toESM(require("node:fs"), 1);
|
|
105505
|
-
|
|
105633
|
+
import_node_path131 = __toESM(require("node:path"), 1);
|
|
105506
105634
|
init_expo_native_workspace();
|
|
105507
105635
|
init_nitro_bundle();
|
|
105508
105636
|
init_one_sdk_preparation();
|
|
105637
|
+
init_shard();
|
|
105509
105638
|
init_source2();
|
|
105510
105639
|
init_oneSdkContract();
|
|
105511
105640
|
init_swift_compile();
|
|
@@ -105513,8 +105642,6 @@ var init_one_sdk_bundle = __esm({
|
|
|
105513
105642
|
init_swift_host();
|
|
105514
105643
|
init_swift_toolchain();
|
|
105515
105644
|
ONE_SDK_ROUTE = "/__peach/one-sdk";
|
|
105516
|
-
ONE_SDK_BINDING_SHARDS = 8;
|
|
105517
|
-
ONE_SDK_BINDING_SHARD_MIN_BYTES = 256 * 1024;
|
|
105518
105645
|
handleOneSDKRequest = compiledModuleRequestHandler(
|
|
105519
105646
|
"One SDK",
|
|
105520
105647
|
(root, origin) => compileOneSDKApp(root, origin),
|
|
@@ -105544,13 +105671,13 @@ var init_expo_eager_seam_contract = __esm({
|
|
|
105544
105671
|
|
|
105545
105672
|
// src/expo-native-compiler-digest.ts
|
|
105546
105673
|
function expoNativeCompilerDigestValue() {
|
|
105547
|
-
return true ? "
|
|
105674
|
+
return true ? "01b557b0d5060f75ecf614ad153ab866ca328079ff7a3b00a07ea3d16f250ec1" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
105548
105675
|
}
|
|
105549
|
-
var
|
|
105676
|
+
var import_node_crypto80;
|
|
105550
105677
|
var init_expo_native_compiler_digest = __esm({
|
|
105551
105678
|
"src/expo-native-compiler-digest.ts"() {
|
|
105552
105679
|
"use strict";
|
|
105553
|
-
|
|
105680
|
+
import_node_crypto80 = require("node:crypto");
|
|
105554
105681
|
init_react_native_core_digest();
|
|
105555
105682
|
init_swift_compiler_digest();
|
|
105556
105683
|
init_swift_standin_digest();
|
|
@@ -105559,7 +105686,7 @@ var init_expo_native_compiler_digest = __esm({
|
|
|
105559
105686
|
|
|
105560
105687
|
// src/expo-discovery-cache.ts
|
|
105561
105688
|
function peachPin() {
|
|
105562
|
-
return (0,
|
|
105689
|
+
return (0, import_node_crypto81.createHash)("sha256").update(
|
|
105563
105690
|
`${FORMAT}\0${expoNativeCompilerDigestValue()}\0${swiftNativePin().distribution.id}\0`
|
|
105564
105691
|
).update(JSON.stringify([...EXPO_EAGER_NATIVE_VIEWS])).update(JSON.stringify([...peachAnsweredNativePackages()].sort())).digest("hex");
|
|
105565
105692
|
}
|
|
@@ -105573,11 +105700,11 @@ function stable(value) {
|
|
|
105573
105700
|
}
|
|
105574
105701
|
async function expoDiscoveryKey(options2) {
|
|
105575
105702
|
const { root, hash } = await hashExpoWorkspace(options2.appRoot, options2.signal);
|
|
105576
|
-
const key2 = (0,
|
|
105703
|
+
const key2 = (0, import_node_crypto81.createHash)("sha256").update(`${peachPin()}\0${hash}\0`).update(`${stable(JSON.parse(options2.searchText))}\0`).update(`${stable(options2.configuration)}\0`).update(stable(JSON.parse(options2.resolveText))).digest("hex");
|
|
105577
105704
|
return { key: key2, root };
|
|
105578
105705
|
}
|
|
105579
105706
|
function expoDiscoveryCacheDir() {
|
|
105580
|
-
return
|
|
105707
|
+
return import_node_path132.default.join(sharedCacheDir(import_node_path132.default.join(ambientHomeDir(), "cache")), "expo-discovery");
|
|
105581
105708
|
}
|
|
105582
105709
|
function vanished2(error) {
|
|
105583
105710
|
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
@@ -105595,7 +105722,7 @@ function expireDiscovery(dir, keep) {
|
|
|
105595
105722
|
if (!import_node_fs129.default.existsSync(parent)) return;
|
|
105596
105723
|
for (const name3 of import_node_fs129.default.readdirSync(parent)) {
|
|
105597
105724
|
if (!expiry(name3)) continue;
|
|
105598
|
-
const file =
|
|
105725
|
+
const file = import_node_path132.default.join(parent, name3);
|
|
105599
105726
|
const modified = import_node_fs129.default.statSync(file, { throwIfNoEntry: false })?.mtimeMs;
|
|
105600
105727
|
if (modified === void 0 || file === keep) continue;
|
|
105601
105728
|
const limit = name3.endsWith(".tmp") ? ORPHAN_TEMPORARY_MS : EXPIRY_MS;
|
|
@@ -105603,7 +105730,7 @@ function expireDiscovery(dir, keep) {
|
|
|
105603
105730
|
}
|
|
105604
105731
|
};
|
|
105605
105732
|
sweep(dir, (name3) => name3.endsWith(".json") || name3.endsWith(".tmp"));
|
|
105606
|
-
sweep(
|
|
105733
|
+
sweep(import_node_path132.default.join(dir, "blobs"), () => true);
|
|
105607
105734
|
}
|
|
105608
105735
|
function isExpoSwiftSourceUnit(value) {
|
|
105609
105736
|
return isRecord(value) && typeof value.namespace === "string" && typeof value.moduleId === "string" && (value.nativeAppIdentity === void 0 || isNativeAppIdentity(value.nativeAppIdentity)) && strings4(value.classes) && strings4(value.bridgeModules) && strings4(value.appDelegateSubscribers) && strings4(value.reactDelegateHandlers) && stringRecord(value.files) && strings4(value.frameworks) && (value.workspaceSources === void 0 || strings4(value.workspaceSources)) && (value.nativeTargets === void 0 || Array.isArray(value.nativeTargets) && value.nativeTargets.every(isRecord)) && (value.nativeFiles === void 0 || stringRecord(value.nativeFiles)) && (value.resources === void 0 || stringRecord(value.resources)) && (value.resourceBundles === void 0 || isSwiftResourceBundles(value.resourceBundles)) && (value.swiftLanguageMode === void 0 || typeof value.swiftLanguageMode === "number");
|
|
@@ -105613,7 +105740,7 @@ function isStoredUnit(value) {
|
|
|
105613
105740
|
}
|
|
105614
105741
|
function readExpoDiscovery(key2) {
|
|
105615
105742
|
let parsed2;
|
|
105616
|
-
const record5 =
|
|
105743
|
+
const record5 = import_node_path132.default.join(expoDiscoveryCacheDir(), `${key2}.json`);
|
|
105617
105744
|
try {
|
|
105618
105745
|
parsed2 = JSON.parse(import_node_fs129.default.readFileSync(record5, "utf8"));
|
|
105619
105746
|
} catch {
|
|
@@ -105642,9 +105769,9 @@ function readExpoDiscovery(key2) {
|
|
|
105642
105769
|
if (!Array.isArray(parsed2.units) || !parsed2.units.every(isBodyOffset))
|
|
105643
105770
|
return void 0;
|
|
105644
105771
|
if (typeof parsed2.archive !== "string" || !isDigest(parsed2.archive)) return void 0;
|
|
105645
|
-
const archive =
|
|
105772
|
+
const archive = import_node_path132.default.join(expoDiscoveryCacheDir(), "blobs", `${parsed2.archive}.zst`);
|
|
105646
105773
|
const bytes = import_node_fs129.default.readFileSync(archive);
|
|
105647
|
-
if ((0,
|
|
105774
|
+
if ((0, import_node_crypto81.createHash)("sha256").update(bytes).digest("hex") !== parsed2.archive)
|
|
105648
105775
|
return void 0;
|
|
105649
105776
|
const bodies = (0, import_node_zlib8.zstdDecompressSync)(bytes);
|
|
105650
105777
|
const decoded = /* @__PURE__ */ new Map();
|
|
@@ -105698,7 +105825,7 @@ function readExpoDiscovery(key2) {
|
|
|
105698
105825
|
}
|
|
105699
105826
|
}
|
|
105700
105827
|
function fileHashesPath() {
|
|
105701
|
-
return
|
|
105828
|
+
return import_node_path132.default.join(expoDiscoveryCacheDir(), "framework-file-hashes.json");
|
|
105702
105829
|
}
|
|
105703
105830
|
function stampedFileHash(file) {
|
|
105704
105831
|
if (!fileHashesLoaded) {
|
|
@@ -105718,7 +105845,7 @@ function stampedFileHash(file) {
|
|
|
105718
105845
|
const stamp = [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(":");
|
|
105719
105846
|
const cached2 = fileHashes.get(file);
|
|
105720
105847
|
if (cached2?.stamp === stamp) return cached2.checksum;
|
|
105721
|
-
const checksum = (0,
|
|
105848
|
+
const checksum = (0, import_node_crypto81.createHash)("sha256").update(import_node_fs129.default.readFileSync(file)).digest("hex");
|
|
105722
105849
|
fileHashes.set(file, { stamp, checksum });
|
|
105723
105850
|
fileHashesChanged = true;
|
|
105724
105851
|
return checksum;
|
|
@@ -105727,9 +105854,9 @@ function saveFileHashes() {
|
|
|
105727
105854
|
if (!fileHashesChanged) return;
|
|
105728
105855
|
fileHashesChanged = false;
|
|
105729
105856
|
const target = fileHashesPath();
|
|
105730
|
-
const temporary = `${target}.${process.pid}.${(0,
|
|
105857
|
+
const temporary = `${target}.${process.pid}.${(0, import_node_crypto81.randomUUID)()}.tmp`;
|
|
105731
105858
|
try {
|
|
105732
|
-
import_node_fs129.default.mkdirSync(
|
|
105859
|
+
import_node_fs129.default.mkdirSync(import_node_path132.default.dirname(target), { recursive: true });
|
|
105733
105860
|
import_node_fs129.default.writeFileSync(
|
|
105734
105861
|
temporary,
|
|
105735
105862
|
JSON.stringify(
|
|
@@ -105752,8 +105879,8 @@ function treeDigest2(directory2, signal) {
|
|
|
105752
105879
|
if (seen.has(canonical)) return;
|
|
105753
105880
|
seen.add(canonical);
|
|
105754
105881
|
for (const child of import_node_fs129.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
105755
|
-
const file =
|
|
105756
|
-
const relative4 =
|
|
105882
|
+
const file = import_node_path132.default.join(dir, child.name);
|
|
105883
|
+
const relative4 = import_node_path132.default.relative(directory2, file);
|
|
105757
105884
|
if (child.isSymbolicLink()) {
|
|
105758
105885
|
entries2.set(relative4, `link\0${import_node_fs129.default.readlinkSync(file)}`);
|
|
105759
105886
|
} else if (child.isDirectory()) {
|
|
@@ -105778,11 +105905,11 @@ function frameworkDigest(directory2, signal) {
|
|
|
105778
105905
|
const entries2 = treeDigest2(directory2, signal);
|
|
105779
105906
|
for (const [relative4, value] of entries2) {
|
|
105780
105907
|
if (!value.startsWith("link\0")) continue;
|
|
105781
|
-
const target = import_node_fs129.default.realpathSync(
|
|
105782
|
-
if (target !== root && !target.startsWith(`${root}${
|
|
105908
|
+
const target = import_node_fs129.default.realpathSync(import_node_path132.default.join(directory2, relative4));
|
|
105909
|
+
if (target !== root && !target.startsWith(`${root}${import_node_path132.default.sep}`))
|
|
105783
105910
|
throw new Error(`framework link escapes its tree: ${relative4}`);
|
|
105784
105911
|
}
|
|
105785
|
-
return (0,
|
|
105912
|
+
return (0, import_node_crypto81.createHash)("sha256").update(JSON.stringify([...entries2])).digest("hex");
|
|
105786
105913
|
}
|
|
105787
105914
|
function rewritePreparedPaths(options2) {
|
|
105788
105915
|
const { units, sourceRoot, preparedRoot, signal } = options2;
|
|
@@ -105803,7 +105930,7 @@ function rewritePreparedPaths(options2) {
|
|
|
105803
105930
|
return null;
|
|
105804
105931
|
}
|
|
105805
105932
|
if (!preparedBytes.equals(sourceBytes)) return null;
|
|
105806
|
-
dependencies[sourceFile] = (0,
|
|
105933
|
+
dependencies[sourceFile] = (0, import_node_crypto81.createHash)("sha256").update(sourceBytes).digest("hex");
|
|
105807
105934
|
verifiedFiles.set(preparedFile, sourceFile);
|
|
105808
105935
|
return sourceFile;
|
|
105809
105936
|
};
|
|
@@ -105828,7 +105955,7 @@ function rewritePreparedPaths(options2) {
|
|
|
105828
105955
|
return match;
|
|
105829
105956
|
const separator = value.lastIndexOf("#");
|
|
105830
105957
|
const preparedFile = value.slice(0, separator);
|
|
105831
|
-
if (separator < 0 || !preparedFile.startsWith(`${preparedRoot}${
|
|
105958
|
+
if (separator < 0 || !preparedFile.startsWith(`${preparedRoot}${import_node_path132.default.sep}`)) {
|
|
105832
105959
|
refusedPlugin = true;
|
|
105833
105960
|
return match;
|
|
105834
105961
|
}
|
|
@@ -105876,11 +106003,11 @@ function rewritePreparedPaths(options2) {
|
|
|
105876
106003
|
frameworkDependencies[sourceDir] = sourceDigest;
|
|
105877
106004
|
let portableDir = sourceDir;
|
|
105878
106005
|
if (preparedDigest !== sourceDigest) {
|
|
105879
|
-
const parent =
|
|
105880
|
-
portableDir =
|
|
106006
|
+
const parent = import_node_path132.default.join(expoDiscoveryCacheDir(), "frameworks", preparedDigest);
|
|
106007
|
+
portableDir = import_node_path132.default.join(parent, import_node_path132.default.basename(dir));
|
|
105881
106008
|
if (!import_node_fs129.default.existsSync(portableDir)) {
|
|
105882
106009
|
import_node_fs129.default.mkdirSync(parent, { recursive: true });
|
|
105883
|
-
const tmp =
|
|
106010
|
+
const tmp = import_node_path132.default.join(parent, `.${process.pid}.${(0, import_node_crypto81.randomUUID)()}.tmp`);
|
|
105884
106011
|
try {
|
|
105885
106012
|
import_node_fs129.default.cpSync(dir, tmp, { recursive: true, verbatimSymlinks: true });
|
|
105886
106013
|
if (frameworkDigest(tmp, signal) !== preparedDigest)
|
|
@@ -105909,7 +106036,7 @@ function writeExpoDiscovery(options2) {
|
|
|
105909
106036
|
try {
|
|
105910
106037
|
const dir = expoDiscoveryCacheDir();
|
|
105911
106038
|
import_node_fs129.default.mkdirSync(dir, { recursive: true });
|
|
105912
|
-
const tmp =
|
|
106039
|
+
const tmp = import_node_path132.default.join(dir, `.${options2.key}.${process.pid}.${(0, import_node_crypto81.randomUUID)()}.tmp`);
|
|
105913
106040
|
if (options2.units === null) {
|
|
105914
106041
|
import_node_fs129.default.writeFileSync(
|
|
105915
106042
|
tmp,
|
|
@@ -105921,8 +106048,8 @@ function writeExpoDiscovery(options2) {
|
|
|
105921
106048
|
frameworks: {}
|
|
105922
106049
|
})
|
|
105923
106050
|
);
|
|
105924
|
-
import_node_fs129.default.renameSync(tmp,
|
|
105925
|
-
expireDiscovery(dir,
|
|
106051
|
+
import_node_fs129.default.renameSync(tmp, import_node_path132.default.join(dir, `${options2.key}.json`));
|
|
106052
|
+
expireDiscovery(dir, import_node_path132.default.join(dir, `${options2.key}.json`));
|
|
105926
106053
|
return null;
|
|
105927
106054
|
}
|
|
105928
106055
|
const preparedRoot = import_node_fs129.default.realpathSync(options2.preparedRoot);
|
|
@@ -105933,7 +106060,7 @@ function writeExpoDiscovery(options2) {
|
|
|
105933
106060
|
signal: options2.signal
|
|
105934
106061
|
});
|
|
105935
106062
|
if ("refuse" in rewritten) return rewritten.refuse;
|
|
105936
|
-
const blobDir =
|
|
106063
|
+
const blobDir = import_node_path132.default.join(dir, "blobs");
|
|
105937
106064
|
import_node_fs129.default.mkdirSync(blobDir, { recursive: true });
|
|
105938
106065
|
const seen = /* @__PURE__ */ new Map();
|
|
105939
106066
|
const chunks = [];
|
|
@@ -105972,11 +106099,11 @@ function writeExpoDiscovery(options2) {
|
|
|
105972
106099
|
}
|
|
105973
106100
|
);
|
|
105974
106101
|
const contents2 = (0, import_node_zlib8.zstdCompressSync)(Buffer.concat(chunks, size2));
|
|
105975
|
-
const archive = (0,
|
|
105976
|
-
const temporary =
|
|
106102
|
+
const archive = (0, import_node_crypto81.createHash)("sha256").update(contents2).digest("hex");
|
|
106103
|
+
const temporary = import_node_path132.default.join(blobDir, "." + (0, import_node_crypto81.randomUUID)() + ".tmp");
|
|
105977
106104
|
try {
|
|
105978
106105
|
import_node_fs129.default.writeFileSync(temporary, contents2);
|
|
105979
|
-
import_node_fs129.default.renameSync(temporary,
|
|
106106
|
+
import_node_fs129.default.renameSync(temporary, import_node_path132.default.join(blobDir, `${archive}.zst`));
|
|
105980
106107
|
} finally {
|
|
105981
106108
|
import_node_fs129.default.rmSync(temporary, { force: true });
|
|
105982
106109
|
}
|
|
@@ -105991,8 +106118,8 @@ function writeExpoDiscovery(options2) {
|
|
|
105991
106118
|
frameworks: rewritten.frameworks
|
|
105992
106119
|
})
|
|
105993
106120
|
);
|
|
105994
|
-
import_node_fs129.default.renameSync(tmp,
|
|
105995
|
-
expireDiscovery(dir,
|
|
106121
|
+
import_node_fs129.default.renameSync(tmp, import_node_path132.default.join(dir, `${options2.key}.json`));
|
|
106122
|
+
expireDiscovery(dir, import_node_path132.default.join(dir, `${options2.key}.json`));
|
|
105996
106123
|
saveFileHashes();
|
|
105997
106124
|
return rewritten.units;
|
|
105998
106125
|
} catch (error) {
|
|
@@ -106000,13 +106127,13 @@ function writeExpoDiscovery(options2) {
|
|
|
106000
106127
|
return error instanceof Error ? error.message : String(error);
|
|
106001
106128
|
}
|
|
106002
106129
|
}
|
|
106003
|
-
var
|
|
106130
|
+
var import_node_crypto81, import_node_fs129, import_node_path132, import_node_zlib8, FORMAT, EXPIRY_MS, ORPHAN_TEMPORARY_MS, strings4, stringRecord, isDigest, digestRecord, isBodyOffset, isBodyOffsets, sourceLocationLine, fileHashes, fileHashesLoaded, fileHashesChanged, MISSING_TREE;
|
|
106004
106131
|
var init_expo_discovery_cache = __esm({
|
|
106005
106132
|
"src/expo-discovery-cache.ts"() {
|
|
106006
106133
|
"use strict";
|
|
106007
|
-
|
|
106134
|
+
import_node_crypto81 = require("node:crypto");
|
|
106008
106135
|
import_node_fs129 = __toESM(require("node:fs"), 1);
|
|
106009
|
-
|
|
106136
|
+
import_node_path132 = __toESM(require("node:path"), 1);
|
|
106010
106137
|
import_node_zlib8 = require("node:zlib");
|
|
106011
106138
|
init_expo_eager_seam_contract();
|
|
106012
106139
|
init_answeredNativePackages();
|
|
@@ -106037,7 +106164,7 @@ var init_expo_discovery_cache = __esm({
|
|
|
106037
106164
|
|
|
106038
106165
|
// src/native-firebase-config.ts
|
|
106039
106166
|
function hasExpoConfig(projectRoot) {
|
|
106040
|
-
const packagePath =
|
|
106167
|
+
const packagePath = import_node_path133.default.join(projectRoot, "package.json");
|
|
106041
106168
|
const manifest = import_node_fs130.default.existsSync(packagePath) ? JSON.parse(import_node_fs130.default.readFileSync(packagePath, "utf8")) : null;
|
|
106042
106169
|
if (isRecord(manifest)) {
|
|
106043
106170
|
const dependencies = [manifest.dependencies, manifest.devDependencies].filter(
|
|
@@ -106046,13 +106173,13 @@ function hasExpoConfig(projectRoot) {
|
|
|
106046
106173
|
if (dependencies.some((deps) => "one" in deps) && !dependencies.some((deps) => "expo" in deps))
|
|
106047
106174
|
return false;
|
|
106048
106175
|
}
|
|
106049
|
-
const appJsonPath =
|
|
106176
|
+
const appJsonPath = import_node_path133.default.join(projectRoot, "app.json");
|
|
106050
106177
|
const appJson = import_node_fs130.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs130.default.readFileSync(appJsonPath, "utf8")) : null;
|
|
106051
106178
|
const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
|
|
106052
106179
|
(value) => isRecord(value) && typeof value.googleServicesFile === "string"
|
|
106053
106180
|
));
|
|
106054
106181
|
return staticExpo || ["app.config.js", "app.config.ts", "app.config.cjs", "app.config.mjs"].some(
|
|
106055
|
-
(name3) => import_node_fs130.default.existsSync(
|
|
106182
|
+
(name3) => import_node_fs130.default.existsSync(import_node_path133.default.join(projectRoot, name3))
|
|
106056
106183
|
);
|
|
106057
106184
|
}
|
|
106058
106185
|
function expoConfigArgs(projectRoot, resultPath) {
|
|
@@ -106060,7 +106187,7 @@ function expoConfigArgs(projectRoot, resultPath) {
|
|
|
106060
106187
|
"--input-type=commonjs",
|
|
106061
106188
|
"-e",
|
|
106062
106189
|
EXPO_CONFIG_SCRIPT,
|
|
106063
|
-
|
|
106190
|
+
import_node_path133.default.resolve(projectRoot),
|
|
106064
106191
|
resultPath
|
|
106065
106192
|
];
|
|
106066
106193
|
}
|
|
@@ -106080,7 +106207,7 @@ function readExpoConfigResult(resultPath, status, signal, stderr) {
|
|
|
106080
106207
|
async function readExpoConfigAsync(projectRoot) {
|
|
106081
106208
|
if (!hasExpoConfig(projectRoot)) return {};
|
|
106082
106209
|
const directory2 = resultDirectory();
|
|
106083
|
-
const resultPath =
|
|
106210
|
+
const resultPath = import_node_path133.default.join(directory2, "config.json");
|
|
106084
106211
|
try {
|
|
106085
106212
|
const child = (0, import_node_child_process63.spawn)("node", expoConfigArgs(projectRoot, resultPath), {
|
|
106086
106213
|
cwd: projectRoot,
|
|
@@ -106103,7 +106230,7 @@ async function readExpoConfigAsync(projectRoot) {
|
|
|
106103
106230
|
import_node_fs130.default.rmSync(directory2, { recursive: true, force: true });
|
|
106104
106231
|
}
|
|
106105
106232
|
}
|
|
106106
|
-
var import_node_child_process63, import_node_fs130, import_node_module17, import_node_os27,
|
|
106233
|
+
var import_node_child_process63, import_node_fs130, import_node_module17, import_node_os27, import_node_path133, EXPO_CONFIG_SCRIPT, EXPO_CONFIG_TIMEOUT_MS, resultDirectory;
|
|
106107
106234
|
var init_native_firebase_config = __esm({
|
|
106108
106235
|
"src/native-firebase-config.ts"() {
|
|
106109
106236
|
"use strict";
|
|
@@ -106111,7 +106238,7 @@ var init_native_firebase_config = __esm({
|
|
|
106111
106238
|
import_node_fs130 = __toESM(require("node:fs"), 1);
|
|
106112
106239
|
import_node_module17 = require("node:module");
|
|
106113
106240
|
import_node_os27 = __toESM(require("node:os"), 1);
|
|
106114
|
-
|
|
106241
|
+
import_node_path133 = __toESM(require("node:path"), 1);
|
|
106115
106242
|
init_is_record();
|
|
106116
106243
|
init_plist();
|
|
106117
106244
|
init_xcode_project();
|
|
@@ -106132,7 +106259,7 @@ const result = JSON.stringify(getConfig(root, { skipSDKVersionRequirement: true
|
|
|
106132
106259
|
if (Buffer.byteLength(result) > 1024 * 1024) throw new Error('Expo native configuration exceeds 1 MiB.');
|
|
106133
106260
|
writeFileSync(process.argv[2], result, { mode: 0o600 });`;
|
|
106134
106261
|
EXPO_CONFIG_TIMEOUT_MS = 3e4;
|
|
106135
|
-
resultDirectory = () => import_node_fs130.default.mkdtempSync(
|
|
106262
|
+
resultDirectory = () => import_node_fs130.default.mkdtempSync(import_node_path133.default.join(import_node_os27.default.tmpdir(), "peach-expo-config-"));
|
|
106136
106263
|
}
|
|
106137
106264
|
});
|
|
106138
106265
|
|
|
@@ -106157,16 +106284,16 @@ function packageRootOf(appRoot, file) {
|
|
|
106157
106284
|
if (parts[0] !== "node_modules") return null;
|
|
106158
106285
|
const at = parts.lastIndexOf("node_modules") + 1;
|
|
106159
106286
|
const end = at + (parts[at]?.startsWith("@") ? 2 : 1);
|
|
106160
|
-
return parts.length > end ?
|
|
106287
|
+
return parts.length > end ? import_node_path134.default.join(appRoot, ...parts.slice(0, end)) : null;
|
|
106161
106288
|
}
|
|
106162
106289
|
async function expoNativeInputs(appRoot) {
|
|
106163
106290
|
appRoot = import_node_fs131.default.realpathSync(appRoot);
|
|
106164
|
-
if (findXcodeProject(
|
|
106165
|
-
const appRequire = (0, import_node_module18.createRequire)(
|
|
106291
|
+
if (findXcodeProject(import_node_path134.default.join(appRoot, "ios"))) return null;
|
|
106292
|
+
const appRequire = (0, import_node_module18.createRequire)(import_node_path134.default.join(appRoot, "package.json"));
|
|
106166
106293
|
let fingerprintEntry;
|
|
106167
106294
|
try {
|
|
106168
106295
|
fingerprintEntry = appRequire.resolve("@expo/fingerprint", {
|
|
106169
|
-
paths: [
|
|
106296
|
+
paths: [import_node_path134.default.dirname(appRequire.resolve("expo/package.json"))]
|
|
106170
106297
|
});
|
|
106171
106298
|
} catch {
|
|
106172
106299
|
return null;
|
|
@@ -106192,7 +106319,7 @@ async function expoNativeInputs(appRoot) {
|
|
|
106192
106319
|
const root = (source.type === "package" || source.type === "dir") && source.filePath ? packageRootOf(appRoot, source.filePath) : null;
|
|
106193
106320
|
if (!root) continue;
|
|
106194
106321
|
const manifest = JSON.parse(
|
|
106195
|
-
import_node_fs131.default.readFileSync(
|
|
106322
|
+
import_node_fs131.default.readFileSync(import_node_path134.default.join(root, "package.json"), "utf8")
|
|
106196
106323
|
);
|
|
106197
106324
|
if (!isRecord(manifest) || typeof manifest.name !== "string")
|
|
106198
106325
|
throw new Error(`${root}: package has no name`);
|
|
@@ -106200,7 +106327,7 @@ async function expoNativeInputs(appRoot) {
|
|
|
106200
106327
|
}
|
|
106201
106328
|
packages.set(
|
|
106202
106329
|
"react-native",
|
|
106203
|
-
|
|
106330
|
+
import_node_path134.default.dirname(appRequire.resolve("react-native/package.json"))
|
|
106204
106331
|
);
|
|
106205
106332
|
return {
|
|
106206
106333
|
inputs: {
|
|
@@ -106208,7 +106335,7 @@ async function expoNativeInputs(appRoot) {
|
|
|
106208
106335
|
"swift-pin": JSON.stringify(swiftNativePin()),
|
|
106209
106336
|
answered: JSON.stringify([...peachAnsweredNativePackages()].sort()),
|
|
106210
106337
|
"pods-environment": JSON.stringify(reactNativePodsEnvironment()),
|
|
106211
|
-
fingerprint: (0,
|
|
106338
|
+
fingerprint: (0, import_node_crypto82.createHash)("sha256").update(lines.sort().join("\n")).digest("hex")
|
|
106212
106339
|
},
|
|
106213
106340
|
packages
|
|
106214
106341
|
};
|
|
@@ -106261,7 +106388,7 @@ function readExpoNativeEntry(value) {
|
|
|
106261
106388
|
};
|
|
106262
106389
|
}
|
|
106263
106390
|
async function answer(appRoot) {
|
|
106264
|
-
if (findXcodeProject(
|
|
106391
|
+
if (findXcodeProject(import_node_path134.default.join(appRoot, "ios"))) return null;
|
|
106265
106392
|
const [source, config] = await Promise.all([
|
|
106266
106393
|
hashExpoSourceWorkspace(appRoot),
|
|
106267
106394
|
readExpoConfigAsync(appRoot)
|
|
@@ -106305,16 +106432,16 @@ async function prebuiltAppTarget(appRoot, signal, dependencies = "lockfile") {
|
|
|
106305
106432
|
signal,
|
|
106306
106433
|
dependencies
|
|
106307
106434
|
);
|
|
106308
|
-
const ios =
|
|
106435
|
+
const ios = import_node_path134.default.join(prepared.app, "ios");
|
|
106309
106436
|
const projects2 = import_node_fs131.default.readdirSync(ios).filter((name3) => name3.endsWith(".xcodeproj"));
|
|
106310
106437
|
if (projects2.length !== 1) throw new Error(`expected one Xcode project in ${ios}`);
|
|
106311
|
-
return readXcodeAppTarget(
|
|
106438
|
+
return readXcodeAppTarget(import_node_path134.default.join(ios, projects2[0]), void 0, "Debug", {
|
|
106312
106439
|
requireSources: false
|
|
106313
106440
|
});
|
|
106314
106441
|
}
|
|
106315
106442
|
function servedExpoSwift(appRoot, entry, app) {
|
|
106316
106443
|
if (!entry.expoSwift) return null;
|
|
106317
|
-
const rootId = `${(0,
|
|
106444
|
+
const rootId = `${(0, import_node_crypto82.createHash)("sha256").update(import_node_fs131.default.realpathSync(appRoot)).digest("hex")}/Expo`;
|
|
106318
106445
|
if (app.infoPlist === null) throw new Error("the prebuilt app target has no Info.plist");
|
|
106319
106446
|
const installed = installedInfoPlist(app.infoPlist, entry.infoPlist);
|
|
106320
106447
|
const infoPlist2 = Buffer.from(installed).toString("base64");
|
|
@@ -106342,14 +106469,14 @@ async function prebuiltExpoSwiftResult(appRoot, entry, signal) {
|
|
|
106342
106469
|
await prebuiltAppTarget(appRoot, signal, "installed")
|
|
106343
106470
|
);
|
|
106344
106471
|
}
|
|
106345
|
-
var
|
|
106472
|
+
var import_node_crypto82, import_node_fs131, import_node_module18, import_node_path134, import_node_util17, EXPO_NATIVE_ENTRY_NAME, IDENTITY_SOURCE_SKIPS, expoNativeEntryUrl, isStringRecord, isPlistArray, published2, lookups, answers;
|
|
106346
106473
|
var init_expo_native_prebuilt = __esm({
|
|
106347
106474
|
"src/expo-native-prebuilt.ts"() {
|
|
106348
106475
|
"use strict";
|
|
106349
|
-
|
|
106476
|
+
import_node_crypto82 = require("node:crypto");
|
|
106350
106477
|
import_node_fs131 = __toESM(require("node:fs"), 1);
|
|
106351
106478
|
import_node_module18 = require("node:module");
|
|
106352
|
-
|
|
106479
|
+
import_node_path134 = __toESM(require("node:path"), 1);
|
|
106353
106480
|
import_node_util17 = require("node:util");
|
|
106354
106481
|
init_answeredNativePackages();
|
|
106355
106482
|
init_expo_native_compiler_digest();
|
|
@@ -106624,7 +106751,7 @@ async function collectBridgeModuleSources(appRoot, signal, installedWorkspace) {
|
|
|
106624
106751
|
const failures = [];
|
|
106625
106752
|
const installedNamespaces = /* @__PURE__ */ new Set();
|
|
106626
106753
|
const projectRoot = import_node_fs132.default.realpathSync(appRoot);
|
|
106627
|
-
const iosRoot =
|
|
106754
|
+
const iosRoot = import_node_path135.default.join(appRoot, "ios");
|
|
106628
106755
|
const project2 = installedWorkspace ?? (import_node_fs132.default.existsSync(iosRoot) ? findXcodeProject(iosRoot) : null);
|
|
106629
106756
|
const targets = project2 ? listXcodeAppTargets(project2, { requireSources: false }) : [];
|
|
106630
106757
|
const app = project2 && targets.length === 1 ? readXcodeAppTarget(project2, targets[0], "Release", {
|
|
@@ -106639,11 +106766,11 @@ async function collectBridgeModuleSources(appRoot, signal, installedWorkspace) {
|
|
|
106639
106766
|
const own2 = (file) => {
|
|
106640
106767
|
const resolved = import_node_fs132.default.realpathSync(file);
|
|
106641
106768
|
if ([file, resolved].some(
|
|
106642
|
-
(name3) => name3.split(
|
|
106769
|
+
(name3) => name3.split(import_node_path135.default.sep).some((part) => part === "Pods" || part === "node_modules")
|
|
106643
106770
|
))
|
|
106644
106771
|
return false;
|
|
106645
|
-
const relative4 =
|
|
106646
|
-
if (relative4 === ".." || relative4.startsWith(`..${
|
|
106772
|
+
const relative4 = import_node_path135.default.relative(projectRoot, resolved);
|
|
106773
|
+
if (relative4 === ".." || relative4.startsWith(`..${import_node_path135.default.sep}`) || import_node_path135.default.isAbsolute(relative4)) {
|
|
106647
106774
|
outside.push(file);
|
|
106648
106775
|
return false;
|
|
106649
106776
|
}
|
|
@@ -106655,8 +106782,8 @@ async function collectBridgeModuleSources(appRoot, signal, installedWorkspace) {
|
|
|
106655
106782
|
accepted.filter((file) => /\.mm?$/.test(file)).map((file) => import_node_fs132.default.realpathSync(file))
|
|
106656
106783
|
)
|
|
106657
106784
|
];
|
|
106658
|
-
const headers = objc.length === 0 ? [] : [...new Set(objc.map((file) =>
|
|
106659
|
-
(dir) => import_node_fs132.default.readdirSync(dir).filter((name3) => name3.endsWith(".h")).sort().map((name3) =>
|
|
106785
|
+
const headers = objc.length === 0 ? [] : [...new Set(objc.map((file) => import_node_path135.default.dirname(file)))].flatMap(
|
|
106786
|
+
(dir) => import_node_fs132.default.readdirSync(dir).filter((name3) => name3.endsWith(".h")).sort().map((name3) => import_node_path135.default.join(dir, name3)).filter(own2)
|
|
106660
106787
|
);
|
|
106661
106788
|
if (outside.length > 0) {
|
|
106662
106789
|
failures.push({
|
|
@@ -106694,8 +106821,8 @@ async function collectBridgeModuleSources(appRoot, signal, installedWorkspace) {
|
|
|
106694
106821
|
continue;
|
|
106695
106822
|
const swiftFiles = {};
|
|
106696
106823
|
for (const file of target.sources) {
|
|
106697
|
-
const relative4 =
|
|
106698
|
-
swiftFiles[`Sources/${namespace}/${relative4.split(
|
|
106824
|
+
const relative4 = import_node_path135.default.relative(projectRoot, import_node_fs132.default.realpathSync(file));
|
|
106825
|
+
swiftFiles[`Sources/${namespace}/${relative4.split(import_node_path135.default.sep).join("/")}`] = `#sourceLocation(file: ${JSON.stringify(file)}, line: 1)
|
|
106699
106826
|
${import_node_fs132.default.readFileSync(file, "utf8")}`;
|
|
106700
106827
|
}
|
|
106701
106828
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -106729,9 +106856,9 @@ ${import_node_fs132.default.readFileSync(file, "utf8")}`;
|
|
|
106729
106856
|
);
|
|
106730
106857
|
const native = target.objc;
|
|
106731
106858
|
const key2 = (file) => {
|
|
106732
|
-
const relative4 =
|
|
106733
|
-
const outside2 = relative4 === ".." || relative4.startsWith(`..${
|
|
106734
|
-
return outside2 ?
|
|
106859
|
+
const relative4 = import_node_path135.default.relative(projectRoot, file);
|
|
106860
|
+
const outside2 = relative4 === ".." || relative4.startsWith(`..${import_node_path135.default.sep}`) || import_node_path135.default.isAbsolute(relative4);
|
|
106861
|
+
return outside2 ? import_node_path135.default.posix.join("__peach_xcode/__outside", file.split(import_node_path135.default.sep).join("/")) : import_node_path135.default.posix.join("__peach_xcode", relative4.split(import_node_path135.default.sep).join("/"));
|
|
106735
106862
|
};
|
|
106736
106863
|
const headerFiles3 = [...nativeInputs.sources].filter(
|
|
106737
106864
|
([file]) => /\.(?:h|hh|hpp|hxx|pch|inc|inl|modulemap)$/.test(file)
|
|
@@ -106756,7 +106883,7 @@ ${import_node_fs132.default.readFileSync(file, "utf8")}`;
|
|
|
106756
106883
|
(file) => key2(file).startsWith("__peach_xcode/__outside/") && !import_node_fs132.default.existsSync(file) ? [] : [key2(file)]
|
|
106757
106884
|
);
|
|
106758
106885
|
const nativePath = (file) => {
|
|
106759
|
-
const absolute =
|
|
106886
|
+
const absolute = import_node_path135.default.resolve(app.rootDir, file);
|
|
106760
106887
|
return absolute === "/usr/include" || absolute.startsWith("/usr/include/") ? SWIFT_NATIVE_SDK_INCLUDE + absolute.slice("/usr/include".length) : `${SWIFT_NATIVE_INPUT_ROOT}/${key2(absolute)}`;
|
|
106761
106888
|
};
|
|
106762
106889
|
unit2.nativeTargets = [
|
|
@@ -106778,7 +106905,7 @@ ${import_node_fs132.default.readFileSync(file, "utf8")}`;
|
|
|
106778
106905
|
headerMaps: native.headerMaps.map((map2) => ({
|
|
106779
106906
|
flag: map2.flag,
|
|
106780
106907
|
entries: map2.entries.flatMap(
|
|
106781
|
-
([name3, file]) => !
|
|
106908
|
+
([name3, file]) => !import_node_path135.default.isAbsolute(file) ? [[name3, file]] : nativeInputs.sources.has(file) ? [[name3, `${SWIFT_NATIVE_INPUT_ROOT}/${key2(file)}`]] : []
|
|
106782
106909
|
)
|
|
106783
106910
|
})),
|
|
106784
106911
|
productHeaders: Object.fromEntries(
|
|
@@ -106837,7 +106964,7 @@ public func ${register}() -> RCTModuleHost.Registration {
|
|
|
106837
106964
|
return units.length === 0 && failures.length === 0 ? null : { units, failures, installedNamespaces: [...installedNamespaces] };
|
|
106838
106965
|
}
|
|
106839
106966
|
function collectInstalledSwiftBridgeUnits(appRoot, units, installedNamespaces, signal) {
|
|
106840
|
-
const manifestPath =
|
|
106967
|
+
const manifestPath = import_node_path135.default.join(appRoot, "package.json");
|
|
106841
106968
|
if (!import_node_fs132.default.existsSync(manifestPath)) return;
|
|
106842
106969
|
const manifest = JSON.parse(import_node_fs132.default.readFileSync(manifestPath, "utf8"));
|
|
106843
106970
|
const dependencies = manifest && typeof manifest === "object" ? Reflect.get(manifest, "dependencies") : null;
|
|
@@ -106851,18 +106978,18 @@ function collectInstalledSwiftBridgeUnits(appRoot, units, installedNamespaces, s
|
|
|
106851
106978
|
let pkgRoot = null;
|
|
106852
106979
|
try {
|
|
106853
106980
|
pkgRoot = import_node_fs132.default.realpathSync(
|
|
106854
|
-
|
|
106981
|
+
import_node_path135.default.dirname(appRequire.resolve(`${packageName}/package.json`))
|
|
106855
106982
|
);
|
|
106856
106983
|
} catch {
|
|
106857
|
-
const fallback =
|
|
106858
|
-
if (import_node_fs132.default.existsSync(
|
|
106984
|
+
const fallback = import_node_path135.default.join(appRoot, "node_modules", packageName);
|
|
106985
|
+
if (import_node_fs132.default.existsSync(import_node_path135.default.join(fallback, "package.json")))
|
|
106859
106986
|
pkgRoot = import_node_fs132.default.realpathSync(fallback);
|
|
106860
106987
|
}
|
|
106861
106988
|
if (!pkgRoot) continue;
|
|
106862
|
-
if (import_node_fs132.default.existsSync(
|
|
106989
|
+
if (import_node_fs132.default.existsSync(import_node_path135.default.join(pkgRoot, "expo-module.config.json")) || import_node_fs132.default.existsSync(import_node_path135.default.join(pkgRoot, "unimodule.json")) || import_node_fs132.default.existsSync(import_node_path135.default.join(pkgRoot, "nitrogen/generated/ios")))
|
|
106863
106990
|
continue;
|
|
106864
106991
|
const podspec = import_node_fs132.default.readdirSync(pkgRoot).filter((name3) => name3.endsWith(".podspec")).sort()[0];
|
|
106865
|
-
const pkgIos =
|
|
106992
|
+
const pkgIos = import_node_path135.default.join(pkgRoot, "ios");
|
|
106866
106993
|
if (!podspec || !import_node_fs132.default.existsSync(pkgIos)) continue;
|
|
106867
106994
|
const objc = [];
|
|
106868
106995
|
const headers = [];
|
|
@@ -106871,7 +106998,7 @@ function collectInstalledSwiftBridgeUnits(appRoot, units, installedNamespaces, s
|
|
|
106871
106998
|
for (const entry of import_node_fs132.default.readdirSync(dir, { withFileTypes: true })) {
|
|
106872
106999
|
if (entry.name === "build" || entry.name === "Pods" || entry.name === "Tests" || entry.name === "__tests__" || entry.name === "node_modules" || entry.name === ".git")
|
|
106873
107000
|
continue;
|
|
106874
|
-
const full =
|
|
107001
|
+
const full = import_node_path135.default.join(dir, entry.name);
|
|
106875
107002
|
if (entry.isDirectory()) walk4(full);
|
|
106876
107003
|
else if (/\.mm?$/.test(entry.name)) objc.push(full);
|
|
106877
107004
|
else if (entry.name.endsWith(".h")) headers.push(full);
|
|
@@ -106899,7 +107026,7 @@ function collectInstalledSwiftBridgeUnits(appRoot, units, installedNamespaces, s
|
|
|
106899
107026
|
if (namespacesSeen.has(namespace)) continue;
|
|
106900
107027
|
const swiftFiles = {};
|
|
106901
107028
|
for (const file of swift) {
|
|
106902
|
-
const relative4 =
|
|
107029
|
+
const relative4 = import_node_path135.default.relative(pkgRoot, file).split(import_node_path135.default.sep).join("/");
|
|
106903
107030
|
swiftFiles[`Sources/${namespace}/${relative4}`] = `import Foundation
|
|
106904
107031
|
import UIKit
|
|
106905
107032
|
import React
|
|
@@ -106937,13 +107064,13 @@ public func ${register}() -> RCTModuleHost.Registration {
|
|
|
106937
107064
|
}
|
|
106938
107065
|
}
|
|
106939
107066
|
}
|
|
106940
|
-
var import_node_fs132, import_node_module19,
|
|
107067
|
+
var import_node_fs132, import_node_module19, import_node_path135, DIRECTIVE, swiftString, BRIDGE_MODULE_FILE_PREFIX;
|
|
106941
107068
|
var init_react_native_bridge_modules = __esm({
|
|
106942
107069
|
"src/react-native-bridge-modules.ts"() {
|
|
106943
107070
|
"use strict";
|
|
106944
107071
|
import_node_fs132 = __toESM(require("node:fs"), 1);
|
|
106945
107072
|
import_node_module19 = require("node:module");
|
|
106946
|
-
|
|
107073
|
+
import_node_path135 = __toESM(require("node:path"), 1);
|
|
106947
107074
|
init_answeredNativePackages();
|
|
106948
107075
|
init_swift_compile();
|
|
106949
107076
|
init_swift_objc_compile();
|
|
@@ -106957,12 +107084,12 @@ var init_react_native_bridge_modules = __esm({
|
|
|
106957
107084
|
|
|
106958
107085
|
// src/swift-clang-type-ownership.ts
|
|
106959
107086
|
function exportedNames(moduleRoot, name3) {
|
|
106960
|
-
const modules =
|
|
106961
|
-
const module2 =
|
|
107087
|
+
const modules = import_node_path136.default.join(moduleRoot, "modules");
|
|
107088
|
+
const module2 = import_node_path136.default.join(modules, `${name3}.swiftmodule`);
|
|
106962
107089
|
if (!import_node_fs133.default.existsSync(module2)) return /* @__PURE__ */ new Set();
|
|
106963
|
-
const key2 = (0,
|
|
106964
|
-
const directory2 =
|
|
106965
|
-
const receipt =
|
|
107090
|
+
const key2 = (0, import_node_crypto83.createHash)("sha256").update(import_node_fs133.default.readFileSync(module2)).digest("hex");
|
|
107091
|
+
const directory2 = import_node_path136.default.join(swiftCacheDir(), "swift-public-names");
|
|
107092
|
+
const receipt = import_node_path136.default.join(directory2, `${key2}.json`);
|
|
106966
107093
|
if (import_node_fs133.default.existsSync(receipt)) {
|
|
106967
107094
|
const names = JSON.parse(import_node_fs133.default.readFileSync(receipt, "utf8"));
|
|
106968
107095
|
if (Array.isArray(names) && names.every((value) => typeof value === "string"))
|
|
@@ -106971,10 +107098,10 @@ function exportedNames(moduleRoot, name3) {
|
|
|
106971
107098
|
const { toolchainBin } = swiftModuleToolchain(moduleRoot);
|
|
106972
107099
|
const { cFlags, darwin, resources, sysroot } = swiftSdkPaths(moduleRoot, toolchainBin);
|
|
106973
107100
|
import_node_fs133.default.mkdirSync(directory2, { recursive: true });
|
|
106974
|
-
const scratch2 = import_node_fs133.default.mkdtempSync(
|
|
107101
|
+
const scratch2 = import_node_fs133.default.mkdtempSync(import_node_path136.default.join(directory2, ".extract-"));
|
|
106975
107102
|
try {
|
|
106976
107103
|
(0, import_node_child_process64.execFileSync)(
|
|
106977
|
-
...withoutCoreDump(
|
|
107104
|
+
...withoutCoreDump(import_node_path136.default.join(toolchainBin, "swift-symbolgraph-extract"), [
|
|
106978
107105
|
"-module-name",
|
|
106979
107106
|
name3,
|
|
106980
107107
|
"-target",
|
|
@@ -106987,7 +107114,7 @@ function exportedNames(moduleRoot, name3) {
|
|
|
106987
107114
|
"-I",
|
|
106988
107115
|
modules,
|
|
106989
107116
|
"-I",
|
|
106990
|
-
|
|
107117
|
+
import_node_path136.default.join(darwin, "usr/include"),
|
|
106991
107118
|
...cFlags.flatMap((flag) => ["-Xcc", flag]),
|
|
106992
107119
|
"-Xcc",
|
|
106993
107120
|
"-fobjc-runtime=gnustep-2.2",
|
|
@@ -107002,7 +107129,7 @@ function exportedNames(moduleRoot, name3) {
|
|
|
107002
107129
|
{ env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
|
|
107003
107130
|
);
|
|
107004
107131
|
const graph = JSON.parse(
|
|
107005
|
-
import_node_fs133.default.readFileSync(
|
|
107132
|
+
import_node_fs133.default.readFileSync(import_node_path136.default.join(scratch2, `${name3}.symbols.json`), "utf8")
|
|
107006
107133
|
);
|
|
107007
107134
|
if (!isRecord(graph) || !Array.isArray(graph.symbols))
|
|
107008
107135
|
throw new Error(`${name3}: invalid Swift symbol graph`);
|
|
@@ -107013,7 +107140,7 @@ function exportedNames(moduleRoot, name3) {
|
|
|
107013
107140
|
return symbol2.pathComponents.length === 1 && typeof declaration === "string" ? [declaration] : [];
|
|
107014
107141
|
})
|
|
107015
107142
|
);
|
|
107016
|
-
const temporary =
|
|
107143
|
+
const temporary = import_node_path136.default.join(scratch2, "names.json");
|
|
107017
107144
|
import_node_fs133.default.writeFileSync(temporary, JSON.stringify([...names].sort()));
|
|
107018
107145
|
import_node_fs133.default.renameSync(temporary, receipt);
|
|
107019
107146
|
return names;
|
|
@@ -107043,14 +107170,14 @@ function clangTypeOwnership(moduleRoot, module2) {
|
|
|
107043
107170
|
}
|
|
107044
107171
|
);
|
|
107045
107172
|
}
|
|
107046
|
-
var import_node_child_process64,
|
|
107173
|
+
var import_node_child_process64, import_node_crypto83, import_node_fs133, import_node_path136, blockTypedef, enumTypedef, enumConstant, swiftPrivate;
|
|
107047
107174
|
var init_swift_clang_type_ownership = __esm({
|
|
107048
107175
|
"src/swift-clang-type-ownership.ts"() {
|
|
107049
107176
|
"use strict";
|
|
107050
107177
|
import_node_child_process64 = require("node:child_process");
|
|
107051
|
-
|
|
107178
|
+
import_node_crypto83 = require("node:crypto");
|
|
107052
107179
|
import_node_fs133 = __toESM(require("node:fs"), 1);
|
|
107053
|
-
|
|
107180
|
+
import_node_path136 = __toESM(require("node:path"), 1);
|
|
107054
107181
|
init_is_record();
|
|
107055
107182
|
init_swift_compile();
|
|
107056
107183
|
init_swift_distribution();
|
|
@@ -107075,16 +107202,16 @@ function mtimeNs(stat) {
|
|
|
107075
107202
|
}
|
|
107076
107203
|
function tracedPath(value) {
|
|
107077
107204
|
if (typeof value === "number" || value == null) return null;
|
|
107078
|
-
if (typeof value === "string") return value.length === 0 ? null :
|
|
107205
|
+
if (typeof value === "string") return value.length === 0 ? null : import_node_path137.default.resolve(value);
|
|
107079
107206
|
if (value instanceof URL)
|
|
107080
107207
|
return value.protocol === "file:" ? (0, import_node_url4.fileURLToPath)(value) : null;
|
|
107081
|
-
if (Buffer.isBuffer(value)) return
|
|
107208
|
+
if (Buffer.isBuffer(value)) return import_node_path137.default.resolve(value.toString());
|
|
107082
107209
|
return null;
|
|
107083
107210
|
}
|
|
107084
107211
|
function ignoredInput(file) {
|
|
107085
|
-
if (file.includes(`${
|
|
107212
|
+
if (file.includes(`${import_node_path137.default.sep}peach-expo-swift${import_node_path137.default.sep}`) || file.endsWith(`${import_node_path137.default.sep}peach-expo-swift`))
|
|
107086
107213
|
return true;
|
|
107087
|
-
const within2 = (root) => file === root || file.startsWith(`${root}${
|
|
107214
|
+
const within2 = (root) => file === root || file.startsWith(`${root}${import_node_path137.default.sep}`);
|
|
107088
107215
|
if (ignoredRoots.some(within2)) return true;
|
|
107089
107216
|
for (const root of ownTemporaryRoots) if (within2(root)) return true;
|
|
107090
107217
|
return false;
|
|
@@ -107158,14 +107285,14 @@ function namesFromListing(dir, entries2) {
|
|
|
107158
107285
|
const names = [];
|
|
107159
107286
|
for (const entry of entries2) {
|
|
107160
107287
|
if (typeof entry === "string" || Buffer.isBuffer(entry)) {
|
|
107161
|
-
names.push(entry.toString().split(
|
|
107288
|
+
names.push(entry.toString().split(import_node_path137.default.sep).join("/"));
|
|
107162
107289
|
continue;
|
|
107163
107290
|
}
|
|
107164
107291
|
if (!entry || typeof entry !== "object" || !("name" in entry)) continue;
|
|
107165
107292
|
const name3 = String(Reflect.get(entry, "name"));
|
|
107166
107293
|
const parent = Reflect.get(entry, "parentPath");
|
|
107167
107294
|
const base2 = typeof parent === "string" && parent.length > 0 ? parent : dir;
|
|
107168
|
-
names.push(
|
|
107295
|
+
names.push(import_node_path137.default.relative(dir, import_node_path137.default.join(base2, name3)).split(import_node_path137.default.sep).join("/"));
|
|
107169
107296
|
}
|
|
107170
107297
|
names.sort();
|
|
107171
107298
|
return names.join("\0");
|
|
@@ -107185,11 +107312,11 @@ function installSwiftInputTrace() {
|
|
|
107185
107312
|
};
|
|
107186
107313
|
savedFs = saved;
|
|
107187
107314
|
const prefixes = [
|
|
107188
|
-
|
|
107189
|
-
|
|
107190
|
-
|
|
107315
|
+
import_node_path137.default.join(cacheDir(), "swift-builds"),
|
|
107316
|
+
import_node_path137.default.join(swiftCacheDir(), "swift-builds"),
|
|
107317
|
+
import_node_path137.default.join(swiftCacheDir(), "swift-sdk-views"),
|
|
107191
107318
|
swiftRootLocksDir(),
|
|
107192
|
-
|
|
107319
|
+
import_node_path137.default.join(cacheDir(), "swift-tmp"),
|
|
107193
107320
|
// content-addressed records whose reads renew their timestamps for expiry.
|
|
107194
107321
|
expoDiscoveryCacheDir()
|
|
107195
107322
|
].filter((prefix, index, all) => all.indexOf(prefix) === index);
|
|
@@ -107218,7 +107345,7 @@ function installSwiftInputTrace() {
|
|
|
107218
107345
|
if (typeof made === "string" && traceStore.getStore()) {
|
|
107219
107346
|
for (const root of ownTemporaryRoots)
|
|
107220
107347
|
if (!saved.existsSync(root)) ownTemporaryRoots.delete(root);
|
|
107221
|
-
ownTemporaryRoots.add(
|
|
107348
|
+
ownTemporaryRoots.add(import_node_path137.default.resolve(made));
|
|
107222
107349
|
}
|
|
107223
107350
|
return made;
|
|
107224
107351
|
});
|
|
@@ -107383,7 +107510,7 @@ function standinNativeTarget(standin, deploymentTarget) {
|
|
|
107383
107510
|
const modulemap = Object.keys(standin.files).find(
|
|
107384
107511
|
(file) => file === "module.modulemap" || file.endsWith("/module.modulemap")
|
|
107385
107512
|
);
|
|
107386
|
-
const headerDir = (modulemap ?
|
|
107513
|
+
const headerDir = (modulemap ? import_node_path137.default.posix.dirname(`${prefix}${modulemap}`) : null) ?? commonStandinHeaderDir(prefix, headers) ?? `${prefix}include`;
|
|
107387
107514
|
return {
|
|
107388
107515
|
...synthesizedNativeTarget(standin.module, deploymentTarget),
|
|
107389
107516
|
headers,
|
|
@@ -107393,11 +107520,11 @@ function standinNativeTarget(standin, deploymentTarget) {
|
|
|
107393
107520
|
}
|
|
107394
107521
|
function commonStandinHeaderDir(prefix, headers) {
|
|
107395
107522
|
if (headers.length === 0) return null;
|
|
107396
|
-
let common2 =
|
|
107523
|
+
let common2 = import_node_path137.default.posix.dirname(headers[0]);
|
|
107397
107524
|
for (const header of headers.slice(1)) {
|
|
107398
|
-
const dir =
|
|
107525
|
+
const dir = import_node_path137.default.posix.dirname(header);
|
|
107399
107526
|
while (dir !== common2 && !dir.startsWith(`${common2}/`))
|
|
107400
|
-
common2 =
|
|
107527
|
+
common2 = import_node_path137.default.posix.dirname(common2);
|
|
107401
107528
|
}
|
|
107402
107529
|
return common2 === prefix.slice(0, -1) || common2.startsWith(prefix) ? common2 : null;
|
|
107403
107530
|
}
|
|
@@ -107511,12 +107638,12 @@ function enrichInstalledUnits(units, installed, namespaceGroups, provided, modul
|
|
|
107511
107638
|
);
|
|
107512
107639
|
const byPath = [...installedTargets].sort((a, b) => b.path.length - a.path.length);
|
|
107513
107640
|
const reactNativeRoot = import_node_fs134.default.realpathSync(
|
|
107514
|
-
|
|
107515
|
-
(0, import_node_module20.createRequire)(
|
|
107641
|
+
import_node_path137.default.dirname(
|
|
107642
|
+
(0, import_node_module20.createRequire)(import_node_path137.default.join(appRoot, "package.json")).resolve(
|
|
107516
107643
|
"react-native/package.json"
|
|
107517
107644
|
)
|
|
107518
107645
|
)
|
|
107519
|
-
) +
|
|
107646
|
+
) + import_node_path137.default.sep;
|
|
107520
107647
|
const reactTargets = new Set(
|
|
107521
107648
|
(input.nativeTargets ?? []).flatMap((target) => {
|
|
107522
107649
|
const originals = Object.keys(target.sourceDirectories).flatMap(
|
|
@@ -107572,7 +107699,7 @@ function enrichInstalledUnits(units, installed, namespaceGroups, provided, modul
|
|
|
107572
107699
|
);
|
|
107573
107700
|
supportFiles[original] = contents2;
|
|
107574
107701
|
if (contents2 !== refined)
|
|
107575
|
-
supportFiles[
|
|
107702
|
+
supportFiles[import_node_path137.default.posix.join(import_node_path137.default.posix.dirname(alias), interfaceName)] = swift.header;
|
|
107576
107703
|
}
|
|
107577
107704
|
}
|
|
107578
107705
|
for (const unit2 of units) {
|
|
@@ -107595,7 +107722,7 @@ function enrichInstalledUnits(units, installed, namespaceGroups, provided, modul
|
|
|
107595
107722
|
const sourceNamespaces = namespaceGroups.get(unit2.namespace) ?? [unit2.namespace];
|
|
107596
107723
|
if (bridge && !target.executable)
|
|
107597
107724
|
for (const file of Object.keys(unit2.files)) {
|
|
107598
|
-
if (!
|
|
107725
|
+
if (!import_node_path137.default.posix.basename(file).startsWith(BRIDGE_MODULE_FILE_PREFIX))
|
|
107599
107726
|
delete unit2.files[file];
|
|
107600
107727
|
}
|
|
107601
107728
|
unit2.swiftLanguageMode = target.languageMode;
|
|
@@ -107734,13 +107861,13 @@ ${source}`;
|
|
|
107734
107861
|
for (const map3 of maps) {
|
|
107735
107862
|
if (!include.startsWith(`${map3.name}/`)) continue;
|
|
107736
107863
|
const header = include.slice(map3.name.length + 1);
|
|
107737
|
-
const candidate =
|
|
107864
|
+
const candidate = import_node_path137.default.posix.join(import_node_path137.default.posix.dirname(map3.file), include);
|
|
107738
107865
|
if (support[candidate] === void 0) continue;
|
|
107739
107866
|
map3.reached.add(header);
|
|
107740
107867
|
pending2.push([candidate, support[candidate]]);
|
|
107741
107868
|
}
|
|
107742
|
-
const relative4 =
|
|
107743
|
-
|
|
107869
|
+
const relative4 = import_node_path137.default.posix.normalize(
|
|
107870
|
+
import_node_path137.default.posix.join(import_node_path137.default.posix.dirname(file), include)
|
|
107744
107871
|
);
|
|
107745
107872
|
if (support[relative4] !== void 0) pending2.push([relative4, support[relative4]]);
|
|
107746
107873
|
}
|
|
@@ -107748,12 +107875,12 @@ ${source}`;
|
|
|
107748
107875
|
for (const map3 of maps) {
|
|
107749
107876
|
if (!map3.reached.size) continue;
|
|
107750
107877
|
const swift = swiftModuleInterface(moduleRoot, map3.name);
|
|
107751
|
-
const mapDirectory =
|
|
107878
|
+
const mapDirectory = import_node_path137.default.posix.dirname(map3.file);
|
|
107752
107879
|
if (swift) {
|
|
107753
107880
|
const header = `${map3.name}-Swift.h`;
|
|
107754
|
-
support[
|
|
107881
|
+
support[import_node_path137.default.posix.join(mapDirectory, map3.name, header)] = swift.header;
|
|
107755
107882
|
const queue = [...map3.reached].map(
|
|
107756
|
-
(file) =>
|
|
107883
|
+
(file) => import_node_path137.default.posix.join(mapDirectory, map3.name, file)
|
|
107757
107884
|
);
|
|
107758
107885
|
const seen = /* @__PURE__ */ new Set();
|
|
107759
107886
|
while (queue.length) {
|
|
@@ -107765,7 +107892,7 @@ ${source}`;
|
|
|
107765
107892
|
/#\s*(?:import|include)\s*[<"]([^>"]+)[>"]/g
|
|
107766
107893
|
)) {
|
|
107767
107894
|
const include = match[1];
|
|
107768
|
-
const next = include.startsWith(`${map3.name}/`) ?
|
|
107895
|
+
const next = include.startsWith(`${map3.name}/`) ? import_node_path137.default.posix.join(mapDirectory, include) : import_node_path137.default.posix.normalize(import_node_path137.default.posix.join(import_node_path137.default.posix.dirname(file), include));
|
|
107769
107896
|
if (support[next] !== void 0) queue.push(next);
|
|
107770
107897
|
}
|
|
107771
107898
|
const contents2 = withoutSwiftDeclarations(
|
|
@@ -107799,7 +107926,7 @@ function swiftAloneObjCClasses(ios, swift, resolveSource) {
|
|
|
107799
107926
|
for (const child of import_node_fs134.default.readdirSync(resolveSource(dir), { withFileTypes: true })) {
|
|
107800
107927
|
if (child.name.startsWith(".") || child.name === "build" || child.name === "node_modules" || /\.(?:xcframework|framework)$/.test(child.name))
|
|
107801
107928
|
continue;
|
|
107802
|
-
const file =
|
|
107929
|
+
const file = import_node_path137.default.join(dir, child.name);
|
|
107803
107930
|
const resolved = resolveSource(file);
|
|
107804
107931
|
const stat = import_node_fs134.default.statSync(resolved);
|
|
107805
107932
|
if (stat.isDirectory()) {
|
|
@@ -107901,13 +108028,13 @@ async function collectExpoSwiftSources(appRoot, signal, installedWorkspace, prep
|
|
|
107901
108028
|
return cloneUnits(units);
|
|
107902
108029
|
}
|
|
107903
108030
|
async function scanExpoModulesWithTimeout(appRequire, autolinker, search) {
|
|
107904
|
-
const appleDir =
|
|
108031
|
+
const appleDir = import_node_path137.default.join(import_node_path137.default.dirname(autolinker), "build/platforms/apple");
|
|
107905
108032
|
if (process.platform === "darwin") {
|
|
107906
108033
|
const coreEntry = search["expo-modules-core"];
|
|
107907
108034
|
const corePath = isRecord(coreEntry) ? coreEntry.path : null;
|
|
107908
108035
|
if (typeof corePath === "string") {
|
|
107909
108036
|
try {
|
|
107910
|
-
const scannerMod = appRequire(
|
|
108037
|
+
const scannerMod = appRequire(import_node_path137.default.join(appleDir, "moduleScanner"));
|
|
107911
108038
|
if (isRecord(scannerMod)) {
|
|
107912
108039
|
const loadScanner = scannerMod.loadModulesScanner;
|
|
107913
108040
|
const collectRoots = scannerMod.collectPackageRoots;
|
|
@@ -107959,10 +108086,10 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
107959
108086
|
signal?.throwIfAborted();
|
|
107960
108087
|
appRoot = import_node_fs134.default.realpathSync(appRoot);
|
|
107961
108088
|
const appConfig = await loadRNXAppConfig(resolveAppProject(appRoot));
|
|
107962
|
-
const appRequire = (0, import_node_module20.createRequire)(
|
|
108089
|
+
const appRequire = (0, import_node_module20.createRequire)(import_node_path137.default.join(appRoot, "package.json"));
|
|
107963
108090
|
let expoRoot;
|
|
107964
108091
|
try {
|
|
107965
|
-
expoRoot =
|
|
108092
|
+
expoRoot = import_node_path137.default.dirname(appRequire.resolve("expo/package.json"));
|
|
107966
108093
|
} catch (error) {
|
|
107967
108094
|
if (!error || typeof error !== "object" || Reflect.get(error, "code") !== "MODULE_NOT_FOUND")
|
|
107968
108095
|
throw error;
|
|
@@ -107982,16 +108109,16 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
107982
108109
|
).version;
|
|
107983
108110
|
if (typeof autolinkerVersion === "string" && Number.parseInt(autolinkerVersion, 10) < 1)
|
|
107984
108111
|
return null;
|
|
107985
|
-
const cli =
|
|
108112
|
+
const cli = import_node_path137.default.join(import_node_path137.default.dirname(autolinker), "bin/expo-modules-autolinking.js");
|
|
107986
108113
|
const flags = autolinkerAppleFlags(autolinker, appRoot);
|
|
107987
108114
|
const appManifest = JSON.parse(
|
|
107988
|
-
import_node_fs134.default.readFileSync(
|
|
108115
|
+
import_node_fs134.default.readFileSync(import_node_path137.default.join(appRoot, "package.json"), "utf8")
|
|
107989
108116
|
);
|
|
107990
108117
|
const expoConfig = appManifest && typeof appManifest === "object" ? Reflect.get(appManifest, "expo") : null;
|
|
107991
108118
|
const autolinking = expoConfig && typeof expoConfig === "object" ? Reflect.get(expoConfig, "autolinking") : null;
|
|
107992
108119
|
const modulesDir = autolinking && typeof autolinking === "object" ? Reflect.get(autolinking, "nativeModulesDir") : null;
|
|
107993
108120
|
import_node_fs134.default.existsSync(
|
|
107994
|
-
|
|
108121
|
+
import_node_path137.default.resolve(appRoot, typeof modulesDir === "string" ? modulesDir : "modules")
|
|
107995
108122
|
);
|
|
107996
108123
|
const childStart = performance.timeOrigin + performance.now();
|
|
107997
108124
|
const [searched, resolvedModules] = await Promise.allSettled(
|
|
@@ -108103,7 +108230,7 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108103
108230
|
if (typeof sourceRoot !== "string")
|
|
108104
108231
|
throw new Error("Expo autolinking entry has no path");
|
|
108105
108232
|
const canonical = import_node_fs134.default.realpathSync(sourceRoot);
|
|
108106
|
-
const answered = canonical.split(
|
|
108233
|
+
const answered = canonical.split(import_node_path137.default.sep).includes("node_modules") && peachAnsweredNativePackages().has(packageName);
|
|
108107
108234
|
if (answered) {
|
|
108108
108235
|
answeredInstalled = true;
|
|
108109
108236
|
if (installed || prepareNative || metadataOnly) {
|
|
@@ -108112,7 +108239,7 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108112
108239
|
}
|
|
108113
108240
|
}
|
|
108114
108241
|
for (const name3 of ["expo-module.config.json", "unimodule.json"]) {
|
|
108115
|
-
const descriptor =
|
|
108242
|
+
const descriptor = import_node_path137.default.join(canonical, name3);
|
|
108116
108243
|
if (import_node_fs134.default.existsSync(descriptor)) {
|
|
108117
108244
|
import_node_fs134.default.readFileSync(descriptor);
|
|
108118
108245
|
noteChangedSince(descriptor, childStart);
|
|
@@ -108129,7 +108256,7 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108129
108256
|
if (!isRecord(pod) || typeof pod.podName !== "string" || typeof pod.podspecDir !== "string")
|
|
108130
108257
|
throw new Error("invalid Expo autolinking pod");
|
|
108131
108258
|
return {
|
|
108132
|
-
base:
|
|
108259
|
+
base: import_node_path137.default.join(pod.podspecDir, pod.podName),
|
|
108133
108260
|
namespace: pod.podName.replace(/[^a-zA-Z0-9]/g, "_")
|
|
108134
108261
|
};
|
|
108135
108262
|
}) : [];
|
|
@@ -108235,10 +108362,10 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108235
108362
|
namespacesSeen.add(namespace);
|
|
108236
108363
|
const files2 = {};
|
|
108237
108364
|
const frameworks = /* @__PURE__ */ new Set();
|
|
108238
|
-
const ios =
|
|
108239
|
-
const appOwned = !canonical.split(
|
|
108240
|
-
const withinApp =
|
|
108241
|
-
const sourceBoundary = appOwned && withinApp !== ".." && !withinApp.startsWith(`..${
|
|
108365
|
+
const ios = import_node_path137.default.join(canonical, "ios");
|
|
108366
|
+
const appOwned = !canonical.split(import_node_path137.default.sep).includes("node_modules");
|
|
108367
|
+
const withinApp = import_node_path137.default.relative(appRoot, canonical);
|
|
108368
|
+
const sourceBoundary = appOwned && withinApp !== ".." && !withinApp.startsWith(`..${import_node_path137.default.sep}`) ? appRoot : canonical;
|
|
108242
108369
|
const boundaryName = sourceBoundary === appRoot ? "app root" : "module root";
|
|
108243
108370
|
const directories2 = /* @__PURE__ */ new Set();
|
|
108244
108371
|
const sources = /* @__PURE__ */ new Set();
|
|
@@ -108252,8 +108379,8 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108252
108379
|
cause
|
|
108253
108380
|
});
|
|
108254
108381
|
}
|
|
108255
|
-
const relative4 =
|
|
108256
|
-
if (relative4 === ".." || relative4.startsWith(`..${
|
|
108382
|
+
const relative4 = import_node_path137.default.relative(sourceBoundary, target);
|
|
108383
|
+
if (relative4 === ".." || relative4.startsWith(`..${import_node_path137.default.sep}`) || import_node_path137.default.isAbsolute(relative4))
|
|
108257
108384
|
throw new Error(
|
|
108258
108385
|
`Expo Swift source escapes ${boundaryName}: ${file} -> ${target}`
|
|
108259
108386
|
);
|
|
@@ -108265,7 +108392,7 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108265
108392
|
if (directories2.has(directory2)) return;
|
|
108266
108393
|
directories2.add(directory2);
|
|
108267
108394
|
for (const child of import_node_fs134.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
108268
|
-
const file =
|
|
108395
|
+
const file = import_node_path137.default.join(dir, child.name);
|
|
108269
108396
|
const linked = child.isSymbolicLink() ? resolveSource(file) : null;
|
|
108270
108397
|
const target = linked ? import_node_fs134.default.statSync(linked) : child;
|
|
108271
108398
|
if (target.isDirectory()) {
|
|
@@ -108280,7 +108407,7 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108280
108407
|
if (import_node_fs134.default.statSync(source2).size > 4096 || !/^(?:\s|\/\/[^\n]*|\/\*[\s\S]*?\*\/)*$/.test(
|
|
108281
108408
|
import_node_fs134.default.readFileSync(source2, "utf8")
|
|
108282
108409
|
))
|
|
108283
|
-
nativeSources.add(
|
|
108410
|
+
nativeSources.add(import_node_path137.default.relative(ios, file));
|
|
108284
108411
|
}
|
|
108285
108412
|
if (!target.isFile() || !child.name.endsWith(".swift")) continue;
|
|
108286
108413
|
const source = linked ?? resolveSource(file);
|
|
@@ -108290,7 +108417,7 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108290
108417
|
fileCount++;
|
|
108291
108418
|
if (!installedWorkspace && (fileCount > MAX_SWIFT_COMPILE_FILES - 2 || bytes > MAX_SWIFT_COMPILE_SOURCE_BYTES))
|
|
108292
108419
|
throw new Error("Expo Swift sources exceed compile service caps");
|
|
108293
|
-
files2[`Sources/${namespace}/${
|
|
108420
|
+
files2[`Sources/${namespace}/${import_node_path137.default.relative(ios, file).split(import_node_path137.default.sep).join("/")}`] = expoSwiftSourceWithPrelude(file, import_node_fs134.default.readFileSync(source, "utf8"));
|
|
108294
108421
|
}
|
|
108295
108422
|
};
|
|
108296
108423
|
const walkFrameworks = (dir) => {
|
|
@@ -108301,7 +108428,7 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108301
108428
|
for (const child of import_node_fs134.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
108302
108429
|
if (child.name.startsWith(".") || child.name === "build" || child.name === "node_modules" || child.name === "android" || child.name === "web" || child.name === "src")
|
|
108303
108430
|
continue;
|
|
108304
|
-
const file =
|
|
108431
|
+
const file = import_node_path137.default.join(dir, child.name);
|
|
108305
108432
|
const linked = child.isSymbolicLink() ? resolveSource(file) : null;
|
|
108306
108433
|
const target = linked ? import_node_fs134.default.statSync(linked) : child;
|
|
108307
108434
|
if (!target.isDirectory()) continue;
|
|
@@ -108357,15 +108484,15 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108357
108484
|
)
|
|
108358
108485
|
);
|
|
108359
108486
|
for (const entry2 of declared) {
|
|
108360
|
-
const declaredPath =
|
|
108361
|
-
const base2 =
|
|
108487
|
+
const declaredPath = import_node_path137.default.resolve(import_node_path137.default.dirname(podspec), entry2);
|
|
108488
|
+
const base2 = import_node_path137.default.dirname(declaredPath);
|
|
108362
108489
|
const name3 = new RegExp(
|
|
108363
|
-
`^${
|
|
108490
|
+
`^${import_node_path137.default.basename(entry2).replace(/[.+^${}()|[\]\\]/g, "\\$&").replaceAll("*", "[^/]*")}$`
|
|
108364
108491
|
);
|
|
108365
108492
|
const found = import_node_fs134.default.existsSync(base2) ? import_node_fs134.default.readdirSync(base2).filter((child) => name3.test(child)) : [];
|
|
108366
108493
|
if (found.length === 0)
|
|
108367
|
-
absentFrameworks.push(
|
|
108368
|
-
for (const child of found) frameworks.add(resolveSource(
|
|
108494
|
+
absentFrameworks.push(import_node_path137.default.relative(appRoot, declaredPath));
|
|
108495
|
+
for (const child of found) frameworks.add(resolveSource(import_node_path137.default.join(base2, child)));
|
|
108369
108496
|
}
|
|
108370
108497
|
}
|
|
108371
108498
|
const podspecFloor = podspecText ? /\.platforms\s*=\s*\{\s*:ios\s*=>\s*['"](\d+(?:\.\d+){0,2})['"]/.exec(
|
|
@@ -108485,7 +108612,7 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108485
108612
|
if (directories !== void 0 && directories.length > 0) {
|
|
108486
108613
|
const scanInline = Reflect.get(
|
|
108487
108614
|
appRequire(
|
|
108488
|
-
|
|
108615
|
+
import_node_path137.default.join(import_node_path137.default.dirname(autolinker), "build/inlineModules/inlineModules.js")
|
|
108489
108616
|
),
|
|
108490
108617
|
"getMirrorStateObject"
|
|
108491
108618
|
);
|
|
@@ -108509,14 +108636,14 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
108509
108636
|
const file = entry && typeof entry === "object" ? Reflect.get(entry, "filePath") : null;
|
|
108510
108637
|
if (typeof file !== "string") throw new Error("invalid Expo inline source");
|
|
108511
108638
|
if (!file.endsWith(".swift")) continue;
|
|
108512
|
-
const relative4 =
|
|
108513
|
-
if (relative4 === ".." || relative4.startsWith(`..${
|
|
108639
|
+
const relative4 = import_node_path137.default.relative(appRoot, import_node_fs134.default.realpathSync(file));
|
|
108640
|
+
if (relative4 === ".." || relative4.startsWith(`..${import_node_path137.default.sep}`) || import_node_path137.default.isAbsolute(relative4))
|
|
108514
108641
|
throw new Error(`Expo inline source escapes app root: ${file}`);
|
|
108515
108642
|
bytes += import_node_fs134.default.statSync(file).size;
|
|
108516
108643
|
fileCount++;
|
|
108517
108644
|
if (fileCount > MAX_SWIFT_COMPILE_FILES - 2 || bytes > MAX_SWIFT_COMPILE_SOURCE_BYTES)
|
|
108518
108645
|
throw new Error("Expo Swift sources exceed compile service caps");
|
|
108519
|
-
appFiles[`Sources/PeachExpoApp/Inline/${relative4.split(
|
|
108646
|
+
appFiles[`Sources/PeachExpoApp/Inline/${relative4.split(import_node_path137.default.sep).join("/")}`] = expoSwiftSourceWithPrelude(file, import_node_fs134.default.readFileSync(file, "utf8"));
|
|
108520
108647
|
}
|
|
108521
108648
|
if (Object.keys(appFiles).length > 0) {
|
|
108522
108649
|
const inlineUnit = {
|
|
@@ -108691,7 +108818,7 @@ function targetSettings2(units) {
|
|
|
108691
108818
|
}
|
|
108692
108819
|
function oneSDKStamp(oneSDK) {
|
|
108693
108820
|
if (!oneSDK) return "";
|
|
108694
|
-
const hash = (0,
|
|
108821
|
+
const hash = (0, import_node_crypto84.createHash)("sha256");
|
|
108695
108822
|
for (const files2 of [oneSDK.targets, oneSDK.entry])
|
|
108696
108823
|
for (const [name3, source] of [...files2].sort(([a], [b]) => a.localeCompare(b)))
|
|
108697
108824
|
hash.update(`${name3}\0${source}\0`);
|
|
@@ -108742,7 +108869,7 @@ ${bridgeModules.length ? "import React\n" : ""}${oneSDK ? "import One\nimport On
|
|
|
108742
108869
|
`;
|
|
108743
108870
|
}
|
|
108744
108871
|
function expoSwiftPreparedKey(base2, units, reactProviderStamp) {
|
|
108745
|
-
const hash = (0,
|
|
108872
|
+
const hash = (0, import_node_crypto84.createHash)("sha256");
|
|
108746
108873
|
hash.update(base2);
|
|
108747
108874
|
hash.update(reactProviderStamp);
|
|
108748
108875
|
for (const unit2 of units) {
|
|
@@ -108779,11 +108906,11 @@ function expoUnitAppPaths(unit2) {
|
|
|
108779
108906
|
});
|
|
108780
108907
|
}
|
|
108781
108908
|
function expoSwiftPackage(appKey, name3) {
|
|
108782
|
-
return
|
|
108909
|
+
return import_node_path137.default.join(import_node_os28.default.tmpdir(), "peach-expo-swift", appKey, `p${process.pid}`, name3);
|
|
108783
108910
|
}
|
|
108784
108911
|
function failureRecordPath(packagePath) {
|
|
108785
|
-
const app =
|
|
108786
|
-
return
|
|
108912
|
+
const app = import_node_path137.default.dirname(import_node_path137.default.dirname(packagePath));
|
|
108913
|
+
return import_node_path137.default.join(app, `${import_node_path137.default.basename(packagePath)}.failed.json`);
|
|
108787
108914
|
}
|
|
108788
108915
|
function readFailedCompilation(packagePath) {
|
|
108789
108916
|
let record5;
|
|
@@ -108910,7 +109037,7 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
108910
109037
|
packagePath,
|
|
108911
109038
|
new Map(
|
|
108912
109039
|
Object.entries(files2).map(([name3, source]) => [
|
|
108913
|
-
|
|
109040
|
+
import_node_path137.default.join(packagePath, name3),
|
|
108914
109041
|
source
|
|
108915
109042
|
])
|
|
108916
109043
|
)
|
|
@@ -108990,20 +109117,20 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
108990
109117
|
{ moduleRoot: options2.moduleRoot }
|
|
108991
109118
|
);
|
|
108992
109119
|
signal.throwIfAborted();
|
|
108993
|
-
const ios =
|
|
108994
|
-
if ([ios,
|
|
109120
|
+
const ios = import_node_path137.default.join(root, "ios");
|
|
109121
|
+
if ([ios, import_node_path137.default.join(ios, "Pods")].some(
|
|
108995
109122
|
(dir) => import_node_fs134.default.existsSync(dir) && import_node_fs134.default.readdirSync(dir).some((entry) => {
|
|
108996
|
-
const project2 =
|
|
109123
|
+
const project2 = import_node_path137.default.join(dir, entry, "project.pbxproj");
|
|
108997
109124
|
return entry.endsWith(".xcodeproj") && import_node_fs134.default.existsSync(project2) && import_node_fs134.default.readFileSync(project2, "utf8").includes("XCRemoteSwiftPackageReference");
|
|
108998
109125
|
})
|
|
108999
109126
|
))
|
|
109000
109127
|
await ensureSwiftToolchain(signal);
|
|
109001
109128
|
let bridge = options2.only ? null : await collectBridgeModuleSources(import_node_fs134.default.realpathSync(root), signal);
|
|
109002
|
-
if (import_node_fs134.default.existsSync(
|
|
109129
|
+
if (import_node_fs134.default.existsSync(import_node_path137.default.join(root, "ios", "Podfile")) && bridge?.units.some(
|
|
109003
109130
|
(unit2) => unit2.nativeTargets?.some((target) => target.bridgingHeader)
|
|
109004
109131
|
)) {
|
|
109005
109132
|
const prepared = options2.installedWorkspace ? {
|
|
109006
|
-
app:
|
|
109133
|
+
app: import_node_path137.default.dirname(import_node_path137.default.dirname(options2.installedWorkspace)),
|
|
109007
109134
|
workspace: options2.installedWorkspace
|
|
109008
109135
|
} : await prepareExpoNativeWorkspace(root, signal, options2.iosTarget);
|
|
109009
109136
|
bridge = await collectBridgeModuleSources(
|
|
@@ -109012,7 +109139,7 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
109012
109139
|
options2.installedWorkspace ?? prepared.workspace
|
|
109013
109140
|
);
|
|
109014
109141
|
}
|
|
109015
|
-
if (bridge && (bridge.installedNamespaces.length > 0 || bridge.units.length > 0 && (options2.installedWorkspace || import_node_fs134.default.existsSync(
|
|
109142
|
+
if (bridge && (bridge.installedNamespaces.length > 0 || bridge.units.length > 0 && (options2.installedWorkspace || import_node_fs134.default.existsSync(import_node_path137.default.join(ios, "Podfile"))))) {
|
|
109016
109143
|
const workspace = options2.installedWorkspace ?? (await prepareExpoNativeWorkspace(root, signal, options2.iosTarget)).workspace;
|
|
109017
109144
|
const module3 = options2.moduleRoot ? { root: options2.moduleRoot, ...swiftModuleToolchain(options2.moduleRoot) } : await resolveSwiftModule({ signal });
|
|
109018
109145
|
await prepareXcodeSwiftPackages(workspace, options2.iosTarget, void 0, signal);
|
|
@@ -109087,9 +109214,9 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
109087
109214
|
const module2 = options2.moduleRoot ? { root: options2.moduleRoot, ...swiftModuleToolchain(options2.moduleRoot) } : await resolveSwiftModule({ signal });
|
|
109088
109215
|
signal.throwIfAborted();
|
|
109089
109216
|
const reactProvider = units.some((unit2) => unit2.reactNativeProvider) ? await (async () => {
|
|
109090
|
-
const projectRoot = options2.installedWorkspace ?
|
|
109091
|
-
const reactNativeRoot =
|
|
109092
|
-
(0, import_node_module20.createRequire)(
|
|
109217
|
+
const projectRoot = options2.installedWorkspace ? import_node_path137.default.dirname(import_node_path137.default.dirname(options2.installedWorkspace)) : (await prepareExpoNativeWorkspace(root, signal, options2.iosTarget)).app;
|
|
109218
|
+
const reactNativeRoot = import_node_path137.default.dirname(
|
|
109219
|
+
(0, import_node_module20.createRequire)(import_node_path137.default.join(projectRoot, "package.json")).resolve(
|
|
109093
109220
|
"react-native/package.json"
|
|
109094
109221
|
)
|
|
109095
109222
|
);
|
|
@@ -109116,8 +109243,8 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
109116
109243
|
}
|
|
109117
109244
|
return provider;
|
|
109118
109245
|
})() : void 0;
|
|
109119
|
-
const reactProviderStamp = reactProvider ? (0,
|
|
109120
|
-
const key2 = (0,
|
|
109246
|
+
const reactProviderStamp = reactProvider ? (0, import_node_crypto84.createHash)("sha256").update(JSON.stringify(reactProvider)).digest("hex") : "";
|
|
109247
|
+
const key2 = (0, import_node_crypto84.createHash)("sha256").update(import_node_fs134.default.realpathSync(root)).digest("hex");
|
|
109121
109248
|
const unitContentStamp = (unit2) => sourceContentStamp(expoSwiftPackage(key2, unit2.moduleId), module2.root) + (unit2.reactNativeProvider ? `:${reactProviderStamp}` : "");
|
|
109122
109249
|
const failures = /* @__PURE__ */ new Map();
|
|
109123
109250
|
const failureRecords = /* @__PURE__ */ new Map();
|
|
@@ -109153,7 +109280,7 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
109153
109280
|
const binaries = await Promise.all(
|
|
109154
109281
|
unit2.frameworks.map(async (dir) => {
|
|
109155
109282
|
const binary2 = {
|
|
109156
|
-
target:
|
|
109283
|
+
target: import_node_path137.default.basename(dir).replace(/\.(xcframework|framework)$/, ""),
|
|
109157
109284
|
source: dir,
|
|
109158
109285
|
url: null,
|
|
109159
109286
|
checksum: null,
|
|
@@ -109459,17 +109586,17 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
109459
109586
|
throw failure2;
|
|
109460
109587
|
}
|
|
109461
109588
|
}
|
|
109462
|
-
var import_node_async_hooks3, import_node_child_process65,
|
|
109589
|
+
var import_node_async_hooks3, import_node_child_process65, import_node_crypto84, import_node_fs134, import_node_module20, import_node_os28, import_node_path137, import_node_url4, import_node_util18, run11, scriptEnv, EXPO_SWIFT_ENTRY, WITNESS_BATCH, traceStore, discoveryCache, preparedCache, savedFs, ignoredRoots, ownTemporaryRoots, EXPO_MODULE_SCAN_TIMEOUT_MS, preparedExpoSwift, openPreparations, ExpoSwiftLinkRefusal;
|
|
109463
109590
|
var init_expo_swift_host = __esm({
|
|
109464
109591
|
"src/expo-swift-host.ts"() {
|
|
109465
109592
|
"use strict";
|
|
109466
109593
|
import_node_async_hooks3 = require("node:async_hooks");
|
|
109467
109594
|
import_node_child_process65 = require("node:child_process");
|
|
109468
|
-
|
|
109595
|
+
import_node_crypto84 = require("node:crypto");
|
|
109469
109596
|
import_node_fs134 = __toESM(require("node:fs"), 1);
|
|
109470
109597
|
import_node_module20 = require("node:module");
|
|
109471
109598
|
import_node_os28 = __toESM(require("node:os"), 1);
|
|
109472
|
-
|
|
109599
|
+
import_node_path137 = __toESM(require("node:path"), 1);
|
|
109473
109600
|
import_node_url4 = require("node:url");
|
|
109474
109601
|
import_node_util18 = require("node:util");
|
|
109475
109602
|
init_expo_eager_seam_contract();
|
|
@@ -109607,8 +109734,8 @@ async function compileTurboApp(appRoot, origin, moduleRoot, iosTarget, prepareRe
|
|
|
109607
109734
|
}
|
|
109608
109735
|
const { artifact, collection } = await compileTurboModule({
|
|
109609
109736
|
appRoot,
|
|
109610
|
-
reactNativeRoot:
|
|
109611
|
-
(0, import_node_module21.createRequire)(
|
|
109737
|
+
reactNativeRoot: import_node_path138.default.dirname(
|
|
109738
|
+
(0, import_node_module21.createRequire)(import_node_path138.default.join(projectRoot, "package.json")).resolve(
|
|
109612
109739
|
"react-native/package.json"
|
|
109613
109740
|
)
|
|
109614
109741
|
),
|
|
@@ -109646,12 +109773,12 @@ async function buildTurboBundle(appRoot, moduleRoot, prepareReactNativeCore) {
|
|
|
109646
109773
|
assets: compiled.artifact ? await compiledModuleAssets(compiled.artifact) : []
|
|
109647
109774
|
};
|
|
109648
109775
|
}
|
|
109649
|
-
var import_node_module21,
|
|
109776
|
+
var import_node_module21, import_node_path138, TURBO_ROUTE, handleTurboRequest;
|
|
109650
109777
|
var init_turbo_bundle = __esm({
|
|
109651
109778
|
"src/turbo-bundle.ts"() {
|
|
109652
109779
|
"use strict";
|
|
109653
109780
|
import_node_module21 = require("node:module");
|
|
109654
|
-
|
|
109781
|
+
import_node_path138 = __toESM(require("node:path"), 1);
|
|
109655
109782
|
init_app_project();
|
|
109656
109783
|
init_app_config();
|
|
109657
109784
|
init_expo_native_prebuilt();
|
|
@@ -109700,7 +109827,7 @@ async function resolveExpoAndroidAutolinking(appRoot) {
|
|
|
109700
109827
|
async function resolveAndroidModules(appRoot) {
|
|
109701
109828
|
let autolinker;
|
|
109702
109829
|
try {
|
|
109703
|
-
autolinker = (0, import_node_module22.createRequire)(
|
|
109830
|
+
autolinker = (0, import_node_module22.createRequire)(import_node_path139.default.join(appRoot, "package.json")).resolve(
|
|
109704
109831
|
"expo-modules-autolinking/package.json"
|
|
109705
109832
|
);
|
|
109706
109833
|
} catch (error) {
|
|
@@ -109708,7 +109835,7 @@ async function resolveAndroidModules(appRoot) {
|
|
|
109708
109835
|
throw error;
|
|
109709
109836
|
}
|
|
109710
109837
|
const output = await runAutolinker(
|
|
109711
|
-
|
|
109838
|
+
import_node_path139.default.join(import_node_path139.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
|
|
109712
109839
|
["resolve", "--platform", "android", "--project-root", appRoot, "--json"],
|
|
109713
109840
|
{
|
|
109714
109841
|
timeout: 3e4,
|
|
@@ -109754,13 +109881,13 @@ async function resolveReactNativeAndroidAutolinking(appRoot) {
|
|
|
109754
109881
|
}
|
|
109755
109882
|
return linked;
|
|
109756
109883
|
}
|
|
109757
|
-
var import_node_fs135, import_node_module22,
|
|
109884
|
+
var import_node_fs135, import_node_module22, import_node_path139, resolving;
|
|
109758
109885
|
var init_android_autolinking = __esm({
|
|
109759
109886
|
"src/android-autolinking.ts"() {
|
|
109760
109887
|
"use strict";
|
|
109761
109888
|
import_node_fs135 = __toESM(require("node:fs"), 1);
|
|
109762
109889
|
import_node_module22 = require("node:module");
|
|
109763
|
-
|
|
109890
|
+
import_node_path139 = __toESM(require("node:path"), 1);
|
|
109764
109891
|
init_androidAutolinkingContract();
|
|
109765
109892
|
init_autolinker_process();
|
|
109766
109893
|
init_is_record();
|
|
@@ -109785,16 +109912,16 @@ async function resolveAndroidGradleSources(request) {
|
|
|
109785
109912
|
includeDependencySources = false
|
|
109786
109913
|
} = request;
|
|
109787
109914
|
if (projectDirs.length === 0) return [];
|
|
109788
|
-
if (!
|
|
109915
|
+
if (!import_node_path140.default.isAbsolute(root) || projectDirs.some((dir) => !import_node_path140.default.isAbsolute(dir)))
|
|
109789
109916
|
throw new Error("Android Gradle source selection requires absolute project paths");
|
|
109790
109917
|
if (!variant2) throw new Error("Android Gradle source selection requires a variant");
|
|
109791
109918
|
root = import_node_fs136.default.realpathSync(root);
|
|
109792
109919
|
const projects2 = [...new Set(projectDirs.map((dir) => import_node_fs136.default.realpathSync(dir)))];
|
|
109793
|
-
const parent =
|
|
109920
|
+
const parent = import_node_path140.default.join(kotlinHome(), "gradle-sources");
|
|
109794
109921
|
import_node_fs136.default.mkdirSync(parent, { recursive: true });
|
|
109795
|
-
const work = import_node_fs136.default.mkdtempSync(
|
|
109796
|
-
const task = `peachAndroidSources${(0,
|
|
109797
|
-
const script =
|
|
109922
|
+
const work = import_node_fs136.default.mkdtempSync(import_node_path140.default.join(parent, ".query-"));
|
|
109923
|
+
const task = `peachAndroidSources${(0, import_node_crypto85.randomBytes)(8).toString("hex")}`;
|
|
109924
|
+
const script = import_node_path140.default.join(work, "sources.gradle");
|
|
109798
109925
|
const encoded = Buffer.from(
|
|
109799
109926
|
JSON.stringify({
|
|
109800
109927
|
root,
|
|
@@ -109813,7 +109940,7 @@ async function resolveAndroidGradleSources(request) {
|
|
|
109813
109940
|
await run12(
|
|
109814
109941
|
"bash",
|
|
109815
109942
|
[
|
|
109816
|
-
|
|
109943
|
+
import_node_path140.default.join(root, "gradlew"),
|
|
109817
109944
|
"--init-script",
|
|
109818
109945
|
script,
|
|
109819
109946
|
`${task}All`,
|
|
@@ -109832,19 +109959,19 @@ async function resolveAndroidGradleSources(request) {
|
|
|
109832
109959
|
);
|
|
109833
109960
|
return projects2.map((projectDir, index) => {
|
|
109834
109961
|
const value = JSON.parse(
|
|
109835
|
-
import_node_fs136.default.readFileSync(
|
|
109962
|
+
import_node_fs136.default.readFileSync(import_node_path140.default.join(work, `${index}.json`), "utf8")
|
|
109836
109963
|
);
|
|
109837
109964
|
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))
|
|
109838
109965
|
throw new Error("Gradle printed an invalid Android project source model");
|
|
109839
109966
|
const paths = (field) => {
|
|
109840
109967
|
const list2 = value[field];
|
|
109841
|
-
if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" &&
|
|
109968
|
+
if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" && import_node_path140.default.isAbsolute(file)))
|
|
109842
109969
|
throw new Error(`Gradle printed invalid Android ${field} paths`);
|
|
109843
109970
|
return list2.map(String);
|
|
109844
109971
|
};
|
|
109845
109972
|
const linkedResource = (field) => {
|
|
109846
109973
|
const file = value[field];
|
|
109847
|
-
if (typeof file !== "string" || !
|
|
109974
|
+
if (typeof file !== "string" || !import_node_path140.default.isAbsolute(file) || !import_node_fs136.default.statSync(file, { throwIfNoEntry: false })?.isFile())
|
|
109848
109975
|
throw new Error(`Gradle did not produce ${field} for ${projectDir}:${variant2}`);
|
|
109849
109976
|
return file;
|
|
109850
109977
|
};
|
|
@@ -109899,7 +110026,7 @@ async function resolveAndroidGradleSources(request) {
|
|
|
109899
110026
|
}
|
|
109900
110027
|
function readDependencyGraph(value) {
|
|
109901
110028
|
if (!isRecord(value) || !Array.isArray(value.javaClasspath) || !value.javaClasspath.every(
|
|
109902
|
-
(file) => typeof file === "string" &&
|
|
110029
|
+
(file) => typeof file === "string" && import_node_path140.default.isAbsolute(file)
|
|
109903
110030
|
)) {
|
|
109904
110031
|
throw new Error("Gradle printed invalid module graphs");
|
|
109905
110032
|
}
|
|
@@ -109912,7 +110039,7 @@ function readDependencyGraph(value) {
|
|
|
109912
110039
|
function readModules(value) {
|
|
109913
110040
|
if (!Array.isArray(value)) throw new Error("Gradle printed an invalid module graph");
|
|
109914
110041
|
const modules = value.map((entry) => {
|
|
109915
|
-
if (!isRecord(entry) || typeof entry.coordinate !== "string" || !/^[^:]+:[^:]+:[^:]+$/.test(entry.coordinate) || !Array.isArray(entry.dependencies) || !entry.dependencies.every((coordinate) => typeof coordinate === "string") || !Array.isArray(entry.jars) || !entry.jars.every((file) => typeof file === "string" &&
|
|
110042
|
+
if (!isRecord(entry) || typeof entry.coordinate !== "string" || !/^[^:]+:[^:]+:[^:]+$/.test(entry.coordinate) || !Array.isArray(entry.dependencies) || !entry.dependencies.every((coordinate) => typeof coordinate === "string") || !Array.isArray(entry.jars) || !entry.jars.every((file) => typeof file === "string" && import_node_path140.default.isAbsolute(file)))
|
|
109916
110043
|
throw new Error("Gradle printed an invalid module");
|
|
109917
110044
|
return {
|
|
109918
110045
|
coordinate: entry.coordinate,
|
|
@@ -109931,7 +110058,7 @@ function readDependencySources(value) {
|
|
|
109931
110058
|
if (!Array.isArray(value)) throw new Error("Gradle printed invalid dependency sources");
|
|
109932
110059
|
const coordinates = /* @__PURE__ */ new Set();
|
|
109933
110060
|
return value.map((entry) => {
|
|
109934
|
-
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" || !
|
|
110061
|
+
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_path140.default.isAbsolute(entry.archive) || !import_node_fs136.default.statSync(entry.archive, { throwIfNoEntry: false })?.isFile())
|
|
109935
110062
|
throw new Error("Gradle printed an invalid dependency sources archive");
|
|
109936
110063
|
const coordinate = `${entry.group}:${entry.name}:${entry.version}`;
|
|
109937
110064
|
if (coordinates.has(coordinate))
|
|
@@ -109945,14 +110072,14 @@ function readDependencySources(value) {
|
|
|
109945
110072
|
};
|
|
109946
110073
|
});
|
|
109947
110074
|
}
|
|
109948
|
-
var import_node_child_process66,
|
|
110075
|
+
var import_node_child_process66, import_node_crypto85, import_node_fs136, import_node_path140, import_node_util19, run12, modelQuery;
|
|
109949
110076
|
var init_android_gradle_sources = __esm({
|
|
109950
110077
|
"src/android-gradle-sources.ts"() {
|
|
109951
110078
|
"use strict";
|
|
109952
110079
|
import_node_child_process66 = require("node:child_process");
|
|
109953
|
-
|
|
110080
|
+
import_node_crypto85 = require("node:crypto");
|
|
109954
110081
|
import_node_fs136 = __toESM(require("node:fs"), 1);
|
|
109955
|
-
|
|
110082
|
+
import_node_path140 = __toESM(require("node:path"), 1);
|
|
109956
110083
|
import_node_util19 = require("node:util");
|
|
109957
110084
|
init_forked_script_contract();
|
|
109958
110085
|
init_is_record();
|
|
@@ -110214,8 +110341,8 @@ function readBridgeFiles(output) {
|
|
|
110214
110341
|
});
|
|
110215
110342
|
}
|
|
110216
110343
|
function androidAppSources(appRoot) {
|
|
110217
|
-
const moduleDir =
|
|
110218
|
-
const gradle = ["build.gradle", "build.gradle.kts"].map((name3) =>
|
|
110344
|
+
const moduleDir = import_node_path141.default.join(appRoot, "android", "app");
|
|
110345
|
+
const gradle = ["build.gradle", "build.gradle.kts"].map((name3) => import_node_path141.default.join(moduleDir, name3)).find((file) => import_node_fs137.default.existsSync(file));
|
|
110219
110346
|
if (!gradle) return null;
|
|
110220
110347
|
const id = /\bapplicationId\s*=?\s*["']([^"']+)["']/.exec(
|
|
110221
110348
|
import_node_fs137.default.readFileSync(gradle, "utf8")
|
|
@@ -110226,15 +110353,15 @@ function androidAppSources(appRoot) {
|
|
|
110226
110353
|
const walk4 = (dir) => {
|
|
110227
110354
|
if (!import_node_fs137.default.existsSync(dir)) return;
|
|
110228
110355
|
for (const child of import_node_fs137.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
110229
|
-
const file =
|
|
110356
|
+
const file = import_node_path141.default.join(dir, child.name);
|
|
110230
110357
|
if (child.isSymbolicLink()) throw new Error(`Android source is a symlink: ${file}`);
|
|
110231
110358
|
if (child.isDirectory()) walk4(file);
|
|
110232
110359
|
else if (child.name.endsWith(".kt")) kotlin.push(file);
|
|
110233
110360
|
else if (child.name.endsWith(".java")) java.push(file);
|
|
110234
110361
|
}
|
|
110235
110362
|
};
|
|
110236
|
-
walk4(
|
|
110237
|
-
walk4(
|
|
110363
|
+
walk4(import_node_path141.default.join(moduleDir, "src", "main", "java"));
|
|
110364
|
+
walk4(import_node_path141.default.join(moduleDir, "src", "main", "kotlin"));
|
|
110238
110365
|
return { applicationId: id[1], kotlin, java };
|
|
110239
110366
|
}
|
|
110240
110367
|
function declares(source, owner, name3) {
|
|
@@ -110252,7 +110379,7 @@ function selectBridgePackages(applicationId, files2, javaFiles) {
|
|
|
110252
110379
|
const javaDeclarations = javaFiles.map((file) => ({
|
|
110253
110380
|
file,
|
|
110254
110381
|
package: /^\s*package\s+([\w.]+)\s*;/m.exec(import_node_fs137.default.readFileSync(file, "utf8"))?.[1] ?? "",
|
|
110255
|
-
name:
|
|
110382
|
+
name: import_node_path141.default.basename(file, ".java")
|
|
110256
110383
|
}));
|
|
110257
110384
|
const closure = (root) => {
|
|
110258
110385
|
const seen = /* @__PURE__ */ new Set([root]);
|
|
@@ -110325,12 +110452,12 @@ function moduleName(text7, className2) {
|
|
|
110325
110452
|
);
|
|
110326
110453
|
return match ? match[1] : null;
|
|
110327
110454
|
}
|
|
110328
|
-
var import_node_fs137,
|
|
110455
|
+
var import_node_fs137, import_node_path141, qualified2;
|
|
110329
110456
|
var init_android_bridge_packages = __esm({
|
|
110330
110457
|
"src/android-bridge-packages.ts"() {
|
|
110331
110458
|
"use strict";
|
|
110332
110459
|
import_node_fs137 = __toESM(require("node:fs"), 1);
|
|
110333
|
-
|
|
110460
|
+
import_node_path141 = __toESM(require("node:path"), 1);
|
|
110334
110461
|
init_is_record();
|
|
110335
110462
|
qualified2 = (file, name3) => file.package ? `${file.package}.${name3}` : name3;
|
|
110336
110463
|
}
|
|
@@ -110338,17 +110465,17 @@ var init_android_bridge_packages = __esm({
|
|
|
110338
110465
|
|
|
110339
110466
|
// src/java-module-abi.ts
|
|
110340
110467
|
async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
|
|
110341
|
-
const digest3 = (0,
|
|
110342
|
-
const parent =
|
|
110468
|
+
const digest3 = (0, import_node_crypto86.createHash)("sha256");
|
|
110469
|
+
const parent = import_node_path142.default.join(kotlinHome(), "java-specs");
|
|
110343
110470
|
import_node_fs138.default.mkdirSync(parent, { recursive: true });
|
|
110344
|
-
const work = import_node_fs138.default.mkdtempSync(
|
|
110471
|
+
const work = import_node_fs138.default.mkdtempSync(import_node_path142.default.join(parent, ".read-"));
|
|
110345
110472
|
try {
|
|
110346
110473
|
const origins = /* @__PURE__ */ new Map();
|
|
110347
110474
|
for (const [index, file] of files2.entries()) {
|
|
110348
110475
|
const bytes = import_node_fs138.default.readFileSync(file);
|
|
110349
110476
|
digest3.update(file).update("\0").update(bytes).update("\0");
|
|
110350
|
-
const target =
|
|
110351
|
-
import_node_fs138.default.mkdirSync(
|
|
110477
|
+
const target = import_node_path142.default.join(work, String(index), import_node_path142.default.basename(file));
|
|
110478
|
+
import_node_fs138.default.mkdirSync(import_node_path142.default.dirname(target));
|
|
110352
110479
|
import_node_fs138.default.writeFileSync(target, bytes);
|
|
110353
110480
|
origins.set(target, file);
|
|
110354
110481
|
}
|
|
@@ -110387,14 +110514,14 @@ ${diagnostic.trim()}`, { cause });
|
|
|
110387
110514
|
}
|
|
110388
110515
|
async function compileJavaModuleAbi(input) {
|
|
110389
110516
|
const { specs, work, hash, toolchain, libraries, sdkRoot, sdkLibrary, language } = input;
|
|
110390
|
-
const directory2 =
|
|
110517
|
+
const directory2 = import_node_path142.default.join(work, "java-abi");
|
|
110391
110518
|
import_node_fs138.default.mkdirSync(directory2);
|
|
110392
110519
|
const sources = specs.specs.map((spec, index) => {
|
|
110393
|
-
const target =
|
|
110520
|
+
const target = import_node_path142.default.join(directory2, `Spec${index}.kt`);
|
|
110394
110521
|
import_node_fs138.default.writeFileSync(target, spec.source);
|
|
110395
110522
|
return target;
|
|
110396
110523
|
});
|
|
110397
|
-
const initializer =
|
|
110524
|
+
const initializer = import_node_path142.default.join(directory2, "Bindings.kt");
|
|
110398
110525
|
import_node_fs138.default.writeFileSync(
|
|
110399
110526
|
initializer,
|
|
110400
110527
|
[
|
|
@@ -110409,8 +110536,8 @@ async function compileJavaModuleAbi(input) {
|
|
|
110409
110536
|
"-J-Xmx2g",
|
|
110410
110537
|
"-Xwasm-target=js",
|
|
110411
110538
|
"-libraries",
|
|
110412
|
-
libraries.join(
|
|
110413
|
-
`-Xplugin=${
|
|
110539
|
+
libraries.join(import_node_path142.default.delimiter),
|
|
110540
|
+
`-Xplugin=${import_node_path142.default.join(sdkRoot, "plugin.jar")}`,
|
|
110414
110541
|
`-Xfriend-modules=${sdkLibrary}`,
|
|
110415
110542
|
"-language-version",
|
|
110416
110543
|
language,
|
|
@@ -110426,23 +110553,23 @@ async function compileJavaModuleAbi(input) {
|
|
|
110426
110553
|
],
|
|
110427
110554
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
110428
110555
|
);
|
|
110429
|
-
const library =
|
|
110556
|
+
const library = import_node_path142.default.join(directory2, "java-abi.klib");
|
|
110430
110557
|
await runKotlinTool(
|
|
110431
110558
|
toolchain,
|
|
110432
110559
|
sdkRoot,
|
|
110433
110560
|
"dev.peach.tools.platform.JavaPlatformTypesKt",
|
|
110434
|
-
[
|
|
110561
|
+
[import_node_path142.default.join(directory2, `${name3}.klib`), library]
|
|
110435
110562
|
);
|
|
110436
110563
|
return library;
|
|
110437
110564
|
}
|
|
110438
|
-
var import_node_child_process67,
|
|
110565
|
+
var import_node_child_process67, import_node_crypto86, import_node_fs138, import_node_path142, import_node_util20, run13, JAVA_BINDINGS_INITIALIZER;
|
|
110439
110566
|
var init_java_module_abi = __esm({
|
|
110440
110567
|
"src/java-module-abi.ts"() {
|
|
110441
110568
|
"use strict";
|
|
110442
110569
|
import_node_child_process67 = require("node:child_process");
|
|
110443
|
-
|
|
110570
|
+
import_node_crypto86 = require("node:crypto");
|
|
110444
110571
|
import_node_fs138 = __toESM(require("node:fs"), 1);
|
|
110445
|
-
|
|
110572
|
+
import_node_path142 = __toESM(require("node:path"), 1);
|
|
110446
110573
|
import_node_util20 = require("node:util");
|
|
110447
110574
|
init_android_bridge_packages();
|
|
110448
110575
|
init_is_record();
|
|
@@ -110535,34 +110662,34 @@ function verifyKotlinSdkDirectory(root, compiler) {
|
|
|
110535
110662
|
const names = import_node_fs139.default.readdirSync(root);
|
|
110536
110663
|
if (names.length !== expectedNames.length || names.some((name3) => !expectedNames.includes(name3)))
|
|
110537
110664
|
throw new Error("Kotlin SDK directory contains unexpected inputs");
|
|
110538
|
-
const manifestStat = import_node_fs139.default.lstatSync(
|
|
110665
|
+
const manifestStat = import_node_fs139.default.lstatSync(import_node_path143.default.join(root, "manifest.json"));
|
|
110539
110666
|
if (!manifestStat.isFile() || manifestStat.nlink !== 1)
|
|
110540
110667
|
throw new Error("Kotlin SDK manifest is not a regular file");
|
|
110541
110668
|
const manifest = readKotlinSdkManifest(
|
|
110542
|
-
import_node_fs139.default.readFileSync(
|
|
110669
|
+
import_node_fs139.default.readFileSync(import_node_path143.default.join(root, "manifest.json"), "utf8"),
|
|
110543
110670
|
compiler.upstreamSha256
|
|
110544
110671
|
);
|
|
110545
110672
|
for (const [name3, expected] of Object.entries(manifest.files)) {
|
|
110546
|
-
const target =
|
|
110673
|
+
const target = import_node_path143.default.join(root, name3);
|
|
110547
110674
|
const stat = import_node_fs139.default.lstatSync(target);
|
|
110548
110675
|
if (!stat.isFile() || stat.nlink !== 1)
|
|
110549
110676
|
throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
|
|
110550
110677
|
const bytes = import_node_fs139.default.readFileSync(target);
|
|
110551
|
-
if (bytes.length !== expected.bytes || (0,
|
|
110678
|
+
if (bytes.length !== expected.bytes || (0, import_node_crypto87.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
|
|
110552
110679
|
throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
|
|
110553
110680
|
}
|
|
110554
110681
|
return manifest;
|
|
110555
110682
|
}
|
|
110556
110683
|
async function installKotlinSdkArchive(archive, compiler) {
|
|
110557
|
-
const sha2565 = (0,
|
|
110558
|
-
const parent =
|
|
110559
|
-
const root =
|
|
110684
|
+
const sha2565 = (0, import_node_crypto87.createHash)("sha256").update(archive).digest("hex");
|
|
110685
|
+
const parent = import_node_path143.default.join(kotlinHome(), "sdk");
|
|
110686
|
+
const root = import_node_path143.default.join(parent, sha2565);
|
|
110560
110687
|
if (import_node_fs139.default.existsSync(root))
|
|
110561
110688
|
return { root, sha256: sha2565, manifest: verifyKotlinSdkDirectory(root, compiler) };
|
|
110562
110689
|
import_node_fs139.default.mkdirSync(parent, { recursive: true });
|
|
110563
|
-
const work = import_node_fs139.default.mkdtempSync(
|
|
110690
|
+
const work = import_node_fs139.default.mkdtempSync(import_node_path143.default.join(parent, ".install-"));
|
|
110564
110691
|
try {
|
|
110565
|
-
const packed =
|
|
110692
|
+
const packed = import_node_path143.default.join(work, "sdk.tar.gz");
|
|
110566
110693
|
import_node_fs139.default.writeFileSync(packed, archive);
|
|
110567
110694
|
const { stdout } = await run14("tar", ["-tzf", packed]);
|
|
110568
110695
|
const names = stdout.trim().split("\n");
|
|
@@ -110583,14 +110710,14 @@ async function installKotlinSdkArchive(archive, compiler) {
|
|
|
110583
110710
|
import_node_fs139.default.rmSync(work, { recursive: true, force: true });
|
|
110584
110711
|
}
|
|
110585
110712
|
}
|
|
110586
|
-
var import_node_child_process68,
|
|
110713
|
+
var import_node_child_process68, import_node_crypto87, import_node_fs139, import_node_path143, import_node_util21, run14;
|
|
110587
110714
|
var init_kotlin_sdk = __esm({
|
|
110588
110715
|
"src/kotlin-sdk.ts"() {
|
|
110589
110716
|
"use strict";
|
|
110590
110717
|
import_node_child_process68 = require("node:child_process");
|
|
110591
|
-
|
|
110718
|
+
import_node_crypto87 = require("node:crypto");
|
|
110592
110719
|
import_node_fs139 = __toESM(require("node:fs"), 1);
|
|
110593
|
-
|
|
110720
|
+
import_node_path143 = __toESM(require("node:path"), 1);
|
|
110594
110721
|
import_node_util21 = require("node:util");
|
|
110595
110722
|
init_kotlin_toolchain();
|
|
110596
110723
|
init_kotlinSdkContract();
|
|
@@ -110600,8 +110727,8 @@ var init_kotlin_sdk = __esm({
|
|
|
110600
110727
|
|
|
110601
110728
|
// src/android-bridge-dependencies.ts
|
|
110602
110729
|
async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
110603
|
-
const root =
|
|
110604
|
-
if (!import_node_fs140.default.existsSync(
|
|
110730
|
+
const root = import_node_path144.default.join(appRoot, "android");
|
|
110731
|
+
if (!import_node_fs140.default.existsSync(import_node_path144.default.join(root, "gradlew"))) return null;
|
|
110605
110732
|
const dependencies = (await resolveReactNativeAndroidAutolinking(appRoot)).flatMap(
|
|
110606
110733
|
(dependency) => dependency.sourceDir === null || dependency.packageInstance === null ? [] : [
|
|
110607
110734
|
{
|
|
@@ -110615,7 +110742,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
110615
110742
|
const models = await resolveAndroidGradleSources({
|
|
110616
110743
|
root,
|
|
110617
110744
|
projects: [
|
|
110618
|
-
|
|
110745
|
+
import_node_path144.default.join(root, "app"),
|
|
110619
110746
|
...dependencies.map((dependency) => dependency.sourceDir)
|
|
110620
110747
|
],
|
|
110621
110748
|
variant: "debug"
|
|
@@ -110625,7 +110752,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
110625
110752
|
const toolchain = readToolchain(moduleRoot);
|
|
110626
110753
|
const [sdk2, ready] = await Promise.all([
|
|
110627
110754
|
installKotlinSdkArchive(
|
|
110628
|
-
import_node_fs140.default.readFileSync(
|
|
110755
|
+
import_node_fs140.default.readFileSync(import_node_path144.default.join(moduleRoot, "sdk.tar.gz")),
|
|
110629
110756
|
toolchain.compiler
|
|
110630
110757
|
),
|
|
110631
110758
|
ensureToolchain(toolchain)
|
|
@@ -110672,12 +110799,12 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
110672
110799
|
}
|
|
110673
110800
|
return packages.length ? { applicationId, packages } : null;
|
|
110674
110801
|
}
|
|
110675
|
-
var import_node_fs140,
|
|
110802
|
+
var import_node_fs140, import_node_path144;
|
|
110676
110803
|
var init_android_bridge_dependencies = __esm({
|
|
110677
110804
|
"src/android-bridge-dependencies.ts"() {
|
|
110678
110805
|
"use strict";
|
|
110679
110806
|
import_node_fs140 = __toESM(require("node:fs"), 1);
|
|
110680
|
-
|
|
110807
|
+
import_node_path144 = __toESM(require("node:path"), 1);
|
|
110681
110808
|
init_android_autolinking();
|
|
110682
110809
|
init_android_gradle_sources();
|
|
110683
110810
|
init_java_module_abi();
|
|
@@ -110688,19 +110815,19 @@ var init_android_bridge_dependencies = __esm({
|
|
|
110688
110815
|
|
|
110689
110816
|
// src/kotlin-module.ts
|
|
110690
110817
|
function peachKotlinModuleRoot() {
|
|
110691
|
-
if (!IS_STANDALONE) return
|
|
110818
|
+
if (!IS_STANDALONE) return import_node_path145.default.join(peachsimPackageRoot(), "kotlin");
|
|
110692
110819
|
if (installedRoot) return installedRoot;
|
|
110693
110820
|
const files2 = JSON.parse(__PEACH_BUNDLED_KOTLIN__);
|
|
110694
|
-
const digest3 = (0,
|
|
110695
|
-
const parent =
|
|
110696
|
-
const root =
|
|
110821
|
+
const digest3 = (0, import_node_crypto88.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
|
|
110822
|
+
const parent = import_node_path145.default.join(rnxHomeDir(), "kotlin", "modules");
|
|
110823
|
+
const root = import_node_path145.default.join(parent, digest3);
|
|
110697
110824
|
import_node_fs141.default.mkdirSync(parent, { recursive: true });
|
|
110698
110825
|
if (!import_node_fs141.default.existsSync(root)) {
|
|
110699
|
-
const pending2 = import_node_fs141.default.mkdtempSync(
|
|
110826
|
+
const pending2 = import_node_fs141.default.mkdtempSync(import_node_path145.default.join(parent, ".install-"));
|
|
110700
110827
|
try {
|
|
110701
110828
|
for (const [name3, contents2] of Object.entries(files2)) {
|
|
110702
|
-
const file =
|
|
110703
|
-
import_node_fs141.default.mkdirSync(
|
|
110829
|
+
const file = import_node_path145.default.join(pending2, name3);
|
|
110830
|
+
import_node_fs141.default.mkdirSync(import_node_path145.default.dirname(file), { recursive: true });
|
|
110704
110831
|
import_node_fs141.default.writeFileSync(file, Buffer.from(contents2, "base64"));
|
|
110705
110832
|
}
|
|
110706
110833
|
try {
|
|
@@ -110714,19 +110841,19 @@ function peachKotlinModuleRoot() {
|
|
|
110714
110841
|
}
|
|
110715
110842
|
}
|
|
110716
110843
|
for (const [name3, contents2] of Object.entries(files2)) {
|
|
110717
|
-
if (!import_node_fs141.default.readFileSync(
|
|
110844
|
+
if (!import_node_fs141.default.readFileSync(import_node_path145.default.join(root, name3)).equals(Buffer.from(contents2, "base64")))
|
|
110718
110845
|
throw new Error(`packaged Kotlin module differs from this CLI: ${name3}`);
|
|
110719
110846
|
}
|
|
110720
110847
|
installedRoot = root;
|
|
110721
110848
|
return root;
|
|
110722
110849
|
}
|
|
110723
|
-
var
|
|
110850
|
+
var import_node_crypto88, import_node_fs141, import_node_path145, installedRoot;
|
|
110724
110851
|
var init_kotlin_module = __esm({
|
|
110725
110852
|
"src/kotlin-module.ts"() {
|
|
110726
110853
|
"use strict";
|
|
110727
|
-
|
|
110854
|
+
import_node_crypto88 = require("node:crypto");
|
|
110728
110855
|
import_node_fs141 = __toESM(require("node:fs"), 1);
|
|
110729
|
-
|
|
110856
|
+
import_node_path145 = __toESM(require("node:path"), 1);
|
|
110730
110857
|
init_standalone();
|
|
110731
110858
|
init_home_paths();
|
|
110732
110859
|
init_is_record();
|
|
@@ -110810,7 +110937,7 @@ function kotlinFragmentFlags(filename, kotlinSources2, translatedSources) {
|
|
|
110810
110937
|
);
|
|
110811
110938
|
return {
|
|
110812
110939
|
name: fragment.name,
|
|
110813
|
-
sources: fragment.sources.map((source) =>
|
|
110940
|
+
sources: fragment.sources.map((source) => import_node_path146.default.resolve(source)),
|
|
110814
110941
|
refines: fragment.refines,
|
|
110815
110942
|
java: fragment.java === true
|
|
110816
110943
|
};
|
|
@@ -110844,47 +110971,47 @@ function kotlinFragmentFlags(filename, kotlinSources2, translatedSources) {
|
|
|
110844
110971
|
];
|
|
110845
110972
|
}
|
|
110846
110973
|
async function compileKotlinLibrarySources(input) {
|
|
110847
|
-
const output =
|
|
110848
|
-
const name3 =
|
|
110974
|
+
const output = import_node_path146.default.resolve(input.output);
|
|
110975
|
+
const name3 = import_node_path146.default.basename(output, ".klib");
|
|
110849
110976
|
if (!name3 || !output.endsWith(".klib") || input.source.kind === "files" && !input.source.java.length && !input.source.kotlin.length)
|
|
110850
110977
|
throw new Error("Android library compilation requires sources and a KLIB output");
|
|
110851
110978
|
const { ready, sdkRoot, libraries } = input;
|
|
110852
|
-
const parent =
|
|
110979
|
+
const parent = import_node_path146.default.dirname(output);
|
|
110853
110980
|
import_node_fs142.default.mkdirSync(parent, { recursive: true });
|
|
110854
|
-
const work = import_node_fs142.default.mkdtempSync(
|
|
110981
|
+
const work = import_node_fs142.default.mkdtempSync(import_node_path146.default.join(parent, ".android-library-"));
|
|
110855
110982
|
try {
|
|
110856
110983
|
const compileLibraries = [...libraries, ...input.dependencies];
|
|
110857
110984
|
let javaSources;
|
|
110858
110985
|
if (input.source.kind === "resources") {
|
|
110859
|
-
const generated =
|
|
110986
|
+
const generated = import_node_path146.default.join(work, "resources");
|
|
110860
110987
|
await runKotlinTool(
|
|
110861
110988
|
ready,
|
|
110862
110989
|
sdkRoot,
|
|
110863
110990
|
"dev.peach.tools.platform.AndroidResourceClassesKt",
|
|
110864
|
-
[
|
|
110991
|
+
[import_node_path146.default.resolve(input.source.archive), generated]
|
|
110865
110992
|
);
|
|
110866
|
-
javaSources = import_node_fs142.default.readdirSync(generated, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".java")).sort().map((file) =>
|
|
110993
|
+
javaSources = import_node_fs142.default.readdirSync(generated, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".java")).sort().map((file) => import_node_path146.default.join(generated, file));
|
|
110867
110994
|
} else {
|
|
110868
110995
|
javaSources = input.source.java;
|
|
110869
110996
|
}
|
|
110870
|
-
const kotlinSources2 = input.source.kind === "files" ? input.source.kotlin.map((file) =>
|
|
110871
|
-
const commonSources = (input.commonSources ?? []).map((file) =>
|
|
110997
|
+
const kotlinSources2 = input.source.kind === "files" ? input.source.kotlin.map((file) => import_node_path146.default.resolve(file)) : [];
|
|
110998
|
+
const commonSources = (input.commonSources ?? []).map((file) => import_node_path146.default.resolve(file));
|
|
110872
110999
|
if (commonSources.length && input.kotlinFragments)
|
|
110873
111000
|
throw new Error("Choose common sources or a Kotlin fragment graph");
|
|
110874
111001
|
if (commonSources.some((file) => file.includes(",") || !kotlinSources2.includes(file)))
|
|
110875
111002
|
throw new Error("Common Kotlin sources must be included in the library source list");
|
|
110876
|
-
const kotlinJvmAbi = input.kotlinJvmAbi &&
|
|
110877
|
-
if (kotlinJvmAbi && (!javaSources.length || !kotlinSources2.length || !kotlinJvmAbi.endsWith(".jar") || !input.javaClasspath.some((file) =>
|
|
111003
|
+
const kotlinJvmAbi = input.kotlinJvmAbi && import_node_path146.default.resolve(input.kotlinJvmAbi);
|
|
111004
|
+
if (kotlinJvmAbi && (!javaSources.length || !kotlinSources2.length || !kotlinJvmAbi.endsWith(".jar") || !input.javaClasspath.some((file) => import_node_path146.default.resolve(file) === kotlinJvmAbi)))
|
|
110878
111005
|
throw new Error(
|
|
110879
111006
|
"The Kotlin JVM ABI must be a JAR on the mixed library\u2019s Java classpath"
|
|
110880
111007
|
);
|
|
110881
111008
|
const dependencyAbiFlags = [];
|
|
110882
111009
|
if (input.dependencyJvmAbi) {
|
|
110883
111010
|
const dependencyPaths = new Set(
|
|
110884
|
-
input.dependencies.map((file) =>
|
|
111011
|
+
input.dependencies.map((file) => import_node_path146.default.resolve(file))
|
|
110885
111012
|
);
|
|
110886
111013
|
const classpathPaths = new Set(
|
|
110887
|
-
input.javaClasspath.map((file) =>
|
|
111014
|
+
input.javaClasspath.map((file) => import_node_path146.default.resolve(file))
|
|
110888
111015
|
);
|
|
110889
111016
|
const value = JSON.parse(import_node_fs142.default.readFileSync(input.dependencyJvmAbi, "utf8"));
|
|
110890
111017
|
if (!Array.isArray(value) || !value.length || !javaSources.length)
|
|
@@ -110894,8 +111021,8 @@ async function compileKotlinLibrarySources(input) {
|
|
|
110894
111021
|
for (const pair of value) {
|
|
110895
111022
|
if (!isRecord(pair) || typeof pair.klib !== "string" || typeof pair.jar !== "string")
|
|
110896
111023
|
throw new Error("Each dependency JVM ABI requires a klib and a jar path");
|
|
110897
|
-
const klib =
|
|
110898
|
-
const jar =
|
|
111024
|
+
const klib = import_node_path146.default.resolve(pair.klib);
|
|
111025
|
+
const jar = import_node_path146.default.resolve(pair.jar);
|
|
110899
111026
|
if (!klib.endsWith(".klib") || !dependencyPaths.has(klib) || !jar.endsWith(".jar") || !classpathPaths.has(jar) || jar === kotlinJvmAbi)
|
|
110900
111027
|
throw new Error(
|
|
110901
111028
|
"Dependency JVM ABI pairs must refer to a dependency KLIB and its Java classpath JAR"
|
|
@@ -110905,13 +111032,13 @@ async function compileKotlinLibrarySources(input) {
|
|
|
110905
111032
|
}
|
|
110906
111033
|
let translatedSources = [];
|
|
110907
111034
|
if (javaSources.length) {
|
|
110908
|
-
const platform2 =
|
|
111035
|
+
const platform2 = import_node_path146.default.join(work, "platform.txt");
|
|
110909
111036
|
const members2 = kotlinToolCommand(
|
|
110910
111037
|
ready,
|
|
110911
111038
|
sdkRoot,
|
|
110912
111039
|
"dev.peach.tools.platform.KlibClassesKt",
|
|
110913
111040
|
[
|
|
110914
|
-
...compileLibraries.map((file) =>
|
|
111041
|
+
...compileLibraries.map((file) => import_node_path146.default.resolve(file)),
|
|
110915
111042
|
...kotlinJvmAbi ? ["--same-library-jvm-abi", kotlinJvmAbi] : [],
|
|
110916
111043
|
...dependencyAbiFlags
|
|
110917
111044
|
]
|
|
@@ -110927,12 +111054,12 @@ async function compileKotlinLibrarySources(input) {
|
|
|
110927
111054
|
} finally {
|
|
110928
111055
|
import_node_fs142.default.closeSync(fd);
|
|
110929
111056
|
}
|
|
110930
|
-
const sourceList =
|
|
111057
|
+
const sourceList = import_node_path146.default.join(work, "sources.txt");
|
|
110931
111058
|
import_node_fs142.default.writeFileSync(
|
|
110932
111059
|
sourceList,
|
|
110933
|
-
javaSources.map((file) =>
|
|
111060
|
+
javaSources.map((file) => import_node_path146.default.resolve(file)).join("\n")
|
|
110934
111061
|
);
|
|
110935
|
-
const translated =
|
|
111062
|
+
const translated = import_node_path146.default.join(work, "translated");
|
|
110936
111063
|
const diagnostics = await runKotlinTool(
|
|
110937
111064
|
ready,
|
|
110938
111065
|
sdkRoot,
|
|
@@ -110943,7 +111070,7 @@ async function compileKotlinLibrarySources(input) {
|
|
|
110943
111070
|
"--release",
|
|
110944
111071
|
input.release,
|
|
110945
111072
|
"--classpath",
|
|
110946
|
-
input.javaClasspath.map((file) =>
|
|
111073
|
+
input.javaClasspath.map((file) => import_node_path146.default.resolve(file)).join(import_node_path146.default.delimiter),
|
|
110947
111074
|
"--platform",
|
|
110948
111075
|
platform2,
|
|
110949
111076
|
...input.processorPath ? ["--processorpath", input.processorPath] : [],
|
|
@@ -110957,18 +111084,18 @@ async function compileKotlinLibrarySources(input) {
|
|
|
110957
111084
|
`Android library ${name3} requires unsupported platform members:
|
|
110958
111085
|
${diagnostics.trimEnd()}`
|
|
110959
111086
|
);
|
|
110960
|
-
translatedSources = input.kotlinFragments ? import_node_fs142.default.readdirSync(translated, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".kt")).sort().map((file) =>
|
|
111087
|
+
translatedSources = input.kotlinFragments ? import_node_fs142.default.readdirSync(translated, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".kt")).sort().map((file) => import_node_path146.default.join(translated, file)) : [translated];
|
|
110961
111088
|
}
|
|
110962
111089
|
const multiplatform = input.kotlinFragments ? kotlinFragmentFlags(input.kotlinFragments, kotlinSources2, translatedSources) : commonSources.length ? ["-Xmulti-platform", `-Xcommon-sources=${commonSources.join(",")}`] : [];
|
|
110963
111090
|
const language = input.kotlinLanguage ?? "2.1";
|
|
110964
|
-
const raw2 =
|
|
111091
|
+
const raw2 = import_node_path146.default.join(work, "raw");
|
|
110965
111092
|
await runCompiler2(
|
|
110966
111093
|
ready.kotlinc,
|
|
110967
111094
|
[
|
|
110968
111095
|
"-J-Xmx4g",
|
|
110969
111096
|
"-Xwasm-target=js",
|
|
110970
111097
|
"-nowarn",
|
|
110971
|
-
`-Xplugin=${
|
|
111098
|
+
`-Xplugin=${import_node_path146.default.join(sdkRoot, "plugin.jar")}`,
|
|
110972
111099
|
"-P",
|
|
110973
111100
|
"plugin:dev.peach.jni:android=true",
|
|
110974
111101
|
"-language-version",
|
|
@@ -110978,7 +111105,7 @@ ${diagnostics.trimEnd()}`
|
|
|
110978
111105
|
...(input.kotlinOptIns ?? []).map((marker) => `-opt-in=${marker}`),
|
|
110979
111106
|
...multiplatform,
|
|
110980
111107
|
"-libraries",
|
|
110981
|
-
compileLibraries.join(
|
|
111108
|
+
compileLibraries.join(import_node_path146.default.delimiter),
|
|
110982
111109
|
"-ir-output-dir",
|
|
110983
111110
|
raw2,
|
|
110984
111111
|
"-ir-output-name",
|
|
@@ -110989,12 +111116,12 @@ ${diagnostics.trimEnd()}`
|
|
|
110989
111116
|
{ stdio: "inherit", env: { ...process.env, JAVA_HOME: ready.javaHome } },
|
|
110990
111117
|
"Android library " + name3 + " compilation"
|
|
110991
111118
|
);
|
|
110992
|
-
const compiled =
|
|
111119
|
+
const compiled = import_node_path146.default.join(raw2, `${name3}.klib`);
|
|
110993
111120
|
if (!javaSources.length) {
|
|
110994
111121
|
import_node_fs142.default.renameSync(compiled, output);
|
|
110995
111122
|
return;
|
|
110996
111123
|
}
|
|
110997
|
-
const normalized =
|
|
111124
|
+
const normalized = import_node_path146.default.join(work, "normalized.klib");
|
|
110998
111125
|
await runKotlinTool(ready, sdkRoot, "dev.peach.tools.platform.JavaPlatformTypesKt", [
|
|
110999
111126
|
compiled,
|
|
111000
111127
|
normalized,
|
|
@@ -111005,13 +111132,13 @@ ${diagnostics.trimEnd()}`
|
|
|
111005
111132
|
import_node_fs142.default.rmSync(work, { recursive: true, force: true });
|
|
111006
111133
|
}
|
|
111007
111134
|
}
|
|
111008
|
-
var import_node_child_process69, import_node_fs142,
|
|
111135
|
+
var import_node_child_process69, import_node_fs142, import_node_path146;
|
|
111009
111136
|
var init_kotlin_library_sources = __esm({
|
|
111010
111137
|
"src/kotlin-library-sources.ts"() {
|
|
111011
111138
|
"use strict";
|
|
111012
111139
|
import_node_child_process69 = require("node:child_process");
|
|
111013
111140
|
import_node_fs142 = __toESM(require("node:fs"), 1);
|
|
111014
|
-
|
|
111141
|
+
import_node_path146 = __toESM(require("node:path"), 1);
|
|
111015
111142
|
init_is_record();
|
|
111016
111143
|
init_kotlin_toolchain();
|
|
111017
111144
|
}
|
|
@@ -111087,27 +111214,27 @@ function zipSources(bytes, where) {
|
|
|
111087
111214
|
return entries2;
|
|
111088
111215
|
}
|
|
111089
111216
|
function extract(bytes, where) {
|
|
111090
|
-
const key2 = (0,
|
|
111217
|
+
const key2 = (0, import_node_crypto89.createHash)("sha256").update(bytes).digest("hex");
|
|
111091
111218
|
const cached2 = pending.get(key2);
|
|
111092
111219
|
if (cached2) return cached2;
|
|
111093
111220
|
const request = (async () => {
|
|
111094
|
-
const dest =
|
|
111095
|
-
const marker =
|
|
111221
|
+
const dest = import_node_path147.default.join(import_node_os29.default.tmpdir(), "peach-maven-sources", key2);
|
|
111222
|
+
const marker = import_node_path147.default.join(dest, ".complete");
|
|
111096
111223
|
if (!import_node_fs143.default.existsSync(marker)) {
|
|
111097
111224
|
const sources = zipSources(bytes, where);
|
|
111098
111225
|
const staging = `${dest}.partial-${process.pid}`;
|
|
111099
111226
|
import_node_fs143.default.rmSync(staging, { recursive: true, force: true });
|
|
111100
|
-
const stagingRoot =
|
|
111227
|
+
const stagingRoot = import_node_path147.default.resolve(staging);
|
|
111101
111228
|
import_node_fs143.default.mkdirSync(stagingRoot, { recursive: true });
|
|
111102
111229
|
for (const entry of sources) {
|
|
111103
|
-
const file =
|
|
111104
|
-
if (!file.startsWith(`${stagingRoot}${
|
|
111230
|
+
const file = import_node_path147.default.resolve(stagingRoot, entry.name);
|
|
111231
|
+
if (!file.startsWith(`${stagingRoot}${import_node_path147.default.sep}`)) {
|
|
111105
111232
|
throw new Error(`${where}: ${entry.name} escapes the sources jar`);
|
|
111106
111233
|
}
|
|
111107
|
-
import_node_fs143.default.mkdirSync(
|
|
111234
|
+
import_node_fs143.default.mkdirSync(import_node_path147.default.dirname(file), { recursive: true });
|
|
111108
111235
|
import_node_fs143.default.writeFileSync(file, entry.data);
|
|
111109
111236
|
}
|
|
111110
|
-
import_node_fs143.default.writeFileSync(
|
|
111237
|
+
import_node_fs143.default.writeFileSync(import_node_path147.default.join(staging, ".complete"), "");
|
|
111111
111238
|
try {
|
|
111112
111239
|
import_node_fs143.default.renameSync(staging, dest);
|
|
111113
111240
|
} catch (error) {
|
|
@@ -111115,7 +111242,7 @@ function extract(bytes, where) {
|
|
|
111115
111242
|
if (!import_node_fs143.default.existsSync(marker)) throw error;
|
|
111116
111243
|
}
|
|
111117
111244
|
}
|
|
111118
|
-
const files2 = import_node_fs143.default.readdirSync(dest, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) =>
|
|
111245
|
+
const files2 = import_node_fs143.default.readdirSync(dest, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path147.default.join(entry.parentPath, entry.name)).sort();
|
|
111119
111246
|
return {
|
|
111120
111247
|
directory: dest,
|
|
111121
111248
|
java: files2.filter((file) => file.endsWith(".java")),
|
|
@@ -111136,14 +111263,14 @@ function readSourcesJar(archive, where) {
|
|
|
111136
111263
|
function readMavenSourcesArchive(archive) {
|
|
111137
111264
|
return extract(readSourcesJar(archive, archive), archive);
|
|
111138
111265
|
}
|
|
111139
|
-
var
|
|
111266
|
+
var import_node_crypto89, import_node_fs143, import_node_os29, import_node_path147, import_node_zlib9, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
|
|
111140
111267
|
var init_kotlin_maven_sources = __esm({
|
|
111141
111268
|
"src/kotlin-maven-sources.ts"() {
|
|
111142
111269
|
"use strict";
|
|
111143
|
-
|
|
111270
|
+
import_node_crypto89 = require("node:crypto");
|
|
111144
111271
|
import_node_fs143 = __toESM(require("node:fs"), 1);
|
|
111145
111272
|
import_node_os29 = __toESM(require("node:os"), 1);
|
|
111146
|
-
|
|
111273
|
+
import_node_path147 = __toESM(require("node:path"), 1);
|
|
111147
111274
|
import_node_zlib9 = require("node:zlib");
|
|
111148
111275
|
pending = /* @__PURE__ */ new Map();
|
|
111149
111276
|
MAX_SOURCES_JAR_BYTES = 64 * 1024 * 1024;
|
|
@@ -111161,12 +111288,12 @@ async function compileKotlinGradleLibraries(input) {
|
|
|
111161
111288
|
java: archiveJava,
|
|
111162
111289
|
kotlin
|
|
111163
111290
|
} = await readMavenSourcesArchive(library.archive);
|
|
111164
|
-
const java = archiveJava.filter((file) =>
|
|
111291
|
+
const java = archiveJava.filter((file) => import_node_path148.default.basename(file) !== "module-info.java");
|
|
111165
111292
|
const commonSources = kotlin.filter(
|
|
111166
|
-
(file) =>
|
|
111293
|
+
(file) => import_node_path148.default.relative(directory2, file).startsWith(`commonMain${import_node_path148.default.sep}`)
|
|
111167
111294
|
);
|
|
111168
111295
|
const jvmSources = kotlin.filter(
|
|
111169
|
-
(file) =>
|
|
111296
|
+
(file) => import_node_path148.default.relative(directory2, file).startsWith(`jvmMain${import_node_path148.default.sep}`)
|
|
111170
111297
|
);
|
|
111171
111298
|
const dependencies = library.dependencies.map((name4) => {
|
|
111172
111299
|
const dependency = compiled.get(name4);
|
|
@@ -111181,8 +111308,8 @@ async function compileKotlinGradleLibraries(input) {
|
|
|
111181
111308
|
])
|
|
111182
111309
|
];
|
|
111183
111310
|
const name3 = library.coordinate.replace(/[^a-zA-Z0-9._-]/g, "-");
|
|
111184
|
-
const suffix = (0,
|
|
111185
|
-
const klib =
|
|
111311
|
+
const suffix = (0, import_node_crypto90.createHash)("sha256").update(library.coordinate).digest("hex").slice(0, 12);
|
|
111312
|
+
const klib = import_node_path148.default.join(input.output, `${name3}-${suffix}.klib`);
|
|
111186
111313
|
const kotlinJvmAbi = java.length && kotlin.length && library.jars.length === 1 ? library.jars[0] : void 0;
|
|
111187
111314
|
const abiPairs = java.length ? dependencies.flatMap(
|
|
111188
111315
|
({ klib: klib2, jars }) => jars.length === 1 ? [{ klib: klib2, jar: jars[0] }] : []
|
|
@@ -111223,13 +111350,13 @@ async function compileKotlinGradleLibraries(input) {
|
|
|
111223
111350
|
}
|
|
111224
111351
|
return [...compiled.values()].map(({ klib }) => klib);
|
|
111225
111352
|
}
|
|
111226
|
-
var
|
|
111353
|
+
var import_node_crypto90, import_node_fs144, import_node_path148;
|
|
111227
111354
|
var init_kotlin_gradle_library_plan = __esm({
|
|
111228
111355
|
"src/kotlin-gradle-library-plan.ts"() {
|
|
111229
111356
|
"use strict";
|
|
111230
|
-
|
|
111357
|
+
import_node_crypto90 = require("node:crypto");
|
|
111231
111358
|
import_node_fs144 = __toESM(require("node:fs"), 1);
|
|
111232
|
-
|
|
111359
|
+
import_node_path148 = __toESM(require("node:path"), 1);
|
|
111233
111360
|
init_kotlin_library_sources();
|
|
111234
111361
|
init_kotlin_maven_sources();
|
|
111235
111362
|
}
|
|
@@ -111503,16 +111630,16 @@ __export(kotlin_host_exports, {
|
|
|
111503
111630
|
});
|
|
111504
111631
|
function loadKotlinSdk(moduleRoot, toolchain) {
|
|
111505
111632
|
return installKotlinSdkArchive(
|
|
111506
|
-
import_node_fs145.default.readFileSync(
|
|
111633
|
+
import_node_fs145.default.readFileSync(import_node_path149.default.join(moduleRoot, "sdk.tar.gz")),
|
|
111507
111634
|
toolchain.compiler
|
|
111508
111635
|
);
|
|
111509
111636
|
}
|
|
111510
111637
|
function appKotlinLanguage(root) {
|
|
111511
|
-
const reactNative =
|
|
111512
|
-
(0, import_node_module23.createRequire)(
|
|
111638
|
+
const reactNative = import_node_path149.default.dirname(
|
|
111639
|
+
(0, import_node_module23.createRequire)(import_node_path149.default.join(root, "package.json")).resolve("react-native/package.json")
|
|
111513
111640
|
);
|
|
111514
111641
|
const versions = import_node_fs145.default.readFileSync(
|
|
111515
|
-
|
|
111642
|
+
import_node_path149.default.join(reactNative, "gradle", "libs.versions.toml"),
|
|
111516
111643
|
"utf8"
|
|
111517
111644
|
);
|
|
111518
111645
|
const match = /^kotlin\s*=\s*"(\d+)\.(\d+)/m.exec(versions);
|
|
@@ -111525,7 +111652,7 @@ function kotlinSources(root, skip = SKIP_DIRS) {
|
|
|
111525
111652
|
const walk4 = (dir) => {
|
|
111526
111653
|
for (const entry of import_node_fs145.default.readdirSync(dir, { withFileTypes: true })) {
|
|
111527
111654
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
111528
|
-
const full =
|
|
111655
|
+
const full = import_node_path149.default.join(dir, entry.name);
|
|
111529
111656
|
if (entry.isDirectory()) walk4(full);
|
|
111530
111657
|
else if (entry.isFile() && entry.name.endsWith(".kt")) sources.push(full);
|
|
111531
111658
|
}
|
|
@@ -111582,7 +111709,7 @@ function entrySource(ids) {
|
|
|
111582
111709
|
].join("\n");
|
|
111583
111710
|
}
|
|
111584
111711
|
function buildsDir() {
|
|
111585
|
-
return
|
|
111712
|
+
return import_node_path149.default.join(kotlinHome(), "builds");
|
|
111586
111713
|
}
|
|
111587
111714
|
async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
|
|
111588
111715
|
const { kotlinSourceId, nativeSourceContract, renderKotlinSourceGlue } = await import("vxrn/native-source-contract");
|
|
@@ -111684,9 +111811,9 @@ function readExpoTypes(output) {
|
|
|
111684
111811
|
});
|
|
111685
111812
|
}
|
|
111686
111813
|
async function scanSources(tool, parse16, toolchain, moduleRoot, files2) {
|
|
111687
|
-
const digest3 = (0,
|
|
111814
|
+
const digest3 = (0, import_node_crypto91.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
|
|
111688
111815
|
const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
|
|
111689
|
-
digest3.update(import_node_fs145.default.readFileSync(
|
|
111816
|
+
digest3.update(import_node_fs145.default.readFileSync(import_node_path149.default.join(moduleRoot, "sdk.tar.gz")));
|
|
111690
111817
|
digest3.update(tool);
|
|
111691
111818
|
for (const file of files2) digest3.update(`${file}\0${import_node_fs145.default.readFileSync(file, "utf8")}\0`);
|
|
111692
111819
|
const key2 = digest3.digest("hex");
|
|
@@ -111863,7 +111990,7 @@ function expoTypeSources(files2) {
|
|
|
111863
111990
|
`${file.package ? `${file.package}.` : ""}peachExpoViews${index}()`
|
|
111864
111991
|
);
|
|
111865
111992
|
}
|
|
111866
|
-
const name3 = `PeachExpoSource_${index}_${
|
|
111993
|
+
const name3 = `PeachExpoSource_${index}_${import_node_path149.default.basename(file.file)}`;
|
|
111867
111994
|
generated[name3] = text7;
|
|
111868
111995
|
origins[name3] = file.file;
|
|
111869
111996
|
}
|
|
@@ -112124,7 +112251,7 @@ function appResourceSources(app) {
|
|
|
112124
112251
|
entries: app.drawables.map((drawable) => ({
|
|
112125
112252
|
name: drawable.name,
|
|
112126
112253
|
init: `listOf(
|
|
112127
|
-
${drawable.files.map((file) => drawableInit(file,
|
|
112254
|
+
${drawable.files.map((file) => drawableInit(file, import_node_path149.default.relative(app.moduleDir, file.file))).join(",\n")}
|
|
112128
112255
|
)`
|
|
112129
112256
|
}))
|
|
112130
112257
|
},
|
|
@@ -112314,8 +112441,8 @@ async function compileKotlin(input, origin) {
|
|
|
112314
112441
|
gradleLibraries
|
|
112315
112442
|
} = input;
|
|
112316
112443
|
const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
|
|
112317
|
-
const plugin =
|
|
112318
|
-
const sdkLibrary =
|
|
112444
|
+
const plugin = import_node_path149.default.join(sdk2.root, "plugin.jar");
|
|
112445
|
+
const sdkLibrary = import_node_path149.default.join(sdk2.root, `${sdkProfile}.klib`);
|
|
112319
112446
|
const javaRead = javaSpecs.length ? await readJavaModuleSpecs(javaSpecs, sdk2.root, await ensureToolchain(toolchain)) : null;
|
|
112320
112447
|
const java = javaRead && javaRead.specs.some((spec) => !spec.application) ? { ...javaRead, specs: javaRead.specs.filter((spec) => !spec.application) } : null;
|
|
112321
112448
|
const applicationJava = javaRead?.specs.filter((spec) => spec.application) ?? [];
|
|
@@ -112346,7 +112473,7 @@ async function compileKotlin(input, origin) {
|
|
|
112346
112473
|
bytes: import_node_fs145.default.readFileSync(file)
|
|
112347
112474
|
}));
|
|
112348
112475
|
const { composeArchive, ...compilerInputs } = toolchain;
|
|
112349
|
-
const digest3 = (0,
|
|
112476
|
+
const digest3 = (0, import_node_crypto91.createHash)("sha256");
|
|
112350
112477
|
digest3.update(
|
|
112351
112478
|
JSON.stringify({
|
|
112352
112479
|
format: BUILD_FORMAT,
|
|
@@ -112360,7 +112487,7 @@ async function compileKotlin(input, origin) {
|
|
|
112360
112487
|
})
|
|
112361
112488
|
);
|
|
112362
112489
|
for (const { file, bytes } of inputs2)
|
|
112363
|
-
digest3.update(
|
|
112490
|
+
digest3.update(import_node_path149.default.relative(root, file)).update("\0").update(bytes).update("\0");
|
|
112364
112491
|
if (gradleLibraries) {
|
|
112365
112492
|
digest3.update(JSON.stringify({ format: 3, ...gradleLibraries }));
|
|
112366
112493
|
const files2 = /* @__PURE__ */ new Set([
|
|
@@ -112368,7 +112495,7 @@ async function compileKotlin(input, origin) {
|
|
|
112368
112495
|
...gradleLibraries.libraries.flatMap(({ archive, jars }) => [archive, ...jars])
|
|
112369
112496
|
]);
|
|
112370
112497
|
for (const file of files2) {
|
|
112371
|
-
digest3.update((0,
|
|
112498
|
+
digest3.update((0, import_node_crypto91.createHash)("sha256").update(import_node_fs145.default.readFileSync(file)).digest());
|
|
112372
112499
|
}
|
|
112373
112500
|
}
|
|
112374
112501
|
if (viewModels) digest3.update(viewModels.toolClass);
|
|
@@ -112379,27 +112506,27 @@ async function compileKotlin(input, origin) {
|
|
|
112379
112506
|
url: `${origin}${KOTLIN_ARTIFACT_PREFIX}${hash}/app.mjs`,
|
|
112380
112507
|
hash
|
|
112381
112508
|
};
|
|
112382
|
-
const out =
|
|
112383
|
-
if (import_node_fs145.default.existsSync(
|
|
112509
|
+
const out = import_node_path149.default.join(buildsDir(), hash);
|
|
112510
|
+
if (import_node_fs145.default.existsSync(import_node_path149.default.join(out, "js", "app.wasm"))) return artifact;
|
|
112384
112511
|
const pending2 = builds.get(hash);
|
|
112385
112512
|
if (pending2) return pending2;
|
|
112386
112513
|
const build2 = (async () => {
|
|
112387
112514
|
const ready = await ensureToolchain(toolchain);
|
|
112388
112515
|
const { kotlinc } = ready;
|
|
112389
|
-
const libraries = [...ready.libraries, sdkLibrary,
|
|
112516
|
+
const libraries = [...ready.libraries, sdkLibrary, import_node_path149.default.join(sdk2.root, "java.klib")];
|
|
112390
112517
|
const compose = usesCompose ? await ensureCompose(toolchain) : null;
|
|
112391
112518
|
if (compose) libraries.push(...compose.libraries);
|
|
112392
112519
|
import_node_fs145.default.mkdirSync(buildsDir(), { recursive: true });
|
|
112393
|
-
const work = import_node_fs145.default.mkdtempSync(
|
|
112394
|
-
const javaLibrary = java ?
|
|
112520
|
+
const work = import_node_fs145.default.mkdtempSync(import_node_path149.default.join(buildsDir(), `${hash}-`));
|
|
112521
|
+
const javaLibrary = java ? import_node_path149.default.join(work, "java-abi", "java-abi.klib") : null;
|
|
112395
112522
|
if (javaLibrary) libraries.push(javaLibrary);
|
|
112396
|
-
const generatedDir =
|
|
112523
|
+
const generatedDir = import_node_path149.default.join(work, "generated");
|
|
112397
112524
|
import_node_fs145.default.mkdirSync(generatedDir);
|
|
112398
112525
|
for (const [name3, text7] of Object.entries(generated))
|
|
112399
|
-
import_node_fs145.default.writeFileSync(
|
|
112526
|
+
import_node_fs145.default.writeFileSync(import_node_path149.default.join(generatedDir, name3), text7);
|
|
112400
112527
|
const compiledSources = inputs2.map(({ file, bytes }, index) => {
|
|
112401
|
-
const target =
|
|
112402
|
-
import_node_fs145.default.mkdirSync(
|
|
112528
|
+
const target = import_node_path149.default.join(work, "sources", String(index), import_node_path149.default.basename(file));
|
|
112529
|
+
import_node_fs145.default.mkdirSync(import_node_path149.default.dirname(target), { recursive: true });
|
|
112403
112530
|
import_node_fs145.default.writeFileSync(target, bytes);
|
|
112404
112531
|
return { file, target };
|
|
112405
112532
|
});
|
|
@@ -112409,19 +112536,19 @@ async function compileKotlin(input, origin) {
|
|
|
112409
112536
|
"-Xallow-kotlin-package",
|
|
112410
112537
|
"-Xwasm-target=js",
|
|
112411
112538
|
"-libraries",
|
|
112412
|
-
libraries.join(
|
|
112539
|
+
libraries.join(import_node_path149.default.delimiter)
|
|
112413
112540
|
];
|
|
112414
112541
|
const compileKlib = (outputDir) => run15(
|
|
112415
112542
|
kotlinc,
|
|
112416
112543
|
[
|
|
112417
112544
|
...common2(),
|
|
112418
112545
|
`-Xplugin=${plugin}`,
|
|
112419
|
-
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(
|
|
112546
|
+
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path149.default.delimiter)}`,
|
|
112420
112547
|
...usesCompose ? [
|
|
112421
|
-
`-Xplugin=${
|
|
112548
|
+
`-Xplugin=${import_node_path149.default.resolve(import_node_path149.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
|
|
112422
112549
|
] : [],
|
|
112423
112550
|
...usesSerialization ? [
|
|
112424
|
-
`-Xplugin=${
|
|
112551
|
+
`-Xplugin=${import_node_path149.default.resolve(import_node_path149.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
|
|
112425
112552
|
] : [],
|
|
112426
112553
|
"-language-version",
|
|
112427
112554
|
language,
|
|
@@ -112435,7 +112562,7 @@ async function compileKotlin(input, origin) {
|
|
|
112435
112562
|
"-ir-output-name",
|
|
112436
112563
|
"app",
|
|
112437
112564
|
...compiledSources.map(({ target }) => target),
|
|
112438
|
-
...Object.keys(generated).map((name3) =>
|
|
112565
|
+
...Object.keys(generated).map((name3) => import_node_path149.default.join(generatedDir, name3))
|
|
112439
112566
|
],
|
|
112440
112567
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
112441
112568
|
);
|
|
@@ -112448,7 +112575,7 @@ async function compileKotlin(input, origin) {
|
|
|
112448
112575
|
sdkRoot: sdk2.root,
|
|
112449
112576
|
libraries: libraries.filter((library) => library !== javaLibrary),
|
|
112450
112577
|
language,
|
|
112451
|
-
output:
|
|
112578
|
+
output: import_node_path149.default.join(work, "gradle-libraries")
|
|
112452
112579
|
})
|
|
112453
112580
|
);
|
|
112454
112581
|
}
|
|
@@ -112466,31 +112593,31 @@ async function compileKotlin(input, origin) {
|
|
|
112466
112593
|
if (viewModels && inputs2.some(
|
|
112467
112594
|
({ file, bytes }) => sources.includes(file) && bytes.includes("ViewModel")
|
|
112468
112595
|
)) {
|
|
112469
|
-
await compileKlib(
|
|
112596
|
+
await compileKlib(import_node_path149.default.join(work, "abi"));
|
|
112470
112597
|
const stdout = await runKotlinTool(
|
|
112471
112598
|
ready,
|
|
112472
112599
|
sdk2.root,
|
|
112473
112600
|
viewModels.toolClass,
|
|
112474
|
-
[
|
|
112601
|
+
[import_node_path149.default.join(work, "abi")],
|
|
112475
112602
|
64 * 1024 * 1024
|
|
112476
112603
|
);
|
|
112477
112604
|
import_node_fs145.default.writeFileSync(
|
|
112478
|
-
|
|
112605
|
+
import_node_path149.default.join(generatedDir, viewModels.file),
|
|
112479
112606
|
viewModels.render(viewModelClasses(readAbiClasses(stdout)))
|
|
112480
112607
|
);
|
|
112481
112608
|
}
|
|
112482
|
-
await compileKlib(
|
|
112609
|
+
await compileKlib(import_node_path149.default.join(work, "klib"));
|
|
112483
112610
|
await run15(
|
|
112484
112611
|
kotlinc,
|
|
112485
112612
|
[
|
|
112486
112613
|
...common2(),
|
|
112487
112614
|
"-nowarn",
|
|
112488
112615
|
"-Xpartial-linkage-loglevel=error",
|
|
112489
|
-
`-Xinclude=${
|
|
112616
|
+
`-Xinclude=${import_node_path149.default.join(work, "klib")}`,
|
|
112490
112617
|
"-Xir-produce-js",
|
|
112491
112618
|
"-Xir-dce",
|
|
112492
112619
|
"-ir-output-dir",
|
|
112493
|
-
|
|
112620
|
+
import_node_path149.default.join(work, "js"),
|
|
112494
112621
|
"-ir-output-name",
|
|
112495
112622
|
"app"
|
|
112496
112623
|
],
|
|
@@ -112498,16 +112625,16 @@ async function compileKotlin(input, origin) {
|
|
|
112498
112625
|
);
|
|
112499
112626
|
if (compose) {
|
|
112500
112627
|
import_node_fs145.default.writeFileSync(
|
|
112501
|
-
|
|
112628
|
+
import_node_path149.default.join(work, "js", "skiko.mjs"),
|
|
112502
112629
|
kotlinSkikoSource(import_node_fs145.default.readFileSync(compose.loader))
|
|
112503
112630
|
);
|
|
112504
112631
|
}
|
|
112505
112632
|
if (usesCompose) {
|
|
112506
112633
|
for (const library of toolchain.composeJsLibraries) {
|
|
112507
112634
|
let imported = false;
|
|
112508
|
-
for (const file of import_node_fs145.default.readdirSync(
|
|
112635
|
+
for (const file of import_node_fs145.default.readdirSync(import_node_path149.default.join(work, "js"))) {
|
|
112509
112636
|
if (!file.endsWith(".mjs")) continue;
|
|
112510
|
-
const target =
|
|
112637
|
+
const target = import_node_path149.default.join(work, "js", file);
|
|
112511
112638
|
const source = import_node_fs145.default.readFileSync(target, "utf8");
|
|
112512
112639
|
let next = source;
|
|
112513
112640
|
for (const quote3 of ["'", '"'])
|
|
@@ -112520,7 +112647,7 @@ async function compileKotlin(input, origin) {
|
|
|
112520
112647
|
imported = true;
|
|
112521
112648
|
}
|
|
112522
112649
|
if (!imported) continue;
|
|
112523
|
-
const archive =
|
|
112650
|
+
const archive = import_node_path149.default.join(
|
|
112524
112651
|
kotlinHome(),
|
|
112525
112652
|
toolchain.compiler.version,
|
|
112526
112653
|
library.name
|
|
@@ -112529,24 +112656,24 @@ async function compileKotlin(input, origin) {
|
|
|
112529
112656
|
const { stdout } = await run15("tar", ["-xOf", archive, library.archiveEntry], {
|
|
112530
112657
|
maxBuffer: 16 * 1024 * 1024
|
|
112531
112658
|
});
|
|
112532
|
-
import_node_fs145.default.writeFileSync(
|
|
112659
|
+
import_node_fs145.default.writeFileSync(import_node_path149.default.join(work, "js", library.file), stdout);
|
|
112533
112660
|
}
|
|
112534
112661
|
}
|
|
112535
112662
|
} catch (error) {
|
|
112536
112663
|
import_node_fs145.default.rmSync(work, { recursive: true, force: true });
|
|
112537
112664
|
let output = isRecord(error) ? `${String(error.stderr ?? "")}${String(error.stdout ?? "")}` : "";
|
|
112538
112665
|
for (const [name3, source] of Object.entries(origins))
|
|
112539
|
-
output = output.replaceAll(
|
|
112666
|
+
output = output.replaceAll(import_node_path149.default.join(generatedDir, name3), source);
|
|
112540
112667
|
for (const [index, spec] of applicationJava.entries())
|
|
112541
112668
|
output = output.replaceAll(
|
|
112542
|
-
|
|
112669
|
+
import_node_path149.default.join(generatedDir, `JavaApplication${index}.kt`),
|
|
112543
112670
|
spec.file
|
|
112544
112671
|
);
|
|
112545
112672
|
for (const { file, target } of compiledSources)
|
|
112546
|
-
output = output.replaceAll(target, file).replaceAll(
|
|
112673
|
+
output = output.replaceAll(target, file).replaceAll(import_node_path149.default.relative(process.cwd(), target), file);
|
|
112547
112674
|
for (const [index, spec] of (java?.specs ?? []).entries())
|
|
112548
112675
|
output = output.replaceAll(
|
|
112549
|
-
|
|
112676
|
+
import_node_path149.default.join(work, "java-abi", `Spec${index}.kt`),
|
|
112550
112677
|
spec.file
|
|
112551
112678
|
);
|
|
112552
112679
|
output = output.replace(
|
|
@@ -112559,15 +112686,15 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
112559
112686
|
);
|
|
112560
112687
|
}
|
|
112561
112688
|
const seams = [kotlinNodeDetection];
|
|
112562
|
-
const js = import_node_fs145.default.readdirSync(
|
|
112689
|
+
const js = import_node_fs145.default.readdirSync(import_node_path149.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
|
|
112563
112690
|
if (js.some(
|
|
112564
|
-
(file) => import_node_fs145.default.readFileSync(
|
|
112691
|
+
(file) => import_node_fs145.default.readFileSync(import_node_path149.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
|
|
112565
112692
|
))
|
|
112566
112693
|
seams.push(kotlinCoroutineDispatcher);
|
|
112567
112694
|
for (const [from, to] of seams) {
|
|
112568
112695
|
let patched = 0;
|
|
112569
112696
|
for (const file of js) {
|
|
112570
|
-
const target =
|
|
112697
|
+
const target = import_node_path149.default.join(work, "js", file);
|
|
112571
112698
|
const text7 = import_node_fs145.default.readFileSync(target, "utf8");
|
|
112572
112699
|
const next = text7.replaceAll(from, to);
|
|
112573
112700
|
if (next !== text7) {
|
|
@@ -112580,9 +112707,9 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
112580
112707
|
`kotlin output no longer contains ${from}; recheck how it detects its host in Peach`
|
|
112581
112708
|
);
|
|
112582
112709
|
}
|
|
112583
|
-
const entry =
|
|
112710
|
+
const entry = import_node_path149.default.join(work, "js/app.mjs");
|
|
112584
112711
|
const entrySource2 = import_node_fs145.default.readFileSync(entry, "utf8");
|
|
112585
|
-
const importsPath =
|
|
112712
|
+
const importsPath = import_node_path149.default.join(work, "js/app.import-object.mjs");
|
|
112586
112713
|
const importsFactory = kotlinInstanceSource(
|
|
112587
112714
|
import_node_fs145.default.readFileSync(importsPath, "utf8"),
|
|
112588
112715
|
"createKotlinImportObject"
|
|
@@ -112593,7 +112720,7 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
112593
112720
|
/* @__PURE__ */ new Map([["./app.import-object.mjs", "createKotlinImportObject"]])
|
|
112594
112721
|
);
|
|
112595
112722
|
import_node_fs145.default.writeFileSync(importsPath, importsFactory.source);
|
|
112596
|
-
import_node_fs145.default.writeFileSync(
|
|
112723
|
+
import_node_fs145.default.writeFileSync(import_node_path149.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
|
|
112597
112724
|
import_node_fs145.default.writeFileSync(
|
|
112598
112725
|
entry,
|
|
112599
112726
|
[
|
|
@@ -112609,7 +112736,7 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
112609
112736
|
try {
|
|
112610
112737
|
import_node_fs145.default.renameSync(work, out);
|
|
112611
112738
|
} catch (error) {
|
|
112612
|
-
if (!import_node_fs145.default.existsSync(
|
|
112739
|
+
if (!import_node_fs145.default.existsSync(import_node_path149.default.join(out, "js", "app.wasm"))) throw error;
|
|
112613
112740
|
import_node_fs145.default.rmSync(work, { recursive: true, force: true });
|
|
112614
112741
|
}
|
|
112615
112742
|
return artifact;
|
|
@@ -112618,23 +112745,23 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
112618
112745
|
return build2;
|
|
112619
112746
|
}
|
|
112620
112747
|
function kotlinArtifactFiles(hash) {
|
|
112621
|
-
const dir =
|
|
112748
|
+
const dir = import_node_path149.default.join(buildsDir(), hash, "js");
|
|
112622
112749
|
return import_node_fs145.default.readdirSync(dir).sort().map((name3) => {
|
|
112623
|
-
const contentType = CONTENT_TYPES[
|
|
112750
|
+
const contentType = CONTENT_TYPES[import_node_path149.default.extname(name3)];
|
|
112624
112751
|
if (!contentType) throw new Error(`unexpected kotlin artifact file ${name3}`);
|
|
112625
|
-
return { name: name3, bytes: import_node_fs145.default.readFileSync(
|
|
112752
|
+
return { name: name3, bytes: import_node_fs145.default.readFileSync(import_node_path149.default.join(dir, name3)), contentType };
|
|
112626
112753
|
});
|
|
112627
112754
|
}
|
|
112628
112755
|
function serveKotlinArtifact(pathname, res) {
|
|
112629
112756
|
if (!pathname.startsWith(KOTLIN_ARTIFACT_PREFIX)) return false;
|
|
112630
112757
|
const [hash, file, ...rest] = pathname.slice(KOTLIN_ARTIFACT_PREFIX.length).split("/");
|
|
112631
|
-
const type = file ? CONTENT_TYPES[
|
|
112758
|
+
const type = file ? CONTENT_TYPES[import_node_path149.default.extname(file)] : void 0;
|
|
112632
112759
|
if (!hash || !/^[0-9a-f]+$/.test(hash) || !file || rest.length > 0 || !type || file.includes("..")) {
|
|
112633
112760
|
res.statusCode = 404;
|
|
112634
112761
|
res.end("not a kotlin artifact");
|
|
112635
112762
|
return true;
|
|
112636
112763
|
}
|
|
112637
|
-
const target =
|
|
112764
|
+
const target = import_node_path149.default.join(buildsDir(), hash, "js", file);
|
|
112638
112765
|
if (!import_node_fs145.default.existsSync(target)) {
|
|
112639
112766
|
res.statusCode = 404;
|
|
112640
112767
|
res.end(`kotlin artifact ${hash}/${file} was not built`);
|
|
@@ -112660,15 +112787,15 @@ async function serveKotlinRequest(pathname, res, app) {
|
|
|
112660
112787
|
}
|
|
112661
112788
|
return true;
|
|
112662
112789
|
}
|
|
112663
|
-
var import_node_child_process70,
|
|
112790
|
+
var import_node_child_process70, import_node_crypto91, import_node_fs145, import_node_module23, import_node_path149, import_node_util22, run15, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal2, CONTENT_TYPES;
|
|
112664
112791
|
var init_kotlin_host = __esm({
|
|
112665
112792
|
"src/kotlin-host.ts"() {
|
|
112666
112793
|
"use strict";
|
|
112667
112794
|
import_node_child_process70 = require("node:child_process");
|
|
112668
|
-
|
|
112795
|
+
import_node_crypto91 = require("node:crypto");
|
|
112669
112796
|
import_node_fs145 = __toESM(require("node:fs"), 1);
|
|
112670
112797
|
import_node_module23 = require("node:module");
|
|
112671
|
-
|
|
112798
|
+
import_node_path149 = __toESM(require("node:path"), 1);
|
|
112672
112799
|
import_node_util22 = require("node:util");
|
|
112673
112800
|
init_kotlinDiscoveryContract();
|
|
112674
112801
|
init_android_bridge_packages();
|
|
@@ -112788,7 +112915,7 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
112788
112915
|
if (!isRecord(project2) || typeof project2.sourceDir !== "string" || !Array.isArray(project2.modules))
|
|
112789
112916
|
throw new Error("invalid Expo Android project");
|
|
112790
112917
|
const sourceDir = import_node_fs146.default.realpathSync(project2.sourceDir);
|
|
112791
|
-
const installed = sourceDir.split(
|
|
112918
|
+
const installed = sourceDir.split(import_node_path150.default.sep).includes("node_modules");
|
|
112792
112919
|
if (installed) {
|
|
112793
112920
|
if (typeof entry.packageName !== "string") continue;
|
|
112794
112921
|
if (peachAnsweredNativePackages().has(entry.packageName)) {
|
|
@@ -112818,7 +112945,7 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
112818
112945
|
const walk4 = (dir) => {
|
|
112819
112946
|
if (!import_node_fs146.default.existsSync(dir)) return;
|
|
112820
112947
|
for (const child of import_node_fs146.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
112821
|
-
const file =
|
|
112948
|
+
const file = import_node_path150.default.join(dir, child.name);
|
|
112822
112949
|
if (child.isSymbolicLink()) reject(`Expo Kotlin source is a symlink: ${file}`);
|
|
112823
112950
|
else if (child.isDirectory()) walk4(file);
|
|
112824
112951
|
else if (child.name.endsWith(".java"))
|
|
@@ -112826,8 +112953,8 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
112826
112953
|
else if (child.name.endsWith(".kt")) group.sources.push(file);
|
|
112827
112954
|
}
|
|
112828
112955
|
};
|
|
112829
|
-
walk4(
|
|
112830
|
-
walk4(
|
|
112956
|
+
walk4(import_node_path150.default.join(sourceDir, "src", "main", "java"));
|
|
112957
|
+
walk4(import_node_path150.default.join(sourceDir, "src", "main", "kotlin"));
|
|
112831
112958
|
result.push(group);
|
|
112832
112959
|
}
|
|
112833
112960
|
}
|
|
@@ -112931,12 +113058,12 @@ async function compileExpoKotlinModules(root, origin) {
|
|
|
112931
113058
|
}
|
|
112932
113059
|
}
|
|
112933
113060
|
}
|
|
112934
|
-
var import_node_fs146,
|
|
113061
|
+
var import_node_fs146, import_node_path150;
|
|
112935
113062
|
var init_expo_kotlin_host = __esm({
|
|
112936
113063
|
"src/expo-kotlin-host.ts"() {
|
|
112937
113064
|
"use strict";
|
|
112938
113065
|
import_node_fs146 = __toESM(require("node:fs"), 1);
|
|
112939
|
-
|
|
113066
|
+
import_node_path150 = __toESM(require("node:path"), 1);
|
|
112940
113067
|
init_android_autolinking();
|
|
112941
113068
|
init_android_bridge_dependencies();
|
|
112942
113069
|
init_android_bridge_packages();
|
|
@@ -113358,13 +113485,13 @@ var init_replacementModule = __esm({
|
|
|
113358
113485
|
|
|
113359
113486
|
// src/host/replacement-module-handler.ts
|
|
113360
113487
|
function resolveReplacementModuleFile(fromFile, specifier) {
|
|
113361
|
-
const base2 =
|
|
113488
|
+
const base2 = import_node_path156.default.resolve(import_node_path156.default.dirname(fromFile), specifier);
|
|
113362
113489
|
const candidates = [
|
|
113363
113490
|
...REPLACEMENT_MODULE_EXTENSIONS.some(
|
|
113364
|
-
(ext) => ext ===
|
|
113491
|
+
(ext) => ext === import_node_path156.default.extname(base2).toLowerCase()
|
|
113365
113492
|
) ? [base2] : [],
|
|
113366
113493
|
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base2 + ext),
|
|
113367
|
-
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) =>
|
|
113494
|
+
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path156.default.join(base2, `index${ext}`))
|
|
113368
113495
|
];
|
|
113369
113496
|
const found = candidates.find(
|
|
113370
113497
|
(candidate) => (0, import_node_fs151.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
|
|
@@ -113376,13 +113503,13 @@ function resolveReplacementModuleFile(fromFile, specifier) {
|
|
|
113376
113503
|
}
|
|
113377
113504
|
return found;
|
|
113378
113505
|
}
|
|
113379
|
-
var import_node_fs151, import_promises12,
|
|
113506
|
+
var import_node_fs151, import_promises12, import_node_path156;
|
|
113380
113507
|
var init_replacement_module_handler = __esm({
|
|
113381
113508
|
"src/host/replacement-module-handler.ts"() {
|
|
113382
113509
|
"use strict";
|
|
113383
113510
|
import_node_fs151 = require("node:fs");
|
|
113384
113511
|
import_promises12 = __toESM(require("node:fs/promises"), 1);
|
|
113385
|
-
|
|
113512
|
+
import_node_path156 = __toESM(require("node:path"), 1);
|
|
113386
113513
|
init_replacementModule();
|
|
113387
113514
|
init_backend_origin();
|
|
113388
113515
|
}
|
|
@@ -113443,7 +113570,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
113443
113570
|
if (!entries2 || typeof entries2 !== "object") continue;
|
|
113444
113571
|
for (const resolution2 of Object.values(entries2)) {
|
|
113445
113572
|
if (resolution2 && typeof resolution2 === "object" && "file" in resolution2 && typeof resolution2.file === "string") {
|
|
113446
|
-
resolution2.file = visit3(
|
|
113573
|
+
resolution2.file = visit3(import_node_path157.default.resolve(resolution2.file));
|
|
113447
113574
|
}
|
|
113448
113575
|
}
|
|
113449
113576
|
}
|
|
@@ -113467,12 +113594,12 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
113467
113594
|
const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
|
|
113468
113595
|
return prefix + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
|
|
113469
113596
|
}
|
|
113470
|
-
var import_node_fs152,
|
|
113597
|
+
var import_node_fs152, import_node_path157, import_sucrase5, import_terser, PREFIX_START, PREFIX_END;
|
|
113471
113598
|
var init_configured_bundle_producer = __esm({
|
|
113472
113599
|
"src/configured-bundle-producer.ts"() {
|
|
113473
113600
|
"use strict";
|
|
113474
113601
|
import_node_fs152 = __toESM(require("node:fs"), 1);
|
|
113475
|
-
|
|
113602
|
+
import_node_path157 = __toESM(require("node:path"), 1);
|
|
113476
113603
|
init_bundle_global_footer();
|
|
113477
113604
|
import_sucrase5 = require("peachsim/vendor/sucrase");
|
|
113478
113605
|
import_terser = require("peachsim/vendor/terser");
|
|
@@ -113495,9 +113622,9 @@ __export(bundle_channel_exports, {
|
|
|
113495
113622
|
snapshotOneProductionBundle: () => snapshotOneProductionBundle
|
|
113496
113623
|
});
|
|
113497
113624
|
module.exports = __toCommonJS(bundle_channel_exports);
|
|
113498
|
-
var
|
|
113625
|
+
var import_node_crypto93 = require("node:crypto");
|
|
113499
113626
|
var import_node_fs153 = require("node:fs");
|
|
113500
|
-
var
|
|
113627
|
+
var import_node_path158 = require("node:path");
|
|
113501
113628
|
var import_node_vm = require("node:vm");
|
|
113502
113629
|
var import_node_zlib11 = require("node:zlib");
|
|
113503
113630
|
init_backend_origin();
|
|
@@ -113665,15 +113792,15 @@ init_process_group();
|
|
|
113665
113792
|
|
|
113666
113793
|
// cli/app-catalog.ts
|
|
113667
113794
|
var import_node_fs150 = __toESM(require("node:fs"), 1);
|
|
113668
|
-
var
|
|
113795
|
+
var import_node_path155 = __toESM(require("node:path"), 1);
|
|
113669
113796
|
init_bundleAssets();
|
|
113670
113797
|
init_expo_native_workspace();
|
|
113671
113798
|
|
|
113672
113799
|
// src/host/staged-host-files.ts
|
|
113673
113800
|
var import_node_async_hooks4 = require("node:async_hooks");
|
|
113674
|
-
var
|
|
113801
|
+
var import_node_crypto92 = require("node:crypto");
|
|
113675
113802
|
var import_node_fs148 = __toESM(require("node:fs"), 1);
|
|
113676
|
-
var
|
|
113803
|
+
var import_node_path152 = __toESM(require("node:path"), 1);
|
|
113677
113804
|
|
|
113678
113805
|
// ../peach-kit/src/uttype-mime.ts
|
|
113679
113806
|
var MIME_BY_EXTENSION = {
|
|
@@ -113745,7 +113872,7 @@ init_runtime_assets();
|
|
|
113745
113872
|
|
|
113746
113873
|
// src/host/app-package-handler.ts
|
|
113747
113874
|
var import_node_fs147 = __toESM(require("node:fs"), 1);
|
|
113748
|
-
var
|
|
113875
|
+
var import_node_path151 = __toESM(require("node:path"), 1);
|
|
113749
113876
|
init_home_paths();
|
|
113750
113877
|
init_is_record();
|
|
113751
113878
|
init_runtime_assets();
|
|
@@ -113764,14 +113891,14 @@ function readPackageManifest() {
|
|
|
113764
113891
|
}
|
|
113765
113892
|
}
|
|
113766
113893
|
for (const [route, resource] of Object.entries(manifest.routes)) {
|
|
113767
|
-
if (!route.startsWith("/") || !isRecord(resource) || typeof resource.file !== "string" || !resource.file ||
|
|
113894
|
+
if (!route.startsWith("/") || !isRecord(resource) || typeof resource.file !== "string" || !resource.file || import_node_path151.default.basename(resource.file) !== resource.file || [".", ".."].includes(resource.file) || typeof resource.contentType !== "string" || /[\r\n]/.test(resource.contentType))
|
|
113768
113895
|
throw new Error(`invalid packaged app resource: ${route}`);
|
|
113769
113896
|
routes2.set(route, { file: resource.file, contentType: resource.contentType });
|
|
113770
113897
|
}
|
|
113771
|
-
const payload =
|
|
113898
|
+
const payload = import_node_path151.default.join(import_node_path151.default.dirname(file), "payload");
|
|
113772
113899
|
if (import_node_fs147.default.statSync(payload, { throwIfNoEntry: false })) {
|
|
113773
113900
|
for (const name3 of import_node_fs147.default.readdirSync(payload)) {
|
|
113774
|
-
if (!relocatable.has(name3)) bundledFiles2.set(name3,
|
|
113901
|
+
if (!relocatable.has(name3)) bundledFiles2.set(name3, import_node_path151.default.join(payload, name3));
|
|
113775
113902
|
}
|
|
113776
113903
|
}
|
|
113777
113904
|
return { routes: routes2, bundledFiles: bundledFiles2 };
|
|
@@ -113785,17 +113912,17 @@ async function captureStagedHostFiles(prepare3) {
|
|
|
113785
113912
|
const value = await stagedCapture.run(names, prepare3);
|
|
113786
113913
|
return {
|
|
113787
113914
|
value,
|
|
113788
|
-
files: new Map([...names].map((name3) => [name3,
|
|
113915
|
+
files: new Map([...names].map((name3) => [name3, import_node_path152.default.join(stagedDir(), name3)]))
|
|
113789
113916
|
};
|
|
113790
113917
|
}
|
|
113791
113918
|
var STAGED_PREFIX = "/__peach/staged/";
|
|
113792
113919
|
var STAGED_NAME = /^([a-f0-9]{64})(\.[a-z0-9]{1,10})?$/;
|
|
113793
113920
|
var STAGED_RETENTION_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
113794
113921
|
function stagedDir() {
|
|
113795
|
-
return
|
|
113922
|
+
return import_node_path152.default.join(cacheDir(), "staged");
|
|
113796
113923
|
}
|
|
113797
113924
|
function stageHostFile(filePath, origin) {
|
|
113798
|
-
return stageHostBytes(import_node_fs148.default.readFileSync(filePath), origin,
|
|
113925
|
+
return stageHostBytes(import_node_fs148.default.readFileSync(filePath), origin, import_node_path152.default.extname(filePath));
|
|
113799
113926
|
}
|
|
113800
113927
|
function stageHostBytes(bytes, origin, extension = "") {
|
|
113801
113928
|
const directory2 = prepareStagedDirectory();
|
|
@@ -113803,21 +113930,21 @@ function stageHostBytes(bytes, origin, extension = "") {
|
|
|
113803
113930
|
}
|
|
113804
113931
|
async function stageHostDerivedBytes(input, producer, origin, extension, derive) {
|
|
113805
113932
|
const directory2 = prepareStagedDirectory();
|
|
113806
|
-
const inputDigest = (0,
|
|
113807
|
-
const index =
|
|
113933
|
+
const inputDigest = (0, import_node_crypto92.createHash)("sha256").update(input).digest("hex");
|
|
113934
|
+
const index = import_node_path152.default.join(
|
|
113808
113935
|
directory2,
|
|
113809
|
-
`derived-${(0,
|
|
113936
|
+
`derived-${(0, import_node_crypto92.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
|
|
113810
113937
|
);
|
|
113811
113938
|
const recorded = import_node_fs148.default.existsSync(index) ? import_node_fs148.default.readFileSync(index, "utf8") : "";
|
|
113812
|
-
if (STAGED_NAME.test(recorded) && import_node_fs148.default.existsSync(
|
|
113939
|
+
if (STAGED_NAME.test(recorded) && import_node_fs148.default.existsSync(import_node_path152.default.join(directory2, recorded))) {
|
|
113813
113940
|
const now = /* @__PURE__ */ new Date();
|
|
113814
113941
|
import_node_fs148.default.utimesSync(index, now, now);
|
|
113815
|
-
import_node_fs148.default.utimesSync(
|
|
113942
|
+
import_node_fs148.default.utimesSync(import_node_path152.default.join(directory2, recorded), now, now);
|
|
113816
113943
|
stagedCapture.getStore()?.add(recorded);
|
|
113817
113944
|
return new URL(STAGED_PREFIX + recorded, origin).toString();
|
|
113818
113945
|
}
|
|
113819
113946
|
const staged = writeStagedBytes(await derive(), origin, extension, directory2);
|
|
113820
|
-
const temporary =
|
|
113947
|
+
const temporary = import_node_path152.default.join(directory2, (0, import_node_crypto92.randomUUID)());
|
|
113821
113948
|
try {
|
|
113822
113949
|
import_node_fs148.default.writeFileSync(temporary, new URL(staged).pathname.slice(STAGED_PREFIX.length), {
|
|
113823
113950
|
flag: "wx"
|
|
@@ -113834,7 +113961,7 @@ function prepareStagedDirectory() {
|
|
|
113834
113961
|
const now = Date.now();
|
|
113835
113962
|
for (const entry of import_node_fs148.default.readdirSync(directory2, { withFileTypes: true })) {
|
|
113836
113963
|
if (!entry.isFile()) continue;
|
|
113837
|
-
const stale =
|
|
113964
|
+
const stale = import_node_path152.default.join(directory2, entry.name);
|
|
113838
113965
|
const stat = import_node_fs148.default.statSync(stale, { throwIfNoEntry: false });
|
|
113839
113966
|
if (stat && now - stat.mtimeMs > STAGED_RETENTION_MS)
|
|
113840
113967
|
import_node_fs148.default.rmSync(stale, { force: true });
|
|
@@ -113842,16 +113969,16 @@ function prepareStagedDirectory() {
|
|
|
113842
113969
|
return directory2;
|
|
113843
113970
|
}
|
|
113844
113971
|
function writeStagedBytes(bytes, origin, extension, directory2) {
|
|
113845
|
-
const digest3 = (0,
|
|
113972
|
+
const digest3 = (0, import_node_crypto92.createHash)("sha256").update(bytes).digest("hex");
|
|
113846
113973
|
extension = extension.toLowerCase();
|
|
113847
113974
|
const name3 = STAGED_NAME.test(digest3 + extension) ? digest3 + extension : digest3;
|
|
113848
113975
|
stagedCapture.getStore()?.add(name3);
|
|
113849
|
-
const destination =
|
|
113976
|
+
const destination = import_node_path152.default.join(directory2, name3);
|
|
113850
113977
|
const now = Date.now();
|
|
113851
113978
|
if (import_node_fs148.default.existsSync(destination)) {
|
|
113852
113979
|
import_node_fs148.default.utimesSync(destination, new Date(now), new Date(now));
|
|
113853
113980
|
} else {
|
|
113854
|
-
const temporary =
|
|
113981
|
+
const temporary = import_node_path152.default.join(directory2, (0, import_node_crypto92.randomUUID)());
|
|
113855
113982
|
try {
|
|
113856
113983
|
import_node_fs148.default.writeFileSync(temporary, bytes, { flag: "wx" });
|
|
113857
113984
|
import_node_fs148.default.renameSync(temporary, destination);
|
|
@@ -113863,12 +113990,12 @@ function writeStagedBytes(bytes, origin, extension, directory2) {
|
|
|
113863
113990
|
}
|
|
113864
113991
|
|
|
113865
113992
|
// src/one-native-app-catalog.ts
|
|
113866
|
-
var
|
|
113993
|
+
var import_node_path154 = __toESM(require("node:path"), 1);
|
|
113867
113994
|
init_is_record();
|
|
113868
113995
|
|
|
113869
113996
|
// src/one-native-app-config.ts
|
|
113870
113997
|
var import_node_fs149 = __toESM(require("node:fs"), 1);
|
|
113871
|
-
var
|
|
113998
|
+
var import_node_path153 = __toESM(require("node:path"), 1);
|
|
113872
113999
|
var import_acorn5 = require("peachsim/vendor/acorn");
|
|
113873
114000
|
var import_sucrase4 = require("peachsim/vendor/sucrase");
|
|
113874
114001
|
init_estree_walk();
|
|
@@ -113891,7 +114018,7 @@ var MODULE_EXTENSIONS = [
|
|
|
113891
114018
|
];
|
|
113892
114019
|
function oneConfigPath(root) {
|
|
113893
114020
|
for (const name3 of CONFIG_FILES) {
|
|
113894
|
-
const file =
|
|
114021
|
+
const file = import_node_path153.default.join(root, name3);
|
|
113895
114022
|
if (import_node_fs149.default.existsSync(file)) return file;
|
|
113896
114023
|
}
|
|
113897
114024
|
return null;
|
|
@@ -113921,7 +114048,7 @@ function resolveName(module2, name3, seen) {
|
|
|
113921
114048
|
if (!source.startsWith(".")) continue;
|
|
113922
114049
|
for (const specifier of statement.specifiers) {
|
|
113923
114050
|
if (specifier.type !== "ImportSpecifier" || specifier.local.name !== name3) continue;
|
|
113924
|
-
const base2 =
|
|
114051
|
+
const base2 = import_node_path153.default.resolve(import_node_path153.default.dirname(module2.file), source);
|
|
113925
114052
|
const target = MODULE_EXTENSIONS.map((ext) => base2 + ext).find(
|
|
113926
114053
|
(file) => import_node_fs149.default.existsSync(file) && import_node_fs149.default.statSync(file).isFile()
|
|
113927
114054
|
);
|
|
@@ -114007,7 +114134,7 @@ function readOneNativeAppCatalog(root) {
|
|
|
114007
114134
|
const ios = readOneNativeApp(root)?.ios;
|
|
114008
114135
|
if (!isRecord(ios)) return null;
|
|
114009
114136
|
const accentColor = parseAccent(ios.accentColor);
|
|
114010
|
-
const assetCatalog = typeof ios.assetCatalog === "string" ?
|
|
114137
|
+
const assetCatalog = typeof ios.assetCatalog === "string" ? import_node_path154.default.resolve(root, ios.assetCatalog) : null;
|
|
114011
114138
|
return accentColor || assetCatalog ? { accentColor, assetCatalog } : null;
|
|
114012
114139
|
}
|
|
114013
114140
|
|
|
@@ -114031,7 +114158,7 @@ function readText(file) {
|
|
|
114031
114158
|
}
|
|
114032
114159
|
function catalogFiles(dir, found) {
|
|
114033
114160
|
for (const entry of listDir2(dir)) {
|
|
114034
|
-
const full =
|
|
114161
|
+
const full = import_node_path155.default.join(dir, entry.name);
|
|
114035
114162
|
if (entry.isDirectory()) catalogFiles(full, found);
|
|
114036
114163
|
else if (entry.name === "Contents.json") found.push(full);
|
|
114037
114164
|
}
|
|
@@ -114079,38 +114206,38 @@ async function stageCatalogSvg(file, scale, origin, bytes) {
|
|
|
114079
114206
|
);
|
|
114080
114207
|
}
|
|
114081
114208
|
function stageCatalogImage(file, scale, origin) {
|
|
114082
|
-
if (
|
|
114209
|
+
if (import_node_path155.default.extname(file).toLowerCase() === ".svg")
|
|
114083
114210
|
return stageCatalogSvg(file, scale, origin, import_node_fs150.default.readFileSync(file));
|
|
114084
114211
|
return stageHostFile(file, origin);
|
|
114085
114212
|
}
|
|
114086
114213
|
async function discoverAppCatalog(appDir, assetOrigin) {
|
|
114087
|
-
if (!import_node_fs150.default.existsSync(
|
|
114088
|
-
const packageJson = readText(
|
|
114214
|
+
if (!import_node_fs150.default.existsSync(import_node_path155.default.join(appDir, "ios")) && findExpoAppConfig(appDir)) {
|
|
114215
|
+
const packageJson = readText(import_node_path155.default.join(appDir, "package.json"));
|
|
114089
114216
|
if (packageJson) {
|
|
114090
114217
|
const manifest = JSON.parse(packageJson);
|
|
114091
114218
|
if (declaresNativeDependency(manifest, "expo") || declaresNativeDependency(manifest, "one"))
|
|
114092
114219
|
appDir = (await prepareExpoNativeProject(appDir)).app;
|
|
114093
114220
|
}
|
|
114094
114221
|
}
|
|
114095
|
-
const iosDir =
|
|
114222
|
+
const iosDir = import_node_path155.default.join(appDir, "ios");
|
|
114096
114223
|
const target = listDir2(iosDir).find(
|
|
114097
|
-
(entry) => entry.isDirectory() && entry.name !== "Pods" && listDir2(
|
|
114224
|
+
(entry) => entry.isDirectory() && entry.name !== "Pods" && listDir2(import_node_path155.default.join(iosDir, entry.name)).some(
|
|
114098
114225
|
(file) => /^AppDelegate\.(swift|mm|m)$/.test(file.name)
|
|
114099
114226
|
)
|
|
114100
114227
|
);
|
|
114101
114228
|
if (!target) return null;
|
|
114102
|
-
const targetDir =
|
|
114229
|
+
const targetDir = import_node_path155.default.join(iosDir, target.name);
|
|
114103
114230
|
const files2 = [];
|
|
114104
114231
|
for (const entry of listDir2(targetDir)) {
|
|
114105
114232
|
if (entry.isDirectory() && entry.name.endsWith(".xcassets"))
|
|
114106
|
-
catalogFiles(
|
|
114233
|
+
catalogFiles(import_node_path155.default.join(targetDir, entry.name), files2);
|
|
114107
114234
|
}
|
|
114108
114235
|
const relative4 = files2.map(
|
|
114109
|
-
(file) =>
|
|
114236
|
+
(file) => import_node_path155.default.relative(targetDir, file).split(import_node_path155.default.sep).join(import_node_path155.default.posix.sep)
|
|
114110
114237
|
);
|
|
114111
|
-
const readContents2 = (candidate) => readText(
|
|
114238
|
+
const readContents2 = (candidate) => readText(import_node_path155.default.join(targetDir, candidate));
|
|
114112
114239
|
const pbxproj = listDir2(iosDir).find((entry) => entry.name.endsWith(".xcodeproj"));
|
|
114113
|
-
const accentName = readText(
|
|
114240
|
+
const accentName = readText(import_node_path155.default.join(targetDir, "Info.plist"))?.match(PLIST_ACCENT)?.[1] ?? (pbxproj ? readText(import_node_path155.default.join(iosDir, pbxproj.name, "project.pbxproj"))?.match(
|
|
114114
114241
|
ACCENT_BUILD_SETTING
|
|
114115
114242
|
)?.[1] : void 0) ?? null;
|
|
114116
114243
|
return readAssetCatalog(
|
|
@@ -114123,7 +114250,7 @@ async function discoverAppCatalog(appDir, assetOrigin) {
|
|
|
114123
114250
|
);
|
|
114124
114251
|
return null;
|
|
114125
114252
|
}
|
|
114126
|
-
return stageCatalogImage(
|
|
114253
|
+
return stageCatalogImage(import_node_path155.default.join(targetDir, file), scale, assetOrigin);
|
|
114127
114254
|
},
|
|
114128
114255
|
accentName
|
|
114129
114256
|
);
|
|
@@ -114148,7 +114275,7 @@ async function discoverProjectOneNativeAppCatalog(projectRoot, assetOrigin) {
|
|
|
114148
114275
|
}
|
|
114149
114276
|
|
|
114150
114277
|
// src/bundle-channel.mjs
|
|
114151
|
-
var digest2 = (bytes) => (0,
|
|
114278
|
+
var digest2 = (bytes) => (0, import_node_crypto93.createHash)("sha256").update(bytes).digest("hex");
|
|
114152
114279
|
var segment2 = /^[a-zA-Z0-9._-]+$/;
|
|
114153
114280
|
function packagedAssetDirectory(location) {
|
|
114154
114281
|
const parsed2 = new URL(location, "https://packaged.invalid");
|
|
@@ -114254,11 +114381,11 @@ async function prepareChannel({
|
|
|
114254
114381
|
files2.set(asset.path, asset.bytes);
|
|
114255
114382
|
}
|
|
114256
114383
|
}
|
|
114257
|
-
const identity2 = (0,
|
|
114258
|
-
for (const [
|
|
114384
|
+
const identity2 = (0, import_node_crypto93.createHash)("sha256").update(bundle).update(icon);
|
|
114385
|
+
for (const [path145, bytes] of [...files2].sort(
|
|
114259
114386
|
([a], [b]) => a < b ? -1 : a > b ? 1 : 0
|
|
114260
114387
|
)) {
|
|
114261
|
-
identity2.update(JSON.stringify([
|
|
114388
|
+
identity2.update(JSON.stringify([path145, digest2(bytes)]));
|
|
114262
114389
|
}
|
|
114263
114390
|
if (native) identity2.update(JSON.stringify(native.metadata));
|
|
114264
114391
|
if (oneSDK) identity2.update(JSON.stringify(oneSDK.metadata));
|
|
@@ -114268,7 +114395,7 @@ async function prepareChannel({
|
|
|
114268
114395
|
const releaseKey = `${prefix}/peach/releases/${identity2.digest("hex")}`;
|
|
114269
114396
|
const assetBaseUrl = `${origin.origin}/${releaseKey}/`;
|
|
114270
114397
|
const directories = new Set(
|
|
114271
|
-
[...files2.keys()].map((
|
|
114398
|
+
[...files2.keys()].map((path145) => path145.slice(0, path145.lastIndexOf("/")))
|
|
114272
114399
|
);
|
|
114273
114400
|
let locations = 0;
|
|
114274
114401
|
const { stripRolldownBundleInventoryFooter, attachRolldownBundleInventory } = (await loadCliRuntime()).rolldown_bundle_inventory;
|
|
@@ -114282,12 +114409,12 @@ async function prepareChannel({
|
|
|
114282
114409
|
/("?httpServerLocation"?\s*:\s*)(?:"((?:[^"\\]|\\.)*)"|`([^`\\$]*)`)/g,
|
|
114283
114410
|
(match, property, quoted2, template) => {
|
|
114284
114411
|
const location = quoted2 === void 0 ? template : JSON.parse(`"${quoted2}"`);
|
|
114285
|
-
const
|
|
114286
|
-
if (!directories.has(
|
|
114412
|
+
const path145 = packagedAssetDirectory(location);
|
|
114413
|
+
if (!directories.has(path145)) {
|
|
114287
114414
|
throw new Error(`bundle asset location has no packaged files: ${location}`);
|
|
114288
114415
|
}
|
|
114289
114416
|
locations++;
|
|
114290
|
-
return `${property}${JSON.stringify(new URL(
|
|
114417
|
+
return `${property}${JSON.stringify(new URL(path145, assetBaseUrl).href)}`;
|
|
114291
114418
|
}
|
|
114292
114419
|
);
|
|
114293
114420
|
if (assets2.some((asset) => !asset.path.startsWith("assets/native-catalog/")) && !locations)
|
|
@@ -114295,7 +114422,7 @@ async function prepareChannel({
|
|
|
114295
114422
|
const attached = insertNativeBundleFooters(
|
|
114296
114423
|
source,
|
|
114297
114424
|
{ oneSDK, expoSwift, expoKotlin, nitro, turbo },
|
|
114298
|
-
(
|
|
114425
|
+
(path145) => new URL(path145, assetBaseUrl).href
|
|
114299
114426
|
);
|
|
114300
114427
|
source = attached.source;
|
|
114301
114428
|
if (appCatalog) {
|
|
@@ -114333,10 +114460,10 @@ async function prepareChannel({
|
|
|
114333
114460
|
contentType: "application/javascript"
|
|
114334
114461
|
},
|
|
114335
114462
|
{ key: `${releaseKey}/icon.png`, bytes: icon, contentType: "image/png" },
|
|
114336
|
-
...[...files2].map(([
|
|
114337
|
-
key: `${releaseKey}/${
|
|
114463
|
+
...[...files2].map(([path145, bytes]) => ({
|
|
114464
|
+
key: `${releaseKey}/${path145}`,
|
|
114338
114465
|
bytes,
|
|
114339
|
-
contentType: nativeAssets.get(
|
|
114466
|
+
contentType: nativeAssets.get(path145)?.contentType ?? {
|
|
114340
114467
|
png: "image/png",
|
|
114341
114468
|
jpg: "image/jpeg",
|
|
114342
114469
|
jpeg: "image/jpeg",
|
|
@@ -114345,13 +114472,13 @@ async function prepareChannel({
|
|
|
114345
114472
|
ttf: "font/ttf",
|
|
114346
114473
|
otf: "font/otf",
|
|
114347
114474
|
wav: "audio/wav"
|
|
114348
|
-
}[
|
|
114475
|
+
}[path145.split(".").pop()] ?? "application/octet-stream"
|
|
114349
114476
|
}))
|
|
114350
114477
|
];
|
|
114351
114478
|
return { platform: platform2, key: `${prefix}/${channelKey(platform2)}`, metadata, objects };
|
|
114352
114479
|
}
|
|
114353
114480
|
function brotliCompressCached(bytes) {
|
|
114354
|
-
const file = (0,
|
|
114481
|
+
const file = (0, import_node_path158.join)(cacheDir(), "bundle-channel-brotli", `${digest2(bytes)}-q11-w24.br`);
|
|
114355
114482
|
if ((0, import_node_fs153.existsSync)(file)) return (0, import_node_fs153.readFileSync)(file);
|
|
114356
114483
|
const compressed = (0, import_node_zlib11.brotliCompressSync)(bytes, {
|
|
114357
114484
|
params: {
|
|
@@ -114359,7 +114486,7 @@ function brotliCompressCached(bytes) {
|
|
|
114359
114486
|
[import_node_zlib11.constants.BROTLI_PARAM_LGWIN]: 24
|
|
114360
114487
|
}
|
|
114361
114488
|
});
|
|
114362
|
-
(0, import_node_fs153.mkdirSync)((0,
|
|
114489
|
+
(0, import_node_fs153.mkdirSync)((0, import_node_path158.dirname)(file), { recursive: true });
|
|
114363
114490
|
(0, import_node_fs153.writeFileSync)(`${file}.${process.pid}`, compressed);
|
|
114364
114491
|
(0, import_node_fs153.renameSync)(`${file}.${process.pid}`, file);
|
|
114365
114492
|
return compressed;
|
|
@@ -114412,15 +114539,15 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
|
|
|
114412
114539
|
const directory2 = packagedAssetDirectory(asset.httpServerLocation);
|
|
114413
114540
|
if (asset.files) {
|
|
114414
114541
|
for (const file of asset.files) {
|
|
114415
|
-
const
|
|
114416
|
-
if (!assets2.has(
|
|
114542
|
+
const path145 = `${directory2}/${(0, import_node_path158.basename)(file)}`;
|
|
114543
|
+
if (!assets2.has(path145)) assets2.set(path145, (0, import_node_fs153.readFileSync)(file));
|
|
114417
114544
|
}
|
|
114418
114545
|
continue;
|
|
114419
114546
|
}
|
|
114420
114547
|
for (const scale of asset.scales) {
|
|
114421
114548
|
const file = `${asset.name}${scale === 1 ? "" : `@${scale}x`}.${asset.type}`;
|
|
114422
|
-
const
|
|
114423
|
-
if (!assets2.has(
|
|
114549
|
+
const path145 = `${directory2}/${file}`;
|
|
114550
|
+
if (!assets2.has(path145)) assets2.set(path145, await readAssetFile(asset, file));
|
|
114424
114551
|
}
|
|
114425
114552
|
}
|
|
114426
114553
|
let appCatalog = null;
|
|
@@ -114434,7 +114561,7 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
|
|
|
114434
114561
|
images: Object.fromEntries(Object.entries(captured.value.images).map(([name3, variants]) => [
|
|
114435
114562
|
name3,
|
|
114436
114563
|
variants.map((image) => {
|
|
114437
|
-
const file = (0,
|
|
114564
|
+
const file = (0, import_node_path158.basename)(new URL(image.uri).pathname);
|
|
114438
114565
|
const staged = captured.files.get(file);
|
|
114439
114566
|
if (!staged) throw new Error("app catalog image was not staged");
|
|
114440
114567
|
const resource = `assets/native-catalog/${file}`;
|
|
@@ -114459,7 +114586,7 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
|
|
|
114459
114586
|
versions
|
|
114460
114587
|
)
|
|
114461
114588
|
),
|
|
114462
|
-
assets: [...assets2].map(([
|
|
114589
|
+
assets: [...assets2].map(([path145, bytes]) => ({ path: path145, bytes })),
|
|
114463
114590
|
...await buildNativeBundles(projectRoot, platform2, configuration)
|
|
114464
114591
|
};
|
|
114465
114592
|
}
|
|
@@ -114539,12 +114666,12 @@ async function snapshotOneProductionBundle(projectRoot, entryFile, env = {}, { r
|
|
|
114539
114666
|
const inputs2 = await readPackagingInputs(projectRoot);
|
|
114540
114667
|
const snapshots = [];
|
|
114541
114668
|
for (const platform2 of platforms2) {
|
|
114542
|
-
const out = await mkdtemp((0,
|
|
114669
|
+
const out = await mkdtemp((0, import_node_path158.join)(tmpdir3(), "peach-production-bundle-"));
|
|
114543
114670
|
try {
|
|
114544
114671
|
await promisify21(execFile22)(
|
|
114545
114672
|
runtimeExecutable,
|
|
114546
114673
|
[
|
|
114547
|
-
(0,
|
|
114674
|
+
(0, import_node_path158.join)(projectRoot, "node_modules/.bin/react-native"),
|
|
114548
114675
|
"bundle",
|
|
114549
114676
|
"--platform",
|
|
114550
114677
|
platform2,
|
|
@@ -114555,19 +114682,19 @@ async function snapshotOneProductionBundle(projectRoot, entryFile, env = {}, { r
|
|
|
114555
114682
|
"--entry-file",
|
|
114556
114683
|
entryFile,
|
|
114557
114684
|
"--bundle-output",
|
|
114558
|
-
(0,
|
|
114685
|
+
(0, import_node_path158.join)(out, "bundle.js"),
|
|
114559
114686
|
"--assets-dest",
|
|
114560
|
-
(0,
|
|
114687
|
+
(0, import_node_path158.join)(out, "assets"),
|
|
114561
114688
|
"--sourcemap-output",
|
|
114562
|
-
(0,
|
|
114689
|
+
(0, import_node_path158.join)(out, "bundle.js.map")
|
|
114563
114690
|
],
|
|
114564
114691
|
{ cwd: projectRoot, env: { ...process.env, ...env, NODE_ENV: "production" } }
|
|
114565
114692
|
);
|
|
114566
114693
|
snapshots.push(
|
|
114567
|
-
await packagePlatformBundle(projectRoot, platform2, await readFile4((0,
|
|
114694
|
+
await packagePlatformBundle(projectRoot, platform2, await readFile4((0, import_node_path158.join)(out, "bundle.js")), {
|
|
114568
114695
|
...inputs2,
|
|
114569
114696
|
configuration: "Release",
|
|
114570
|
-
readAssetFile: (asset, file) => readFile4((0,
|
|
114697
|
+
readAssetFile: (asset, file) => readFile4((0, import_node_path158.join)(out, asset.httpServerLocation, file))
|
|
114571
114698
|
})
|
|
114572
114699
|
);
|
|
114573
114700
|
} finally {
|
|
@@ -114580,11 +114707,11 @@ async function snapshotOneDevBundle(projectRoot, env = {}, { runtimeExecutable =
|
|
|
114580
114707
|
const { spawn: spawn15 } = await import("node:child_process");
|
|
114581
114708
|
const { createServer: createServer2 } = await import("node:net");
|
|
114582
114709
|
const { createRequire: createRequire24 } = await import("node:module");
|
|
114583
|
-
const onePackage = createRequire24((0,
|
|
114710
|
+
const onePackage = createRequire24((0, import_node_path158.join)(projectRoot, "package.json")).resolve(
|
|
114584
114711
|
"one/package.json"
|
|
114585
114712
|
);
|
|
114586
|
-
const oneBin = (0,
|
|
114587
|
-
(0,
|
|
114713
|
+
const oneBin = (0, import_node_path158.join)(
|
|
114714
|
+
(0, import_node_path158.dirname)(onePackage),
|
|
114588
114715
|
JSON.parse((0, import_node_fs153.readFileSync)(onePackage, "utf8")).bin.one
|
|
114589
114716
|
);
|
|
114590
114717
|
const port = await new Promise((resolve4, reject) => {
|