peachsim 0.1.2563 → 0.1.2564
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 +5 -4
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-6TRDV6GV.mjs → acorn-ATKTRGBC.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-LJ5X3L6Q.mjs → chunk-2TNHD5YC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WRACAH6T.mjs → chunk-3AJ4PEJW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-X6DL6VLB.mjs → chunk-3NAKTTKU.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OJQUPEDV.mjs → chunk-4M2ZY4ZW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UI4Q2Y2F.mjs → chunk-5LOA3GZ5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-A2APYKPJ.mjs → chunk-6NLIASIH.mjs} +12 -12
- package/dist-lib/esm-chunks/{chunk-VLUSSVKC.mjs → chunk-7XBAB4AZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UWTBFK2Q.mjs → chunk-BOXFJKG3.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-TH33GVSD.mjs → chunk-CXPBA242.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CA5EIHD2.mjs → chunk-CZEW62OH.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-KPBQFLN4.mjs → chunk-D3KCDVEW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2P5CSC3P.mjs → chunk-DR56NKJH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-DOLHETCA.mjs → chunk-E5TVA4S2.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-ZOYVG7OX.mjs → chunk-HRNPUVXK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GTOP2SAE.mjs → chunk-JGXROSXH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-LG7XZOP6.mjs → chunk-LHMCEVNH.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-MRSQ2NLY.mjs → chunk-LKAABC7D.mjs} +4 -4
- package/dist-lib/esm-chunks/chunk-QGJL5Z4W.mjs +10 -0
- package/dist-lib/esm-chunks/{chunk-4IIXA354.mjs → chunk-QT6GM735.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JMM5OO5X.mjs → chunk-UJZ4QMYX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-C4B2NROS.mjs → chunk-UR5E3JF4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ORY3UUVZ.mjs → chunk-XJCUPAKO.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-MB23IWM5.mjs → metro-layout-parser-BMT4ABLU.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-URYMEPCF.mjs → swift-package-prebuilt-IDP3F7A5.mjs} +10 -10
- package/dist-lib/esm-chunks/{swift-sdk-app-module-5BJBIXIN.mjs → swift-sdk-app-module-3XVFPUB6.mjs} +14 -13
- package/dist-lib/esm-chunks/{swift-sdk-image-ALW5XBJ5.mjs → swift-sdk-image-CT65HIPH.mjs} +14 -13
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-ILJ6IEZJ.mjs → swift-sdk-image-producer-NCT6LI7J.mjs} +4 -4
- package/dist-lib/expo-swift-bundle.cjs +4 -3
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1369 -821
- package/dist-lib/host/fetch-proxy-handler.cjs +4 -3
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +16 -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 -79
- package/dist-lib/public-origins-lib.json +77 -70
- 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 -7
- package/dist-lib/skills.cjs +1932 -1384
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +10 -10
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +5 -3
- package/dist-lib/swift-submit.mjs +9 -7
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/@xmldom/xmldom.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/bplist-parser.cjs +1 -1
- package/dist-lib/vendor/ignore.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/plist.cjs +1 -1
- package/dist-lib/vendor/smol-toml.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/package.json +1 -1
- package/src/one-native-controls-package.ts +580 -0
- package/src/one-native-source.ts +39 -5
- package/src/oneNativeControlsContract.ts +5 -0
- package/src/swift-submit.ts +4 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2564 | (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;
|
|
@@ -491,12 +491,12 @@ var init_bridge_constants = __esm({
|
|
|
491
491
|
|
|
492
492
|
// src/chromium-admission.ts
|
|
493
493
|
function readChromiumQueue(deps, verified2, own2) {
|
|
494
|
-
const { fs:
|
|
495
|
-
const dir =
|
|
494
|
+
const { fs: fs122, os: os29, path: path160, childProcess: childProcess3 } = deps;
|
|
495
|
+
const dir = path160.join(
|
|
496
496
|
process.platform === "win32" ? os29.tmpdir() : "/tmp",
|
|
497
497
|
"chromium-admission"
|
|
498
498
|
);
|
|
499
|
-
|
|
499
|
+
fs122.mkdirSync(dir, { recursive: true });
|
|
500
500
|
const limit = Math.max(2, Math.floor(os29.cpus().length / 2));
|
|
501
501
|
const alive = (pid) => {
|
|
502
502
|
try {
|
|
@@ -506,7 +506,7 @@ function readChromiumQueue(deps, verified2, own2) {
|
|
|
506
506
|
return err instanceof Error && "code" in err && err.code === "EPERM";
|
|
507
507
|
}
|
|
508
508
|
};
|
|
509
|
-
const entries2 =
|
|
509
|
+
const entries2 = fs122.readdirSync(dir).map((entry) => {
|
|
510
510
|
const match = /^(\d+)-(\d+)-/.exec(entry);
|
|
511
511
|
const pid = match ? Number(match[1]) : 0;
|
|
512
512
|
const held = entry === own2 || match !== null && alive(pid);
|
|
@@ -537,7 +537,7 @@ function readChromiumQueue(deps, verified2, own2) {
|
|
|
537
537
|
for (const { entry, held } of entries2) {
|
|
538
538
|
if (!held || verified2.get(entry) === false) {
|
|
539
539
|
try {
|
|
540
|
-
|
|
540
|
+
fs122.unlinkSync(path160.join(dir, entry));
|
|
541
541
|
} catch {
|
|
542
542
|
}
|
|
543
543
|
continue;
|
|
@@ -545,7 +545,7 @@ function readChromiumQueue(deps, verified2, own2) {
|
|
|
545
545
|
try {
|
|
546
546
|
tickets.push({
|
|
547
547
|
entry,
|
|
548
|
-
created:
|
|
548
|
+
created: fs122.statSync(path160.join(dir, entry), { bigint: true }).ctimeNs
|
|
549
549
|
});
|
|
550
550
|
} catch {
|
|
551
551
|
}
|
|
@@ -556,21 +556,21 @@ function readChromiumQueue(deps, verified2, own2) {
|
|
|
556
556
|
return { dir, limit, tickets: tickets.map((t) => t.entry) };
|
|
557
557
|
}
|
|
558
558
|
async function acquireChromiumAdmission(deps) {
|
|
559
|
-
const { fs:
|
|
559
|
+
const { fs: fs122, path: path160, label, readQueue, signal } = deps;
|
|
560
560
|
signal?.throwIfAborted();
|
|
561
561
|
const queuedAt = Date.now();
|
|
562
562
|
const verified2 = /* @__PURE__ */ new Map();
|
|
563
563
|
const startedAt = Math.round(Date.now() / 1e3 - process.uptime());
|
|
564
564
|
const name3 = `${process.pid}-${startedAt}-${Math.random().toString(36).slice(2, 10)}`;
|
|
565
|
-
const ticket =
|
|
566
|
-
|
|
565
|
+
const ticket = path160.join(readQueue(deps, verified2, name3).dir, name3);
|
|
566
|
+
fs122.closeSync(fs122.openSync(ticket, "wx"));
|
|
567
567
|
let released = false;
|
|
568
568
|
const release = () => {
|
|
569
569
|
if (released) return;
|
|
570
570
|
released = true;
|
|
571
571
|
process.removeListener("exit", release);
|
|
572
572
|
try {
|
|
573
|
-
|
|
573
|
+
fs122.unlinkSync(ticket);
|
|
574
574
|
} catch {
|
|
575
575
|
}
|
|
576
576
|
};
|
|
@@ -2133,13 +2133,15 @@ function parseSwiftHostDiscovery(value) {
|
|
|
2133
2133
|
..."iconPath" in value && value.iconPath === SWIFT_ICON_PATH ? { iconPath: SWIFT_ICON_PATH } : {}
|
|
2134
2134
|
};
|
|
2135
2135
|
}
|
|
2136
|
-
var SWIFT_DISCOVERY_PATH, SWIFT_GUEST_PATH, SWIFT_ICON_PATH;
|
|
2136
|
+
var SWIFT_DISCOVERY_PATH, SWIFT_GUEST_PATH, SWIFT_ICON_PATH, SWIFT_PACKAGE_PATH, SWIFT_HMR_PATH;
|
|
2137
2137
|
var init_swiftDiscoveryContract = __esm({
|
|
2138
2138
|
"../peach-globals/src/swiftDiscoveryContract.ts"() {
|
|
2139
2139
|
"use strict";
|
|
2140
2140
|
SWIFT_DISCOVERY_PATH = "/__peach/swift-host";
|
|
2141
2141
|
SWIFT_GUEST_PATH = "/__peach/swift-guest.js";
|
|
2142
2142
|
SWIFT_ICON_PATH = "/__peach/swift-icon";
|
|
2143
|
+
SWIFT_PACKAGE_PATH = "/__peach/swift-package/";
|
|
2144
|
+
SWIFT_HMR_PATH = "/__peach/swift-hmr";
|
|
2143
2145
|
}
|
|
2144
2146
|
});
|
|
2145
2147
|
|
|
@@ -2937,15 +2939,14 @@ async function compileSwiftProject(submit, work, origin, signal, onStage) {
|
|
|
2937
2939
|
}
|
|
2938
2940
|
}
|
|
2939
2941
|
}
|
|
2940
|
-
var SWIFT_COMPILE_PATH,
|
|
2942
|
+
var SWIFT_COMPILE_PATH, MAX_SWIFT_COMPILE_FILES, DEFAULT_SWIFT_COMPILE_BUILD_MS, MAX_SWIFT_COMPILE_BUILD_MS, MAX_SWIFT_COMPILE_SOURCE_BYTES, MAX_SWIFT_COMPILE_RESOURCES, MAX_SWIFT_COMPILE_RESOURCE_BYTES, MAX_SWIFT_COMPILE_RESOURCE_TOTAL_BYTES, MAX_SWIFT_COMPILE_METAL_FILES, MAX_SWIFT_COMPILE_METAL_BYTES, MAX_SWIFT_COMPILE_METAL_TOTAL_BYTES, MAX_SWIFT_COMPILE_IMAGES, MAX_SWIFT_COMPILE_IMAGE_BYTES, MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES, SWIFT_HOST_ABI, POLL_INTERVAL_MS;
|
|
2941
2943
|
var init_swift_submit = __esm({
|
|
2942
2944
|
"src/swift-submit.ts"() {
|
|
2943
2945
|
"use strict";
|
|
2944
2946
|
init_is_record();
|
|
2945
2947
|
init_swiftContract();
|
|
2948
|
+
init_swiftDiscoveryContract();
|
|
2946
2949
|
SWIFT_COMPILE_PATH = "/api/swift-compile";
|
|
2947
|
-
SWIFT_PACKAGE_PATH = "/__peach/swift-package/";
|
|
2948
|
-
SWIFT_HMR_PATH = "/__peach/swift-hmr";
|
|
2949
2950
|
MAX_SWIFT_COMPILE_FILES = 256;
|
|
2950
2951
|
DEFAULT_SWIFT_COMPILE_BUILD_MS = 10 * 6e4;
|
|
2951
2952
|
MAX_SWIFT_COMPILE_BUILD_MS = 60 * 6e4;
|
|
@@ -3598,9 +3599,9 @@ function safeChildPlistName(value) {
|
|
|
3598
3599
|
name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
|
|
3599
3600
|
};
|
|
3600
3601
|
}
|
|
3601
|
-
async function readableSettingsBundle(
|
|
3602
|
+
async function readableSettingsBundle(path160) {
|
|
3602
3603
|
try {
|
|
3603
|
-
const root = await (0, import_promises3.stat)((0, import_node_path10.join)(
|
|
3604
|
+
const root = await (0, import_promises3.stat)((0, import_node_path10.join)(path160, "Root.plist"));
|
|
3604
3605
|
return root.isFile() && root.size <= MAX_PLIST_BYTES;
|
|
3605
3606
|
} catch {
|
|
3606
3607
|
return false;
|
|
@@ -3645,11 +3646,11 @@ async function settingsBundleFingerprint(bundlePath) {
|
|
|
3645
3646
|
return null;
|
|
3646
3647
|
}
|
|
3647
3648
|
}
|
|
3648
|
-
async function parsePlistRecord(
|
|
3649
|
+
async function parsePlistRecord(path160) {
|
|
3649
3650
|
try {
|
|
3650
|
-
const metadata = await (0, import_promises3.stat)(
|
|
3651
|
+
const metadata = await (0, import_promises3.stat)(path160);
|
|
3651
3652
|
if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
|
|
3652
|
-
const source = await (0, import_promises3.readFile)(
|
|
3653
|
+
const source = await (0, import_promises3.readFile)(path160, "utf8");
|
|
3653
3654
|
const parsed2 = parsePlistSource(source);
|
|
3654
3655
|
return isRecord(parsed2) ? parsed2 : null;
|
|
3655
3656
|
} catch {
|
|
@@ -4129,7 +4130,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
|
4129
4130
|
return null;
|
|
4130
4131
|
}
|
|
4131
4132
|
}
|
|
4132
|
-
function httpGet(hostname2, port,
|
|
4133
|
+
function httpGet(hostname2, port, path160, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
4133
4134
|
return new Promise((resolve10) => {
|
|
4134
4135
|
let settled = false;
|
|
4135
4136
|
let killing = false;
|
|
@@ -4138,7 +4139,7 @@ function httpGet(hostname2, port, path159, method = "GET", timeout = TIMEOUT_MS,
|
|
|
4138
4139
|
settled = true;
|
|
4139
4140
|
resolve10(value);
|
|
4140
4141
|
};
|
|
4141
|
-
const req = import_http.default.request({ hostname: hostname2, port, path:
|
|
4142
|
+
const req = import_http.default.request({ hostname: hostname2, port, path: path160, method, headers }, (res) => {
|
|
4142
4143
|
let body = "";
|
|
4143
4144
|
res.on("data", (c) => body += c.toString());
|
|
4144
4145
|
const contentType2 = (() => {
|
|
@@ -4947,8 +4948,8 @@ function sourceEntryPath() {
|
|
|
4947
4948
|
return null;
|
|
4948
4949
|
}
|
|
4949
4950
|
}
|
|
4950
|
-
function isCliEntry(
|
|
4951
|
-
const name3 = (0, import_node_path13.basename)(
|
|
4951
|
+
function isCliEntry(path160) {
|
|
4952
|
+
const name3 = (0, import_node_path13.basename)(path160);
|
|
4952
4953
|
return name3 === "bin.ts" || name3 === "bin.js";
|
|
4953
4954
|
}
|
|
4954
4955
|
function rnxSelfInvocation() {
|
|
@@ -5715,13 +5716,13 @@ var init_swift_standin_digest = __esm({
|
|
|
5715
5716
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
5716
5717
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
5717
5718
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
5718
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
5719
|
+
STANDIN_SOURCE_DIGEST = true ? "c89bc814b276ad27414ecbc41145921ff29ffdcfb658d6aeb6ae63ec5ea26cc0" : standinSourceDigest();
|
|
5719
5720
|
}
|
|
5720
5721
|
});
|
|
5721
5722
|
|
|
5722
5723
|
// src/expo-native-compiler-digest.ts
|
|
5723
5724
|
function expoNativeCompilerDigestValue() {
|
|
5724
|
-
return true ? "
|
|
5725
|
+
return true ? "bc2b0640667533650a30d025ca814c8f779d18ed809f434d7078ffeae2470346" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
5725
5726
|
}
|
|
5726
5727
|
var import_node_crypto11;
|
|
5727
5728
|
var init_expo_native_compiler_digest = __esm({
|
|
@@ -10050,9 +10051,9 @@ var init_podspec_ruby = __esm({
|
|
|
10050
10051
|
}
|
|
10051
10052
|
// ---- errors
|
|
10052
10053
|
exceptionClass(name3) {
|
|
10053
|
-
const
|
|
10054
|
+
const path160 = name3.split("::");
|
|
10054
10055
|
let module2 = this.object;
|
|
10055
|
-
for (const part of
|
|
10056
|
+
for (const part of path160) {
|
|
10056
10057
|
const next = module2.consts.get(part);
|
|
10057
10058
|
if (!(next instanceof RModule))
|
|
10058
10059
|
throw new UnsupportedRuby(`no exception class ${name3}`);
|
|
@@ -14436,8 +14437,8 @@ export *
|
|
|
14436
14437
|
}`;
|
|
14437
14438
|
}
|
|
14438
14439
|
function swiftPackageIdentity(url) {
|
|
14439
|
-
const
|
|
14440
|
-
return (
|
|
14440
|
+
const path160 = url.endsWith("/") ? url.slice(0, -1) : url;
|
|
14441
|
+
return (path160.split("/").pop() ?? path160).replace(/\.git$/, "").toLowerCase();
|
|
14441
14442
|
}
|
|
14442
14443
|
function clangSettingEntries(settings, tool) {
|
|
14443
14444
|
return (settings ?? []).flatMap(
|
|
@@ -15083,10 +15084,10 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
|
|
|
15083
15084
|
const enclosing = scopes.length > 0 ? scopes[scopes.length - 1].prefix : [];
|
|
15084
15085
|
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] !== "<") {
|
|
15085
15086
|
const name3 = scope2[4];
|
|
15086
|
-
const
|
|
15087
|
-
if (!byPath.has(
|
|
15087
|
+
const path160 = scopeOf(name3, enclosing, false);
|
|
15088
|
+
if (!byPath.has(path160.join(".")) && (path160.length === 1 || byPath.has(path160.slice(0, -1).join(".")))) {
|
|
15088
15089
|
const keptAttrs = [...(scope2[1] ?? "").matchAll(/@\w+(?:\([^)]*\))?/g)].map((attr) => attr[0]).filter((attr) => !attr.startsWith("@objc"));
|
|
15089
|
-
const id = `s:peach-synthesized-${module2}-${
|
|
15090
|
+
const id = `s:peach-synthesized-${module2}-${path160.join(".")}`;
|
|
15090
15091
|
const body = [];
|
|
15091
15092
|
let inner = 1;
|
|
15092
15093
|
let closed = false;
|
|
@@ -15141,15 +15142,15 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
|
|
|
15141
15142
|
symbols.push({
|
|
15142
15143
|
kind: { identifier: "swift.enum" },
|
|
15143
15144
|
identifier: { precise: id },
|
|
15144
|
-
pathComponents:
|
|
15145
|
+
pathComponents: path160,
|
|
15145
15146
|
declarationFragments: fragments,
|
|
15146
15147
|
accessLevel: "public"
|
|
15147
15148
|
});
|
|
15148
|
-
if (
|
|
15149
|
+
if (path160.length > 1)
|
|
15149
15150
|
relationships.push({
|
|
15150
15151
|
kind: "memberOf",
|
|
15151
15152
|
source: id,
|
|
15152
|
-
target: byPath.get(
|
|
15153
|
+
target: byPath.get(path160.slice(0, -1).join("."))
|
|
15153
15154
|
});
|
|
15154
15155
|
for (const kase of cases) {
|
|
15155
15156
|
const memberId = `${id}-${kase.leaf}`;
|
|
@@ -15158,7 +15159,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
|
|
|
15158
15159
|
symbols.push({
|
|
15159
15160
|
kind: { identifier: "swift.enum.case" },
|
|
15160
15161
|
identifier: { precise: memberId },
|
|
15161
|
-
pathComponents: [...
|
|
15162
|
+
pathComponents: [...path160, kase.leaf],
|
|
15162
15163
|
declarationFragments: [
|
|
15163
15164
|
{ kind: "keyword", spelling: "case" },
|
|
15164
15165
|
{ kind: "text", spelling: " " },
|
|
@@ -15174,7 +15175,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
|
|
|
15174
15175
|
symbols.push({
|
|
15175
15176
|
kind: { identifier: "swift.init" },
|
|
15176
15177
|
identifier: { precise: initId },
|
|
15177
|
-
pathComponents: [...
|
|
15178
|
+
pathComponents: [...path160, "init(rawValue:)"],
|
|
15178
15179
|
declarationFragments: [
|
|
15179
15180
|
{ kind: "keyword", spelling: "init" },
|
|
15180
15181
|
{ kind: "text", spelling: "?(" },
|
|
@@ -15253,7 +15254,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15253
15254
|
})
|
|
15254
15255
|
)
|
|
15255
15256
|
);
|
|
15256
|
-
const trap = (
|
|
15257
|
+
const trap = (path160) => `fatalError("${path160} is ${options2.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
|
|
15257
15258
|
const skipped = [];
|
|
15258
15259
|
const behavior = options2.behavior ?? /* @__PURE__ */ new Map();
|
|
15259
15260
|
const used = /* @__PURE__ */ new Set();
|
|
@@ -15604,34 +15605,34 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15604
15605
|
lines.push(...physical);
|
|
15605
15606
|
owners.push(...physical.map(() => current2));
|
|
15606
15607
|
};
|
|
15607
|
-
const emitAt = (
|
|
15608
|
-
if (omit.has(
|
|
15608
|
+
const emitAt = (path160, line) => {
|
|
15609
|
+
if (omit.has(path160)) return;
|
|
15609
15610
|
const previous = current2;
|
|
15610
|
-
current2 =
|
|
15611
|
+
current2 = path160;
|
|
15611
15612
|
emit(line);
|
|
15612
15613
|
current2 = previous;
|
|
15613
15614
|
};
|
|
15614
15615
|
const emitInertState = (id, indent2, build2) => {
|
|
15615
|
-
const
|
|
15616
|
+
const path160 = pathOf(byId.get(id));
|
|
15616
15617
|
emitAt(hiddenInit(id), `${indent2}init(_peachInert: Void) { ${build2} }`);
|
|
15617
15618
|
const list2 = conforms.get(id) ?? [];
|
|
15618
15619
|
const has = (name3) => (children.get(id) ?? []).some((member) => leaf(member) === name3);
|
|
15619
15620
|
if (list2.includes("Encodable") && !has("encode(to:)"))
|
|
15620
15621
|
emitAt(
|
|
15621
|
-
`${
|
|
15622
|
+
`${path160}.encode(to:)`,
|
|
15622
15623
|
`${indent2}public func encode(to encoder: Encoder) throws {}`
|
|
15623
15624
|
);
|
|
15624
15625
|
if (list2.includes("Decodable") && !has("init(from:)"))
|
|
15625
15626
|
emitAt(
|
|
15626
|
-
`${
|
|
15627
|
+
`${path160}.init(from:)`,
|
|
15627
15628
|
`${indent2}public init(from decoder: Decoder) throws { self.init(_peachInert: ()) }`
|
|
15628
15629
|
);
|
|
15629
15630
|
};
|
|
15630
15631
|
const scoped = (body) => (symbol2, ...rest) => {
|
|
15631
|
-
const
|
|
15632
|
-
if (omit.has(
|
|
15632
|
+
const path160 = pathOf(symbol2);
|
|
15633
|
+
if (omit.has(path160)) return void skipped.push({ path: path160, reason: omit.get(path160) });
|
|
15633
15634
|
const previous = current2;
|
|
15634
|
-
current2 =
|
|
15635
|
+
current2 = path160;
|
|
15635
15636
|
try {
|
|
15636
15637
|
body(symbol2, ...rest);
|
|
15637
15638
|
} finally {
|
|
@@ -15663,7 +15664,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15663
15664
|
};
|
|
15664
15665
|
const emitMember = scoped(
|
|
15665
15666
|
(member, indent2, context) => {
|
|
15666
|
-
const
|
|
15667
|
+
const path160 = pathOf(member);
|
|
15667
15668
|
if (TYPE_KINDS.has(member.kind.identifier)) {
|
|
15668
15669
|
const origin = origins.get(member.identifier.precise)?.split(".")[0];
|
|
15669
15670
|
const parent = owner.get(member.identifier.precise);
|
|
@@ -15680,7 +15681,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15680
15681
|
))
|
|
15681
15682
|
return;
|
|
15682
15683
|
if (!MEMBER_KINDS.has(member.kind.identifier)) {
|
|
15683
|
-
skipped.push({ path:
|
|
15684
|
+
skipped.push({ path: path160, reason: `unhandled ${member.kind.identifier}` });
|
|
15684
15685
|
return;
|
|
15685
15686
|
}
|
|
15686
15687
|
const { 1: spelledAttrs, 2: rest } = LEADING_ATTRS.exec(text2(member));
|
|
@@ -15691,15 +15692,15 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15691
15692
|
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(
|
|
15692
15693
|
member.identifier.precise
|
|
15693
15694
|
)?.[1] : void 0;
|
|
15694
|
-
const attrs = options2.unobjc?.has(
|
|
15695
|
+
const attrs = options2.unobjc?.has(path160) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : `${wrapped}${selector ? `@objc(${selector}) ` : ""}`;
|
|
15695
15696
|
const modifiers = /^((?:(?:required|final|override|convenience|unowned(?:\(\w+\))?|weak|lazy|nonisolated|mutating|nonmutating) )*)(.*)$/s.exec(
|
|
15696
15697
|
rest
|
|
15697
15698
|
);
|
|
15698
15699
|
const flags = new Set(
|
|
15699
15700
|
modifiers[1].trim().split(/\s+/).filter(Boolean).map((flag) => flag.replace(/\(.*/, ""))
|
|
15700
15701
|
);
|
|
15701
|
-
const requiredInit = context.inClass && !!options2.requiredInits?.has(
|
|
15702
|
-
const restatesRequired = context.inClass &&
|
|
15702
|
+
const requiredInit = context.inClass && !!options2.requiredInits?.has(path160);
|
|
15703
|
+
const restatesRequired = context.inClass && path160.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
|
|
15703
15704
|
(at) => options2.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
15704
15705
|
);
|
|
15705
15706
|
const protocolInit = member.kind.identifier === "swift.init" && /^c:objc\(pl\)\w+\(im\).*::SYNTHESIZED::c:objc\(cs\)/.test(
|
|
@@ -15709,7 +15710,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15709
15710
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
15710
15711
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
15711
15712
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
15712
|
-
for (const type of options2.unwrappedParameters?.get(
|
|
15713
|
+
for (const type of options2.unwrappedParameters?.get(path160) ?? [])
|
|
15713
15714
|
core = core.replace(
|
|
15714
15715
|
new RegExp(
|
|
15715
15716
|
`(:\\s*(?:\\w+\\.)*${type.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})(?=\\s*[,)])`,
|
|
@@ -15717,12 +15718,12 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15717
15718
|
),
|
|
15718
15719
|
"$1!"
|
|
15719
15720
|
);
|
|
15720
|
-
const override = context.inClass && !options2.plain?.has(
|
|
15721
|
+
const override = context.inClass && !options2.plain?.has(path160) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options2.forcedOverride?.has(path160) || isObjC(member) && path160.endsWith(".init()")) ? "override " : "";
|
|
15721
15722
|
const head = `${indent2}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
15722
|
-
const measured = behavior.get(
|
|
15723
|
-
if (measured) used.add(
|
|
15723
|
+
const measured = behavior.get(path160);
|
|
15724
|
+
if (measured) used.add(path160);
|
|
15724
15725
|
const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
|
|
15725
|
-
const body = overloadBody ?? measured?.body ?? (options2.inert ? inertBody(member) : trap(
|
|
15726
|
+
const body = overloadBody ?? measured?.body ?? (options2.inert ? inertBody(member) : trap(path160));
|
|
15726
15727
|
switch (member.kind.identifier) {
|
|
15727
15728
|
case "swift.property":
|
|
15728
15729
|
case "swift.type.property":
|
|
@@ -15735,13 +15736,13 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15735
15736
|
const parameter = !measured && !options2.inert && !settable && /:\s*some\s/.test(decl) ? opaqueParameter(member) : void 0;
|
|
15736
15737
|
const getter = parameter ? `return ({ () -> ${parameter} in ${body} })()` : body;
|
|
15737
15738
|
const computed = decl.replace(/^((?:static |class )*)let /, "$1var ");
|
|
15738
|
-
const wrapper = options2.projections?.get(
|
|
15739
|
+
const wrapper = options2.projections?.get(path160);
|
|
15739
15740
|
if (wrapper) {
|
|
15740
15741
|
const type = /^var\s+`?\w+`?\s*:\s*(.+)$/s.exec(computed)?.[1];
|
|
15741
|
-
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [
|
|
15742
|
+
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path160]);
|
|
15742
15743
|
if (!initial)
|
|
15743
15744
|
return void skipped.push({
|
|
15744
|
-
path:
|
|
15745
|
+
path: path160,
|
|
15745
15746
|
reason: `wrapped by ${wrapper} with no inert initial value`
|
|
15746
15747
|
});
|
|
15747
15748
|
const own2 = new RegExp(
|
|
@@ -15762,7 +15763,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15762
15763
|
return;
|
|
15763
15764
|
}
|
|
15764
15765
|
emit(
|
|
15765
|
-
`${head.replace(/@NSCopying\b\s*/g, "")}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed2.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options2.inert ? "" : trap(
|
|
15766
|
+
`${head.replace(/@NSCopying\b\s*/g, "")}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed2.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options2.inert ? "" : trap(path160))} }` : ""} }`
|
|
15766
15767
|
);
|
|
15767
15768
|
return;
|
|
15768
15769
|
}
|
|
@@ -15821,7 +15822,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15821
15822
|
};
|
|
15822
15823
|
const emitType = scoped(
|
|
15823
15824
|
(symbol2, indent2) => {
|
|
15824
|
-
const
|
|
15825
|
+
const path160 = pathOf(symbol2);
|
|
15825
15826
|
const id = symbol2.identifier.precise;
|
|
15826
15827
|
const inner = `${indent2} `;
|
|
15827
15828
|
switch (symbol2.kind.identifier) {
|
|
@@ -15838,10 +15839,10 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15838
15839
|
case "swift.class": {
|
|
15839
15840
|
const shape = header(symbol2, "class", indent2);
|
|
15840
15841
|
if (!shape)
|
|
15841
|
-
return void skipped.push({ path:
|
|
15842
|
-
const parent = options2.superclasses?.get(
|
|
15842
|
+
return void skipped.push({ path: path160, reason: `unparsed class ${text2(symbol2)}` });
|
|
15843
|
+
const parent = options2.superclasses?.get(path160) ?? superclass.get(id);
|
|
15843
15844
|
const blocked = classBlocked(id);
|
|
15844
|
-
if (blocked) return void skipped.push({ path:
|
|
15845
|
+
if (blocked) return void skipped.push({ path: path160, reason: blocked });
|
|
15845
15846
|
const ancestors = /* @__PURE__ */ new Set();
|
|
15846
15847
|
const inherited = /* @__PURE__ */ new Set();
|
|
15847
15848
|
for (let at = superId.get(id); at; at = superId.get(at)) {
|
|
@@ -15857,7 +15858,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15857
15858
|
"Equatable",
|
|
15858
15859
|
"CustomStringConvertible",
|
|
15859
15860
|
"CustomDebugStringConvertible"
|
|
15860
|
-
].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options2.unconformed?.get(
|
|
15861
|
+
].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options2.unconformed?.get(path160)?.has(name3.split(/::|\./).pop()) && !options2.unconformed?.get(path160)?.has(name3)
|
|
15861
15862
|
)
|
|
15862
15863
|
].filter((name3, at, all2) => all2.indexOf(name3) === at);
|
|
15863
15864
|
const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
|
|
@@ -15869,9 +15870,9 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15869
15870
|
`${indent2}${shape.attrs}${objcName ? `@objc(${objcName}) ` : ""}${shape.final}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
|
|
15870
15871
|
);
|
|
15871
15872
|
const members2 = membersOf(id);
|
|
15872
|
-
const extra = options2.behavior?.get(
|
|
15873
|
+
const extra = options2.behavior?.get(path160)?.members;
|
|
15873
15874
|
if (extra) {
|
|
15874
|
-
used.add(
|
|
15875
|
+
used.add(path160);
|
|
15875
15876
|
emit(`${inner}${extra}`);
|
|
15876
15877
|
}
|
|
15877
15878
|
for (const member of members2)
|
|
@@ -15927,11 +15928,11 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15927
15928
|
if (protocol && member.kind.identifier === "swift.method" && leaf(member).endsWith("()") && have.has(`instance|leaf|${leaf(member).slice(0, -2)}`))
|
|
15928
15929
|
propertyWitnesses.push({
|
|
15929
15930
|
owner: current2,
|
|
15930
|
-
head: `extension ${pathOf(protocol)} where Self: ${
|
|
15931
|
+
head: `extension ${pathOf(protocol)} where Self: ${path160} {`,
|
|
15931
15932
|
member,
|
|
15932
|
-
path:
|
|
15933
|
+
path: path160
|
|
15933
15934
|
});
|
|
15934
|
-
else emitWitness(member, inner,
|
|
15935
|
+
else emitWitness(member, inner, path160, open && isObjC(member));
|
|
15935
15936
|
}
|
|
15936
15937
|
}
|
|
15937
15938
|
if (options2.inert && designated2 && classBuild(id) === "hidden")
|
|
@@ -15939,13 +15940,13 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15939
15940
|
const coder = members2.some((member) => leaf(member) === "init(coder:)");
|
|
15940
15941
|
if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
15941
15942
|
emit(
|
|
15942
|
-
`${inner}public required init${options2.coderNonfailable?.has(
|
|
15943
|
+
`${inner}public required init${options2.coderNonfailable?.has(path160) ? "" : "?"}(coder: NSCoder) { ${options2.inert && !options2.coderNonfailable?.has(path160) ? "return nil" : trap(`${path160}.init(coder:)`)} }`
|
|
15943
15944
|
);
|
|
15944
15945
|
if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
|
|
15945
15946
|
(at) => options2.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
15946
15947
|
))
|
|
15947
15948
|
emit(
|
|
15948
|
-
`${inner}public required init() { ${options2.inert ? superInit(id) : trap(`${
|
|
15949
|
+
`${inner}public required init() { ${options2.inert ? superInit(id) : trap(`${path160}.init()`)} }`
|
|
15949
15950
|
);
|
|
15950
15951
|
emit(`${indent2}}`);
|
|
15951
15952
|
return;
|
|
@@ -15953,7 +15954,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15953
15954
|
case "swift.struct": {
|
|
15954
15955
|
const shape = header(symbol2, "struct", indent2);
|
|
15955
15956
|
if (!shape)
|
|
15956
|
-
return void skipped.push({ path:
|
|
15957
|
+
return void skipped.push({ path: path160, reason: `unparsed struct ${text2(symbol2)}` });
|
|
15957
15958
|
const members2 = membersOf(id);
|
|
15958
15959
|
const raw2 = rawType(members2);
|
|
15959
15960
|
const list2 = inheritance(id);
|
|
@@ -15993,7 +15994,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
15993
15994
|
emitInertState(
|
|
15994
15995
|
id,
|
|
15995
15996
|
inner,
|
|
15996
|
-
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [
|
|
15997
|
+
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path160]) ?? "0"}` : ""
|
|
15997
15998
|
);
|
|
15998
15999
|
emit(`${indent2}}`);
|
|
15999
16000
|
return;
|
|
@@ -16001,7 +16002,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
16001
16002
|
case "swift.enum": {
|
|
16002
16003
|
const shape = header(symbol2, "enum", indent2);
|
|
16003
16004
|
if (!shape)
|
|
16004
|
-
return void skipped.push({ path:
|
|
16005
|
+
return void skipped.push({ path: path160, reason: `unparsed enum ${text2(symbol2)}` });
|
|
16005
16006
|
const members2 = membersOf(id);
|
|
16006
16007
|
const cases = members2.filter(
|
|
16007
16008
|
(member) => member.kind.identifier === "swift.enum.case"
|
|
@@ -16011,7 +16012,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
16011
16012
|
const missing2 = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
|
|
16012
16013
|
if (raw2 && (isObjC(symbol2) || /^c:@C?M@[^@]+@E@/.test(id)) && missing2.length > 0)
|
|
16013
16014
|
return void skipped.push({
|
|
16014
|
-
path:
|
|
16015
|
+
path: path160,
|
|
16015
16016
|
reason: `no header value for ${missing2.map(leaf).join(", ")}`
|
|
16016
16017
|
});
|
|
16017
16018
|
const list2 = inheritance(id, raw2 ?? void 0).filter(
|
|
@@ -16050,8 +16051,8 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
16050
16051
|
});
|
|
16051
16052
|
}
|
|
16052
16053
|
if (options2.inert) {
|
|
16053
|
-
const value = options2.trapped?.has(hiddenInit(id)) ? null : inertValue(
|
|
16054
|
-
emitInertState(id, inner, value === null ? trap(
|
|
16054
|
+
const value = options2.trapped?.has(hiddenInit(id)) ? null : inertValue(path160, /* @__PURE__ */ new Set(), []);
|
|
16055
|
+
emitInertState(id, inner, value === null ? trap(path160) : `self = ${value}`);
|
|
16055
16056
|
}
|
|
16056
16057
|
emit(`${indent2}}`);
|
|
16057
16058
|
return;
|
|
@@ -16060,14 +16061,14 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
16060
16061
|
const shape = header(symbol2, "protocol", indent2);
|
|
16061
16062
|
if (!shape)
|
|
16062
16063
|
return void skipped.push({
|
|
16063
|
-
path:
|
|
16064
|
+
path: path160,
|
|
16064
16065
|
reason: `unparsed protocol ${text2(symbol2)}`
|
|
16065
16066
|
});
|
|
16066
16067
|
const native = nativeObjcProtocols.has(id);
|
|
16067
16068
|
const objcName = native ? /^c:objc\(pl\)(\w+)$/.exec(id)?.[1] : void 0;
|
|
16068
16069
|
if (native && !objcName)
|
|
16069
16070
|
return void skipped.push({
|
|
16070
|
-
path:
|
|
16071
|
+
path: path160,
|
|
16071
16072
|
reason: `unknown Objective-C protocol identity ${id}`
|
|
16072
16073
|
});
|
|
16073
16074
|
const list2 = [
|
|
@@ -16095,7 +16096,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
16095
16096
|
}
|
|
16096
16097
|
emit(`${indent2}}`);
|
|
16097
16098
|
if (defaults.length > 0) {
|
|
16098
|
-
emit(`${indent2}extension ${
|
|
16099
|
+
emit(`${indent2}extension ${path160} {`);
|
|
16099
16100
|
for (const member of defaults) {
|
|
16100
16101
|
const decl = text2(member);
|
|
16101
16102
|
if (optional3.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
|
|
@@ -16189,7 +16190,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
16189
16190
|
return null;
|
|
16190
16191
|
};
|
|
16191
16192
|
const emitGlobal = scoped((symbol2) => {
|
|
16192
|
-
const
|
|
16193
|
+
const path160 = pathOf(symbol2);
|
|
16193
16194
|
const kind = symbol2.kind.identifier;
|
|
16194
16195
|
if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
|
|
16195
16196
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text2(symbol2));
|
|
@@ -16198,20 +16199,20 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
16198
16199
|
if (leaf(symbol2).endsWith("(_:)") && !/^(?:prefix|infix|postfix)\b/.test(spelled2))
|
|
16199
16200
|
spelled2 = `prefix ${spelled2}`;
|
|
16200
16201
|
}
|
|
16201
|
-
const measured = behavior.get(
|
|
16202
|
-
if (measured) used.add(
|
|
16202
|
+
const measured = behavior.get(path160);
|
|
16203
|
+
if (measured) used.add(path160);
|
|
16203
16204
|
const overloadBody = /\basync\b/.test(spelled2) ? measured?.asyncBody : /\bResult</.test(spelled2) ? measured?.resultBody : void 0;
|
|
16204
16205
|
emit(
|
|
16205
|
-
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(
|
|
16206
|
+
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path160))} }`
|
|
16206
16207
|
);
|
|
16207
16208
|
} else if (kind === "swift.var") {
|
|
16208
16209
|
const parsed2 = splitAccessors(text2(symbol2).replace(/^let /, "var "));
|
|
16209
|
-
const measured = behavior.get(
|
|
16210
|
-
if (measured) used.add(
|
|
16210
|
+
const measured = behavior.get(path160);
|
|
16211
|
+
if (measured) used.add(path160);
|
|
16211
16212
|
emit(
|
|
16212
|
-
`public ${parsed2.decl} { ${measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(
|
|
16213
|
+
`public ${parsed2.decl} { ${measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path160))} }`
|
|
16213
16214
|
);
|
|
16214
|
-
} else skipped.push({ path:
|
|
16215
|
+
} else skipped.push({ path: path160, reason: `unhandled top-level ${kind}` });
|
|
16215
16216
|
});
|
|
16216
16217
|
const cExports = new Set(
|
|
16217
16218
|
[...byId.values()].flatMap((symbol2) => {
|
|
@@ -16228,7 +16229,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
16228
16229
|
return !name3 || !cExports.has(`${name3}|${text2(symbol2)}`);
|
|
16229
16230
|
}).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
|
|
16230
16231
|
for (const symbol2 of roots) {
|
|
16231
|
-
const
|
|
16232
|
+
const path160 = pathOf(symbol2);
|
|
16232
16233
|
if (TYPE_KINDS.has(symbol2.kind.identifier)) emitType(symbol2, "");
|
|
16233
16234
|
else emitGlobal(symbol2);
|
|
16234
16235
|
}
|
|
@@ -16308,9 +16309,9 @@ function emitSwiftStandin(sourceGraphs, options2) {
|
|
|
16308
16309
|
"#endif",
|
|
16309
16310
|
""
|
|
16310
16311
|
];
|
|
16311
|
-
for (const
|
|
16312
|
-
if (!used.has(
|
|
16313
|
-
skipped.push({ path:
|
|
16312
|
+
for (const path160 of behavior.keys())
|
|
16313
|
+
if (!used.has(path160))
|
|
16314
|
+
skipped.push({ path: path160, reason: "behavior names no emitted declaration" });
|
|
16314
16315
|
return {
|
|
16315
16316
|
source: `${[...banner, ...lines].join("\n")}
|
|
16316
16317
|
`,
|
|
@@ -21802,17 +21803,17 @@ function visit(node, visitor) {
|
|
|
21802
21803
|
} else
|
|
21803
21804
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
21804
21805
|
}
|
|
21805
|
-
function visit_(key2, node, visitor,
|
|
21806
|
-
const ctrl = callVisitor(key2, node, visitor,
|
|
21806
|
+
function visit_(key2, node, visitor, path160) {
|
|
21807
|
+
const ctrl = callVisitor(key2, node, visitor, path160);
|
|
21807
21808
|
if (isNode2(ctrl) || isPair(ctrl)) {
|
|
21808
|
-
replaceNode(key2,
|
|
21809
|
-
return visit_(key2, ctrl, visitor,
|
|
21809
|
+
replaceNode(key2, path160, ctrl);
|
|
21810
|
+
return visit_(key2, ctrl, visitor, path160);
|
|
21810
21811
|
}
|
|
21811
21812
|
if (typeof ctrl !== "symbol") {
|
|
21812
21813
|
if (isCollection(node)) {
|
|
21813
|
-
|
|
21814
|
+
path160 = Object.freeze(path160.concat(node));
|
|
21814
21815
|
for (let i = 0; i < node.items.length; ++i) {
|
|
21815
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
21816
|
+
const ci = visit_(i, node.items[i], visitor, path160);
|
|
21816
21817
|
if (typeof ci === "number")
|
|
21817
21818
|
i = ci - 1;
|
|
21818
21819
|
else if (ci === BREAK)
|
|
@@ -21823,13 +21824,13 @@ function visit_(key2, node, visitor, path159) {
|
|
|
21823
21824
|
}
|
|
21824
21825
|
}
|
|
21825
21826
|
} else if (isPair(node)) {
|
|
21826
|
-
|
|
21827
|
-
const ck = visit_("key", node.key, visitor,
|
|
21827
|
+
path160 = Object.freeze(path160.concat(node));
|
|
21828
|
+
const ck = visit_("key", node.key, visitor, path160);
|
|
21828
21829
|
if (ck === BREAK)
|
|
21829
21830
|
return BREAK;
|
|
21830
21831
|
else if (ck === REMOVE)
|
|
21831
21832
|
node.key = null;
|
|
21832
|
-
const cv = visit_("value", node.value, visitor,
|
|
21833
|
+
const cv = visit_("value", node.value, visitor, path160);
|
|
21833
21834
|
if (cv === BREAK)
|
|
21834
21835
|
return BREAK;
|
|
21835
21836
|
else if (cv === REMOVE)
|
|
@@ -21847,17 +21848,17 @@ async function visitAsync(node, visitor) {
|
|
|
21847
21848
|
} else
|
|
21848
21849
|
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
21849
21850
|
}
|
|
21850
|
-
async function visitAsync_(key2, node, visitor,
|
|
21851
|
-
const ctrl = await callVisitor(key2, node, visitor,
|
|
21851
|
+
async function visitAsync_(key2, node, visitor, path160) {
|
|
21852
|
+
const ctrl = await callVisitor(key2, node, visitor, path160);
|
|
21852
21853
|
if (isNode2(ctrl) || isPair(ctrl)) {
|
|
21853
|
-
replaceNode(key2,
|
|
21854
|
-
return visitAsync_(key2, ctrl, visitor,
|
|
21854
|
+
replaceNode(key2, path160, ctrl);
|
|
21855
|
+
return visitAsync_(key2, ctrl, visitor, path160);
|
|
21855
21856
|
}
|
|
21856
21857
|
if (typeof ctrl !== "symbol") {
|
|
21857
21858
|
if (isCollection(node)) {
|
|
21858
|
-
|
|
21859
|
+
path160 = Object.freeze(path160.concat(node));
|
|
21859
21860
|
for (let i = 0; i < node.items.length; ++i) {
|
|
21860
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
21861
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path160);
|
|
21861
21862
|
if (typeof ci === "number")
|
|
21862
21863
|
i = ci - 1;
|
|
21863
21864
|
else if (ci === BREAK)
|
|
@@ -21868,13 +21869,13 @@ async function visitAsync_(key2, node, visitor, path159) {
|
|
|
21868
21869
|
}
|
|
21869
21870
|
}
|
|
21870
21871
|
} else if (isPair(node)) {
|
|
21871
|
-
|
|
21872
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
21872
|
+
path160 = Object.freeze(path160.concat(node));
|
|
21873
|
+
const ck = await visitAsync_("key", node.key, visitor, path160);
|
|
21873
21874
|
if (ck === BREAK)
|
|
21874
21875
|
return BREAK;
|
|
21875
21876
|
else if (ck === REMOVE)
|
|
21876
21877
|
node.key = null;
|
|
21877
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
21878
|
+
const cv = await visitAsync_("value", node.value, visitor, path160);
|
|
21878
21879
|
if (cv === BREAK)
|
|
21879
21880
|
return BREAK;
|
|
21880
21881
|
else if (cv === REMOVE)
|
|
@@ -21901,23 +21902,23 @@ function initVisitor(visitor) {
|
|
|
21901
21902
|
}
|
|
21902
21903
|
return visitor;
|
|
21903
21904
|
}
|
|
21904
|
-
function callVisitor(key2, node, visitor,
|
|
21905
|
+
function callVisitor(key2, node, visitor, path160) {
|
|
21905
21906
|
if (typeof visitor === "function")
|
|
21906
|
-
return visitor(key2, node,
|
|
21907
|
+
return visitor(key2, node, path160);
|
|
21907
21908
|
if (isMap(node))
|
|
21908
|
-
return visitor.Map?.(key2, node,
|
|
21909
|
+
return visitor.Map?.(key2, node, path160);
|
|
21909
21910
|
if (isSeq(node))
|
|
21910
|
-
return visitor.Seq?.(key2, node,
|
|
21911
|
+
return visitor.Seq?.(key2, node, path160);
|
|
21911
21912
|
if (isPair(node))
|
|
21912
|
-
return visitor.Pair?.(key2, node,
|
|
21913
|
+
return visitor.Pair?.(key2, node, path160);
|
|
21913
21914
|
if (isScalar(node))
|
|
21914
|
-
return visitor.Scalar?.(key2, node,
|
|
21915
|
+
return visitor.Scalar?.(key2, node, path160);
|
|
21915
21916
|
if (isAlias(node))
|
|
21916
|
-
return visitor.Alias?.(key2, node,
|
|
21917
|
+
return visitor.Alias?.(key2, node, path160);
|
|
21917
21918
|
return void 0;
|
|
21918
21919
|
}
|
|
21919
|
-
function replaceNode(key2,
|
|
21920
|
-
const parent =
|
|
21920
|
+
function replaceNode(key2, path160, node) {
|
|
21921
|
+
const parent = path160[path160.length - 1];
|
|
21921
21922
|
if (isCollection(parent)) {
|
|
21922
21923
|
parent.items[key2] = node;
|
|
21923
21924
|
} else if (isPair(parent)) {
|
|
@@ -22517,10 +22518,10 @@ var init_createNode = __esm({
|
|
|
22517
22518
|
});
|
|
22518
22519
|
|
|
22519
22520
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
22520
|
-
function collectionFromPath(schema4,
|
|
22521
|
+
function collectionFromPath(schema4, path160, value) {
|
|
22521
22522
|
let v10 = value;
|
|
22522
|
-
for (let i =
|
|
22523
|
-
const k =
|
|
22523
|
+
for (let i = path160.length - 1; i >= 0; --i) {
|
|
22524
|
+
const k = path160[i];
|
|
22524
22525
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
22525
22526
|
const a = [];
|
|
22526
22527
|
a[k] = v10;
|
|
@@ -22545,7 +22546,7 @@ var init_Collection = __esm({
|
|
|
22545
22546
|
init_createNode();
|
|
22546
22547
|
init_identity();
|
|
22547
22548
|
init_Node();
|
|
22548
|
-
isEmptyPath = (
|
|
22549
|
+
isEmptyPath = (path160) => path160 == null || typeof path160 === "object" && !!path160[Symbol.iterator]().next().done;
|
|
22549
22550
|
Collection = class extends NodeBase {
|
|
22550
22551
|
constructor(type, schema4) {
|
|
22551
22552
|
super(type);
|
|
@@ -22575,11 +22576,11 @@ var init_Collection = __esm({
|
|
|
22575
22576
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
22576
22577
|
* that already exists in the map.
|
|
22577
22578
|
*/
|
|
22578
|
-
addIn(
|
|
22579
|
-
if (isEmptyPath(
|
|
22579
|
+
addIn(path160, value) {
|
|
22580
|
+
if (isEmptyPath(path160))
|
|
22580
22581
|
this.add(value);
|
|
22581
22582
|
else {
|
|
22582
|
-
const [key2, ...rest] =
|
|
22583
|
+
const [key2, ...rest] = path160;
|
|
22583
22584
|
const node = this.get(key2, true);
|
|
22584
22585
|
if (isCollection(node))
|
|
22585
22586
|
node.addIn(rest, value);
|
|
@@ -22593,8 +22594,8 @@ var init_Collection = __esm({
|
|
|
22593
22594
|
* Removes a value from the collection.
|
|
22594
22595
|
* @returns `true` if the item was found and removed.
|
|
22595
22596
|
*/
|
|
22596
|
-
deleteIn(
|
|
22597
|
-
const [key2, ...rest] =
|
|
22597
|
+
deleteIn(path160) {
|
|
22598
|
+
const [key2, ...rest] = path160;
|
|
22598
22599
|
if (rest.length === 0)
|
|
22599
22600
|
return this.delete(key2);
|
|
22600
22601
|
const node = this.get(key2, true);
|
|
@@ -22608,8 +22609,8 @@ var init_Collection = __esm({
|
|
|
22608
22609
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
22609
22610
|
* `true` (collections are always returned intact).
|
|
22610
22611
|
*/
|
|
22611
|
-
getIn(
|
|
22612
|
-
const [key2, ...rest] =
|
|
22612
|
+
getIn(path160, keepScalar) {
|
|
22613
|
+
const [key2, ...rest] = path160;
|
|
22613
22614
|
const node = this.get(key2, true);
|
|
22614
22615
|
if (rest.length === 0)
|
|
22615
22616
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -22627,8 +22628,8 @@ var init_Collection = __esm({
|
|
|
22627
22628
|
/**
|
|
22628
22629
|
* Checks if the collection includes a value with the key `key`.
|
|
22629
22630
|
*/
|
|
22630
|
-
hasIn(
|
|
22631
|
-
const [key2, ...rest] =
|
|
22631
|
+
hasIn(path160) {
|
|
22632
|
+
const [key2, ...rest] = path160;
|
|
22632
22633
|
if (rest.length === 0)
|
|
22633
22634
|
return this.has(key2);
|
|
22634
22635
|
const node = this.get(key2, true);
|
|
@@ -22638,8 +22639,8 @@ var init_Collection = __esm({
|
|
|
22638
22639
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
22639
22640
|
* boolean to add/remove the item from the set.
|
|
22640
22641
|
*/
|
|
22641
|
-
setIn(
|
|
22642
|
-
const [key2, ...rest] =
|
|
22642
|
+
setIn(path160, value) {
|
|
22643
|
+
const [key2, ...rest] = path160;
|
|
22643
22644
|
if (rest.length === 0) {
|
|
22644
22645
|
this.set(key2, value);
|
|
22645
22646
|
} else {
|
|
@@ -25073,9 +25074,9 @@ var init_Document = __esm({
|
|
|
25073
25074
|
this.contents.add(value);
|
|
25074
25075
|
}
|
|
25075
25076
|
/** Adds a value to the document. */
|
|
25076
|
-
addIn(
|
|
25077
|
+
addIn(path160, value) {
|
|
25077
25078
|
if (assertCollection(this.contents))
|
|
25078
|
-
this.contents.addIn(
|
|
25079
|
+
this.contents.addIn(path160, value);
|
|
25079
25080
|
}
|
|
25080
25081
|
/**
|
|
25081
25082
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -25150,14 +25151,14 @@ var init_Document = __esm({
|
|
|
25150
25151
|
* Removes a value from the document.
|
|
25151
25152
|
* @returns `true` if the item was found and removed.
|
|
25152
25153
|
*/
|
|
25153
|
-
deleteIn(
|
|
25154
|
-
if (isEmptyPath(
|
|
25154
|
+
deleteIn(path160) {
|
|
25155
|
+
if (isEmptyPath(path160)) {
|
|
25155
25156
|
if (this.contents == null)
|
|
25156
25157
|
return false;
|
|
25157
25158
|
this.contents = null;
|
|
25158
25159
|
return true;
|
|
25159
25160
|
}
|
|
25160
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
25161
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path160) : false;
|
|
25161
25162
|
}
|
|
25162
25163
|
/**
|
|
25163
25164
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -25172,10 +25173,10 @@ var init_Document = __esm({
|
|
|
25172
25173
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
25173
25174
|
* `true` (collections are always returned intact).
|
|
25174
25175
|
*/
|
|
25175
|
-
getIn(
|
|
25176
|
-
if (isEmptyPath(
|
|
25176
|
+
getIn(path160, keepScalar) {
|
|
25177
|
+
if (isEmptyPath(path160))
|
|
25177
25178
|
return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
|
|
25178
|
-
return isCollection(this.contents) ? this.contents.getIn(
|
|
25179
|
+
return isCollection(this.contents) ? this.contents.getIn(path160, keepScalar) : void 0;
|
|
25179
25180
|
}
|
|
25180
25181
|
/**
|
|
25181
25182
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -25186,10 +25187,10 @@ var init_Document = __esm({
|
|
|
25186
25187
|
/**
|
|
25187
25188
|
* Checks if the document includes a value at `path`.
|
|
25188
25189
|
*/
|
|
25189
|
-
hasIn(
|
|
25190
|
-
if (isEmptyPath(
|
|
25190
|
+
hasIn(path160) {
|
|
25191
|
+
if (isEmptyPath(path160))
|
|
25191
25192
|
return this.contents !== void 0;
|
|
25192
|
-
return isCollection(this.contents) ? this.contents.hasIn(
|
|
25193
|
+
return isCollection(this.contents) ? this.contents.hasIn(path160) : false;
|
|
25193
25194
|
}
|
|
25194
25195
|
/**
|
|
25195
25196
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -25206,13 +25207,13 @@ var init_Document = __esm({
|
|
|
25206
25207
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
25207
25208
|
* boolean to add/remove the item from the set.
|
|
25208
25209
|
*/
|
|
25209
|
-
setIn(
|
|
25210
|
-
if (isEmptyPath(
|
|
25210
|
+
setIn(path160, value) {
|
|
25211
|
+
if (isEmptyPath(path160)) {
|
|
25211
25212
|
this.contents = value;
|
|
25212
25213
|
} else if (this.contents == null) {
|
|
25213
|
-
this.contents = collectionFromPath(this.schema, Array.from(
|
|
25214
|
+
this.contents = collectionFromPath(this.schema, Array.from(path160), value);
|
|
25214
25215
|
} else if (assertCollection(this.contents)) {
|
|
25215
|
-
this.contents.setIn(
|
|
25216
|
+
this.contents.setIn(path160, value);
|
|
25216
25217
|
}
|
|
25217
25218
|
}
|
|
25218
25219
|
/**
|
|
@@ -27117,15 +27118,15 @@ function visit2(cst, visitor) {
|
|
|
27117
27118
|
cst = { start: cst.start, value: cst.value };
|
|
27118
27119
|
_visit(Object.freeze([]), cst, visitor);
|
|
27119
27120
|
}
|
|
27120
|
-
function _visit(
|
|
27121
|
-
let ctrl = visitor(item,
|
|
27121
|
+
function _visit(path160, item, visitor) {
|
|
27122
|
+
let ctrl = visitor(item, path160);
|
|
27122
27123
|
if (typeof ctrl === "symbol")
|
|
27123
27124
|
return ctrl;
|
|
27124
27125
|
for (const field of ["key", "value"]) {
|
|
27125
27126
|
const token = item[field];
|
|
27126
27127
|
if (token && "items" in token) {
|
|
27127
27128
|
for (let i = 0; i < token.items.length; ++i) {
|
|
27128
|
-
const ci = _visit(Object.freeze(
|
|
27129
|
+
const ci = _visit(Object.freeze(path160.concat([[field, i]])), token.items[i], visitor);
|
|
27129
27130
|
if (typeof ci === "number")
|
|
27130
27131
|
i = ci - 1;
|
|
27131
27132
|
else if (ci === BREAK2)
|
|
@@ -27136,10 +27137,10 @@ function _visit(path159, item, visitor) {
|
|
|
27136
27137
|
}
|
|
27137
27138
|
}
|
|
27138
27139
|
if (typeof ctrl === "function" && field === "key")
|
|
27139
|
-
ctrl = ctrl(item,
|
|
27140
|
+
ctrl = ctrl(item, path160);
|
|
27140
27141
|
}
|
|
27141
27142
|
}
|
|
27142
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
27143
|
+
return typeof ctrl === "function" ? ctrl(item, path160) : ctrl;
|
|
27143
27144
|
}
|
|
27144
27145
|
var BREAK2, SKIP2, REMOVE2;
|
|
27145
27146
|
var init_cst_visit = __esm({
|
|
@@ -27150,9 +27151,9 @@ var init_cst_visit = __esm({
|
|
|
27150
27151
|
visit2.BREAK = BREAK2;
|
|
27151
27152
|
visit2.SKIP = SKIP2;
|
|
27152
27153
|
visit2.REMOVE = REMOVE2;
|
|
27153
|
-
visit2.itemAtPath = (cst,
|
|
27154
|
+
visit2.itemAtPath = (cst, path160) => {
|
|
27154
27155
|
let item = cst;
|
|
27155
|
-
for (const [field, index] of
|
|
27156
|
+
for (const [field, index] of path160) {
|
|
27156
27157
|
const tok = item?.[field];
|
|
27157
27158
|
if (tok && "items" in tok) {
|
|
27158
27159
|
item = tok.items[index];
|
|
@@ -27161,9 +27162,9 @@ var init_cst_visit = __esm({
|
|
|
27161
27162
|
}
|
|
27162
27163
|
return item;
|
|
27163
27164
|
};
|
|
27164
|
-
visit2.parentCollection = (cst,
|
|
27165
|
-
const parent = visit2.itemAtPath(cst,
|
|
27166
|
-
const field =
|
|
27165
|
+
visit2.parentCollection = (cst, path160) => {
|
|
27166
|
+
const parent = visit2.itemAtPath(cst, path160.slice(0, -1));
|
|
27167
|
+
const field = path160[path160.length - 1][0];
|
|
27167
27168
|
const coll = parent?.[field];
|
|
27168
27169
|
if (coll && "items" in coll)
|
|
27169
27170
|
return coll;
|
|
@@ -28466,14 +28467,14 @@ var init_parser = __esm({
|
|
|
28466
28467
|
case "scalar":
|
|
28467
28468
|
case "single-quoted-scalar":
|
|
28468
28469
|
case "double-quoted-scalar": {
|
|
28469
|
-
const
|
|
28470
|
+
const fs122 = this.flowScalar(this.type);
|
|
28470
28471
|
if (atNextItem || it.value) {
|
|
28471
|
-
map2.items.push({ start, key:
|
|
28472
|
+
map2.items.push({ start, key: fs122, sep: [] });
|
|
28472
28473
|
this.onKeyLine = true;
|
|
28473
28474
|
} else if (it.sep) {
|
|
28474
|
-
this.stack.push(
|
|
28475
|
+
this.stack.push(fs122);
|
|
28475
28476
|
} else {
|
|
28476
|
-
Object.assign(it, { key:
|
|
28477
|
+
Object.assign(it, { key: fs122, sep: [] });
|
|
28477
28478
|
this.onKeyLine = true;
|
|
28478
28479
|
}
|
|
28479
28480
|
return;
|
|
@@ -28601,13 +28602,13 @@ var init_parser = __esm({
|
|
|
28601
28602
|
case "scalar":
|
|
28602
28603
|
case "single-quoted-scalar":
|
|
28603
28604
|
case "double-quoted-scalar": {
|
|
28604
|
-
const
|
|
28605
|
+
const fs122 = this.flowScalar(this.type);
|
|
28605
28606
|
if (!it || it.value)
|
|
28606
|
-
fc.items.push({ start: [], key:
|
|
28607
|
+
fc.items.push({ start: [], key: fs122, sep: [] });
|
|
28607
28608
|
else if (it.sep)
|
|
28608
|
-
this.stack.push(
|
|
28609
|
+
this.stack.push(fs122);
|
|
28609
28610
|
else
|
|
28610
|
-
Object.assign(it, { key:
|
|
28611
|
+
Object.assign(it, { key: fs122, sep: [] });
|
|
28611
28612
|
return;
|
|
28612
28613
|
}
|
|
28613
28614
|
case "flow-map-end":
|
|
@@ -29047,8 +29048,8 @@ function metadataValue(value, key2) {
|
|
|
29047
29048
|
if (!value || typeof value !== "object") return void 0;
|
|
29048
29049
|
return Object.getOwnPropertyDescriptor(value, key2)?.value;
|
|
29049
29050
|
}
|
|
29050
|
-
function readProjectJson(
|
|
29051
|
-
const text7 = readProjectMetadata(
|
|
29051
|
+
function readProjectJson(path160, files2 = nodeRepoFileReader) {
|
|
29052
|
+
const text7 = readProjectMetadata(path160, files2);
|
|
29052
29053
|
if (text7 === null) return null;
|
|
29053
29054
|
try {
|
|
29054
29055
|
const value = JSON.parse(text7);
|
|
@@ -29652,7 +29653,7 @@ function scanLocalNative(appDir, pkg, answered, platform3, knownPackages = /* @_
|
|
|
29652
29653
|
expoModule: moduleDir ? (0, import_node_path43.relative)(appDir, moduleDir) || "." : null,
|
|
29653
29654
|
optional: optional3,
|
|
29654
29655
|
swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
|
|
29655
|
-
(
|
|
29656
|
+
(path160) => path160.endsWith(".swift") && [...(readSmallFile(path160) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
|
|
29656
29657
|
(match) => match[1] === name3
|
|
29657
29658
|
)
|
|
29658
29659
|
) : false,
|
|
@@ -35333,9 +35334,9 @@ function originalColumn(line, column) {
|
|
|
35333
35334
|
}
|
|
35334
35335
|
function designTimeDiagnostic(output, files2) {
|
|
35335
35336
|
const rewritten = /* @__PURE__ */ new Map();
|
|
35336
|
-
const linesOf = (
|
|
35337
|
+
const linesOf = (path160) => {
|
|
35337
35338
|
const file = Object.keys(files2).find(
|
|
35338
|
-
(name3) => name3.endsWith(".swift") && (
|
|
35339
|
+
(name3) => name3.endsWith(".swift") && (path160 === name3 || path160.endsWith(`/${name3}`))
|
|
35339
35340
|
);
|
|
35340
35341
|
if (file === void 0) return null;
|
|
35341
35342
|
let lines = rewritten.get(file);
|
|
@@ -36723,15 +36724,15 @@ function readWasmLinkMap(file, partition) {
|
|
|
36723
36724
|
if (!input) continue;
|
|
36724
36725
|
const name3 = input[4];
|
|
36725
36726
|
const split = /^(.*?):\((.*)\)$/s.exec(name3);
|
|
36726
|
-
const
|
|
36727
|
-
const member = /\(([^()]+)\)$/.exec(
|
|
36727
|
+
const path160 = split ? split[1] : name3;
|
|
36728
|
+
const member = /\(([^()]+)\)$/.exec(path160);
|
|
36728
36729
|
previous = {
|
|
36729
|
-
inputFile:
|
|
36730
|
+
inputFile: path160,
|
|
36730
36731
|
segment: segment2,
|
|
36731
36732
|
address: hex(input[1]),
|
|
36732
36733
|
offset: parseInt(input[2], 16),
|
|
36733
36734
|
size: parseInt(input[3], 16),
|
|
36734
|
-
object: (member ? member[1] : (0, import_node_path56.basename)(
|
|
36735
|
+
object: (member ? member[1] : (0, import_node_path56.basename)(path160)).replace(/^lib\w*?__/, ""),
|
|
36735
36736
|
section: split ? split[2] : "",
|
|
36736
36737
|
symbols: []
|
|
36737
36738
|
};
|
|
@@ -45118,13 +45119,13 @@ function swiftSdkGuestLookups(moduleRoot, sdkRoot, objects) {
|
|
|
45118
45119
|
const shared = /* @__PURE__ */ new Set();
|
|
45119
45120
|
const sdkWeakReferences = /* @__PURE__ */ new Map();
|
|
45120
45121
|
for (const objects2 of groups.values())
|
|
45121
|
-
for (const { path:
|
|
45122
|
+
for (const { path: path160, bytes } of objects2) {
|
|
45122
45123
|
const defined = guestWasmSymbols(bytes);
|
|
45123
45124
|
for (const name3 of defined.defined) symbols.add(name3);
|
|
45124
45125
|
for (const name3 of defined.tags) shared.add(name3);
|
|
45125
45126
|
for (const name3 of defined.globals) shared.add(name3);
|
|
45126
45127
|
if (defined.weakUndefined.length)
|
|
45127
|
-
sdkWeakReferences.set(
|
|
45128
|
+
sdkWeakReferences.set(path160, new Set(defined.weakUndefined));
|
|
45128
45129
|
}
|
|
45129
45130
|
return createGuestImageLedger({
|
|
45130
45131
|
images,
|
|
@@ -50224,7 +50225,7 @@ async function compileGuestLink(options2) {
|
|
|
50224
50225
|
let lazyFunctions = [];
|
|
50225
50226
|
let dyldSymbols = [];
|
|
50226
50227
|
const bundlePaths = new Map(
|
|
50227
|
-
options2.resourceBundles.map(({ target, path:
|
|
50228
|
+
options2.resourceBundles.map(({ target, path: path160 }) => [target, path160])
|
|
50228
50229
|
);
|
|
50229
50230
|
const imageMetadata = (products) => {
|
|
50230
50231
|
const source = sourceImages.map((image) => {
|
|
@@ -52925,7 +52926,7 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
|
|
|
52925
52926
|
);
|
|
52926
52927
|
const names = /* @__PURE__ */ new Set([...frameworks, ...targets.map((target) => target.name)]);
|
|
52927
52928
|
const entriesByPrefix = new Map(
|
|
52928
|
-
targets.map(({ path:
|
|
52929
|
+
targets.map(({ path: path160 }) => [path160 === "." ? "" : `${path160}/`, []])
|
|
52929
52930
|
);
|
|
52930
52931
|
for (const entry of Object.entries(files2)) {
|
|
52931
52932
|
const [file] = entry;
|
|
@@ -52960,7 +52961,7 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
|
|
|
52960
52961
|
(excluded) => relative5 === excluded || relative5.startsWith(`${excluded}/`)
|
|
52961
52962
|
))
|
|
52962
52963
|
continue;
|
|
52963
|
-
if (nested.some((
|
|
52964
|
+
if (nested.some((path160) => file.startsWith(path160))) continue;
|
|
52964
52965
|
const imports2 = file.endsWith(".swift") ? swiftImportNames(contents2) : SWIFT_NATIVE_SOURCE_EXTENSIONS.some((extension) => file.endsWith(extension)) ? clangImportNames(contents2, ownsHeader) : [];
|
|
52965
52966
|
for (const name3 of imports2) {
|
|
52966
52967
|
if (names.has(name3) && name3 !== target.name && !(target.dependencies !== void 0 && localNames.has(name3)))
|
|
@@ -61733,16 +61734,16 @@ var init_pods_files = __esm({
|
|
|
61733
61734
|
};
|
|
61734
61735
|
unique = (values) => [...new Set(values)];
|
|
61735
61736
|
XCFramework = class {
|
|
61736
|
-
constructor(targetName,
|
|
61737
|
+
constructor(targetName, path160) {
|
|
61737
61738
|
this.targetName = targetName;
|
|
61738
|
-
this.path =
|
|
61739
|
-
const plist6 = parsePlistBytes(import_node_fs85.default.readFileSync(`${
|
|
61739
|
+
this.path = path160;
|
|
61740
|
+
const plist6 = parsePlistBytes(import_node_fs85.default.readFileSync(`${path160}/Info.plist`));
|
|
61740
61741
|
if (!isRecord(plist6) || !Array.isArray(plist6.AvailableLibraries))
|
|
61741
|
-
throw new Error(`${
|
|
61742
|
+
throw new Error(`${path160}/Info.plist declares no AvailableLibraries`);
|
|
61742
61743
|
this.slices = plist6.AvailableLibraries.map((library) => {
|
|
61743
61744
|
if (!isRecord(library) || typeof library.LibraryIdentifier !== "string" || typeof library.LibraryPath !== "string" || typeof library.SupportedPlatform !== "string")
|
|
61744
|
-
throw new Error(`${
|
|
61745
|
-
const root = `${
|
|
61745
|
+
throw new Error(`${path160}/Info.plist has an invalid library entry`);
|
|
61746
|
+
const root = `${path160}/${library.LibraryIdentifier}`;
|
|
61746
61747
|
const slicePath = `${root}/${library.LibraryPath}`;
|
|
61747
61748
|
const extension = slicePath.slice(slicePath.lastIndexOf("."));
|
|
61748
61749
|
const packaging = extension === ".framework" ? "framework" : extension === ".a" || extension === ".dylib" ? "library" : null;
|
|
@@ -61764,7 +61765,7 @@ var init_pods_files = __esm({
|
|
|
61764
61765
|
}).sort((a, b) => byBytes2(a.identifier, b.identifier));
|
|
61765
61766
|
if (this.slices.length === 0)
|
|
61766
61767
|
throw new Error(
|
|
61767
|
-
`XCFramework at ${
|
|
61768
|
+
`XCFramework at ${path160} does not contain any frameworks or libraries.`
|
|
61768
61769
|
);
|
|
61769
61770
|
}
|
|
61770
61771
|
slices;
|
|
@@ -63618,9 +63619,9 @@ echo "SUCCESS" > "\${SCRIPT_OUTPUT_FILE_0}"
|
|
|
63618
63619
|
DEFAULT_SHELL_SCRIPT = "# Type a script or drag a script file from your workspace to insert its path.\n";
|
|
63619
63620
|
stringList2 = (value) => Array.isArray(value) && value.every((item) => typeof item === "string") ? value : null;
|
|
63620
63621
|
UserProject = class {
|
|
63621
|
-
constructor(table,
|
|
63622
|
+
constructor(table, path160, objectVersion) {
|
|
63622
63623
|
this.table = table;
|
|
63623
|
-
this.path =
|
|
63624
|
+
this.path = path160;
|
|
63624
63625
|
this.objectVersion = objectVersion;
|
|
63625
63626
|
}
|
|
63626
63627
|
get projectDir() {
|
|
@@ -70816,14 +70817,14 @@ function addAsset(into, asset) {
|
|
|
70816
70817
|
function checkStack(dir, type, devices2) {
|
|
70817
70818
|
const sets = (parent, allowed) => (0, import_node_fs94.readdirSync)(parent, { withFileTypes: true }).flatMap((entry) => {
|
|
70818
70819
|
if (entry.name.startsWith(".") || entry.isFile()) return [];
|
|
70819
|
-
const
|
|
70820
|
+
const path160 = (0, import_node_path96.join)(parent, entry.name);
|
|
70820
70821
|
const extension = (0, import_node_path96.extname)(entry.name);
|
|
70821
70822
|
if (!entry.isDirectory() || !allowed.includes(extension))
|
|
70822
70823
|
return refuse(
|
|
70823
|
-
|
|
70824
|
+
path160,
|
|
70824
70825
|
`image stack content other than ${allowed.join(", ")} is unproven`
|
|
70825
70826
|
);
|
|
70826
|
-
return [{ path:
|
|
70827
|
+
return [{ path: path160, extension }];
|
|
70827
70828
|
});
|
|
70828
70829
|
for (const layer of sets(dir, [`.${type}layer`, ".imageset", ".colorset"])) {
|
|
70829
70830
|
if (layer.extension !== `.${type}layer`) continue;
|
|
@@ -70835,37 +70836,37 @@ function checkStack(dir, type, devices2) {
|
|
|
70835
70836
|
function walk(dir, into, devices2, extensions) {
|
|
70836
70837
|
for (const entry of (0, import_node_fs94.readdirSync)(dir, { withFileTypes: true })) {
|
|
70837
70838
|
if (entry.name.startsWith(".") || entry.isFile()) continue;
|
|
70838
|
-
const
|
|
70839
|
-
if (!entry.isDirectory()) return refuse(
|
|
70839
|
+
const path160 = (0, import_node_path96.join)(dir, entry.name);
|
|
70840
|
+
if (!entry.isDirectory()) return refuse(path160, "it is neither a file nor a directory");
|
|
70840
70841
|
const extension = (0, import_node_path96.extname)(entry.name).slice(1);
|
|
70841
70842
|
const type = extension.toLowerCase();
|
|
70842
70843
|
const base2 = entry.name.slice(0, entry.name.length - extension.length - 1);
|
|
70843
70844
|
if (type !== extension && knownTypes.has(type))
|
|
70844
|
-
return refuse(
|
|
70845
|
+
return refuse(path160, "its type extension is not lowercase");
|
|
70845
70846
|
if (type === "colorset" || type === "imageset" || type === "symbolset") {
|
|
70846
70847
|
addAsset(into, {
|
|
70847
70848
|
kind: type === "colorset" ? "color" : "image",
|
|
70848
70849
|
name: base2,
|
|
70849
|
-
...assetState(
|
|
70850
|
+
...assetState(path160, type, devices2),
|
|
70850
70851
|
extensions,
|
|
70851
|
-
source:
|
|
70852
|
+
source: path160
|
|
70852
70853
|
});
|
|
70853
70854
|
continue;
|
|
70854
70855
|
}
|
|
70855
70856
|
if (silentTypes.has(type)) continue;
|
|
70856
70857
|
if (stackTypes.has(type)) {
|
|
70857
|
-
checkStack(
|
|
70858
|
+
checkStack(path160, type, devices2);
|
|
70858
70859
|
continue;
|
|
70859
70860
|
}
|
|
70860
|
-
if (unprovenTypes.has(type)) return refuse(
|
|
70861
|
+
if (unprovenTypes.has(type)) return refuse(path160, `${type} assets are unproven`);
|
|
70861
70862
|
const name3 = type === "spriteatlas" ? base2 : entry.name;
|
|
70862
|
-
if (!folderProperties((0, import_node_path96.join)(
|
|
70863
|
-
walk(
|
|
70863
|
+
if (!folderProperties((0, import_node_path96.join)(path160, "Contents.json")).namespace) {
|
|
70864
|
+
walk(path160, into, devices2, extensions);
|
|
70864
70865
|
continue;
|
|
70865
70866
|
}
|
|
70866
|
-
const child = into.namespaces.get(name3) ?? scope(
|
|
70867
|
+
const child = into.namespaces.get(name3) ?? scope(path160);
|
|
70867
70868
|
into.namespaces.set(name3, child);
|
|
70868
|
-
walk(
|
|
70869
|
+
walk(path160, child, devices2, extensions);
|
|
70869
70870
|
}
|
|
70870
70871
|
}
|
|
70871
70872
|
function words(name3) {
|
|
@@ -70912,11 +70913,11 @@ function members(into, kind, prefix, extensions) {
|
|
|
70912
70913
|
const assets2 = /* @__PURE__ */ new Set();
|
|
70913
70914
|
const out = [];
|
|
70914
70915
|
for (const entry of entries2) {
|
|
70915
|
-
const
|
|
70916
|
+
const path160 = `${prefix}${entry.name}`;
|
|
70916
70917
|
const source = entry.child ? entry.child.source : entry.asset.source;
|
|
70917
70918
|
if (Array.from(entry.name).some((char) => char.charCodeAt(0) > 127))
|
|
70918
70919
|
refuse(source, "its name is not ASCII");
|
|
70919
|
-
const named = (text8) => `The \\"${escape(
|
|
70920
|
+
const named = (text8) => `The \\"${escape(path160)}\\" ${text8}`;
|
|
70920
70921
|
if (entry.child) {
|
|
70921
70922
|
const text8 = symbol(entry.name, true);
|
|
70922
70923
|
if (!text8)
|
|
@@ -70939,9 +70940,9 @@ function members(into, kind, prefix, extensions) {
|
|
|
70939
70940
|
namespaces.add(text8);
|
|
70940
70941
|
out.push({
|
|
70941
70942
|
type: "namespace",
|
|
70942
|
-
path:
|
|
70943
|
+
path: path160,
|
|
70943
70944
|
symbol: spelled(text8),
|
|
70944
|
-
members: members(entry.child, kind, `${
|
|
70945
|
+
members: members(entry.child, kind, `${path160}/`, extensions)
|
|
70945
70946
|
});
|
|
70946
70947
|
}
|
|
70947
70948
|
continue;
|
|
@@ -70968,7 +70969,7 @@ function members(into, kind, prefix, extensions) {
|
|
|
70968
70969
|
else if (!omitted)
|
|
70969
70970
|
out.push({
|
|
70970
70971
|
type: "asset",
|
|
70971
|
-
path:
|
|
70972
|
+
path: path160,
|
|
70972
70973
|
name: entry.name,
|
|
70973
70974
|
symbol: spelled(text7),
|
|
70974
70975
|
thinnable: asset.thinnable,
|
|
@@ -71249,8 +71250,8 @@ var init_xcode_asset_symbols = __esm({
|
|
|
71249
71250
|
import_node_path96 = require("node:path");
|
|
71250
71251
|
Refusal = class extends Error {
|
|
71251
71252
|
};
|
|
71252
|
-
refuse = (
|
|
71253
|
-
throw new Refusal(`Generated asset symbols are unproven for ${
|
|
71253
|
+
refuse = (path160, reason) => {
|
|
71254
|
+
throw new Refusal(`Generated asset symbols are unproven for ${path160}: ${reason}`);
|
|
71254
71255
|
};
|
|
71255
71256
|
isRecord5 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
71256
71257
|
scope = (source) => ({
|
|
@@ -71696,11 +71697,11 @@ function catalogDigest(directory2) {
|
|
|
71696
71697
|
for (const entry of (0, import_node_fs95.readdirSync)(dir, { withFileTypes: true }).sort(
|
|
71697
71698
|
(a, b) => a.name.localeCompare(b.name)
|
|
71698
71699
|
)) {
|
|
71699
|
-
const
|
|
71700
|
-
if (entry.isDirectory()) walk4(
|
|
71701
|
-
else if (entry.isFile() && (0, import_node_fs95.statSync)(
|
|
71702
|
-
hashes.push([(0, import_node_path97.relative)(directory2,
|
|
71703
|
-
else throw new Error(`Unsupported asset catalog entry: ${
|
|
71700
|
+
const path160 = (0, import_node_path97.join)(dir, entry.name);
|
|
71701
|
+
if (entry.isDirectory()) walk4(path160);
|
|
71702
|
+
else if (entry.isFile() && (0, import_node_fs95.statSync)(path160).size <= 64 * 1024 * 1024)
|
|
71703
|
+
hashes.push([(0, import_node_path97.relative)(directory2, path160), sha2562((0, import_node_fs95.readFileSync)(path160))]);
|
|
71704
|
+
else throw new Error(`Unsupported asset catalog entry: ${path160}`);
|
|
71704
71705
|
}
|
|
71705
71706
|
};
|
|
71706
71707
|
walk4(directory2);
|
|
@@ -71711,7 +71712,7 @@ function symbolSource(plan, root) {
|
|
|
71711
71712
|
const known = symbolTexts.get(key2);
|
|
71712
71713
|
if (known !== void 0) return { status: "source", text: known };
|
|
71713
71714
|
const source = assetSymbolSource(
|
|
71714
|
-
plan.catalogs.map(({ path:
|
|
71715
|
+
plan.catalogs.map(({ path: path160 }) => (0, import_node_path97.join)(root, path160)),
|
|
71715
71716
|
plan.settings
|
|
71716
71717
|
);
|
|
71717
71718
|
if (source.status === "source") symbolTexts.set(key2, source.text);
|
|
@@ -71770,9 +71771,9 @@ function planAssetSymbols(resources, root, settings) {
|
|
|
71770
71771
|
`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}".`
|
|
71771
71772
|
);
|
|
71772
71773
|
const plan = {
|
|
71773
|
-
catalogs: catalogs.map((
|
|
71774
|
-
path:
|
|
71775
|
-
sha256: catalogDigest((0, import_node_path97.join)(root,
|
|
71774
|
+
catalogs: catalogs.map((path160) => ({
|
|
71775
|
+
path: path160,
|
|
71776
|
+
sha256: catalogDigest((0, import_node_path97.join)(root, path160))
|
|
71776
71777
|
})),
|
|
71777
71778
|
settings: { deployment: target, devices: devices2, extensions: extensions === "YES" }
|
|
71778
71779
|
};
|
|
@@ -79016,9 +79017,9 @@ function hashPackageTree(root, options2) {
|
|
|
79016
79017
|
(a, b) => options2.compareNames(a.name, b.name)
|
|
79017
79018
|
)) {
|
|
79018
79019
|
if (entry.name === "node_modules") continue;
|
|
79019
|
-
const
|
|
79020
|
-
if (entry.isDirectory()) walk4((0, import_node_path106.join)(directory2, entry.name), `${
|
|
79021
|
-
else if (entry.isFile() && !options2.skipFile?.(entry.name)) files2.push(
|
|
79020
|
+
const path160 = `${relative5}${entry.name}`;
|
|
79021
|
+
if (entry.isDirectory()) walk4((0, import_node_path106.join)(directory2, entry.name), `${path160}/`);
|
|
79022
|
+
else if (entry.isFile() && !options2.skipFile?.(entry.name)) files2.push(path160);
|
|
79022
79023
|
}
|
|
79023
79024
|
};
|
|
79024
79025
|
walk4(root, "");
|
|
@@ -81022,7 +81023,7 @@ function resolveSwiftPackages(options2) {
|
|
|
81022
81023
|
headers.set(name3, import_node_path113.default.relative(binary2.dir, dir));
|
|
81023
81024
|
};
|
|
81024
81025
|
visit3(pkg, binary2.target);
|
|
81025
|
-
binary2.headerDependencies = [...headers].map(([module2,
|
|
81026
|
+
binary2.headerDependencies = [...headers].map(([module2, path160]) => ({ module: module2, path: path160 }));
|
|
81026
81027
|
}
|
|
81027
81028
|
for (const owner of options2.owners ?? []) {
|
|
81028
81029
|
const found2 = productClosure(owner.products);
|
|
@@ -82844,8 +82845,8 @@ function withBuiltinStandinBehavior(behavior) {
|
|
|
82844
82845
|
for (const [module2, members2] of Object.entries(BUILTIN_STANDIN_BEHAVIOR))
|
|
82845
82846
|
merged[module2] = {
|
|
82846
82847
|
...Object.fromEntries(
|
|
82847
|
-
Object.entries(members2).map(([
|
|
82848
|
-
|
|
82848
|
+
Object.entries(members2).map(([path160, entry]) => [
|
|
82849
|
+
path160,
|
|
82849
82850
|
{ ...entry, builtin: true }
|
|
82850
82851
|
])
|
|
82851
82852
|
),
|
|
@@ -88042,10 +88043,10 @@ var require_path_parse = __commonJS({
|
|
|
88042
88043
|
code === 45 || /* - */
|
|
88043
88044
|
code === 46;
|
|
88044
88045
|
}
|
|
88045
|
-
function State(
|
|
88046
|
+
function State(path160) {
|
|
88046
88047
|
this.index = 0;
|
|
88047
|
-
this.path =
|
|
88048
|
-
this.max =
|
|
88048
|
+
this.path = path160;
|
|
88049
|
+
this.max = path160.length;
|
|
88049
88050
|
this.result = [];
|
|
88050
88051
|
this.param = 0;
|
|
88051
88052
|
this.err = "";
|
|
@@ -88419,7 +88420,7 @@ var require_a2c = __commonJS({
|
|
|
88419
88420
|
}
|
|
88420
88421
|
return sign * Math.acos(dot);
|
|
88421
88422
|
}
|
|
88422
|
-
function get_arc_center(x1, y1, x2, y2, fa,
|
|
88423
|
+
function get_arc_center(x1, y1, x2, y2, fa, fs122, rx, ry, sin_phi, cos_phi) {
|
|
88423
88424
|
var x1p = cos_phi * (x1 - x2) / 2 + sin_phi * (y1 - y2) / 2;
|
|
88424
88425
|
var y1p = -sin_phi * (x1 - x2) / 2 + cos_phi * (y1 - y2) / 2;
|
|
88425
88426
|
var rx_sq = rx * rx;
|
|
@@ -88431,7 +88432,7 @@ var require_a2c = __commonJS({
|
|
|
88431
88432
|
radicant = 0;
|
|
88432
88433
|
}
|
|
88433
88434
|
radicant /= rx_sq * y1p_sq + ry_sq * x1p_sq;
|
|
88434
|
-
radicant = Math.sqrt(radicant) * (fa ===
|
|
88435
|
+
radicant = Math.sqrt(radicant) * (fa === fs122 ? -1 : 1);
|
|
88435
88436
|
var cxp = radicant * rx / ry * y1p;
|
|
88436
88437
|
var cyp = radicant * -ry / rx * x1p;
|
|
88437
88438
|
var cx = cos_phi * cxp - sin_phi * cyp + (x1 + x2) / 2;
|
|
@@ -88442,10 +88443,10 @@ var require_a2c = __commonJS({
|
|
|
88442
88443
|
var v2y = (-y1p - cyp) / ry;
|
|
88443
88444
|
var theta1 = unit_vector_angle(1, 0, v1x, v1y);
|
|
88444
88445
|
var delta_theta = unit_vector_angle(v1x, v1y, v2x, v2y);
|
|
88445
|
-
if (
|
|
88446
|
+
if (fs122 === 0 && delta_theta > 0) {
|
|
88446
88447
|
delta_theta -= TAU;
|
|
88447
88448
|
}
|
|
88448
|
-
if (
|
|
88449
|
+
if (fs122 === 1 && delta_theta < 0) {
|
|
88449
88450
|
delta_theta += TAU;
|
|
88450
88451
|
}
|
|
88451
88452
|
return [cx, cy, theta1, delta_theta];
|
|
@@ -88458,7 +88459,7 @@ var require_a2c = __commonJS({
|
|
|
88458
88459
|
var y2 = Math.sin(theta1 + delta_theta);
|
|
88459
88460
|
return [x1, y1, x1 - y1 * alpha, y1 + x1 * alpha, x2 + y2 * alpha, y2 - x2 * alpha, x2, y2];
|
|
88460
88461
|
}
|
|
88461
|
-
module2.exports = function a2c(x1, y1, x2, y2, fa,
|
|
88462
|
+
module2.exports = function a2c(x1, y1, x2, y2, fa, fs122, rx, ry, phi) {
|
|
88462
88463
|
var sin_phi = Math.sin(phi * TAU / 360);
|
|
88463
88464
|
var cos_phi = Math.cos(phi * TAU / 360);
|
|
88464
88465
|
var x1p = cos_phi * (x1 - x2) / 2 + sin_phi * (y1 - y2) / 2;
|
|
@@ -88476,7 +88477,7 @@ var require_a2c = __commonJS({
|
|
|
88476
88477
|
rx *= Math.sqrt(lambda);
|
|
88477
88478
|
ry *= Math.sqrt(lambda);
|
|
88478
88479
|
}
|
|
88479
|
-
var cc = get_arc_center(x1, y1, x2, y2, fa,
|
|
88480
|
+
var cc = get_arc_center(x1, y1, x2, y2, fa, fs122, rx, ry, sin_phi, cos_phi);
|
|
88480
88481
|
var result = [];
|
|
88481
88482
|
var theta1 = cc[2];
|
|
88482
88483
|
var delta_theta = cc[3];
|
|
@@ -88565,11 +88566,11 @@ var require_svgpath = __commonJS({
|
|
|
88565
88566
|
var matrix = require_matrix();
|
|
88566
88567
|
var a2c = require_a2c();
|
|
88567
88568
|
var ellipse = require_ellipse();
|
|
88568
|
-
function SvgPath(
|
|
88569
|
+
function SvgPath(path160) {
|
|
88569
88570
|
if (!(this instanceof SvgPath)) {
|
|
88570
|
-
return new SvgPath(
|
|
88571
|
+
return new SvgPath(path160);
|
|
88571
88572
|
}
|
|
88572
|
-
var pstate = pathParse(
|
|
88573
|
+
var pstate = pathParse(path160);
|
|
88573
88574
|
this.segments = pstate.segments;
|
|
88574
88575
|
this.err = pstate.err;
|
|
88575
88576
|
this.__stack = [];
|
|
@@ -89052,8 +89053,8 @@ function imagesetFiles(images) {
|
|
|
89052
89053
|
function bundleImageRenditionKey(file, scale) {
|
|
89053
89054
|
return extOf(file) === ".svg" ? `${file}/${scale}x.png` : file;
|
|
89054
89055
|
}
|
|
89055
|
-
function flatScale(
|
|
89056
|
-
const match = /@([23])x\.[^./]+$/.exec(
|
|
89056
|
+
function flatScale(path160) {
|
|
89057
|
+
const match = /@([23])x\.[^./]+$/.exec(path160);
|
|
89057
89058
|
return match ? Number(match[1]) : 1;
|
|
89058
89059
|
}
|
|
89059
89060
|
function providesNamespace(text7) {
|
|
@@ -89080,8 +89081,8 @@ function catalogEntryName(contentsPath, kind, readText) {
|
|
|
89080
89081
|
}
|
|
89081
89082
|
return segments.join("/");
|
|
89082
89083
|
}
|
|
89083
|
-
function isFlatResourceImage(
|
|
89084
|
-
return
|
|
89084
|
+
function isFlatResourceImage(path160) {
|
|
89085
|
+
return path160.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path160));
|
|
89085
89086
|
}
|
|
89086
89087
|
function enumerateBundleImages(paths, readText, bundleForFile = () => ".") {
|
|
89087
89088
|
const table = [];
|
|
@@ -89094,7 +89095,7 @@ function enumerateBundleImages(paths, readText, bundleForFile = () => ".") {
|
|
|
89094
89095
|
seen.set(bundlePath, names);
|
|
89095
89096
|
return { bundlePath, names };
|
|
89096
89097
|
};
|
|
89097
|
-
const catalogs = paths.filter((
|
|
89098
|
+
const catalogs = paths.filter((path160) => baseOf(path160) === "Contents.json");
|
|
89098
89099
|
for (const contentsPath of catalogs) {
|
|
89099
89100
|
const name3 = catalogEntryName(contentsPath, ".imageset", readText);
|
|
89100
89101
|
if (name3 === null) continue;
|
|
@@ -89127,16 +89128,16 @@ function enumerateBundleImages(paths, readText, bundleForFile = () => ".") {
|
|
|
89127
89128
|
...intent === "template" || intent === "original" ? { renderingMode: intent } : {}
|
|
89128
89129
|
});
|
|
89129
89130
|
}
|
|
89130
|
-
for (const
|
|
89131
|
-
if (!isFlatResourceImage(
|
|
89132
|
-
const filename = baseOf(
|
|
89131
|
+
for (const path160 of paths) {
|
|
89132
|
+
if (!isFlatResourceImage(path160)) continue;
|
|
89133
|
+
const filename = baseOf(path160);
|
|
89133
89134
|
const name3 = filename.slice(0, -extOf(filename).length);
|
|
89134
|
-
const { bundlePath, names } = namesFor(
|
|
89135
|
+
const { bundlePath, names } = namesFor(path160);
|
|
89135
89136
|
if (name3 === "" || names.has(name3)) continue;
|
|
89136
89137
|
names.add(name3);
|
|
89137
89138
|
const scaledFilename = filename.replace(/@[23]x(?=\.[^./]+$)/, "");
|
|
89138
89139
|
const fileNames = (scaledFilename === filename ? [filename] : [filename, scaledFilename]).filter((lookup4) => !names.has(lookup4));
|
|
89139
|
-
table.push({ name: name3, file:
|
|
89140
|
+
table.push({ name: name3, file: path160, scale: flatScale(path160), bundlePath, fileNames });
|
|
89140
89141
|
}
|
|
89141
89142
|
return table;
|
|
89142
89143
|
}
|
|
@@ -89171,7 +89172,7 @@ function colorsetValue(color) {
|
|
|
89171
89172
|
}
|
|
89172
89173
|
function enumerateBundleColors(paths, readText) {
|
|
89173
89174
|
const table = {};
|
|
89174
|
-
for (const contentsPath of paths.filter((
|
|
89175
|
+
for (const contentsPath of paths.filter((path160) => baseOf(path160) === "Contents.json")) {
|
|
89175
89176
|
const name3 = catalogEntryName(contentsPath, ".colorset", readText);
|
|
89176
89177
|
if (name3 === null || name3 in table) continue;
|
|
89177
89178
|
let colors;
|
|
@@ -89235,8 +89236,8 @@ function axisExtremes(points) {
|
|
|
89235
89236
|
function pathBounds(d) {
|
|
89236
89237
|
const xs = [];
|
|
89237
89238
|
const ys = [];
|
|
89238
|
-
for (const
|
|
89239
|
-
(0, import_svgpath.default)(
|
|
89239
|
+
for (const path160 of d)
|
|
89240
|
+
(0, import_svgpath.default)(path160).abs().unshort().unarc().iterate((segment2, _index, x, y) => {
|
|
89240
89241
|
const [command, ...args] = segment2;
|
|
89241
89242
|
if (command === "M" || command === "L") {
|
|
89242
89243
|
xs.push(Number(args[0]));
|
|
@@ -89302,7 +89303,7 @@ function guide(elements, id, axis) {
|
|
|
89302
89303
|
}
|
|
89303
89304
|
function enumerateBundleSymbols(paths, readText, bundleForFile) {
|
|
89304
89305
|
const table = {};
|
|
89305
|
-
for (const contentsPath of paths.filter((
|
|
89306
|
+
for (const contentsPath of paths.filter((path160) => baseOf(path160) === "Contents.json")) {
|
|
89306
89307
|
const name3 = catalogEntryName(contentsPath, ".symbolset", readText);
|
|
89307
89308
|
if (name3 === null) continue;
|
|
89308
89309
|
const bundle = bundleForFile(contentsPath);
|
|
@@ -89368,8 +89369,8 @@ function enumerateBundleSymbols(paths, readText, bundleForFile) {
|
|
|
89368
89369
|
advance,
|
|
89369
89370
|
box: [12 - wide2 / 2, 12 - tall / 2, wide2, tall],
|
|
89370
89371
|
...bearings ? { customLayout: { bearings, verticalOutset, descent } } : {},
|
|
89371
|
-
layers: d.map((
|
|
89372
|
-
d: (0, import_svgpath.default)(
|
|
89372
|
+
layers: d.map((path160) => ({
|
|
89373
|
+
d: (0, import_svgpath.default)(path160).abs().scale(em).translate(translateX, translateY).round(3).toString()
|
|
89373
89374
|
}))
|
|
89374
89375
|
};
|
|
89375
89376
|
table[vectorKey] = vector;
|
|
@@ -89380,13 +89381,13 @@ function enumerateBundleSymbols(paths, readText, bundleForFile) {
|
|
|
89380
89381
|
}
|
|
89381
89382
|
return table;
|
|
89382
89383
|
}
|
|
89383
|
-
function isCopiedResource(
|
|
89384
|
-
const segments =
|
|
89384
|
+
function isCopiedResource(path160, copiedBundle, copyLooseRasters) {
|
|
89385
|
+
const segments = path160.split("/");
|
|
89385
89386
|
if (segments.some((segment2) => /\.(atlasc|bundle|storyboardc|nib|momd)$/.test(segment2)))
|
|
89386
89387
|
return true;
|
|
89387
89388
|
if (segments.some((segment2) => /\.xcdatamodeld?$/.test(segment2))) return false;
|
|
89388
89389
|
if (copiedBundle) return true;
|
|
89389
|
-
const ext = extOf(
|
|
89390
|
+
const ext = extOf(path160);
|
|
89390
89391
|
if (ext === ".json" || ext === ".xcstrings") return true;
|
|
89391
89392
|
return !COMPILED_EXTENSIONS.has(ext) && (copyLooseRasters || !RASTER_EXTENSIONS.has(ext)) && !segments.some((segment2) => segment2.endsWith(".xcassets"));
|
|
89392
89393
|
}
|
|
@@ -89394,7 +89395,7 @@ function enumerateBundleResources(paths, { copiedBundle = false, copyLooseRaster
|
|
|
89394
89395
|
const found2 = [];
|
|
89395
89396
|
const seen = /* @__PURE__ */ new Set();
|
|
89396
89397
|
const ordered = [...paths].filter(
|
|
89397
|
-
(
|
|
89398
|
+
(path160) => path160.split("/").includes("Resources") && path160.split("/").every((segment2) => segment2 !== "" && segment2 !== "..") && isCopiedResource(path160, copiedBundle, copyLooseRasters)
|
|
89398
89399
|
).sort((a, b) => {
|
|
89399
89400
|
const aDepth = a.split("/").length;
|
|
89400
89401
|
const bDepth = b.split("/").length;
|
|
@@ -89559,31 +89560,31 @@ function tokens(text7) {
|
|
|
89559
89560
|
}
|
|
89560
89561
|
return result;
|
|
89561
89562
|
}
|
|
89562
|
-
function qualified(language, key2,
|
|
89563
|
-
return `(${language}: ${key2}${
|
|
89563
|
+
function qualified(language, key2, path160) {
|
|
89564
|
+
return `(${language}: ${key2}${path160 === "" ? "" : "|==|" + path160})`;
|
|
89564
89565
|
}
|
|
89565
|
-
function requiresNumber(language, key2,
|
|
89566
|
+
function requiresNumber(language, key2, path160) {
|
|
89566
89567
|
return Error(
|
|
89567
|
-
"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,
|
|
89568
|
+
"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, path160)
|
|
89568
89569
|
);
|
|
89569
89570
|
}
|
|
89570
|
-
function moreThanOne(language, key2,
|
|
89571
|
+
function moreThanOne(language, key2, path160) {
|
|
89571
89572
|
return Error(
|
|
89572
|
-
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2,
|
|
89573
|
+
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path160)
|
|
89573
89574
|
);
|
|
89574
89575
|
}
|
|
89575
89576
|
function schemaPath(segments) {
|
|
89576
89577
|
return segments.map((segment2) => `'${segment2}'`).join(" -> ");
|
|
89577
89578
|
}
|
|
89578
|
-
function checkUnitShape(node,
|
|
89579
|
+
function checkUnitShape(node, path160) {
|
|
89579
89580
|
const raw2 = node.stringUnit;
|
|
89580
89581
|
if (raw2 === void 0)
|
|
89581
|
-
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(
|
|
89582
|
+
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path160)}`);
|
|
89582
89583
|
if (raw2 === null)
|
|
89583
|
-
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(
|
|
89584
|
+
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path160)}`);
|
|
89584
89585
|
if (!isRecord6(raw2))
|
|
89585
|
-
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(
|
|
89586
|
-
const unitPath = [...
|
|
89586
|
+
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path160)}`);
|
|
89587
|
+
const unitPath = [...path160, "stringUnit"];
|
|
89587
89588
|
if (!Object.hasOwn(raw2, "state"))
|
|
89588
89589
|
throw Error(`Missing required key 'state' inside ${schemaPath(unitPath)}`);
|
|
89589
89590
|
const state = raw2.state;
|
|
@@ -89600,38 +89601,38 @@ function checkUnitShape(node, path159) {
|
|
|
89600
89601
|
throw Error(`Expected string for key 'value' inside ${schemaPath(unitPath)}`);
|
|
89601
89602
|
return value;
|
|
89602
89603
|
}
|
|
89603
|
-
function checkPluralShape(node,
|
|
89604
|
+
function checkPluralShape(node, path160) {
|
|
89604
89605
|
for (const [category, raw2] of Object.entries(node)) {
|
|
89605
|
-
const categoryPath = [...
|
|
89606
|
+
const categoryPath = [...path160, category];
|
|
89606
89607
|
if (raw2 === null)
|
|
89607
89608
|
throw Error(
|
|
89608
|
-
`Missing required value for key '${category}' inside ${schemaPath(
|
|
89609
|
+
`Missing required value for key '${category}' inside ${schemaPath(path160)}`
|
|
89609
89610
|
);
|
|
89610
89611
|
if (!isRecord6(raw2))
|
|
89611
|
-
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(
|
|
89612
|
+
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path160)}`);
|
|
89612
89613
|
checkUnitShape(raw2, categoryPath);
|
|
89613
89614
|
}
|
|
89614
89615
|
}
|
|
89615
|
-
function checkLocalizationShape(node,
|
|
89616
|
+
function checkLocalizationShape(node, path160, deviceValue = false) {
|
|
89616
89617
|
if (node === null)
|
|
89617
89618
|
throw Error(
|
|
89618
|
-
`Missing required value for key '${
|
|
89619
|
+
`Missing required value for key '${path160[path160.length - 1]}' inside ${schemaPath(path160.slice(0, -1))}`
|
|
89619
89620
|
);
|
|
89620
89621
|
if (!isRecord6(node))
|
|
89621
89622
|
throw Error(
|
|
89622
|
-
`Expected dictionary for key '${
|
|
89623
|
+
`Expected dictionary for key '${path160[path160.length - 1]}' inside ${schemaPath(path160.slice(0, -1))}`
|
|
89623
89624
|
);
|
|
89624
|
-
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations,
|
|
89625
|
+
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path160);
|
|
89625
89626
|
if (!deviceValue && Object.hasOwn(node, "substitutions"))
|
|
89626
|
-
checkSubstitutionsShape(node.substitutions,
|
|
89627
|
-
if (!Object.hasOwn(node, "variations")) checkUnitShape(node,
|
|
89627
|
+
checkSubstitutionsShape(node.substitutions, path160);
|
|
89628
|
+
if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path160);
|
|
89628
89629
|
}
|
|
89629
|
-
function checkVariationsShape(variations,
|
|
89630
|
+
function checkVariationsShape(variations, path160) {
|
|
89630
89631
|
if (variations === null)
|
|
89631
|
-
throw Error(`Missing required value for key 'variations' inside ${schemaPath(
|
|
89632
|
+
throw Error(`Missing required value for key 'variations' inside ${schemaPath(path160)}`);
|
|
89632
89633
|
if (!isRecord6(variations))
|
|
89633
|
-
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(
|
|
89634
|
-
const variationsPath = [...
|
|
89634
|
+
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path160)}`);
|
|
89635
|
+
const variationsPath = [...path160, "variations"];
|
|
89635
89636
|
for (const [type, raw2] of Object.entries(variations)) {
|
|
89636
89637
|
if (raw2 === null)
|
|
89637
89638
|
throw Error(
|
|
@@ -89657,11 +89658,11 @@ function checkVariationsShape(variations, path159) {
|
|
|
89657
89658
|
}
|
|
89658
89659
|
}
|
|
89659
89660
|
}
|
|
89660
|
-
function checkSubstitutionsShape(substitutions,
|
|
89661
|
+
function checkSubstitutionsShape(substitutions, path160) {
|
|
89661
89662
|
if (substitutions === null) return;
|
|
89662
89663
|
if (!isRecord6(substitutions))
|
|
89663
|
-
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(
|
|
89664
|
-
const substitutionsPath = [...
|
|
89664
|
+
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path160)}`);
|
|
89665
|
+
const substitutionsPath = [...path160, "substitutions"];
|
|
89665
89666
|
for (const [name3, raw2] of Object.entries(substitutions)) {
|
|
89666
89667
|
const subPath = [...substitutionsPath, name3];
|
|
89667
89668
|
if (raw2 === null)
|
|
@@ -89703,10 +89704,10 @@ function scanSpecs(forms) {
|
|
|
89703
89704
|
}
|
|
89704
89705
|
return specs;
|
|
89705
89706
|
}
|
|
89706
|
-
function inferPlural(forms, language, key2,
|
|
89707
|
+
function inferPlural(forms, language, key2, path160) {
|
|
89707
89708
|
const specs = scanSpecs(forms);
|
|
89708
|
-
if (specs.size === 0) throw requiresNumber(language, key2,
|
|
89709
|
-
if (specs.size > 1) throw moreThanOne(language, key2,
|
|
89709
|
+
if (specs.size === 0) throw requiresNumber(language, key2, path160);
|
|
89710
|
+
if (specs.size > 1) throw moreThanOne(language, key2, path160);
|
|
89710
89711
|
return [...specs.values()][0] ?? { specifier: "", argument: 0 };
|
|
89711
89712
|
}
|
|
89712
89713
|
function unit(value) {
|
|
@@ -90175,8 +90176,8 @@ function plist5(value, depth) {
|
|
|
90175
90176
|
}
|
|
90176
90177
|
function compileStringCatalog(source, name3) {
|
|
90177
90178
|
return Object.fromEntries(
|
|
90178
|
-
Object.entries(compileCatalogTables(source, name3)).map(([
|
|
90179
|
-
|
|
90179
|
+
Object.entries(compileCatalogTables(source, name3)).map(([path160, table]) => [
|
|
90180
|
+
path160,
|
|
90180
90181
|
'<?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' + plist5(table, 0) + "</plist>\n"
|
|
90181
90182
|
])
|
|
90182
90183
|
);
|
|
@@ -95450,9 +95451,9 @@ function packageChromiumPath(resolved, env) {
|
|
|
95450
95451
|
(0, import_node_fs129.renameSync)(staged, chromiumPathsFile());
|
|
95451
95452
|
return { ok: true, path: parsed2.expectedPath };
|
|
95452
95453
|
}
|
|
95453
|
-
function isExecutable(
|
|
95454
|
+
function isExecutable(path160) {
|
|
95454
95455
|
try {
|
|
95455
|
-
(0, import_node_fs129.accessSync)(
|
|
95456
|
+
(0, import_node_fs129.accessSync)(path160, import_node_fs129.constants.X_OK);
|
|
95456
95457
|
return true;
|
|
95457
95458
|
} catch {
|
|
95458
95459
|
return false;
|
|
@@ -95497,7 +95498,7 @@ function probeBrowser(resolved, env, shell) {
|
|
|
95497
95498
|
(name3) => name3.startsWith(prefix) && /^\d+$/.test(name3.slice(prefix.length))
|
|
95498
95499
|
).sort((a, b) => Number(b.slice(prefix.length)) - Number(a.slice(prefix.length))) : [];
|
|
95499
95500
|
for (const revision of revisions) {
|
|
95500
|
-
const installed2 = paths.map((
|
|
95501
|
+
const installed2 = paths.map((path160) => (0, import_node_path129.join)(browsersDir, revision, path160)).find(isExecutable);
|
|
95501
95502
|
if (installed2) {
|
|
95502
95503
|
executablePath = installed2;
|
|
95503
95504
|
break;
|
|
@@ -97696,7 +97697,7 @@ async function buildXcodeLayout(root) {
|
|
|
97696
97697
|
});
|
|
97697
97698
|
if (framework.moduleName !== module2 || framework.allSources.length === 0)
|
|
97698
97699
|
throw new Error(`${project2}: ${target} did not produce source module ${module2}`);
|
|
97699
|
-
if (framework.linkedProducts.length > 0 || framework.binaryFrameworks.some(({ path:
|
|
97700
|
+
if (framework.linkedProducts.length > 0 || framework.binaryFrameworks.some(({ path: path160 }) => path160))
|
|
97700
97701
|
throw new Error(
|
|
97701
97702
|
`${project2}: ${target} has external dependencies outside the source framework build`
|
|
97702
97703
|
);
|
|
@@ -101314,11 +101315,11 @@ function stringList3(value) {
|
|
|
101314
101315
|
function externalSpecMembers(root, requested) {
|
|
101315
101316
|
const children = (spec) => Array.isArray(spec.subspecs) ? spec.subspecs.filter(object6) : [];
|
|
101316
101317
|
const chains = /* @__PURE__ */ new Map();
|
|
101317
|
-
const select = (
|
|
101318
|
-
const key2 =
|
|
101318
|
+
const select = (path160) => {
|
|
101319
|
+
const key2 = path160.join("/");
|
|
101319
101320
|
if (chains.has(key2)) return;
|
|
101320
101321
|
const chain = [root];
|
|
101321
|
-
for (const part of
|
|
101322
|
+
for (const part of path160) {
|
|
101322
101323
|
const child = children(chain.at(-1)).find((sub) => sub.name === part);
|
|
101323
101324
|
if (!child) throw new Error(`${String(root.name)} has no subspec ${key2}`);
|
|
101324
101325
|
chain.push(child);
|
|
@@ -101327,7 +101328,7 @@ function externalSpecMembers(root, requested) {
|
|
|
101327
101328
|
const spec = chain.at(-1);
|
|
101328
101329
|
const defaults = stringList3(spec.default_subspecs ?? spec.default_subspec);
|
|
101329
101330
|
const activated = defaults[0] === "none" ? [] : defaults.length > 0 ? defaults : children(spec).map((sub) => String(sub.name));
|
|
101330
|
-
for (const name3 of activated) select([...
|
|
101331
|
+
for (const name3 of activated) select([...path160, ...name3.split("/")]);
|
|
101331
101332
|
for (const member of chain)
|
|
101332
101333
|
for (const dependencies of [member.dependencies, iosOf(member)?.dependencies])
|
|
101333
101334
|
for (const dependency of object6(dependencies) ? Object.keys(dependencies) : []) {
|
|
@@ -113173,16 +113174,542 @@ var init_staged_host_files = __esm({
|
|
|
113173
113174
|
}
|
|
113174
113175
|
});
|
|
113175
113176
|
|
|
113177
|
+
// ../peach-globals/src/oneNativeControlsContract.ts
|
|
113178
|
+
var ONE_NATIVE_CONTROLS_PACKAGE, ONE_NATIVE_CONTROLS_CONTRACT, ONE_NATIVE_CONTROLS_NAVIGATION_STACK_VIEW;
|
|
113179
|
+
var init_oneNativeControlsContract = __esm({
|
|
113180
|
+
"../peach-globals/src/oneNativeControlsContract.ts"() {
|
|
113181
|
+
"use strict";
|
|
113182
|
+
ONE_NATIVE_CONTROLS_PACKAGE = "OneNativeControls";
|
|
113183
|
+
ONE_NATIVE_CONTROLS_CONTRACT = "one-native-controls-v1";
|
|
113184
|
+
ONE_NATIVE_CONTROLS_NAVIGATION_STACK_VIEW = "OneNativeNavigationStack";
|
|
113185
|
+
}
|
|
113186
|
+
});
|
|
113187
|
+
|
|
113188
|
+
// src/oneNativeControlsContract.ts
|
|
113189
|
+
var init_oneNativeControlsContract2 = __esm({
|
|
113190
|
+
"src/oneNativeControlsContract.ts"() {
|
|
113191
|
+
"use strict";
|
|
113192
|
+
init_oneNativeControlsContract();
|
|
113193
|
+
}
|
|
113194
|
+
});
|
|
113195
|
+
|
|
113196
|
+
// src/one-native-controls-package.ts
|
|
113197
|
+
function resolveOneNativeAppleIosDir(appRoot) {
|
|
113198
|
+
if (appRoot && import_node_fs150.default.existsSync(import_node_path150.default.join(appRoot, "package.json"))) {
|
|
113199
|
+
const appRequire = (0, import_node_module21.createRequire)(import_node_path150.default.join(appRoot, "package.json"));
|
|
113200
|
+
let oneManifest;
|
|
113201
|
+
try {
|
|
113202
|
+
oneManifest = appRequire.resolve("one/package.json");
|
|
113203
|
+
} catch (error) {
|
|
113204
|
+
if (!(error instanceof Error) || !("code" in error) || error.code !== "MODULE_NOT_FOUND") {
|
|
113205
|
+
throw error;
|
|
113206
|
+
}
|
|
113207
|
+
}
|
|
113208
|
+
if (oneManifest) {
|
|
113209
|
+
const installed2 = import_node_path150.default.join(import_node_path150.default.dirname(oneManifest), "native/apple/ios");
|
|
113210
|
+
if (import_node_fs150.default.existsSync(
|
|
113211
|
+
import_node_path150.default.join(installed2, "Generated/OneNativeNavigationStackView.swift")
|
|
113212
|
+
))
|
|
113213
|
+
return installed2;
|
|
113214
|
+
}
|
|
113215
|
+
}
|
|
113216
|
+
const workspace = import_node_path150.default.resolve(
|
|
113217
|
+
import_node_path150.default.dirname((0, import_node_url8.fileURLToPath)(__sootsim_import_meta_url)),
|
|
113218
|
+
"../../one-v3/native/apple/ios"
|
|
113219
|
+
);
|
|
113220
|
+
if (!import_node_fs150.default.existsSync(import_node_path150.default.join(workspace, "Generated/OneNativeNavigationStackView.swift"))) {
|
|
113221
|
+
throw new Error(`One SwiftUI native sources not found at ${workspace}`);
|
|
113222
|
+
}
|
|
113223
|
+
return workspace;
|
|
113224
|
+
}
|
|
113225
|
+
async function oneNativeControlsPackage(appRoot) {
|
|
113226
|
+
const iosDir = resolveOneNativeAppleIosDir(appRoot);
|
|
113227
|
+
const sdkDir = import_node_path150.default.join(iosDir, "SDK");
|
|
113228
|
+
const sdkFiles = import_node_fs150.default.readdirSync(sdkDir).filter((name3) => name3.endsWith(".swift")).sort().map((name3) => `SDK/${name3}`);
|
|
113229
|
+
const files2 = /* @__PURE__ */ new Map();
|
|
113230
|
+
const watched = [];
|
|
113231
|
+
const digest3 = (0, import_node_crypto88.createHash)("sha256");
|
|
113232
|
+
for (const relative5 of [...ONE_CONTROL_SOURCES, ...sdkFiles]) {
|
|
113233
|
+
const full = import_node_path150.default.join(iosDir, relative5);
|
|
113234
|
+
const content = import_node_fs150.default.readFileSync(full, "utf8");
|
|
113235
|
+
const flatName = import_node_path150.default.basename(relative5);
|
|
113236
|
+
if (files2.has(flatName)) {
|
|
113237
|
+
throw new Error(`duplicate Swift filename ${flatName} in OneNativeControls`);
|
|
113238
|
+
}
|
|
113239
|
+
files2.set(flatName, content);
|
|
113240
|
+
watched.push(full);
|
|
113241
|
+
digest3.update(flatName).update("\0").update(content).update("\0");
|
|
113242
|
+
}
|
|
113243
|
+
files2.set("OneNativeControlsBridge.swift", BRIDGE_SWIFT);
|
|
113244
|
+
digest3.update("OneNativeControlsBridge.swift\0").update(BRIDGE_SWIFT).update("\0");
|
|
113245
|
+
const key2 = digest3.digest("hex").slice(0, 16);
|
|
113246
|
+
files2.set(
|
|
113247
|
+
"Package.swift",
|
|
113248
|
+
[
|
|
113249
|
+
"// swift-tools-version: 6.2",
|
|
113250
|
+
`// OneNativeControls ${key2}`,
|
|
113251
|
+
"import PackageDescription",
|
|
113252
|
+
`let package = Package(name: "${ONE_NATIVE_CONTROLS_PACKAGE}", platforms: [.iOS(.v17)], targets: [`,
|
|
113253
|
+
` .executableTarget(name: "${ONE_NATIVE_CONTROLS_PACKAGE}", path: ".", swiftSettings: [.swiftLanguageMode(.v5)]),`,
|
|
113254
|
+
"])",
|
|
113255
|
+
""
|
|
113256
|
+
].join("\n")
|
|
113257
|
+
);
|
|
113258
|
+
const packagePath = import_node_path150.default.join(
|
|
113259
|
+
swiftCacheDir(),
|
|
113260
|
+
"one-native-controls",
|
|
113261
|
+
key2,
|
|
113262
|
+
ONE_NATIVE_CONTROLS_PACKAGE
|
|
113263
|
+
);
|
|
113264
|
+
import_node_fs150.default.mkdirSync(packagePath, { recursive: true });
|
|
113265
|
+
syncSwiftTree(
|
|
113266
|
+
packagePath,
|
|
113267
|
+
new Map([...files2].map(([file, text7]) => [import_node_path150.default.join(packagePath, file), text7]))
|
|
113268
|
+
);
|
|
113269
|
+
return { packagePath, watched };
|
|
113270
|
+
}
|
|
113271
|
+
var import_node_crypto88, import_node_fs150, import_node_module21, import_node_path150, import_node_url8, ONE_CONTROL_SOURCES, BRIDGE_SWIFT;
|
|
113272
|
+
var init_one_native_controls_package = __esm({
|
|
113273
|
+
"src/one-native-controls-package.ts"() {
|
|
113274
|
+
"use strict";
|
|
113275
|
+
import_node_crypto88 = require("node:crypto");
|
|
113276
|
+
import_node_fs150 = __toESM(require("node:fs"), 1);
|
|
113277
|
+
import_node_module21 = require("node:module");
|
|
113278
|
+
import_node_path150 = __toESM(require("node:path"), 1);
|
|
113279
|
+
import_node_url8 = require("node:url");
|
|
113280
|
+
init_oneNativeControlsContract2();
|
|
113281
|
+
init_swift_compile();
|
|
113282
|
+
init_swift_host();
|
|
113283
|
+
init_swift_submit();
|
|
113284
|
+
init_swift_toolchain();
|
|
113285
|
+
ONE_CONTROL_SOURCES = [
|
|
113286
|
+
"Generated/OneNativeNavigationStackView.swift",
|
|
113287
|
+
"Generated/OneNativeToolbarView.swift",
|
|
113288
|
+
"Generated/OneNativeListView.swift",
|
|
113289
|
+
"Generated/OneNativeSectionView.swift",
|
|
113290
|
+
"Generated/OneNativeFileImporterView.swift",
|
|
113291
|
+
"Generated/OneNativeButtonView.swift",
|
|
113292
|
+
"Generated/OneNativeLabelView.swift",
|
|
113293
|
+
"Generated/OneNativeTextView.swift",
|
|
113294
|
+
"Generated/OneNativeSwiftUI.swift",
|
|
113295
|
+
"Generated/OneNativeAnimationValues.swift",
|
|
113296
|
+
"Generated/OneNativeEnvironment.swift",
|
|
113297
|
+
"OneNativeContainerSlotView.swift",
|
|
113298
|
+
"OneNativeSyncState.swift",
|
|
113299
|
+
"OneNativeAnimators.swift",
|
|
113300
|
+
"OneNativeDragBinding.swift",
|
|
113301
|
+
"OneNativeAccessibility.swift",
|
|
113302
|
+
"OneNativeAsyncAction.swift",
|
|
113303
|
+
"OneNativeControlled.swift",
|
|
113304
|
+
"OneZoomSources.swift",
|
|
113305
|
+
"OneNativeComposition.swift",
|
|
113306
|
+
"OneNativeHostingController.swift",
|
|
113307
|
+
"OneNativeSlot.swift",
|
|
113308
|
+
"OneNativeStyle.swift"
|
|
113309
|
+
];
|
|
113310
|
+
BRIDGE_SWIFT = `import SwiftUI
|
|
113311
|
+
@_spi(Peach) import UIKit
|
|
113312
|
+
import PeachJSON
|
|
113313
|
+
|
|
113314
|
+
private typealias Spec = [String: Any]
|
|
113315
|
+
|
|
113316
|
+
private func platformColor(named name: String) -> UIColor? {
|
|
113317
|
+
switch name {
|
|
113318
|
+
case "label", "-apple-system-label": return UIColor.label
|
|
113319
|
+
case "secondaryLabel", "-apple-system-secondary-label": return UIColor.secondaryLabel
|
|
113320
|
+
case "tertiaryLabel", "-apple-system-tertiary-label": return UIColor.tertiaryLabel
|
|
113321
|
+
case "quaternaryLabel": return UIColor.quaternaryLabel
|
|
113322
|
+
case "placeholderText", "-apple-system-placeholder-text": return UIColor.placeholderText
|
|
113323
|
+
case "separator", "-apple-system-separator": return UIColor.separator
|
|
113324
|
+
case "opaqueSeparator": return UIColor.opaqueSeparator
|
|
113325
|
+
case "systemBackground", "-apple-system-background": return UIColor.systemBackground
|
|
113326
|
+
case "secondarySystemBackground", "-apple-system-secondary-background": return UIColor.secondarySystemBackground
|
|
113327
|
+
case "tertiarySystemBackground", "-apple-system-tertiary-background": return UIColor.tertiarySystemBackground
|
|
113328
|
+
case "systemGroupedBackground", "-apple-system-grouped-background": return UIColor.systemGroupedBackground
|
|
113329
|
+
case "secondarySystemGroupedBackground", "-apple-system-secondary-grouped-background": return UIColor.secondarySystemGroupedBackground
|
|
113330
|
+
case "tertiarySystemGroupedBackground": return UIColor.tertiarySystemGroupedBackground
|
|
113331
|
+
case "systemFill": return UIColor.systemFill
|
|
113332
|
+
case "secondarySystemFill": return UIColor.secondarySystemFill
|
|
113333
|
+
case "tertiarySystemFill", "-apple-system-tertiary-fill": return UIColor.tertiarySystemFill
|
|
113334
|
+
case "quaternarySystemFill": return UIColor.quaternarySystemFill
|
|
113335
|
+
case "systemBlue", "-apple-system-blue": return UIColor.systemBlue
|
|
113336
|
+
case "systemCyan", "-apple-system-cyan": return UIColor.systemCyan
|
|
113337
|
+
case "systemGray", "-apple-system-gray": return UIColor.systemGray
|
|
113338
|
+
case "systemGray2": return UIColor.systemGray2
|
|
113339
|
+
case "systemGray3", "-apple-system-gray-3": return UIColor.systemGray3
|
|
113340
|
+
case "systemGray4": return UIColor.systemGray4
|
|
113341
|
+
case "systemGray5": return UIColor.systemGray5
|
|
113342
|
+
case "systemGray6": return UIColor.systemGray6
|
|
113343
|
+
case "systemGreen", "-apple-system-green": return UIColor.systemGreen
|
|
113344
|
+
case "systemIndigo", "-apple-system-indigo": return UIColor.systemIndigo
|
|
113345
|
+
case "systemOrange", "-apple-system-orange": return UIColor.systemOrange
|
|
113346
|
+
case "systemPink", "-apple-system-pink": return UIColor.systemPink
|
|
113347
|
+
case "systemPurple", "-apple-system-purple": return UIColor.systemPurple
|
|
113348
|
+
case "systemRed", "-apple-system-red": return UIColor.systemRed
|
|
113349
|
+
case "systemTeal", "-apple-system-teal": return UIColor.systemTeal
|
|
113350
|
+
case "systemYellow", "-apple-system-yellow": return UIColor.systemYellow
|
|
113351
|
+
case "clear": return UIColor.clear
|
|
113352
|
+
default: return nil
|
|
113353
|
+
}
|
|
113354
|
+
}
|
|
113355
|
+
|
|
113356
|
+
private func parseColor(_ raw: Any) -> UIColor? {
|
|
113357
|
+
if let color = raw as? UIColor { return color }
|
|
113358
|
+
if let number = raw as? NSNumber {
|
|
113359
|
+
let argb = UInt32(truncatingIfNeeded: number.int64Value)
|
|
113360
|
+
let a = CGFloat((argb >> 24) & 0xFF) / 255.0
|
|
113361
|
+
let r = CGFloat((argb >> 16) & 0xFF) / 255.0
|
|
113362
|
+
let g = CGFloat((argb >> 8) & 0xFF) / 255.0
|
|
113363
|
+
let b = CGFloat(argb & 0xFF) / 255.0
|
|
113364
|
+
return UIColor(red: r, green: g, blue: b, alpha: a)
|
|
113365
|
+
}
|
|
113366
|
+
if let text = raw as? String {
|
|
113367
|
+
if let named = platformColor(named: text) { return named }
|
|
113368
|
+
if text.hasPrefix("#") {
|
|
113369
|
+
let hex = String(text.dropFirst())
|
|
113370
|
+
if hex.count == 6, let value = UInt64(hex, radix: 16) {
|
|
113371
|
+
return UIColor(
|
|
113372
|
+
red: CGFloat((value >> 16) & 0xFF) / 255.0,
|
|
113373
|
+
green: CGFloat((value >> 8) & 0xFF) / 255.0,
|
|
113374
|
+
blue: CGFloat(value & 0xFF) / 255.0,
|
|
113375
|
+
alpha: 1.0
|
|
113376
|
+
)
|
|
113377
|
+
}
|
|
113378
|
+
if hex.count == 8, let value = UInt64(hex, radix: 16) {
|
|
113379
|
+
return UIColor(
|
|
113380
|
+
red: CGFloat((value >> 24) & 0xFF) / 255.0,
|
|
113381
|
+
green: CGFloat((value >> 16) & 0xFF) / 255.0,
|
|
113382
|
+
blue: CGFloat((value >> 8) & 0xFF) / 255.0,
|
|
113383
|
+
alpha: CGFloat(value & 0xFF) / 255.0
|
|
113384
|
+
)
|
|
113385
|
+
}
|
|
113386
|
+
}
|
|
113387
|
+
return nil
|
|
113388
|
+
}
|
|
113389
|
+
if let dict = raw as? Spec {
|
|
113390
|
+
if let semantic = dict["semantic"] as? [String] {
|
|
113391
|
+
for name in semantic {
|
|
113392
|
+
if let color = platformColor(named: name) { return color }
|
|
113393
|
+
}
|
|
113394
|
+
}
|
|
113395
|
+
if let dynamic = dict["dynamic"] as? Spec,
|
|
113396
|
+
let light = dynamic["light"].flatMap(parseColor),
|
|
113397
|
+
let dark = dynamic["dark"].flatMap(parseColor) {
|
|
113398
|
+
return UIColor { traits in
|
|
113399
|
+
traits.userInterfaceStyle == .dark ? dark : light
|
|
113400
|
+
}
|
|
113401
|
+
}
|
|
113402
|
+
}
|
|
113403
|
+
return nil
|
|
113404
|
+
}
|
|
113405
|
+
|
|
113406
|
+
private func normalizeStyle(_ raw: Spec?) -> Spec {
|
|
113407
|
+
guard var style = raw else { return [:] }
|
|
113408
|
+
for key in ["maxWidth", "maxHeight"] {
|
|
113409
|
+
if let value = style[key] as? String, value == "Infinity" {
|
|
113410
|
+
style[key] = Double.infinity
|
|
113411
|
+
}
|
|
113412
|
+
}
|
|
113413
|
+
for key in ["foregroundStyle", "tint", "background", "borderColor", "glassEffectTint"] {
|
|
113414
|
+
if let value = style[key], let color = parseColor(value) {
|
|
113415
|
+
style[key] = color
|
|
113416
|
+
}
|
|
113417
|
+
}
|
|
113418
|
+
if let cssColors = style["cssColors"] as? [String: String] {
|
|
113419
|
+
for (field, keyword) in cssColors {
|
|
113420
|
+
if let color = platformColor(named: keyword) {
|
|
113421
|
+
style[field] = color
|
|
113422
|
+
}
|
|
113423
|
+
}
|
|
113424
|
+
style.removeValue(forKey: "cssColors")
|
|
113425
|
+
}
|
|
113426
|
+
return style
|
|
113427
|
+
}
|
|
113428
|
+
|
|
113429
|
+
private struct NavigationStackBridge: UIViewRepresentable {
|
|
113430
|
+
let spec: Spec
|
|
113431
|
+
let emit: (String, String) -> Void
|
|
113432
|
+
|
|
113433
|
+
final class Coordinator {
|
|
113434
|
+
let slot = UIView(frame: .zero)
|
|
113435
|
+
var views: [String: UIView] = [:]
|
|
113436
|
+
var children: [String: [UIView]] = [:]
|
|
113437
|
+
var slots: [String: UIView] = [:]
|
|
113438
|
+
var toolbars: [OneNativeToolbarView] = []
|
|
113439
|
+
var emit: ((String, String) -> Void)?
|
|
113440
|
+
|
|
113441
|
+
func send(_ id: String, _ event: String, _ fields: Spec) {
|
|
113442
|
+
let payload = try! JSONSerialization.data(withJSONObject: [id, event, fields])
|
|
113443
|
+
emit?("dispatch", String(decoding: payload, as: UTF8.self))
|
|
113444
|
+
}
|
|
113445
|
+
|
|
113446
|
+
func reconcile(
|
|
113447
|
+
_ next: [UIView],
|
|
113448
|
+
previous: [UIView],
|
|
113449
|
+
remove: (UIView) -> Void,
|
|
113450
|
+
insert: (UIView, Int) -> Void
|
|
113451
|
+
) {
|
|
113452
|
+
let prefix = zip(previous, next).prefix(while: { $0 === $1 }).count
|
|
113453
|
+
for child in previous.dropFirst(prefix).reversed() { remove(child) }
|
|
113454
|
+
for (index, child) in next.enumerated().dropFirst(prefix) { insert(child, index) }
|
|
113455
|
+
}
|
|
113456
|
+
|
|
113457
|
+
func render(_ node: Spec, visited: inout Set<String>) -> UIView {
|
|
113458
|
+
let id = node["id"] as! String
|
|
113459
|
+
let spec = node["spec"] as! Spec
|
|
113460
|
+
let control = spec["control"] as! String
|
|
113461
|
+
let style = normalizeStyle(spec["swiftStyle"] as? Spec)
|
|
113462
|
+
let access = spec["accessibility"] as? Spec ?? [:]
|
|
113463
|
+
let label = access["label"] as? String ?? ""
|
|
113464
|
+
let hint = access["hint"] as? String ?? ""
|
|
113465
|
+
let value = access["value"] as? String ?? ""
|
|
113466
|
+
let identifier = access["identifier"] as? String ?? spec["testID"] as? String ?? ""
|
|
113467
|
+
let visit: (String, String) -> Void = { [weak self] name, value in
|
|
113468
|
+
self?.send(id, "onNativeSDKEvent", ["name": name, "value": value])
|
|
113469
|
+
}
|
|
113470
|
+
let view: UIView
|
|
113471
|
+
visited.insert(id)
|
|
113472
|
+
switch control {
|
|
113473
|
+
case "OneNativeToolbar":
|
|
113474
|
+
view = views[id] ?? OneNativeToolbarView()
|
|
113475
|
+
case "OneNativeToolbarItem", "OneNativeToolbarItemGroup", "OneNativeToolbarSpacer", "OneNativeToolbarDefaultItem":
|
|
113476
|
+
let marker = views[id] as? OneNativeToolbarMarkerView ?? OneNativeToolbarMarkerView()
|
|
113477
|
+
let kinds = [
|
|
113478
|
+
"OneNativeToolbarItem": "item",
|
|
113479
|
+
"OneNativeToolbarItemGroup": "group",
|
|
113480
|
+
"OneNativeToolbarSpacer": "spacer",
|
|
113481
|
+
"OneNativeToolbarDefaultItem": "defaultItem",
|
|
113482
|
+
]
|
|
113483
|
+
marker.configure(
|
|
113484
|
+
kind: kinds[control]!,
|
|
113485
|
+
placement: spec["placement"] as? String ?? "automatic",
|
|
113486
|
+
sizing: spec["sizing"] as? String ?? "flexible",
|
|
113487
|
+
label: spec["label"] as? String ?? "",
|
|
113488
|
+
systemImage: spec["systemImage"] as? String ?? "",
|
|
113489
|
+
defaultItem: spec["kind"] as? String ?? ""
|
|
113490
|
+
)
|
|
113491
|
+
marker.configureStyle(style)
|
|
113492
|
+
marker.setOnSDKEvent(visit)
|
|
113493
|
+
view = marker
|
|
113494
|
+
case "OneNativeButton":
|
|
113495
|
+
let button = views[id] as? OneNativeButtonView ?? OneNativeButtonView()
|
|
113496
|
+
button.configure(buttonRole: spec["buttonRole"] as? String ?? "")
|
|
113497
|
+
button.configureAccessibility(label, hint: hint, value: value, identifier: identifier)
|
|
113498
|
+
button.onAction = { [weak self] count in
|
|
113499
|
+
self?.send(id, "onNativeButtonPress", ["eventCount": count])
|
|
113500
|
+
}
|
|
113501
|
+
view = button
|
|
113502
|
+
case "OneNativeLabel":
|
|
113503
|
+
let labelView = views[id] as? OneNativeLabelView ?? OneNativeLabelView(frame: .zero)
|
|
113504
|
+
labelView.configure(spec["label"] as? String ?? "", systemImage: spec["systemImage"] as? String ?? "")
|
|
113505
|
+
labelView.configureAccessibility(label, hint: hint, value: value, identifier: identifier)
|
|
113506
|
+
labelView.configureStyle(style)
|
|
113507
|
+
labelView.onSDKEvent = visit
|
|
113508
|
+
view = labelView
|
|
113509
|
+
case "OneNativeText":
|
|
113510
|
+
let text = views[id] as? OneNativeTextView ?? OneNativeTextView(frame: .zero)
|
|
113511
|
+
text.configure(spec["text"] as? String ?? "")
|
|
113512
|
+
text.configureAccessibility(label, hint: hint, value: value, identifier: identifier)
|
|
113513
|
+
text.configureStyle(style)
|
|
113514
|
+
text.onSDKEvent = visit
|
|
113515
|
+
view = text
|
|
113516
|
+
case "OneNativeContainerSlot":
|
|
113517
|
+
let slot = views[id] as? OneNativeContainerSlotView ?? OneNativeContainerSlotView(frame: .zero)
|
|
113518
|
+
let host = slots[id] ?? UIView(frame: .zero)
|
|
113519
|
+
slots[id] = host
|
|
113520
|
+
host._peachReactContentHost = node["contentHost"] as? String
|
|
113521
|
+
slot.content = host
|
|
113522
|
+
slot.configure(height: spec["height"] as? Double ?? 0, width: spec["width"] as? Double ?? 0)
|
|
113523
|
+
slot.configureSwiftStyle(style)
|
|
113524
|
+
slot.onSwiftStyleEvent = visit
|
|
113525
|
+
view = slot
|
|
113526
|
+
default:
|
|
113527
|
+
preconditionFailure("unsupported OneNativeNavigationStack toolbar child \\(control)")
|
|
113528
|
+
}
|
|
113529
|
+
views[id] = view
|
|
113530
|
+
if let container = view as? OneNativeContainerView {
|
|
113531
|
+
container.configureSwiftStyle(style)
|
|
113532
|
+
container.onSwiftStyleEvent = visit
|
|
113533
|
+
let nested = (node["children"] as? [Spec] ?? []).map { render($0, visited: &visited) }
|
|
113534
|
+
reconcile(
|
|
113535
|
+
nested,
|
|
113536
|
+
previous: children[id] ?? [],
|
|
113537
|
+
remove: container.removeChild,
|
|
113538
|
+
insert: container.insertChild
|
|
113539
|
+
)
|
|
113540
|
+
children[id] = nested
|
|
113541
|
+
}
|
|
113542
|
+
return view
|
|
113543
|
+
}
|
|
113544
|
+
|
|
113545
|
+
func prune(keeping visited: Set<String>) {
|
|
113546
|
+
for (id, view) in views where !visited.contains(id) {
|
|
113547
|
+
if let container = view as? OneNativeContainerView { container.reset() }
|
|
113548
|
+
views.removeValue(forKey: id)
|
|
113549
|
+
children.removeValue(forKey: id)
|
|
113550
|
+
slots.removeValue(forKey: id)
|
|
113551
|
+
}
|
|
113552
|
+
}
|
|
113553
|
+
}
|
|
113554
|
+
|
|
113555
|
+
func makeCoordinator() -> Coordinator { Coordinator() }
|
|
113556
|
+
|
|
113557
|
+
func makeUIView(context: Context) -> OneNativeNavigationStackView {
|
|
113558
|
+
let stack = OneNativeNavigationStackView(frame: .zero)
|
|
113559
|
+
let state = context.coordinator
|
|
113560
|
+
stack.mountContent(state.slot) { [weak state] frame in
|
|
113561
|
+
state?.send("", "layout", ["x": frame.minX, "y": frame.minY, "width": frame.width, "height": frame.height])
|
|
113562
|
+
}
|
|
113563
|
+
return stack
|
|
113564
|
+
}
|
|
113565
|
+
|
|
113566
|
+
func updateUIView(_ stack: OneNativeNavigationStackView, context: Context) {
|
|
113567
|
+
let state = context.coordinator
|
|
113568
|
+
state.emit = emit
|
|
113569
|
+
let root = spec["root"] as! Spec
|
|
113570
|
+
let id = root["id"] as! String
|
|
113571
|
+
let rootSpec = root["spec"] as! Spec
|
|
113572
|
+
state.slot._peachReactContentHost = spec["contentHost"] as? String
|
|
113573
|
+
stack.onSDKEvent = { [weak state] name, value in
|
|
113574
|
+
state?.send(id, "onNativeSDKEvent", ["name": name, "value": value])
|
|
113575
|
+
}
|
|
113576
|
+
stack.configureStyle(normalizeStyle(rootSpec["swiftStyle"] as? Spec))
|
|
113577
|
+
var visited = Set<String>()
|
|
113578
|
+
let next = (root["children"] as? [Spec] ?? []).map {
|
|
113579
|
+
state.render($0, visited: &visited) as! OneNativeToolbarView
|
|
113580
|
+
}
|
|
113581
|
+
state.reconcile(
|
|
113582
|
+
next,
|
|
113583
|
+
previous: state.toolbars,
|
|
113584
|
+
remove: { stack.unmountToolbar($0 as! OneNativeToolbarView) },
|
|
113585
|
+
insert: { view, _ in stack.mountToolbar(view as! OneNativeToolbarView) }
|
|
113586
|
+
)
|
|
113587
|
+
state.toolbars = next
|
|
113588
|
+
state.prune(keeping: visited)
|
|
113589
|
+
}
|
|
113590
|
+
|
|
113591
|
+
static func dismantleUIView(_ view: OneNativeNavigationStackView, coordinator: Coordinator) {
|
|
113592
|
+
view.unmountContent(coordinator.slot)
|
|
113593
|
+
for toolbar in coordinator.toolbars { view.unmountToolbar(toolbar) }
|
|
113594
|
+
coordinator.prune(keeping: [])
|
|
113595
|
+
coordinator.toolbars.removeAll()
|
|
113596
|
+
view.reset()
|
|
113597
|
+
coordinator.emit = nil
|
|
113598
|
+
}
|
|
113599
|
+
}
|
|
113600
|
+
|
|
113601
|
+
@_expose(wasm, "peach_register_views")
|
|
113602
|
+
@_cdecl("peach_register_views")
|
|
113603
|
+
@MainActor public func peach_register_views() {
|
|
113604
|
+
PeachTypedViews.register { view, contract, props, emit in
|
|
113605
|
+
precondition(
|
|
113606
|
+
view == "${ONE_NATIVE_CONTROLS_NAVIGATION_STACK_VIEW}" && contract == "${ONE_NATIVE_CONTROLS_CONTRACT}",
|
|
113607
|
+
"unexpected compiled One control request \\(view) / \\(contract)"
|
|
113608
|
+
)
|
|
113609
|
+
let spec = try! JSONSerialization.jsonObject(with: Data(props.utf8)) as! Spec
|
|
113610
|
+
return AnyView(
|
|
113611
|
+
NavigationStackBridge(spec: spec, emit: emit)
|
|
113612
|
+
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
113613
|
+
)
|
|
113614
|
+
}
|
|
113615
|
+
}
|
|
113616
|
+
|
|
113617
|
+
// representative tree exercised only when swift-startup-split profiles this package,
|
|
113618
|
+
// keeping NavigationStack + Toolbar hot paths in the primary startup chunk instead
|
|
113619
|
+
// of deferring them across hundreds of lazy code parts on first sheet open.
|
|
113620
|
+
private let startupProfileSpec: [String: Any] = [
|
|
113621
|
+
"contentHost": "__one-swift-startup-profile-slot",
|
|
113622
|
+
"dispatch": false,
|
|
113623
|
+
"root": [
|
|
113624
|
+
"id": "profile-root",
|
|
113625
|
+
"spec": [
|
|
113626
|
+
"control": "OneNativeNavigationStack",
|
|
113627
|
+
"swiftStyle": [
|
|
113628
|
+
"sdkModifiers": #"[["navigationTitleWithText","Profile"],["navigationBarTitleDisplayMode","inline"]]"#,
|
|
113629
|
+
],
|
|
113630
|
+
],
|
|
113631
|
+
"children": [
|
|
113632
|
+
[
|
|
113633
|
+
"id": "profile-toolbar",
|
|
113634
|
+
"spec": ["control": "OneNativeToolbar"],
|
|
113635
|
+
"children": [
|
|
113636
|
+
[
|
|
113637
|
+
"id": "profile-cancel-item",
|
|
113638
|
+
"spec": ["control": "OneNativeToolbarItem", "placement": "cancellationAction"],
|
|
113639
|
+
"children": [
|
|
113640
|
+
[
|
|
113641
|
+
"id": "profile-cancel-btn",
|
|
113642
|
+
"spec": ["control": "OneNativeButton", "role": "cancel"],
|
|
113643
|
+
"children": [
|
|
113644
|
+
[
|
|
113645
|
+
"id": "profile-cancel-label",
|
|
113646
|
+
"spec": ["control": "OneNativeLabel", "title": "Cancel", "systemImage": "xmark"],
|
|
113647
|
+
"children": [] as [Any],
|
|
113648
|
+
],
|
|
113649
|
+
],
|
|
113650
|
+
],
|
|
113651
|
+
],
|
|
113652
|
+
],
|
|
113653
|
+
[
|
|
113654
|
+
"id": "profile-spacer",
|
|
113655
|
+
"spec": ["control": "OneNativeToolbarSpacer", "placement": "topBarTrailing", "sizing": "fixed"],
|
|
113656
|
+
"children": [] as [Any],
|
|
113657
|
+
],
|
|
113658
|
+
[
|
|
113659
|
+
"id": "profile-confirm-group",
|
|
113660
|
+
"spec": ["control": "OneNativeToolbarItemGroup", "placement": "confirmationAction"],
|
|
113661
|
+
"children": [
|
|
113662
|
+
[
|
|
113663
|
+
"id": "profile-confirm-btn",
|
|
113664
|
+
"spec": ["control": "OneNativeButton", "role": "confirm", "disabled": true],
|
|
113665
|
+
"children": [
|
|
113666
|
+
[
|
|
113667
|
+
"id": "profile-confirm-label",
|
|
113668
|
+
"spec": ["control": "OneNativeLabel", "title": "Add", "systemImage": "checkmark"],
|
|
113669
|
+
"children": [] as [Any],
|
|
113670
|
+
],
|
|
113671
|
+
],
|
|
113672
|
+
],
|
|
113673
|
+
[
|
|
113674
|
+
"id": "profile-text",
|
|
113675
|
+
"spec": ["control": "OneNativeText", "text": "Item"],
|
|
113676
|
+
"children": [] as [Any],
|
|
113677
|
+
],
|
|
113678
|
+
[
|
|
113679
|
+
"id": "profile-slot",
|
|
113680
|
+
"contentHost": "__one-swift-startup-profile-inline-slot",
|
|
113681
|
+
"spec": ["control": "OneNativeContainerSlot", "width": 20.0, "height": 20.0],
|
|
113682
|
+
"children": [] as [Any],
|
|
113683
|
+
],
|
|
113684
|
+
],
|
|
113685
|
+
],
|
|
113686
|
+
],
|
|
113687
|
+
],
|
|
113688
|
+
],
|
|
113689
|
+
],
|
|
113690
|
+
]
|
|
113691
|
+
|
|
113692
|
+
@main
|
|
113693
|
+
struct OneNativeControlsGuest: PeachPackage {
|
|
113694
|
+
func view(props: JSON) -> some View {
|
|
113695
|
+
NavigationStackBridge(spec: startupProfileSpec, emit: { _, _ in })
|
|
113696
|
+
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
113697
|
+
}
|
|
113698
|
+
}
|
|
113699
|
+
`;
|
|
113700
|
+
}
|
|
113701
|
+
});
|
|
113702
|
+
|
|
113176
113703
|
// src/one-native-app-config.ts
|
|
113177
113704
|
function oneConfigPath(root) {
|
|
113178
113705
|
for (const name3 of CONFIG_FILES) {
|
|
113179
|
-
const file =
|
|
113180
|
-
if (
|
|
113706
|
+
const file = import_node_path151.default.join(root, name3);
|
|
113707
|
+
if (import_node_fs151.default.existsSync(file)) return file;
|
|
113181
113708
|
}
|
|
113182
113709
|
return null;
|
|
113183
113710
|
}
|
|
113184
113711
|
function readModule2(file) {
|
|
113185
|
-
const { code } = (0, import_sucrase4.transform)(
|
|
113712
|
+
const { code } = (0, import_sucrase4.transform)(import_node_fs151.default.readFileSync(file, "utf8"), {
|
|
113186
113713
|
transforms: /\.[cm]?tsx?$/.test(file) ? ["typescript"] : [],
|
|
113187
113714
|
disableESTransforms: true
|
|
113188
113715
|
});
|
|
@@ -113205,9 +113732,9 @@ function resolveName(module2, name3, seen) {
|
|
|
113205
113732
|
if (!source.startsWith(".")) continue;
|
|
113206
113733
|
for (const specifier of statement.specifiers) {
|
|
113207
113734
|
if (specifier.type !== "ImportSpecifier" || specifier.local.name !== name3) continue;
|
|
113208
|
-
const base2 =
|
|
113735
|
+
const base2 = import_node_path151.default.resolve(import_node_path151.default.dirname(module2.file), source);
|
|
113209
113736
|
const target = MODULE_EXTENSIONS.map((ext) => base2 + ext).find(
|
|
113210
|
-
(file) =>
|
|
113737
|
+
(file) => import_node_fs151.default.existsSync(file) && import_node_fs151.default.statSync(file).isFile()
|
|
113211
113738
|
);
|
|
113212
113739
|
if (!target) return NOT_STATIC;
|
|
113213
113740
|
const imported = specifier.imported.type === "Identifier" ? specifier.imported.name : String(specifier.imported.value);
|
|
@@ -113278,12 +113805,12 @@ function readOneNativeApp(root) {
|
|
|
113278
113805
|
});
|
|
113279
113806
|
return app;
|
|
113280
113807
|
}
|
|
113281
|
-
var
|
|
113808
|
+
var import_node_fs151, import_node_path151, import_acorn3, import_sucrase4, CONFIG_FILES, MODULE_EXTENSIONS, NOT_STATIC;
|
|
113282
113809
|
var init_one_native_app_config = __esm({
|
|
113283
113810
|
"src/one-native-app-config.ts"() {
|
|
113284
113811
|
"use strict";
|
|
113285
|
-
|
|
113286
|
-
|
|
113812
|
+
import_node_fs151 = __toESM(require("node:fs"), 1);
|
|
113813
|
+
import_node_path151 = __toESM(require("node:path"), 1);
|
|
113287
113814
|
import_acorn3 = require("peachsim/vendor/acorn");
|
|
113288
113815
|
import_sucrase4 = require("peachsim/vendor/sucrase");
|
|
113289
113816
|
init_estree_walk();
|
|
@@ -113336,7 +113863,7 @@ function readConfig(root) {
|
|
|
113336
113863
|
return {
|
|
113337
113864
|
widget,
|
|
113338
113865
|
urlSchemes,
|
|
113339
|
-
watched: [
|
|
113866
|
+
watched: [import_node_path152.default.join(root, "package.json"), ...configPath ? [configPath] : []]
|
|
113340
113867
|
};
|
|
113341
113868
|
}
|
|
113342
113869
|
function declaredFamilies(source) {
|
|
@@ -113350,13 +113877,13 @@ function declaredFamilies(source) {
|
|
|
113350
113877
|
return home;
|
|
113351
113878
|
}
|
|
113352
113879
|
async function readOneWidgetSources(appRoot) {
|
|
113353
|
-
const root =
|
|
113880
|
+
const root = import_node_fs152.default.realpathSync(appRoot);
|
|
113354
113881
|
const config = readConfig(root);
|
|
113355
113882
|
if (!config.widget) return null;
|
|
113356
113883
|
const widget = config.widget;
|
|
113357
113884
|
const sourceFiles2 = {
|
|
113358
|
-
"OneWidget.swift":
|
|
113359
|
-
"OneWidgetContract.swift":
|
|
113885
|
+
"OneWidget.swift": import_node_path152.default.join(root, "ios/OneWidgets/OneWidget.swift"),
|
|
113886
|
+
"OneWidgetContract.swift": import_node_path152.default.join(
|
|
113360
113887
|
root,
|
|
113361
113888
|
"ios",
|
|
113362
113889
|
widget.appName,
|
|
@@ -113366,14 +113893,14 @@ async function readOneWidgetSources(appRoot) {
|
|
|
113366
113893
|
const files2 = /* @__PURE__ */ new Map();
|
|
113367
113894
|
const sources = {};
|
|
113368
113895
|
for (const [name3, file] of Object.entries(sourceFiles2)) {
|
|
113369
|
-
if (!
|
|
113896
|
+
if (!import_node_fs152.default.existsSync(file))
|
|
113370
113897
|
throw new Error(`missing One widget prebuild source ${file}; run one prebuild`);
|
|
113371
113898
|
const bytes = readPackageFile(root, file, MAX_SWIFT_COMPILE_SOURCE_BYTES);
|
|
113372
113899
|
const text7 = bytes.toString("utf8");
|
|
113373
113900
|
if (!Buffer.from(text7).equals(bytes))
|
|
113374
113901
|
throw new Error(`One widget prebuild source is not UTF-8: ${file}`);
|
|
113375
113902
|
files2.set(name3, text7);
|
|
113376
|
-
sources[
|
|
113903
|
+
sources[import_node_path152.default.relative(root, file).split(import_node_path152.default.sep).join("/")] = (0, import_node_crypto89.createHash)("sha256").update(bytes).digest("hex");
|
|
113377
113904
|
}
|
|
113378
113905
|
const contract = files2.get("OneWidgetContract.swift") ?? "";
|
|
113379
113906
|
const source = files2.get("OneWidget.swift") ?? "";
|
|
@@ -113397,19 +113924,19 @@ async function configuredOneWidget(appRoot, bundleUrl, packageUrl) {
|
|
|
113397
113924
|
return {
|
|
113398
113925
|
metadata: source.widget,
|
|
113399
113926
|
projectRoot: source.root,
|
|
113400
|
-
appIdentity: (0,
|
|
113927
|
+
appIdentity: (0, import_node_crypto89.createHash)("sha256").update(JSON.stringify([source.root, source.widget.bundleId])).digest("hex"),
|
|
113401
113928
|
bundleUrl,
|
|
113402
113929
|
packageUrl,
|
|
113403
113930
|
urlSchemes: source.urlSchemes
|
|
113404
113931
|
};
|
|
113405
113932
|
}
|
|
113406
|
-
var
|
|
113933
|
+
var import_node_crypto89, import_node_fs152, import_node_path152, ONE_WIDGET_PACKAGE, nonEmpty;
|
|
113407
113934
|
var init_one_widget_metadata = __esm({
|
|
113408
113935
|
"src/one-widget-metadata.ts"() {
|
|
113409
113936
|
"use strict";
|
|
113410
|
-
|
|
113411
|
-
|
|
113412
|
-
|
|
113937
|
+
import_node_crypto89 = require("node:crypto");
|
|
113938
|
+
import_node_fs152 = __toESM(require("node:fs"), 1);
|
|
113939
|
+
import_node_path152 = __toESM(require("node:path"), 1);
|
|
113413
113940
|
init_is_record();
|
|
113414
113941
|
init_one_native_app_config();
|
|
113415
113942
|
init_oneWidgetContract();
|
|
@@ -113438,16 +113965,16 @@ async function oneWidgetPackage(appRoot) {
|
|
|
113438
113965
|
""
|
|
113439
113966
|
].join("\n")
|
|
113440
113967
|
);
|
|
113441
|
-
const packagePath =
|
|
113968
|
+
const packagePath = import_node_path153.default.join(
|
|
113442
113969
|
import_node_os32.default.tmpdir(),
|
|
113443
113970
|
"peach-one-widgets",
|
|
113444
|
-
(0,
|
|
113971
|
+
(0, import_node_crypto90.createHash)("sha256").update(root).digest("hex"),
|
|
113445
113972
|
ONE_WIDGET_PACKAGE
|
|
113446
113973
|
);
|
|
113447
|
-
|
|
113974
|
+
import_node_fs153.default.mkdirSync(packagePath, { recursive: true });
|
|
113448
113975
|
syncSwiftTree(
|
|
113449
113976
|
packagePath,
|
|
113450
|
-
new Map([...files2].map(([file, text7]) => [
|
|
113977
|
+
new Map([...files2].map(([file, text7]) => [import_node_path153.default.join(packagePath, file), text7]))
|
|
113451
113978
|
);
|
|
113452
113979
|
return {
|
|
113453
113980
|
packagePath,
|
|
@@ -113455,14 +113982,14 @@ async function oneWidgetPackage(appRoot) {
|
|
|
113455
113982
|
widget
|
|
113456
113983
|
};
|
|
113457
113984
|
}
|
|
113458
|
-
var
|
|
113985
|
+
var import_node_crypto90, import_node_fs153, import_node_os32, import_node_path153;
|
|
113459
113986
|
var init_one_widget_package = __esm({
|
|
113460
113987
|
"src/one-widget-package.ts"() {
|
|
113461
113988
|
"use strict";
|
|
113462
|
-
|
|
113463
|
-
|
|
113989
|
+
import_node_crypto90 = require("node:crypto");
|
|
113990
|
+
import_node_fs153 = __toESM(require("node:fs"), 1);
|
|
113464
113991
|
import_node_os32 = __toESM(require("node:os"), 1);
|
|
113465
|
-
|
|
113992
|
+
import_node_path153 = __toESM(require("node:path"), 1);
|
|
113466
113993
|
init_one_widget_metadata();
|
|
113467
113994
|
init_swift_compile();
|
|
113468
113995
|
init_one_widget_metadata();
|
|
@@ -113514,27 +114041,27 @@ function readBridgeFiles(output) {
|
|
|
113514
114041
|
});
|
|
113515
114042
|
}
|
|
113516
114043
|
function androidAppSources(appRoot) {
|
|
113517
|
-
const moduleDir =
|
|
113518
|
-
const gradle = ["build.gradle", "build.gradle.kts"].map((name3) =>
|
|
114044
|
+
const moduleDir = import_node_path154.default.join(appRoot, "android", "app");
|
|
114045
|
+
const gradle = ["build.gradle", "build.gradle.kts"].map((name3) => import_node_path154.default.join(moduleDir, name3)).find((file) => import_node_fs154.default.existsSync(file));
|
|
113519
114046
|
if (!gradle) return null;
|
|
113520
114047
|
const id = /\bapplicationId\s*=?\s*["']([^"']+)["']/.exec(
|
|
113521
|
-
|
|
114048
|
+
import_node_fs154.default.readFileSync(gradle, "utf8")
|
|
113522
114049
|
);
|
|
113523
114050
|
if (!id) throw new Error(`${gradle}: no applicationId`);
|
|
113524
114051
|
const kotlin = [];
|
|
113525
114052
|
const java = [];
|
|
113526
114053
|
const walk4 = (dir) => {
|
|
113527
|
-
if (!
|
|
113528
|
-
for (const child of
|
|
113529
|
-
const file =
|
|
114054
|
+
if (!import_node_fs154.default.existsSync(dir)) return;
|
|
114055
|
+
for (const child of import_node_fs154.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
114056
|
+
const file = import_node_path154.default.join(dir, child.name);
|
|
113530
114057
|
if (child.isSymbolicLink()) throw new Error(`Android source is a symlink: ${file}`);
|
|
113531
114058
|
if (child.isDirectory()) walk4(file);
|
|
113532
114059
|
else if (child.name.endsWith(".kt")) kotlin.push(file);
|
|
113533
114060
|
else if (child.name.endsWith(".java")) java.push(file);
|
|
113534
114061
|
}
|
|
113535
114062
|
};
|
|
113536
|
-
walk4(
|
|
113537
|
-
walk4(
|
|
114063
|
+
walk4(import_node_path154.default.join(moduleDir, "src", "main", "java"));
|
|
114064
|
+
walk4(import_node_path154.default.join(moduleDir, "src", "main", "kotlin"));
|
|
113538
114065
|
return { applicationId: id[1], kotlin, java };
|
|
113539
114066
|
}
|
|
113540
114067
|
function declares(source, owner, name3) {
|
|
@@ -113543,7 +114070,7 @@ function declares(source, owner, name3) {
|
|
|
113543
114070
|
}
|
|
113544
114071
|
function selectBridgePackages(applicationId, files2, javaFiles) {
|
|
113545
114072
|
const texts = new Map(
|
|
113546
|
-
files2.map((file) => [file.file,
|
|
114073
|
+
files2.map((file) => [file.file, import_node_fs154.default.readFileSync(file.file, "utf8")])
|
|
113547
114074
|
);
|
|
113548
114075
|
const owners = /* @__PURE__ */ new Map();
|
|
113549
114076
|
for (const file of files2)
|
|
@@ -113551,8 +114078,8 @@ function selectBridgePackages(applicationId, files2, javaFiles) {
|
|
|
113551
114078
|
owners.set(name3, [...owners.get(name3) ?? [], file]);
|
|
113552
114079
|
const javaDeclarations = javaFiles.map((file) => ({
|
|
113553
114080
|
file,
|
|
113554
|
-
package: /^\s*package\s+([\w.]+)\s*;/m.exec(
|
|
113555
|
-
name:
|
|
114081
|
+
package: /^\s*package\s+([\w.]+)\s*;/m.exec(import_node_fs154.default.readFileSync(file, "utf8"))?.[1] ?? "",
|
|
114082
|
+
name: import_node_path154.default.basename(file, ".java")
|
|
113556
114083
|
}));
|
|
113557
114084
|
const closure = (root) => {
|
|
113558
114085
|
const seen = /* @__PURE__ */ new Set([root]);
|
|
@@ -113625,12 +114152,12 @@ function moduleName(text7, className2) {
|
|
|
113625
114152
|
);
|
|
113626
114153
|
return match ? match[1] : null;
|
|
113627
114154
|
}
|
|
113628
|
-
var
|
|
114155
|
+
var import_node_fs154, import_node_path154, qualified2;
|
|
113629
114156
|
var init_android_bridge_packages = __esm({
|
|
113630
114157
|
"src/android-bridge-packages.ts"() {
|
|
113631
114158
|
"use strict";
|
|
113632
|
-
|
|
113633
|
-
|
|
114159
|
+
import_node_fs154 = __toESM(require("node:fs"), 1);
|
|
114160
|
+
import_node_path154 = __toESM(require("node:path"), 1);
|
|
113634
114161
|
init_is_record();
|
|
113635
114162
|
qualified2 = (file, name3) => file.package ? `${file.package}.${name3}` : name3;
|
|
113636
114163
|
}
|
|
@@ -113675,18 +114202,18 @@ var init_android_view_classes = __esm({
|
|
|
113675
114202
|
|
|
113676
114203
|
// src/java-module-abi.ts
|
|
113677
114204
|
async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
|
|
113678
|
-
const digest3 = (0,
|
|
113679
|
-
const parent =
|
|
113680
|
-
|
|
113681
|
-
const work =
|
|
114205
|
+
const digest3 = (0, import_node_crypto91.createHash)("sha256");
|
|
114206
|
+
const parent = import_node_path155.default.join(kotlinHome(), "java-specs");
|
|
114207
|
+
import_node_fs155.default.mkdirSync(parent, { recursive: true });
|
|
114208
|
+
const work = import_node_fs155.default.mkdtempSync(import_node_path155.default.join(parent, ".read-"));
|
|
113682
114209
|
try {
|
|
113683
114210
|
const origins = /* @__PURE__ */ new Map();
|
|
113684
114211
|
for (const [index, file] of files2.entries()) {
|
|
113685
|
-
const bytes =
|
|
114212
|
+
const bytes = import_node_fs155.default.readFileSync(file);
|
|
113686
114213
|
digest3.update(file).update("\0").update(bytes).update("\0");
|
|
113687
|
-
const target =
|
|
113688
|
-
|
|
113689
|
-
|
|
114214
|
+
const target = import_node_path155.default.join(work, String(index), import_node_path155.default.basename(file));
|
|
114215
|
+
import_node_fs155.default.mkdirSync(import_node_path155.default.dirname(target));
|
|
114216
|
+
import_node_fs155.default.writeFileSync(target, bytes);
|
|
113690
114217
|
origins.set(target, file);
|
|
113691
114218
|
}
|
|
113692
114219
|
const stdout = await runKotlinTool(
|
|
@@ -113719,20 +114246,20 @@ ${diagnostic.trim()}`, { cause });
|
|
|
113719
114246
|
});
|
|
113720
114247
|
return { sha256: digest3.digest("hex"), specs };
|
|
113721
114248
|
} finally {
|
|
113722
|
-
|
|
114249
|
+
import_node_fs155.default.rmSync(work, { recursive: true, force: true });
|
|
113723
114250
|
}
|
|
113724
114251
|
}
|
|
113725
114252
|
async function compileJavaModuleAbi(input) {
|
|
113726
114253
|
const { specs, work, hash, toolchain, libraries, sdkRoot, sdkLibrary, language } = input;
|
|
113727
|
-
const directory2 =
|
|
113728
|
-
|
|
114254
|
+
const directory2 = import_node_path155.default.join(work, "java-abi");
|
|
114255
|
+
import_node_fs155.default.mkdirSync(directory2);
|
|
113729
114256
|
const sources = specs.specs.map((spec, index) => {
|
|
113730
|
-
const target =
|
|
113731
|
-
|
|
114257
|
+
const target = import_node_path155.default.join(directory2, `Spec${index}.kt`);
|
|
114258
|
+
import_node_fs155.default.writeFileSync(target, spec.source);
|
|
113732
114259
|
return target;
|
|
113733
114260
|
});
|
|
113734
|
-
const initializer =
|
|
113735
|
-
|
|
114261
|
+
const initializer = import_node_path155.default.join(directory2, "Bindings.kt");
|
|
114262
|
+
import_node_fs155.default.writeFileSync(
|
|
113736
114263
|
initializer,
|
|
113737
114264
|
[
|
|
113738
114265
|
"package dev.peach.jni",
|
|
@@ -113746,8 +114273,8 @@ async function compileJavaModuleAbi(input) {
|
|
|
113746
114273
|
"-J-Xmx2g",
|
|
113747
114274
|
"-Xwasm-target=js",
|
|
113748
114275
|
"-libraries",
|
|
113749
|
-
libraries.join(
|
|
113750
|
-
`-Xplugin=${
|
|
114276
|
+
libraries.join(import_node_path155.default.delimiter),
|
|
114277
|
+
`-Xplugin=${import_node_path155.default.join(sdkRoot, "plugin.jar")}`,
|
|
113751
114278
|
`-Xfriend-modules=${sdkLibrary}`,
|
|
113752
114279
|
"-language-version",
|
|
113753
114280
|
language,
|
|
@@ -113763,23 +114290,23 @@ async function compileJavaModuleAbi(input) {
|
|
|
113763
114290
|
],
|
|
113764
114291
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
113765
114292
|
);
|
|
113766
|
-
const library =
|
|
114293
|
+
const library = import_node_path155.default.join(directory2, "java-abi.klib");
|
|
113767
114294
|
await runKotlinTool(
|
|
113768
114295
|
toolchain,
|
|
113769
114296
|
sdkRoot,
|
|
113770
114297
|
"dev.peach.tools.platform.JavaPlatformTypesKt",
|
|
113771
|
-
[
|
|
114298
|
+
[import_node_path155.default.join(directory2, `${name3}.klib`), library]
|
|
113772
114299
|
);
|
|
113773
114300
|
return library;
|
|
113774
114301
|
}
|
|
113775
|
-
var import_node_child_process72,
|
|
114302
|
+
var import_node_child_process72, import_node_crypto91, import_node_fs155, import_node_path155, import_node_util18, run13, JAVA_BINDINGS_INITIALIZER;
|
|
113776
114303
|
var init_java_module_abi = __esm({
|
|
113777
114304
|
"src/java-module-abi.ts"() {
|
|
113778
114305
|
"use strict";
|
|
113779
114306
|
import_node_child_process72 = require("node:child_process");
|
|
113780
|
-
|
|
113781
|
-
|
|
113782
|
-
|
|
114307
|
+
import_node_crypto91 = require("node:crypto");
|
|
114308
|
+
import_node_fs155 = __toESM(require("node:fs"), 1);
|
|
114309
|
+
import_node_path155 = __toESM(require("node:path"), 1);
|
|
113783
114310
|
import_node_util18 = require("node:util");
|
|
113784
114311
|
init_android_bridge_packages();
|
|
113785
114312
|
init_is_record();
|
|
@@ -114017,65 +114544,65 @@ var init_kotlinSdkContract = __esm({
|
|
|
114017
114544
|
// src/kotlin-sdk.ts
|
|
114018
114545
|
function verifyKotlinSdkDirectory(root, compiler) {
|
|
114019
114546
|
const expectedNames = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
114020
|
-
const names =
|
|
114547
|
+
const names = import_node_fs156.default.readdirSync(root);
|
|
114021
114548
|
if (names.length !== expectedNames.length || names.some((name3) => !expectedNames.includes(name3)))
|
|
114022
114549
|
throw new Error("Kotlin SDK directory contains unexpected inputs");
|
|
114023
|
-
const manifestStat =
|
|
114550
|
+
const manifestStat = import_node_fs156.default.lstatSync(import_node_path156.default.join(root, "manifest.json"));
|
|
114024
114551
|
if (!manifestStat.isFile() || manifestStat.nlink !== 1)
|
|
114025
114552
|
throw new Error("Kotlin SDK manifest is not a regular file");
|
|
114026
114553
|
const manifest = readKotlinSdkManifest(
|
|
114027
|
-
|
|
114554
|
+
import_node_fs156.default.readFileSync(import_node_path156.default.join(root, "manifest.json"), "utf8"),
|
|
114028
114555
|
compiler.upstreamSha256
|
|
114029
114556
|
);
|
|
114030
114557
|
for (const [name3, expected] of Object.entries(manifest.files)) {
|
|
114031
|
-
const target =
|
|
114032
|
-
const stat2 =
|
|
114558
|
+
const target = import_node_path156.default.join(root, name3);
|
|
114559
|
+
const stat2 = import_node_fs156.default.lstatSync(target);
|
|
114033
114560
|
if (!stat2.isFile() || stat2.nlink !== 1)
|
|
114034
114561
|
throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
|
|
114035
|
-
const bytes =
|
|
114036
|
-
if (bytes.length !== expected.bytes || (0,
|
|
114562
|
+
const bytes = import_node_fs156.default.readFileSync(target);
|
|
114563
|
+
if (bytes.length !== expected.bytes || (0, import_node_crypto92.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
|
|
114037
114564
|
throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
|
|
114038
114565
|
}
|
|
114039
114566
|
return manifest;
|
|
114040
114567
|
}
|
|
114041
114568
|
async function installKotlinSdkArchive(archive, compiler) {
|
|
114042
|
-
const sha2565 = (0,
|
|
114043
|
-
const parent =
|
|
114044
|
-
const root =
|
|
114045
|
-
if (
|
|
114569
|
+
const sha2565 = (0, import_node_crypto92.createHash)("sha256").update(archive).digest("hex");
|
|
114570
|
+
const parent = import_node_path156.default.join(kotlinHome(), "sdk");
|
|
114571
|
+
const root = import_node_path156.default.join(parent, sha2565);
|
|
114572
|
+
if (import_node_fs156.default.existsSync(root))
|
|
114046
114573
|
return { root, sha256: sha2565, manifest: verifyKotlinSdkDirectory(root, compiler) };
|
|
114047
|
-
|
|
114048
|
-
const work =
|
|
114574
|
+
import_node_fs156.default.mkdirSync(parent, { recursive: true });
|
|
114575
|
+
const work = import_node_fs156.default.mkdtempSync(import_node_path156.default.join(parent, ".install-"));
|
|
114049
114576
|
try {
|
|
114050
|
-
const packed =
|
|
114051
|
-
|
|
114577
|
+
const packed = import_node_path156.default.join(work, "sdk.tar.gz");
|
|
114578
|
+
import_node_fs156.default.writeFileSync(packed, archive);
|
|
114052
114579
|
const { stdout } = await run14("tar", ["-tzf", packed]);
|
|
114053
114580
|
const names = stdout.trim().split("\n");
|
|
114054
114581
|
const expected = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
114055
114582
|
if (names.length !== expected.length || new Set(names).size !== names.length || names.some((name3) => !expected.includes(name3)))
|
|
114056
114583
|
throw new Error("Kotlin SDK archive contains unexpected inputs");
|
|
114057
114584
|
await run14("tar", ["-xzf", packed, "-C", work, "--", ...expected]);
|
|
114058
|
-
|
|
114585
|
+
import_node_fs156.default.rmSync(packed);
|
|
114059
114586
|
const manifest = verifyKotlinSdkDirectory(work, compiler);
|
|
114060
114587
|
try {
|
|
114061
|
-
|
|
114588
|
+
import_node_fs156.default.renameSync(work, root);
|
|
114062
114589
|
} catch (error) {
|
|
114063
|
-
if (!
|
|
114590
|
+
if (!import_node_fs156.default.existsSync(root)) throw error;
|
|
114064
114591
|
verifyKotlinSdkDirectory(root, compiler);
|
|
114065
114592
|
}
|
|
114066
114593
|
return { root, sha256: sha2565, manifest };
|
|
114067
114594
|
} finally {
|
|
114068
|
-
|
|
114595
|
+
import_node_fs156.default.rmSync(work, { recursive: true, force: true });
|
|
114069
114596
|
}
|
|
114070
114597
|
}
|
|
114071
|
-
var import_node_child_process73,
|
|
114598
|
+
var import_node_child_process73, import_node_crypto92, import_node_fs156, import_node_path156, import_node_util19, run14;
|
|
114072
114599
|
var init_kotlin_sdk = __esm({
|
|
114073
114600
|
"src/kotlin-sdk.ts"() {
|
|
114074
114601
|
"use strict";
|
|
114075
114602
|
import_node_child_process73 = require("node:child_process");
|
|
114076
|
-
|
|
114077
|
-
|
|
114078
|
-
|
|
114603
|
+
import_node_crypto92 = require("node:crypto");
|
|
114604
|
+
import_node_fs156 = __toESM(require("node:fs"), 1);
|
|
114605
|
+
import_node_path156 = __toESM(require("node:path"), 1);
|
|
114079
114606
|
import_node_util19 = require("node:util");
|
|
114080
114607
|
init_kotlin_toolchain();
|
|
114081
114608
|
init_kotlinSdkContract();
|
|
@@ -114206,45 +114733,45 @@ var init_kotlin_view_models = __esm({
|
|
|
114206
114733
|
|
|
114207
114734
|
// src/kotlin-module.ts
|
|
114208
114735
|
function peachKotlinModuleRoot() {
|
|
114209
|
-
if (!IS_STANDALONE) return
|
|
114736
|
+
if (!IS_STANDALONE) return import_node_path157.default.join(peachsimPackageRoot(), "kotlin");
|
|
114210
114737
|
if (installedRoot) return installedRoot;
|
|
114211
114738
|
const files2 = JSON.parse(__PEACH_BUNDLED_KOTLIN__);
|
|
114212
|
-
const digest3 = (0,
|
|
114213
|
-
const parent =
|
|
114214
|
-
const root =
|
|
114215
|
-
|
|
114216
|
-
if (!
|
|
114217
|
-
const pending =
|
|
114739
|
+
const digest3 = (0, import_node_crypto93.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
|
|
114740
|
+
const parent = import_node_path157.default.join(rnxHomeDir(), "kotlin", "modules");
|
|
114741
|
+
const root = import_node_path157.default.join(parent, digest3);
|
|
114742
|
+
import_node_fs157.default.mkdirSync(parent, { recursive: true });
|
|
114743
|
+
if (!import_node_fs157.default.existsSync(root)) {
|
|
114744
|
+
const pending = import_node_fs157.default.mkdtempSync(import_node_path157.default.join(parent, ".install-"));
|
|
114218
114745
|
try {
|
|
114219
114746
|
for (const [name3, contents2] of Object.entries(files2)) {
|
|
114220
|
-
const file =
|
|
114221
|
-
|
|
114222
|
-
|
|
114747
|
+
const file = import_node_path157.default.join(pending, name3);
|
|
114748
|
+
import_node_fs157.default.mkdirSync(import_node_path157.default.dirname(file), { recursive: true });
|
|
114749
|
+
import_node_fs157.default.writeFileSync(file, Buffer.from(contents2, "base64"));
|
|
114223
114750
|
}
|
|
114224
114751
|
try {
|
|
114225
|
-
|
|
114752
|
+
import_node_fs157.default.renameSync(pending, root);
|
|
114226
114753
|
} catch (error) {
|
|
114227
114754
|
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY")
|
|
114228
114755
|
throw error;
|
|
114229
114756
|
}
|
|
114230
114757
|
} finally {
|
|
114231
|
-
|
|
114758
|
+
import_node_fs157.default.rmSync(pending, { recursive: true, force: true });
|
|
114232
114759
|
}
|
|
114233
114760
|
}
|
|
114234
114761
|
for (const [name3, contents2] of Object.entries(files2)) {
|
|
114235
|
-
if (!
|
|
114762
|
+
if (!import_node_fs157.default.readFileSync(import_node_path157.default.join(root, name3)).equals(Buffer.from(contents2, "base64")))
|
|
114236
114763
|
throw new Error(`packaged Kotlin module differs from this CLI: ${name3}`);
|
|
114237
114764
|
}
|
|
114238
114765
|
installedRoot = root;
|
|
114239
114766
|
return root;
|
|
114240
114767
|
}
|
|
114241
|
-
var
|
|
114768
|
+
var import_node_crypto93, import_node_fs157, import_node_path157, installedRoot;
|
|
114242
114769
|
var init_kotlin_module = __esm({
|
|
114243
114770
|
"src/kotlin-module.ts"() {
|
|
114244
114771
|
"use strict";
|
|
114245
|
-
|
|
114246
|
-
|
|
114247
|
-
|
|
114772
|
+
import_node_crypto93 = require("node:crypto");
|
|
114773
|
+
import_node_fs157 = __toESM(require("node:fs"), 1);
|
|
114774
|
+
import_node_path157 = __toESM(require("node:path"), 1);
|
|
114248
114775
|
init_standalone();
|
|
114249
114776
|
init_home_paths();
|
|
114250
114777
|
init_is_record();
|
|
@@ -114268,16 +114795,16 @@ async function resolveAndroidGradleSources(request) {
|
|
|
114268
114795
|
includeDependencySources = false
|
|
114269
114796
|
} = request;
|
|
114270
114797
|
if (projectDirs.length === 0) return [];
|
|
114271
|
-
if (!
|
|
114798
|
+
if (!import_node_path158.default.isAbsolute(root) || projectDirs.some((dir) => !import_node_path158.default.isAbsolute(dir)))
|
|
114272
114799
|
throw new Error("Android Gradle source selection requires absolute project paths");
|
|
114273
114800
|
if (!variant2) throw new Error("Android Gradle source selection requires a variant");
|
|
114274
|
-
root =
|
|
114275
|
-
const projects2 = [...new Set(projectDirs.map((dir) =>
|
|
114276
|
-
const parent =
|
|
114277
|
-
|
|
114278
|
-
const work =
|
|
114279
|
-
const task = `peachAndroidSources${(0,
|
|
114280
|
-
const script =
|
|
114801
|
+
root = import_node_fs158.default.realpathSync(root);
|
|
114802
|
+
const projects2 = [...new Set(projectDirs.map((dir) => import_node_fs158.default.realpathSync(dir)))];
|
|
114803
|
+
const parent = import_node_path158.default.join(kotlinHome(), "gradle-sources");
|
|
114804
|
+
import_node_fs158.default.mkdirSync(parent, { recursive: true });
|
|
114805
|
+
const work = import_node_fs158.default.mkdtempSync(import_node_path158.default.join(parent, ".query-"));
|
|
114806
|
+
const task = `peachAndroidSources${(0, import_node_crypto94.randomBytes)(8).toString("hex")}`;
|
|
114807
|
+
const script = import_node_path158.default.join(work, "sources.gradle");
|
|
114281
114808
|
const encoded = Buffer.from(
|
|
114282
114809
|
JSON.stringify({
|
|
114283
114810
|
root,
|
|
@@ -114291,12 +114818,12 @@ async function resolveAndroidGradleSources(request) {
|
|
|
114291
114818
|
task
|
|
114292
114819
|
})
|
|
114293
114820
|
).toString("base64");
|
|
114294
|
-
|
|
114821
|
+
import_node_fs158.default.writeFileSync(script, modelQuery.replace("__PEACH_REQUEST__", encoded));
|
|
114295
114822
|
try {
|
|
114296
114823
|
await run15(
|
|
114297
114824
|
"bash",
|
|
114298
114825
|
[
|
|
114299
|
-
|
|
114826
|
+
import_node_path158.default.join(root, "gradlew"),
|
|
114300
114827
|
"--init-script",
|
|
114301
114828
|
script,
|
|
114302
114829
|
`${task}All`,
|
|
@@ -114315,19 +114842,19 @@ async function resolveAndroidGradleSources(request) {
|
|
|
114315
114842
|
);
|
|
114316
114843
|
return projects2.map((projectDir, index) => {
|
|
114317
114844
|
const value = JSON.parse(
|
|
114318
|
-
|
|
114845
|
+
import_node_fs158.default.readFileSync(import_node_path158.default.join(work, `${index}.json`), "utf8")
|
|
114319
114846
|
);
|
|
114320
114847
|
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))
|
|
114321
114848
|
throw new Error("Gradle printed an invalid Android project source model");
|
|
114322
114849
|
const paths = (field) => {
|
|
114323
114850
|
const list2 = value[field];
|
|
114324
|
-
if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" &&
|
|
114851
|
+
if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" && import_node_path158.default.isAbsolute(file)))
|
|
114325
114852
|
throw new Error(`Gradle printed invalid Android ${field} paths`);
|
|
114326
114853
|
return list2.map(String);
|
|
114327
114854
|
};
|
|
114328
114855
|
const linkedResource = (field) => {
|
|
114329
114856
|
const file = value[field];
|
|
114330
|
-
if (typeof file !== "string" || !
|
|
114857
|
+
if (typeof file !== "string" || !import_node_path158.default.isAbsolute(file) || !import_node_fs158.default.statSync(file, { throwIfNoEntry: false })?.isFile())
|
|
114331
114858
|
throw new Error(`Gradle did not produce ${field} for ${projectDir}:${variant2}`);
|
|
114332
114859
|
return file;
|
|
114333
114860
|
};
|
|
@@ -114376,14 +114903,14 @@ async function resolveAndroidGradleSources(request) {
|
|
|
114376
114903
|
};
|
|
114377
114904
|
});
|
|
114378
114905
|
} finally {
|
|
114379
|
-
|
|
114906
|
+
import_node_fs158.default.rmSync(work, { recursive: true, force: true });
|
|
114380
114907
|
}
|
|
114381
114908
|
}
|
|
114382
114909
|
function readDependencySources(value) {
|
|
114383
114910
|
if (!Array.isArray(value)) throw new Error("Gradle printed invalid dependency sources");
|
|
114384
114911
|
const coordinates = /* @__PURE__ */ new Set();
|
|
114385
114912
|
return value.map((entry) => {
|
|
114386
|
-
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" || !
|
|
114913
|
+
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_path158.default.isAbsolute(entry.archive) || !import_node_fs158.default.statSync(entry.archive, { throwIfNoEntry: false })?.isFile())
|
|
114387
114914
|
throw new Error("Gradle printed an invalid dependency sources archive");
|
|
114388
114915
|
const coordinate = `${entry.group}:${entry.name}:${entry.version}`;
|
|
114389
114916
|
if (coordinates.has(coordinate))
|
|
@@ -114397,14 +114924,14 @@ function readDependencySources(value) {
|
|
|
114397
114924
|
};
|
|
114398
114925
|
});
|
|
114399
114926
|
}
|
|
114400
|
-
var import_node_child_process74,
|
|
114927
|
+
var import_node_child_process74, import_node_crypto94, import_node_fs158, import_node_path158, import_node_util20, run15, modelQuery;
|
|
114401
114928
|
var init_android_gradle_sources = __esm({
|
|
114402
114929
|
"src/android-gradle-sources.ts"() {
|
|
114403
114930
|
"use strict";
|
|
114404
114931
|
import_node_child_process74 = require("node:child_process");
|
|
114405
|
-
|
|
114406
|
-
|
|
114407
|
-
|
|
114932
|
+
import_node_crypto94 = require("node:crypto");
|
|
114933
|
+
import_node_fs158 = __toESM(require("node:fs"), 1);
|
|
114934
|
+
import_node_path158 = __toESM(require("node:path"), 1);
|
|
114408
114935
|
import_node_util20 = require("node:util");
|
|
114409
114936
|
init_forked_script_contract();
|
|
114410
114937
|
init_is_record();
|
|
@@ -114592,16 +115119,16 @@ __export(kotlin_host_exports, {
|
|
|
114592
115119
|
});
|
|
114593
115120
|
function loadKotlinSdk(moduleRoot, toolchain) {
|
|
114594
115121
|
return installKotlinSdkArchive(
|
|
114595
|
-
|
|
115122
|
+
import_node_fs159.default.readFileSync(import_node_path159.default.join(moduleRoot, "sdk.tar.gz")),
|
|
114596
115123
|
toolchain.compiler
|
|
114597
115124
|
);
|
|
114598
115125
|
}
|
|
114599
115126
|
function appKotlinLanguage(root) {
|
|
114600
|
-
const reactNative =
|
|
114601
|
-
(0,
|
|
115127
|
+
const reactNative = import_node_path159.default.dirname(
|
|
115128
|
+
(0, import_node_module22.createRequire)(import_node_path159.default.join(root, "package.json")).resolve("react-native/package.json")
|
|
114602
115129
|
);
|
|
114603
|
-
const versions =
|
|
114604
|
-
|
|
115130
|
+
const versions = import_node_fs159.default.readFileSync(
|
|
115131
|
+
import_node_path159.default.join(reactNative, "gradle", "libs.versions.toml"),
|
|
114605
115132
|
"utf8"
|
|
114606
115133
|
);
|
|
114607
115134
|
const match = /^kotlin\s*=\s*"(\d+)\.(\d+)/m.exec(versions);
|
|
@@ -114612,9 +115139,9 @@ function appKotlinLanguage(root) {
|
|
|
114612
115139
|
function kotlinSources(root, skip = SKIP_DIRS) {
|
|
114613
115140
|
const sources = [];
|
|
114614
115141
|
const walk4 = (dir) => {
|
|
114615
|
-
for (const entry of
|
|
115142
|
+
for (const entry of import_node_fs159.default.readdirSync(dir, { withFileTypes: true })) {
|
|
114616
115143
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
114617
|
-
const full =
|
|
115144
|
+
const full = import_node_path159.default.join(dir, entry.name);
|
|
114618
115145
|
if (entry.isDirectory()) walk4(full);
|
|
114619
115146
|
else if (entry.isFile() && entry.name.endsWith(".kt")) sources.push(full);
|
|
114620
115147
|
}
|
|
@@ -114671,7 +115198,7 @@ function entrySource(ids) {
|
|
|
114671
115198
|
].join("\n");
|
|
114672
115199
|
}
|
|
114673
115200
|
function buildsDir() {
|
|
114674
|
-
return
|
|
115201
|
+
return import_node_path159.default.join(kotlinHome(), "builds");
|
|
114675
115202
|
}
|
|
114676
115203
|
async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
|
|
114677
115204
|
const { kotlinSourceId, nativeSourceContract, renderKotlinSourceGlue } = await import("vxrn/native-source-contract");
|
|
@@ -114684,7 +115211,7 @@ async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
|
|
|
114684
115211
|
const viewIds = [];
|
|
114685
115212
|
let usesCompose = false;
|
|
114686
115213
|
for (const file of sources) {
|
|
114687
|
-
const source =
|
|
115214
|
+
const source = import_node_fs159.default.readFileSync(file, "utf8");
|
|
114688
115215
|
if (/\bandroidx\.compose\./.test(source)) usesCompose = true;
|
|
114689
115216
|
const contract = nativeSourceContract(file, source);
|
|
114690
115217
|
if (contract.modules.length === 0 && contract.views.length === 0) continue;
|
|
@@ -114773,11 +115300,11 @@ function readExpoTypes(output) {
|
|
|
114773
115300
|
});
|
|
114774
115301
|
}
|
|
114775
115302
|
async function scanSources(tool, parse17, toolchain, moduleRoot, files2) {
|
|
114776
|
-
const digest3 = (0,
|
|
115303
|
+
const digest3 = (0, import_node_crypto95.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
|
|
114777
115304
|
const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
|
|
114778
|
-
digest3.update(
|
|
115305
|
+
digest3.update(import_node_fs159.default.readFileSync(import_node_path159.default.join(moduleRoot, "sdk.tar.gz")));
|
|
114779
115306
|
digest3.update(tool);
|
|
114780
|
-
for (const file of files2) digest3.update(`${file}\0${
|
|
115307
|
+
for (const file of files2) digest3.update(`${file}\0${import_node_fs159.default.readFileSync(file, "utf8")}\0`);
|
|
114781
115308
|
const key2 = digest3.digest("hex");
|
|
114782
115309
|
let scan3 = toolScans.get(key2);
|
|
114783
115310
|
if (!scan3) {
|
|
@@ -114792,7 +115319,7 @@ async function scanSources(tool, parse17, toolchain, moduleRoot, files2) {
|
|
|
114792
115319
|
async function scanExpoTypes(toolchain, moduleRoot, sources) {
|
|
114793
115320
|
const candidates = sources.filter(
|
|
114794
115321
|
(file) => /\bRecord\b|\benum\s+class\b|\bExpoComposeView\b|\bExpoView\b|\bComposeProps\b|:\s*(?:[A-Za-z0-9_.]+\.)?(?:View|FrameLayout|LinearLayout|ViewGroup)\b/.test(
|
|
114795
|
-
|
|
115322
|
+
import_node_fs159.default.readFileSync(file, "utf8")
|
|
114796
115323
|
)
|
|
114797
115324
|
);
|
|
114798
115325
|
if (candidates.length === 0) return [];
|
|
@@ -114936,7 +115463,7 @@ function expoTypeSources(files2) {
|
|
|
114936
115463
|
)
|
|
114937
115464
|
];
|
|
114938
115465
|
if (edits.length > 0 || views.length > 0) {
|
|
114939
|
-
let text7 =
|
|
115466
|
+
let text7 = import_node_fs159.default.readFileSync(file.file, "utf8").replaceAll("\r\n", "\n");
|
|
114940
115467
|
for (const { range: range3, owner, field } of edits.sort((a, b) => b.range[0] - a.range[0]))
|
|
114941
115468
|
text7 = `${text7.slice(0, range3[0])}dev.peach.expo.PeachExpoTypes.initial(${owner}::class, ${literal3(field.key)}, ${field.required}) { ${text7.slice(range3[0], range3[1])} }${text7.slice(range3[1])}`;
|
|
114942
115469
|
if (views.length > 0) {
|
|
@@ -114952,7 +115479,7 @@ function expoTypeSources(files2) {
|
|
|
114952
115479
|
`${file.package ? `${file.package}.` : ""}peachExpoViews${index}()`
|
|
114953
115480
|
);
|
|
114954
115481
|
}
|
|
114955
|
-
const name3 = `PeachExpoSource_${index}_${
|
|
115482
|
+
const name3 = `PeachExpoSource_${index}_${import_node_path159.default.basename(file.file)}`;
|
|
114956
115483
|
generated[name3] = text7;
|
|
114957
115484
|
origins[name3] = file.file;
|
|
114958
115485
|
}
|
|
@@ -114994,7 +115521,7 @@ async function expoKotlinArtifact(root, moduleRoot, origin, modules) {
|
|
|
114994
115521
|
const language = appKotlinLanguage(root);
|
|
114995
115522
|
const scanned = await scanExpoTypes(toolchain, moduleRoot, modules.sources);
|
|
114996
115523
|
const usesCompose = scanned.some((file) => file.views.length > 0) || modules.sources.some(
|
|
114997
|
-
(file) => /\bandroidx\.compose\./.test(
|
|
115524
|
+
(file) => /\bandroidx\.compose\./.test(import_node_fs159.default.readFileSync(file, "utf8"))
|
|
114998
115525
|
);
|
|
114999
115526
|
const types2 = expoTypeSources(scanned);
|
|
115000
115527
|
const rewritten = new Set(Object.values(types2.origins));
|
|
@@ -115212,7 +115739,7 @@ function appResourceSources(app) {
|
|
|
115212
115739
|
entries: app.drawables.map((drawable) => ({
|
|
115213
115740
|
name: drawable.name,
|
|
115214
115741
|
init: `listOf(
|
|
115215
|
-
${drawable.files.map((file) => drawableInit(file,
|
|
115742
|
+
${drawable.files.map((file) => drawableInit(file, import_node_path159.default.relative(app.moduleDir, file.file))).join(",\n")}
|
|
115216
115743
|
)`
|
|
115217
115744
|
}))
|
|
115218
115745
|
},
|
|
@@ -115336,7 +115863,7 @@ function drawableInit(drawable, file) {
|
|
|
115336
115863
|
if (drawable.kind === "xml") return `PeachDrawable.Xml(${where})`;
|
|
115337
115864
|
if (drawable.kind === "bitmap")
|
|
115338
115865
|
return `PeachDrawable.Bitmap(${where}, ${drawable.ninePatch}, ${literal3(
|
|
115339
|
-
|
|
115866
|
+
import_node_fs159.default.readFileSync(drawable.file).toString("base64")
|
|
115340
115867
|
)})`;
|
|
115341
115868
|
const vector = drawable.vector;
|
|
115342
115869
|
const float3 = (value) => `${value}f`;
|
|
@@ -115401,8 +115928,8 @@ async function compileKotlin(input, origin) {
|
|
|
115401
115928
|
javaSpecs = []
|
|
115402
115929
|
} = input;
|
|
115403
115930
|
const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
|
|
115404
|
-
const plugin =
|
|
115405
|
-
const sdkLibrary =
|
|
115931
|
+
const plugin = import_node_path159.default.join(sdk2.root, "plugin.jar");
|
|
115932
|
+
const sdkLibrary = import_node_path159.default.join(sdk2.root, `${sdkProfile}.klib`);
|
|
115406
115933
|
const javaRead = javaSpecs.length ? await readJavaModuleSpecs(javaSpecs, sdk2.root, await ensureToolchain(toolchain)) : null;
|
|
115407
115934
|
const java = javaRead && javaRead.specs.some((spec) => !spec.application) ? { ...javaRead, specs: javaRead.specs.filter((spec) => !spec.application) } : null;
|
|
115408
115935
|
const applicationJava = javaRead?.specs.filter((spec) => spec.application) ?? [];
|
|
@@ -115430,10 +115957,10 @@ async function compileKotlin(input, origin) {
|
|
|
115430
115957
|
};
|
|
115431
115958
|
const inputs2 = sources.map((file) => ({
|
|
115432
115959
|
file,
|
|
115433
|
-
bytes:
|
|
115960
|
+
bytes: import_node_fs159.default.readFileSync(file)
|
|
115434
115961
|
}));
|
|
115435
115962
|
const { composeArchive, ...compilerInputs } = toolchain;
|
|
115436
|
-
const digest3 = (0,
|
|
115963
|
+
const digest3 = (0, import_node_crypto95.createHash)("sha256");
|
|
115437
115964
|
digest3.update(
|
|
115438
115965
|
JSON.stringify({
|
|
115439
115966
|
format: BUILD_FORMAT,
|
|
@@ -115447,7 +115974,7 @@ async function compileKotlin(input, origin) {
|
|
|
115447
115974
|
})
|
|
115448
115975
|
);
|
|
115449
115976
|
for (const { file, bytes } of inputs2)
|
|
115450
|
-
digest3.update(
|
|
115977
|
+
digest3.update(import_node_path159.default.relative(root, file)).update("\0").update(bytes).update("\0");
|
|
115451
115978
|
if (viewModels) digest3.update(viewModels.toolClass);
|
|
115452
115979
|
for (const [name3, text7] of Object.entries(generated))
|
|
115453
115980
|
digest3.update(`${name3}\0${text7}\0`);
|
|
@@ -115456,28 +115983,28 @@ async function compileKotlin(input, origin) {
|
|
|
115456
115983
|
url: `${origin}${KOTLIN_ARTIFACT_PREFIX}${hash}/app.mjs`,
|
|
115457
115984
|
hash
|
|
115458
115985
|
};
|
|
115459
|
-
const out =
|
|
115460
|
-
if (
|
|
115986
|
+
const out = import_node_path159.default.join(buildsDir(), hash);
|
|
115987
|
+
if (import_node_fs159.default.existsSync(import_node_path159.default.join(out, "js", "app.wasm"))) return artifact;
|
|
115461
115988
|
const pending = builds.get(hash);
|
|
115462
115989
|
if (pending) return pending;
|
|
115463
115990
|
const build2 = (async () => {
|
|
115464
115991
|
const ready = await ensureToolchain(toolchain);
|
|
115465
115992
|
const { kotlinc } = ready;
|
|
115466
|
-
const libraries = [...ready.libraries, sdkLibrary,
|
|
115993
|
+
const libraries = [...ready.libraries, sdkLibrary, import_node_path159.default.join(sdk2.root, "java.klib")];
|
|
115467
115994
|
const compose = usesCompose ? await ensureCompose(toolchain) : null;
|
|
115468
115995
|
if (compose) libraries.push(...compose.libraries);
|
|
115469
|
-
|
|
115470
|
-
const work =
|
|
115471
|
-
const javaLibrary = java ?
|
|
115996
|
+
import_node_fs159.default.mkdirSync(buildsDir(), { recursive: true });
|
|
115997
|
+
const work = import_node_fs159.default.mkdtempSync(import_node_path159.default.join(buildsDir(), `${hash}-`));
|
|
115998
|
+
const javaLibrary = java ? import_node_path159.default.join(work, "java-abi", "java-abi.klib") : null;
|
|
115472
115999
|
if (javaLibrary) libraries.push(javaLibrary);
|
|
115473
|
-
const generatedDir =
|
|
115474
|
-
|
|
116000
|
+
const generatedDir = import_node_path159.default.join(work, "generated");
|
|
116001
|
+
import_node_fs159.default.mkdirSync(generatedDir);
|
|
115475
116002
|
for (const [name3, text7] of Object.entries(generated))
|
|
115476
|
-
|
|
116003
|
+
import_node_fs159.default.writeFileSync(import_node_path159.default.join(generatedDir, name3), text7);
|
|
115477
116004
|
const compiledSources = inputs2.map(({ file, bytes }, index) => {
|
|
115478
|
-
const target =
|
|
115479
|
-
|
|
115480
|
-
|
|
116005
|
+
const target = import_node_path159.default.join(work, "sources", String(index), import_node_path159.default.basename(file));
|
|
116006
|
+
import_node_fs159.default.mkdirSync(import_node_path159.default.dirname(target), { recursive: true });
|
|
116007
|
+
import_node_fs159.default.writeFileSync(target, bytes);
|
|
115481
116008
|
return { file, target };
|
|
115482
116009
|
});
|
|
115483
116010
|
const common2 = [
|
|
@@ -115486,19 +116013,19 @@ async function compileKotlin(input, origin) {
|
|
|
115486
116013
|
"-Xallow-kotlin-package",
|
|
115487
116014
|
"-Xwasm-target=js",
|
|
115488
116015
|
"-libraries",
|
|
115489
|
-
libraries.join(
|
|
116016
|
+
libraries.join(import_node_path159.default.delimiter)
|
|
115490
116017
|
];
|
|
115491
116018
|
const compileKlib = (outputDir) => run16(
|
|
115492
116019
|
kotlinc,
|
|
115493
116020
|
[
|
|
115494
116021
|
...common2,
|
|
115495
116022
|
`-Xplugin=${plugin}`,
|
|
115496
|
-
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(
|
|
116023
|
+
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path159.default.delimiter)}`,
|
|
115497
116024
|
...usesCompose ? [
|
|
115498
|
-
`-Xplugin=${
|
|
116025
|
+
`-Xplugin=${import_node_path159.default.resolve(import_node_path159.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
|
|
115499
116026
|
] : [],
|
|
115500
116027
|
...usesSerialization ? [
|
|
115501
|
-
`-Xplugin=${
|
|
116028
|
+
`-Xplugin=${import_node_path159.default.resolve(import_node_path159.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
|
|
115502
116029
|
] : [],
|
|
115503
116030
|
"-language-version",
|
|
115504
116031
|
language,
|
|
@@ -115512,7 +116039,7 @@ async function compileKotlin(input, origin) {
|
|
|
115512
116039
|
"-ir-output-name",
|
|
115513
116040
|
"app",
|
|
115514
116041
|
...compiledSources.map(({ target }) => target),
|
|
115515
|
-
...Object.keys(generated).map((name3) =>
|
|
116042
|
+
...Object.keys(generated).map((name3) => import_node_path159.default.join(generatedDir, name3))
|
|
115516
116043
|
],
|
|
115517
116044
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
115518
116045
|
);
|
|
@@ -115531,49 +116058,49 @@ async function compileKotlin(input, origin) {
|
|
|
115531
116058
|
if (viewModels && inputs2.some(
|
|
115532
116059
|
({ file, bytes }) => sources.includes(file) && bytes.includes("ViewModel")
|
|
115533
116060
|
)) {
|
|
115534
|
-
await compileKlib(
|
|
116061
|
+
await compileKlib(import_node_path159.default.join(work, "abi"));
|
|
115535
116062
|
const stdout = await runKotlinTool(
|
|
115536
116063
|
ready,
|
|
115537
116064
|
sdk2.root,
|
|
115538
116065
|
viewModels.toolClass,
|
|
115539
|
-
[
|
|
116066
|
+
[import_node_path159.default.join(work, "abi")],
|
|
115540
116067
|
64 * 1024 * 1024
|
|
115541
116068
|
);
|
|
115542
|
-
|
|
115543
|
-
|
|
116069
|
+
import_node_fs159.default.writeFileSync(
|
|
116070
|
+
import_node_path159.default.join(generatedDir, viewModels.file),
|
|
115544
116071
|
viewModels.render(viewModelClasses(readAbiClasses(stdout)))
|
|
115545
116072
|
);
|
|
115546
116073
|
}
|
|
115547
|
-
await compileKlib(
|
|
116074
|
+
await compileKlib(import_node_path159.default.join(work, "klib"));
|
|
115548
116075
|
await run16(
|
|
115549
116076
|
kotlinc,
|
|
115550
116077
|
[
|
|
115551
116078
|
...common2,
|
|
115552
116079
|
"-nowarn",
|
|
115553
116080
|
"-Xpartial-linkage-loglevel=error",
|
|
115554
|
-
`-Xinclude=${
|
|
116081
|
+
`-Xinclude=${import_node_path159.default.join(work, "klib")}`,
|
|
115555
116082
|
"-Xir-produce-js",
|
|
115556
116083
|
"-Xir-dce",
|
|
115557
116084
|
"-ir-output-dir",
|
|
115558
|
-
|
|
116085
|
+
import_node_path159.default.join(work, "js"),
|
|
115559
116086
|
"-ir-output-name",
|
|
115560
116087
|
"app"
|
|
115561
116088
|
],
|
|
115562
116089
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
115563
116090
|
);
|
|
115564
116091
|
if (compose) {
|
|
115565
|
-
|
|
115566
|
-
|
|
115567
|
-
kotlinSkikoSource(
|
|
116092
|
+
import_node_fs159.default.writeFileSync(
|
|
116093
|
+
import_node_path159.default.join(work, "js", "skiko.mjs"),
|
|
116094
|
+
kotlinSkikoSource(import_node_fs159.default.readFileSync(compose.loader))
|
|
115568
116095
|
);
|
|
115569
116096
|
}
|
|
115570
116097
|
if (usesCompose) {
|
|
115571
116098
|
for (const library of toolchain.composeJsLibraries) {
|
|
115572
116099
|
let imported = false;
|
|
115573
|
-
for (const file of
|
|
116100
|
+
for (const file of import_node_fs159.default.readdirSync(import_node_path159.default.join(work, "js"))) {
|
|
115574
116101
|
if (!file.endsWith(".mjs")) continue;
|
|
115575
|
-
const target =
|
|
115576
|
-
const source =
|
|
116102
|
+
const target = import_node_path159.default.join(work, "js", file);
|
|
116103
|
+
const source = import_node_fs159.default.readFileSync(target, "utf8");
|
|
115577
116104
|
let next = source;
|
|
115578
116105
|
for (const quote3 of ["'", '"'])
|
|
115579
116106
|
next = next.replaceAll(
|
|
@@ -115581,11 +116108,11 @@ async function compileKotlin(input, origin) {
|
|
|
115581
116108
|
`from ${quote3}./${library.file}${quote3}`
|
|
115582
116109
|
);
|
|
115583
116110
|
if (next === source) continue;
|
|
115584
|
-
|
|
116111
|
+
import_node_fs159.default.writeFileSync(target, next);
|
|
115585
116112
|
imported = true;
|
|
115586
116113
|
}
|
|
115587
116114
|
if (!imported) continue;
|
|
115588
|
-
const archive =
|
|
116115
|
+
const archive = import_node_path159.default.join(
|
|
115589
116116
|
kotlinHome(),
|
|
115590
116117
|
toolchain.compiler.version,
|
|
115591
116118
|
library.name
|
|
@@ -115594,24 +116121,24 @@ async function compileKotlin(input, origin) {
|
|
|
115594
116121
|
const { stdout } = await run16("tar", ["-xOf", archive, library.archiveEntry], {
|
|
115595
116122
|
maxBuffer: 16 * 1024 * 1024
|
|
115596
116123
|
});
|
|
115597
|
-
|
|
116124
|
+
import_node_fs159.default.writeFileSync(import_node_path159.default.join(work, "js", library.file), stdout);
|
|
115598
116125
|
}
|
|
115599
116126
|
}
|
|
115600
116127
|
} catch (error) {
|
|
115601
|
-
|
|
116128
|
+
import_node_fs159.default.rmSync(work, { recursive: true, force: true });
|
|
115602
116129
|
let output = isRecord(error) ? `${String(error.stderr ?? "")}${String(error.stdout ?? "")}` : "";
|
|
115603
116130
|
for (const [name3, source] of Object.entries(origins))
|
|
115604
|
-
output = output.replaceAll(
|
|
116131
|
+
output = output.replaceAll(import_node_path159.default.join(generatedDir, name3), source);
|
|
115605
116132
|
for (const [index, spec] of applicationJava.entries())
|
|
115606
116133
|
output = output.replaceAll(
|
|
115607
|
-
|
|
116134
|
+
import_node_path159.default.join(generatedDir, `JavaApplication${index}.kt`),
|
|
115608
116135
|
spec.file
|
|
115609
116136
|
);
|
|
115610
116137
|
for (const { file, target } of compiledSources)
|
|
115611
|
-
output = output.replaceAll(target, file).replaceAll(
|
|
116138
|
+
output = output.replaceAll(target, file).replaceAll(import_node_path159.default.relative(process.cwd(), target), file);
|
|
115612
116139
|
for (const [index, spec] of (java?.specs ?? []).entries())
|
|
115613
116140
|
output = output.replaceAll(
|
|
115614
|
-
|
|
116141
|
+
import_node_path159.default.join(work, "java-abi", `Spec${index}.kt`),
|
|
115615
116142
|
spec.file
|
|
115616
116143
|
);
|
|
115617
116144
|
output = output.replace(
|
|
@@ -115624,20 +116151,20 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
115624
116151
|
);
|
|
115625
116152
|
}
|
|
115626
116153
|
const seams = [kotlinNodeDetection];
|
|
115627
|
-
const js =
|
|
116154
|
+
const js = import_node_fs159.default.readdirSync(import_node_path159.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
|
|
115628
116155
|
if (js.some(
|
|
115629
|
-
(file) =>
|
|
116156
|
+
(file) => import_node_fs159.default.readFileSync(import_node_path159.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
|
|
115630
116157
|
))
|
|
115631
116158
|
seams.push(kotlinCoroutineDispatcher);
|
|
115632
116159
|
for (const [from, to] of seams) {
|
|
115633
116160
|
let patched = 0;
|
|
115634
116161
|
for (const file of js) {
|
|
115635
|
-
const target =
|
|
115636
|
-
const text7 =
|
|
116162
|
+
const target = import_node_path159.default.join(work, "js", file);
|
|
116163
|
+
const text7 = import_node_fs159.default.readFileSync(target, "utf8");
|
|
115637
116164
|
const next = text7.replaceAll(from, to);
|
|
115638
116165
|
if (next !== text7) {
|
|
115639
116166
|
patched++;
|
|
115640
|
-
|
|
116167
|
+
import_node_fs159.default.writeFileSync(target, next);
|
|
115641
116168
|
}
|
|
115642
116169
|
}
|
|
115643
116170
|
if (patched === 0)
|
|
@@ -115645,11 +116172,11 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
115645
116172
|
`kotlin output no longer contains ${from}; recheck how it detects its host in Peach`
|
|
115646
116173
|
);
|
|
115647
116174
|
}
|
|
115648
|
-
const entry =
|
|
115649
|
-
const entrySource2 =
|
|
115650
|
-
const importsPath =
|
|
116175
|
+
const entry = import_node_path159.default.join(work, "js/app.mjs");
|
|
116176
|
+
const entrySource2 = import_node_fs159.default.readFileSync(entry, "utf8");
|
|
116177
|
+
const importsPath = import_node_path159.default.join(work, "js/app.import-object.mjs");
|
|
115651
116178
|
const importsFactory = kotlinInstanceSource(
|
|
115652
|
-
|
|
116179
|
+
import_node_fs159.default.readFileSync(importsPath, "utf8"),
|
|
115653
116180
|
"createKotlinImportObject"
|
|
115654
116181
|
);
|
|
115655
116182
|
const runtimeFactory = kotlinInstanceSource(
|
|
@@ -115657,9 +116184,9 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
115657
116184
|
"createKotlinInstance",
|
|
115658
116185
|
/* @__PURE__ */ new Map([["./app.import-object.mjs", "createKotlinImportObject"]])
|
|
115659
116186
|
);
|
|
115660
|
-
|
|
115661
|
-
|
|
115662
|
-
|
|
116187
|
+
import_node_fs159.default.writeFileSync(importsPath, importsFactory.source);
|
|
116188
|
+
import_node_fs159.default.writeFileSync(import_node_path159.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
|
|
116189
|
+
import_node_fs159.default.writeFileSync(
|
|
115663
116190
|
entry,
|
|
115664
116191
|
[
|
|
115665
116192
|
"import { createKotlinInstance } from './app-runtime.mjs';",
|
|
@@ -115672,10 +116199,10 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
115672
116199
|
].join("\n")
|
|
115673
116200
|
);
|
|
115674
116201
|
try {
|
|
115675
|
-
|
|
116202
|
+
import_node_fs159.default.renameSync(work, out);
|
|
115676
116203
|
} catch (error) {
|
|
115677
|
-
if (!
|
|
115678
|
-
|
|
116204
|
+
if (!import_node_fs159.default.existsSync(import_node_path159.default.join(out, "js", "app.wasm"))) throw error;
|
|
116205
|
+
import_node_fs159.default.rmSync(work, { recursive: true, force: true });
|
|
115679
116206
|
}
|
|
115680
116207
|
return artifact;
|
|
115681
116208
|
})().finally(() => builds.delete(hash));
|
|
@@ -115683,24 +116210,24 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
115683
116210
|
return build2;
|
|
115684
116211
|
}
|
|
115685
116212
|
function kotlinArtifactFiles(hash) {
|
|
115686
|
-
const dir =
|
|
115687
|
-
return
|
|
115688
|
-
const contentType2 = CONTENT_TYPES[
|
|
116213
|
+
const dir = import_node_path159.default.join(buildsDir(), hash, "js");
|
|
116214
|
+
return import_node_fs159.default.readdirSync(dir).sort().map((name3) => {
|
|
116215
|
+
const contentType2 = CONTENT_TYPES[import_node_path159.default.extname(name3)];
|
|
115689
116216
|
if (!contentType2) throw new Error(`unexpected kotlin artifact file ${name3}`);
|
|
115690
|
-
return { name: name3, bytes:
|
|
116217
|
+
return { name: name3, bytes: import_node_fs159.default.readFileSync(import_node_path159.default.join(dir, name3)), contentType: contentType2 };
|
|
115691
116218
|
});
|
|
115692
116219
|
}
|
|
115693
116220
|
function serveKotlinArtifact(pathname, res) {
|
|
115694
116221
|
if (!pathname.startsWith(KOTLIN_ARTIFACT_PREFIX)) return false;
|
|
115695
116222
|
const [hash, file, ...rest] = pathname.slice(KOTLIN_ARTIFACT_PREFIX.length).split("/");
|
|
115696
|
-
const type = file ? CONTENT_TYPES[
|
|
116223
|
+
const type = file ? CONTENT_TYPES[import_node_path159.default.extname(file)] : void 0;
|
|
115697
116224
|
if (!hash || !/^[0-9a-f]+$/.test(hash) || !file || rest.length > 0 || !type || file.includes("..")) {
|
|
115698
116225
|
res.statusCode = 404;
|
|
115699
116226
|
res.end("not a kotlin artifact");
|
|
115700
116227
|
return true;
|
|
115701
116228
|
}
|
|
115702
|
-
const target =
|
|
115703
|
-
if (!
|
|
116229
|
+
const target = import_node_path159.default.join(buildsDir(), hash, "js", file);
|
|
116230
|
+
if (!import_node_fs159.default.existsSync(target)) {
|
|
115704
116231
|
res.statusCode = 404;
|
|
115705
116232
|
res.end(`kotlin artifact ${hash}/${file} was not built`);
|
|
115706
116233
|
return true;
|
|
@@ -115708,7 +116235,7 @@ function serveKotlinArtifact(pathname, res) {
|
|
|
115708
116235
|
res.setHeader("access-control-allow-origin", "*");
|
|
115709
116236
|
res.setHeader("content-type", type);
|
|
115710
116237
|
res.setHeader("cache-control", "public, max-age=31536000, immutable");
|
|
115711
|
-
res.end(
|
|
116238
|
+
res.end(import_node_fs159.default.readFileSync(target));
|
|
115712
116239
|
return true;
|
|
115713
116240
|
}
|
|
115714
116241
|
async function serveKotlinRequest(pathname, res, app) {
|
|
@@ -115725,15 +116252,15 @@ async function serveKotlinRequest(pathname, res, app) {
|
|
|
115725
116252
|
}
|
|
115726
116253
|
return true;
|
|
115727
116254
|
}
|
|
115728
|
-
var import_node_child_process75,
|
|
116255
|
+
var import_node_child_process75, import_node_crypto95, import_node_fs159, import_node_module22, import_node_path159, import_node_util21, run16, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal3, CONTENT_TYPES;
|
|
115729
116256
|
var init_kotlin_host = __esm({
|
|
115730
116257
|
"src/kotlin-host.ts"() {
|
|
115731
116258
|
"use strict";
|
|
115732
116259
|
import_node_child_process75 = require("node:child_process");
|
|
115733
|
-
|
|
115734
|
-
|
|
115735
|
-
|
|
115736
|
-
|
|
116260
|
+
import_node_crypto95 = require("node:crypto");
|
|
116261
|
+
import_node_fs159 = __toESM(require("node:fs"), 1);
|
|
116262
|
+
import_node_module22 = require("node:module");
|
|
116263
|
+
import_node_path159 = __toESM(require("node:path"), 1);
|
|
115737
116264
|
import_node_util21 = require("node:util");
|
|
115738
116265
|
init_kotlinDiscoveryContract();
|
|
115739
116266
|
init_android_bridge_packages();
|
|
@@ -115847,16 +116374,16 @@ __export(one_native_source_exports, {
|
|
|
115847
116374
|
});
|
|
115848
116375
|
function swiftModuleRoot() {
|
|
115849
116376
|
if (privateSwiftDistributionRoot()) return void 0;
|
|
115850
|
-
const root =
|
|
115851
|
-
|
|
116377
|
+
const root = import_node_path160.default.resolve(
|
|
116378
|
+
import_node_path160.default.dirname((0, import_node_url9.fileURLToPath)(__sootsim_import_meta_url)),
|
|
115852
116379
|
"../../sootsim-swift"
|
|
115853
116380
|
);
|
|
115854
|
-
return
|
|
116381
|
+
return import_node_fs160.default.existsSync(import_node_path160.default.join(root, "toolchain.json")) ? root : void 0;
|
|
115855
116382
|
}
|
|
115856
116383
|
function appFor(url, origin) {
|
|
115857
116384
|
const requested = url.searchParams.get("root");
|
|
115858
|
-
if (!requested || !
|
|
115859
|
-
const root =
|
|
116385
|
+
if (!requested || !import_node_path160.default.isAbsolute(requested) || !import_node_fs160.default.existsSync(requested)) return null;
|
|
116386
|
+
const root = import_node_fs160.default.realpathSync(requested);
|
|
115860
116387
|
let app = apps.get(root);
|
|
115861
116388
|
if (!app) {
|
|
115862
116389
|
app = {
|
|
@@ -115876,10 +116403,10 @@ function send2(app, change) {
|
|
|
115876
116403
|
if (client2.readyState === import_ws2.WebSocket.OPEN) client2.send(message);
|
|
115877
116404
|
}
|
|
115878
116405
|
async function swiftPackages2(root) {
|
|
115879
|
-
const resolved = (0,
|
|
116406
|
+
const resolved = (0, import_node_module23.createRequire)(import_node_path160.default.join(root, "package.json")).resolve(
|
|
115880
116407
|
"vxrn/swift-package-id"
|
|
115881
116408
|
);
|
|
115882
|
-
const loaded4 = await import((0,
|
|
116409
|
+
const loaded4 = await import((0, import_node_url9.pathToFileURL)(resolved).href);
|
|
115883
116410
|
const directories = typeof loaded4.swiftPackageDirectories === "function" ? loaded4.swiftPackageDirectories(root) : null;
|
|
115884
116411
|
if (!(directories instanceof Map))
|
|
115885
116412
|
throw new Error("vxrn/swift-package-id has no swiftPackageDirectories");
|
|
@@ -115890,13 +116417,14 @@ async function swiftPackages2(root) {
|
|
|
115890
116417
|
return packages;
|
|
115891
116418
|
}
|
|
115892
116419
|
async function packageMetadata(app, packageName2) {
|
|
115893
|
-
const
|
|
115894
|
-
|
|
115895
|
-
if (
|
|
116420
|
+
const builtinControls = packageName2 === ONE_NATIVE_CONTROLS_PACKAGE ? await oneNativeControlsPackage(app.root || void 0) : null;
|
|
116421
|
+
const widget = !builtinControls && packageName2 === ONE_WIDGET_PACKAGE ? await oneWidgetPackage(app.root) : null;
|
|
116422
|
+
if (!builtinControls && !widget) app.packages ??= await swiftPackages2(app.root);
|
|
116423
|
+
if (widget && app.packages?.has(packageName2))
|
|
115896
116424
|
throw new Error(
|
|
115897
116425
|
`swift package ${packageName2} conflicts with One's generated widget extension`
|
|
115898
116426
|
);
|
|
115899
|
-
const packagePath = widget?.packagePath ?? app.packages
|
|
116427
|
+
const packagePath = builtinControls?.packagePath ?? widget?.packagePath ?? app.packages?.get(packageName2);
|
|
115900
116428
|
if (!packagePath) throw new Error(`swift package ${packageName2} was not found`);
|
|
115901
116429
|
const moduleRoot = swiftModuleRoot();
|
|
115902
116430
|
const built2 = await swiftPackageMetadata(
|
|
@@ -115908,12 +116436,13 @@ async function packageMetadata(app, packageName2) {
|
|
|
115908
116436
|
if (!app.active.has(packageName2)) {
|
|
115909
116437
|
const files2 = [
|
|
115910
116438
|
...await swiftPackageWatchFiles(packagePath, moduleRoot),
|
|
116439
|
+
...builtinControls?.watched ?? [],
|
|
115911
116440
|
...widget?.watched ?? []
|
|
115912
116441
|
];
|
|
115913
116442
|
app.active.set(packageName2, { packagePath, files: new Set(files2) });
|
|
115914
116443
|
watch(app, packagePath, true);
|
|
115915
116444
|
for (const file of files2)
|
|
115916
|
-
if (!file.startsWith(`${packagePath}${
|
|
116445
|
+
if (!file.startsWith(`${packagePath}${import_node_path160.default.sep}`)) watch(app, import_node_path160.default.dirname(file));
|
|
115917
116446
|
}
|
|
115918
116447
|
return {
|
|
115919
116448
|
...built2,
|
|
@@ -115922,9 +116451,9 @@ async function packageMetadata(app, packageName2) {
|
|
|
115922
116451
|
};
|
|
115923
116452
|
}
|
|
115924
116453
|
function changed(app, file) {
|
|
115925
|
-
if (
|
|
116454
|
+
if (import_node_path160.default.basename(file) === "Package.swift") app.packages = void 0;
|
|
115926
116455
|
for (const [packageName2, { packagePath, files: files2 }] of app.active) {
|
|
115927
|
-
if (!files2.has(file) && !file.startsWith(`${packagePath}${
|
|
116456
|
+
if (!files2.has(file) && !file.startsWith(`${packagePath}${import_node_path160.default.sep}`)) continue;
|
|
115928
116457
|
packageMetadata(app, packageName2).then(
|
|
115929
116458
|
(metadata) => send2(app, { type: "package", packageName: packageName2, metadata }),
|
|
115930
116459
|
(error) => send2(app, {
|
|
@@ -115935,15 +116464,15 @@ function changed(app, file) {
|
|
|
115935
116464
|
);
|
|
115936
116465
|
}
|
|
115937
116466
|
const kotlinModule = app.kotlinModule;
|
|
115938
|
-
if (kotlinModule && (file.endsWith(".kt") || file.startsWith(`${kotlinModule}${
|
|
116467
|
+
if (kotlinModule && (file.endsWith(".kt") || file.startsWith(`${kotlinModule}${import_node_path160.default.sep}`)))
|
|
115939
116468
|
send2(app, { type: "kotlin", packageName: "kotlin" });
|
|
115940
116469
|
}
|
|
115941
116470
|
function watch(app, directory2, recursive = false) {
|
|
115942
|
-
if (app.watched.has(directory2) || !
|
|
116471
|
+
if (app.watched.has(directory2) || !import_node_fs160.default.existsSync(directory2)) return;
|
|
115943
116472
|
app.watched.add(directory2);
|
|
115944
|
-
|
|
115945
|
-
if (name3 && !name3.split(
|
|
115946
|
-
changed(app,
|
|
116473
|
+
import_node_fs160.default.watch(directory2, { recursive }, (_event, name3) => {
|
|
116474
|
+
if (name3 && !name3.split(import_node_path160.default.sep).includes("node_modules"))
|
|
116475
|
+
changed(app, import_node_path160.default.join(directory2, name3));
|
|
115947
116476
|
});
|
|
115948
116477
|
}
|
|
115949
116478
|
function loopbackClient(req) {
|
|
@@ -115963,7 +116492,24 @@ async function handleOneNativeSourceRequest(req, res) {
|
|
|
115963
116492
|
}
|
|
115964
116493
|
res.setHeader("access-control-allow-origin", req.headers.origin ?? "*");
|
|
115965
116494
|
res.setHeader("vary", "origin");
|
|
115966
|
-
const
|
|
116495
|
+
const builtinControlsName = isSwift ? decodeURIComponent(url.pathname.slice(SWIFT_PACKAGE_PATH.length)) : null;
|
|
116496
|
+
const origin = req.headers.host ? `http://${req.headers.host}` : null;
|
|
116497
|
+
const app = origin && (appFor(url, origin) ?? (builtinControlsName === ONE_NATIVE_CONTROLS_PACKAGE ? (() => {
|
|
116498
|
+
let shared = apps.get("");
|
|
116499
|
+
if (!shared) {
|
|
116500
|
+
shared = {
|
|
116501
|
+
root: "",
|
|
116502
|
+
origin,
|
|
116503
|
+
sockets: new import_ws2.WebSocketServer({ noServer: true }),
|
|
116504
|
+
watched: /* @__PURE__ */ new Set(),
|
|
116505
|
+
active: /* @__PURE__ */ new Map()
|
|
116506
|
+
};
|
|
116507
|
+
apps.set("", shared);
|
|
116508
|
+
} else {
|
|
116509
|
+
shared.origin = origin;
|
|
116510
|
+
}
|
|
116511
|
+
return shared;
|
|
116512
|
+
})() : null));
|
|
115967
116513
|
if (!app) {
|
|
115968
116514
|
res.writeHead(400);
|
|
115969
116515
|
res.end("missing absolute app root");
|
|
@@ -116036,21 +116582,23 @@ function handleOneNativeSourceUpgrade(req, socket, head) {
|
|
|
116036
116582
|
});
|
|
116037
116583
|
return true;
|
|
116038
116584
|
}
|
|
116039
|
-
var
|
|
116585
|
+
var import_node_fs160, import_node_module23, import_node_path160, import_node_url9, import_node_util22, import_node_zlib10, import_ws2, apps, compressMetadata;
|
|
116040
116586
|
var init_one_native_source = __esm({
|
|
116041
116587
|
"src/one-native-source.ts"() {
|
|
116042
116588
|
"use strict";
|
|
116043
|
-
|
|
116044
|
-
|
|
116045
|
-
|
|
116046
|
-
|
|
116589
|
+
import_node_fs160 = __toESM(require("node:fs"), 1);
|
|
116590
|
+
import_node_module23 = require("node:module");
|
|
116591
|
+
import_node_path160 = __toESM(require("node:path"), 1);
|
|
116592
|
+
import_node_url9 = require("node:url");
|
|
116047
116593
|
import_node_util22 = require("node:util");
|
|
116048
116594
|
import_node_zlib10 = require("node:zlib");
|
|
116049
116595
|
init_kotlinDiscoveryContract();
|
|
116050
116596
|
import_ws2 = require("peachsim/vendor/ws");
|
|
116051
116597
|
init_backend_origin();
|
|
116598
|
+
init_one_native_controls_package();
|
|
116052
116599
|
init_one_widget_metadata();
|
|
116053
116600
|
init_one_widget_package();
|
|
116601
|
+
init_oneNativeControlsContract2();
|
|
116054
116602
|
init_oneWidgetContract();
|
|
116055
116603
|
init_swift_host();
|
|
116056
116604
|
init_swift_submit();
|
|
@@ -116082,7 +116630,7 @@ async function readManagedExpoIdentity(root, platform3, iosTarget, bridgeOrigin)
|
|
|
116082
116630
|
url.searchParams.set("root", root);
|
|
116083
116631
|
const response = await nodeHttpFetch(url.href);
|
|
116084
116632
|
if (response.ok && response.headers.get("content-type") === revisionType) {
|
|
116085
|
-
const environment = (0,
|
|
116633
|
+
const environment = (0, import_node_crypto96.createHash)("sha256").update(JSON.stringify(Object.entries(process.env).sort())).digest("hex");
|
|
116086
116634
|
const inputs2 = Buffer.from(
|
|
116087
116635
|
JSON.stringify([
|
|
116088
116636
|
await response.text(),
|
|
@@ -116122,12 +116670,12 @@ function handleManagedExpoInputs(req, res, url) {
|
|
|
116122
116670
|
return;
|
|
116123
116671
|
}
|
|
116124
116672
|
const source = url.searchParams.get("root");
|
|
116125
|
-
if (!source || !
|
|
116673
|
+
if (!source || !import_node_path161.default.isAbsolute(source)) {
|
|
116126
116674
|
res.writeHead(400);
|
|
116127
116675
|
res.end("Missing absolute app root");
|
|
116128
116676
|
return;
|
|
116129
116677
|
}
|
|
116130
|
-
const root =
|
|
116678
|
+
const root = import_node_fs161.default.realpathSync(source);
|
|
116131
116679
|
const revision = nativeInputRevision(root);
|
|
116132
116680
|
res.setHeader("Cache-Control", "no-store");
|
|
116133
116681
|
if (!revision) {
|
|
@@ -116138,13 +116686,13 @@ function handleManagedExpoInputs(req, res, url) {
|
|
|
116138
116686
|
res.writeHead(200, { "Content-Type": revisionType });
|
|
116139
116687
|
res.end(revision);
|
|
116140
116688
|
}
|
|
116141
|
-
var
|
|
116689
|
+
var import_node_crypto96, import_node_fs161, import_node_path161, revisionType;
|
|
116142
116690
|
var init_managed_expo_identity = __esm({
|
|
116143
116691
|
"src/managed-expo-identity.ts"() {
|
|
116144
116692
|
"use strict";
|
|
116145
|
-
|
|
116146
|
-
|
|
116147
|
-
|
|
116693
|
+
import_node_crypto96 = require("node:crypto");
|
|
116694
|
+
import_node_fs161 = __toESM(require("node:fs"), 1);
|
|
116695
|
+
import_node_path161 = __toESM(require("node:path"), 1);
|
|
116148
116696
|
init_backend_origin();
|
|
116149
116697
|
init_cli_version();
|
|
116150
116698
|
init_expo_native_prebuilt();
|
|
@@ -116160,11 +116708,11 @@ var init_managed_expo_identity = __esm({
|
|
|
116160
116708
|
});
|
|
116161
116709
|
|
|
116162
116710
|
// src/one-native-app-catalog.ts
|
|
116163
|
-
var
|
|
116711
|
+
var import_node_path162;
|
|
116164
116712
|
var init_one_native_app_catalog = __esm({
|
|
116165
116713
|
"src/one-native-app-catalog.ts"() {
|
|
116166
116714
|
"use strict";
|
|
116167
|
-
|
|
116715
|
+
import_node_path162 = __toESM(require("node:path"), 1);
|
|
116168
116716
|
init_is_record();
|
|
116169
116717
|
init_one_native_app_config();
|
|
116170
116718
|
}
|
|
@@ -116213,12 +116761,12 @@ async function stageCatalogSvg(file, scale, origin, bytes) {
|
|
|
116213
116761
|
}
|
|
116214
116762
|
);
|
|
116215
116763
|
}
|
|
116216
|
-
var
|
|
116764
|
+
var import_node_fs162, import_node_path163;
|
|
116217
116765
|
var init_app_catalog = __esm({
|
|
116218
116766
|
"cli/app-catalog.ts"() {
|
|
116219
116767
|
"use strict";
|
|
116220
|
-
|
|
116221
|
-
|
|
116768
|
+
import_node_fs162 = __toESM(require("node:fs"), 1);
|
|
116769
|
+
import_node_path163 = __toESM(require("node:path"), 1);
|
|
116222
116770
|
init_bundleAssets();
|
|
116223
116771
|
init_expo_native_workspace();
|
|
116224
116772
|
init_staged_host_files();
|
|
@@ -116229,17 +116777,17 @@ var init_app_catalog = __esm({
|
|
|
116229
116777
|
|
|
116230
116778
|
// src/expo-widget-assets.ts
|
|
116231
116779
|
async function stagePreparedExpoWidgetAssets(preparedApp, origin) {
|
|
116232
|
-
const ios =
|
|
116233
|
-
const targets =
|
|
116780
|
+
const ios = import_node_path164.default.join(preparedApp, "ios");
|
|
116781
|
+
const targets = import_node_fs163.default.readdirSync(ios, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).flatMap((entry) => readXcodeExtensionTargets(import_node_path164.default.join(ios, entry.name))).filter(
|
|
116234
116782
|
({ infoPlist: infoPlist2 }) => isRecord(infoPlist2.NSExtension) && infoPlist2.NSExtension.NSExtensionPointIdentifier === "com.apple.widgetkit-extension" && typeof infoPlist2.ExpoWidgetsAppGroupIdentifier === "string"
|
|
116235
116783
|
);
|
|
116236
116784
|
if (targets.length === 0) return null;
|
|
116237
116785
|
if (targets.length !== 1) throw new Error("expected one Expo Widgets extension target");
|
|
116238
116786
|
const target = targets[0];
|
|
116239
|
-
const root =
|
|
116787
|
+
const root = import_node_fs163.default.realpathSync(findWorkspaceRoot(preparedApp));
|
|
116240
116788
|
const members2 = new Map(
|
|
116241
116789
|
target.resources.map((file) => [
|
|
116242
|
-
|
|
116790
|
+
import_node_path164.default.relative(root, file).split(import_node_path164.default.sep).join("/"),
|
|
116243
116791
|
file
|
|
116244
116792
|
])
|
|
116245
116793
|
);
|
|
@@ -116254,10 +116802,10 @@ async function stagePreparedExpoWidgetAssets(preparedApp, origin) {
|
|
|
116254
116802
|
(file) => members2.has(file) ? read(file).toString("utf8") : null,
|
|
116255
116803
|
(file, scale) => {
|
|
116256
116804
|
const bytes = read(file);
|
|
116257
|
-
const ext =
|
|
116805
|
+
const ext = import_node_path164.default.extname(file);
|
|
116258
116806
|
if (ext.toLowerCase() === ".svg") return stageCatalogSvg(file, scale, origin, bytes);
|
|
116259
116807
|
if (ext.toLowerCase() === ".pdf") {
|
|
116260
|
-
const sha2565 = (0,
|
|
116808
|
+
const sha2565 = (0, import_node_crypto97.createHash)("sha256").update(bytes).digest("hex");
|
|
116261
116809
|
const png = rasterizePdfFiles([{ file: members2.get(file), sha256: sha2565 }]).get(sha2565);
|
|
116262
116810
|
return stageHostBytes(png, origin, ".png");
|
|
116263
116811
|
}
|
|
@@ -116270,13 +116818,13 @@ async function stageExpoWidgetAssets(appRoot, origin) {
|
|
|
116270
116818
|
const prepared = await prepareExpoNativeProject(appRoot);
|
|
116271
116819
|
return stagePreparedExpoWidgetAssets(prepared.app, origin);
|
|
116272
116820
|
}
|
|
116273
|
-
var
|
|
116821
|
+
var import_node_crypto97, import_node_fs163, import_node_path164;
|
|
116274
116822
|
var init_expo_widget_assets = __esm({
|
|
116275
116823
|
"src/expo-widget-assets.ts"() {
|
|
116276
116824
|
"use strict";
|
|
116277
|
-
|
|
116278
|
-
|
|
116279
|
-
|
|
116825
|
+
import_node_crypto97 = require("node:crypto");
|
|
116826
|
+
import_node_fs163 = __toESM(require("node:fs"), 1);
|
|
116827
|
+
import_node_path164 = __toESM(require("node:path"), 1);
|
|
116280
116828
|
init_app_catalog();
|
|
116281
116829
|
init_expo_native_workspace();
|
|
116282
116830
|
init_staged_host_files();
|
|
@@ -116323,17 +116871,17 @@ var init_nitro_app_providers = __esm({
|
|
|
116323
116871
|
async function trunkSpecification(lockFile, root, version2, checksum) {
|
|
116324
116872
|
if (typeof checksum !== "string" || !/^[a-f0-9]{40}$/.test(checksum))
|
|
116325
116873
|
throw new Error(`${lockFile}: missing checksum for ${root}`);
|
|
116326
|
-
const file =
|
|
116874
|
+
const file = import_node_path165.default.join(
|
|
116327
116875
|
cacheDir(),
|
|
116328
116876
|
"swift-source-pods",
|
|
116329
116877
|
"specifications",
|
|
116330
116878
|
`${checksum}.json`
|
|
116331
116879
|
);
|
|
116332
|
-
const sha1 = (value) => (0,
|
|
116880
|
+
const sha1 = (value) => (0, import_node_crypto98.createHash)("sha1").update(value).digest("hex");
|
|
116333
116881
|
let text7;
|
|
116334
|
-
if (
|
|
116882
|
+
if (import_node_fs164.default.existsSync(file)) text7 = import_node_fs164.default.readFileSync(file, "utf8");
|
|
116335
116883
|
else {
|
|
116336
|
-
const shard2 = (0,
|
|
116884
|
+
const shard2 = (0, import_node_crypto98.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
|
|
116337
116885
|
const specPath = `Specs/${shard2}/${root}/${version2}/${root}.podspec.json`;
|
|
116338
116886
|
const response = await fetch(`https://cdn.cocoapods.org/${specPath}`);
|
|
116339
116887
|
if (!response.ok)
|
|
@@ -116368,21 +116916,21 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
|
|
|
116368
116916
|
const spec = JSON.parse(text7);
|
|
116369
116917
|
if (!record5(spec) || spec.name !== root || spec.version !== version2)
|
|
116370
116918
|
throw new Error(`specification identity differs for ${root} ${version2}`);
|
|
116371
|
-
if (!
|
|
116372
|
-
|
|
116373
|
-
|
|
116919
|
+
if (!import_node_fs164.default.existsSync(file)) {
|
|
116920
|
+
import_node_fs164.default.mkdirSync(import_node_path165.default.dirname(file), { recursive: true });
|
|
116921
|
+
import_node_fs164.default.writeFileSync(file, text7);
|
|
116374
116922
|
}
|
|
116375
116923
|
return { text: text7, spec };
|
|
116376
116924
|
}
|
|
116377
116925
|
function appPodfileLock(appRoot) {
|
|
116378
116926
|
return [
|
|
116379
|
-
|
|
116380
|
-
|
|
116381
|
-
].find((file) =>
|
|
116927
|
+
import_node_path165.default.join(appRoot, "ios", "Podfile.lock"),
|
|
116928
|
+
import_node_path165.default.join(appRoot, "Podfile.lock")
|
|
116929
|
+
].find((file) => import_node_fs164.default.existsSync(file));
|
|
116382
116930
|
}
|
|
116383
116931
|
async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModules = []) {
|
|
116384
116932
|
if (modules.length === 0 && headerModules.length === 0) return null;
|
|
116385
|
-
const original =
|
|
116933
|
+
const original = import_node_fs164.default.readFileSync(lockFile, "utf8");
|
|
116386
116934
|
const lock = browser_default.parse(original);
|
|
116387
116935
|
const pods = lockedPods(lock);
|
|
116388
116936
|
if (!record5(lock) || !record5(lock["SPEC CHECKSUMS"]))
|
|
@@ -116462,17 +117010,17 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
116462
117010
|
"end",
|
|
116463
117011
|
""
|
|
116464
117012
|
].join("\n");
|
|
116465
|
-
const key2 = (0,
|
|
117013
|
+
const key2 = (0, import_node_crypto98.createHash)("sha256").update(project).update(podfile).update(JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b)))).update(
|
|
116466
117014
|
JSON.stringify(
|
|
116467
117015
|
Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b))
|
|
116468
117016
|
)
|
|
116469
117017
|
).digest("hex");
|
|
116470
|
-
const work =
|
|
117018
|
+
const work = import_node_path165.default.join(cacheDir(), "swift-source-pods", key2);
|
|
116471
117019
|
return withSwiftRootLock(work, async () => {
|
|
116472
|
-
const ios =
|
|
116473
|
-
const complete =
|
|
116474
|
-
if (!
|
|
116475
|
-
|
|
117020
|
+
const ios = import_node_path165.default.join(work, "ios");
|
|
117021
|
+
const complete = import_node_path165.default.join(work, "pods-installed");
|
|
117022
|
+
if (!import_node_fs164.default.existsSync(complete)) {
|
|
117023
|
+
import_node_fs164.default.mkdirSync(import_node_path165.default.join(ios, `${APP}.xcodeproj`), { recursive: true });
|
|
116476
117024
|
for (const root of [...roots].sort()) {
|
|
116477
117025
|
const { text: text7 } = await trunkSpecification(
|
|
116478
117026
|
lockFile,
|
|
@@ -116480,26 +117028,26 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
116480
117028
|
rootVersion(root),
|
|
116481
117029
|
specificationChecksums[root]
|
|
116482
117030
|
);
|
|
116483
|
-
|
|
117031
|
+
import_node_fs164.default.writeFileSync(import_node_path165.default.join(ios, `${root}.podspec.json`), text7);
|
|
116484
117032
|
}
|
|
116485
|
-
|
|
116486
|
-
|
|
116487
|
-
|
|
117033
|
+
import_node_fs164.default.writeFileSync(import_node_path165.default.join(ios, `${APP}.xcodeproj/project.pbxproj`), project);
|
|
117034
|
+
import_node_fs164.default.writeFileSync(import_node_path165.default.join(ios, "main.swift"), "import Foundation\n");
|
|
117035
|
+
import_node_fs164.default.writeFileSync(import_node_path165.default.join(ios, "Podfile"), podfile);
|
|
116488
117036
|
await installPods(
|
|
116489
117037
|
work,
|
|
116490
117038
|
{ ...process.env, LANG: "en_US.UTF-8", LC_ALL: "en_US.UTF-8" },
|
|
116491
117039
|
work
|
|
116492
117040
|
);
|
|
116493
|
-
|
|
117041
|
+
import_node_fs164.default.writeFileSync(complete, key2);
|
|
116494
117042
|
}
|
|
116495
117043
|
const actual = lockedPods(
|
|
116496
|
-
browser_default.parse(
|
|
117044
|
+
browser_default.parse(import_node_fs164.default.readFileSync(import_node_path165.default.join(ios, "Pods/Manifest.lock"), "utf8"))
|
|
116497
117045
|
);
|
|
116498
117046
|
if (JSON.stringify([...actual].sort(([a], [b]) => a.localeCompare(b))) !== JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b))))
|
|
116499
117047
|
throw new Error(
|
|
116500
117048
|
`${work}: installed pod versions or dependencies differ from ${lockFile}`
|
|
116501
117049
|
);
|
|
116502
|
-
const workspace =
|
|
117050
|
+
const workspace = import_node_path165.default.join(ios, `${APP}.xcworkspace`);
|
|
116503
117051
|
await prepareXcodeSwiftPackages(workspace, APP, "Release");
|
|
116504
117052
|
const app = readXcodeAppTarget(workspace, APP, "Release", { installedPods: true });
|
|
116505
117053
|
if (app.binaryFrameworks.length > 0)
|
|
@@ -116531,13 +117079,13 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
116531
117079
|
);
|
|
116532
117080
|
});
|
|
116533
117081
|
}
|
|
116534
|
-
var
|
|
117082
|
+
var import_node_crypto98, import_node_fs164, import_node_path165, APP, record5, project, podModuleName;
|
|
116535
117083
|
var init_swift_source_pods = __esm({
|
|
116536
117084
|
"src/swift-source-pods.ts"() {
|
|
116537
117085
|
"use strict";
|
|
116538
|
-
|
|
116539
|
-
|
|
116540
|
-
|
|
117086
|
+
import_node_crypto98 = require("node:crypto");
|
|
117087
|
+
import_node_fs164 = __toESM(require("node:fs"), 1);
|
|
117088
|
+
import_node_path165 = __toESM(require("node:path"), 1);
|
|
116541
117089
|
init_browser();
|
|
116542
117090
|
init_home_paths();
|
|
116543
117091
|
init_pod_lockfile();
|
|
@@ -116797,11 +117345,11 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
116797
117345
|
const coreUpstream = `Sources/${TURBO_CORE_TARGET}/upstream/react-native`;
|
|
116798
117346
|
const flatMap = /* @__PURE__ */ new Map();
|
|
116799
117347
|
for (const { from, to } of RN_HEADER_DIR_MAP) {
|
|
116800
|
-
const dir =
|
|
116801
|
-
if (!
|
|
116802
|
-
for (const entry of
|
|
117348
|
+
const dir = import_node_path166.default.join(reactNativeRoot, from);
|
|
117349
|
+
if (!import_node_fs165.default.existsSync(dir)) continue;
|
|
117350
|
+
for (const entry of import_node_fs165.default.readdirSync(dir, { recursive: true, withFileTypes: true })) {
|
|
116803
117351
|
if (!entry.isFile() || !/\.(?:h|hpp)$/.test(entry.name)) continue;
|
|
116804
|
-
const rel =
|
|
117352
|
+
const rel = import_node_path166.default.relative(reactNativeRoot, import_node_path166.default.join(entry.parentPath, entry.name)).split(import_node_path166.default.sep).join("/");
|
|
116805
117353
|
const key2 = `${to}/${entry.name}`;
|
|
116806
117354
|
if (!flatMap.has(key2)) flatMap.set(key2, rel);
|
|
116807
117355
|
}
|
|
@@ -116810,12 +117358,12 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
116810
117358
|
const scanQueue = [];
|
|
116811
117359
|
const stageRelative = (rel) => {
|
|
116812
117360
|
const clean2 = rel.replace(/^\//, "");
|
|
116813
|
-
const full =
|
|
116814
|
-
if (!
|
|
117361
|
+
const full = import_node_path166.default.join(reactNativeRoot, clean2);
|
|
117362
|
+
if (!import_node_fs165.default.statSync(full, { throwIfNoEntry: false })?.isFile()) return null;
|
|
116815
117363
|
const targetKey = `${coreUpstream}/${clean2}`;
|
|
116816
117364
|
if (!Object.hasOwn(supportFiles, targetKey)) {
|
|
116817
|
-
supportFiles[targetKey] =
|
|
116818
|
-
scanQueue.push({ key: targetKey, dir:
|
|
117365
|
+
supportFiles[targetKey] = import_node_fs165.default.readFileSync(full, "utf8");
|
|
117366
|
+
scanQueue.push({ key: targetKey, dir: import_node_path166.default.posix.dirname(clean2) });
|
|
116819
117367
|
}
|
|
116820
117368
|
return targetKey;
|
|
116821
117369
|
};
|
|
@@ -116824,7 +117372,7 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
116824
117372
|
if (Object.hasOwn(supportFiles, outKey)) return;
|
|
116825
117373
|
let targetKey = null;
|
|
116826
117374
|
if (fromDir) {
|
|
116827
|
-
const candidate =
|
|
117375
|
+
const candidate = import_node_path166.default.posix.normalize(import_node_path166.default.posix.join(fromDir, include));
|
|
116828
117376
|
if (!candidate.startsWith("..")) targetKey = stageRelative(candidate);
|
|
116829
117377
|
}
|
|
116830
117378
|
if (!targetKey && flatMap.has(include)) {
|
|
@@ -116832,12 +117380,12 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
116832
117380
|
}
|
|
116833
117381
|
if (!targetKey) {
|
|
116834
117382
|
for (const root of RN_COMMON_ROOTS) {
|
|
116835
|
-
targetKey = stageRelative(
|
|
117383
|
+
targetKey = stageRelative(import_node_path166.default.posix.join(root, include));
|
|
116836
117384
|
if (targetKey) break;
|
|
116837
117385
|
}
|
|
116838
117386
|
}
|
|
116839
117387
|
if (targetKey) {
|
|
116840
|
-
const rel =
|
|
117388
|
+
const rel = import_node_path166.default.posix.relative(import_node_path166.default.posix.dirname(outKey), targetKey);
|
|
116841
117389
|
supportFiles[outKey] = `#pragma once
|
|
116842
117390
|
#ifdef __OBJC__
|
|
116843
117391
|
#import ${JSON.stringify(rel)}
|
|
@@ -116850,7 +117398,7 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
116850
117398
|
const dep = dependencyHeader(include);
|
|
116851
117399
|
if (dep) {
|
|
116852
117400
|
supportFiles[outKey] = dep.text;
|
|
116853
|
-
scanQueue.push({ key: outKey, dir:
|
|
117401
|
+
scanQueue.push({ key: outKey, dir: import_node_path166.default.posix.dirname(include) });
|
|
116854
117402
|
for (const extra of nitroDependencyIncludes(
|
|
116855
117403
|
reactNativeVersion,
|
|
116856
117404
|
reactNativeRoot,
|
|
@@ -116861,7 +117409,7 @@ function stageMissingReactHeaders(supportFiles, collectionFiles, reactNativeRoot
|
|
|
116861
117409
|
const extraDep = dependencyHeader(extra);
|
|
116862
117410
|
if (extraDep) {
|
|
116863
117411
|
supportFiles[extraOut] = extraDep.text;
|
|
116864
|
-
scanQueue.push({ key: extraOut, dir:
|
|
117412
|
+
scanQueue.push({ key: extraOut, dir: import_node_path166.default.posix.dirname(extra) });
|
|
116865
117413
|
}
|
|
116866
117414
|
}
|
|
116867
117415
|
}
|
|
@@ -116905,7 +117453,7 @@ function nitroDependencyHeaderSettings(target, dependencies, files2) {
|
|
|
116905
117453
|
return { extraDeps: [], cEntries: [], cxxEntries: [], usesTurboCore: false };
|
|
116906
117454
|
}
|
|
116907
117455
|
const turboInclude = `.headerSearchPath(${JSON.stringify(
|
|
116908
|
-
|
|
117456
|
+
import_node_path166.default.posix.relative(target.path, `Sources/${TURBO_CORE_TARGET}/include`)
|
|
116909
117457
|
)})`;
|
|
116910
117458
|
const pchPath = `Sources/${TURBO_CORE_TARGET}/include/PeachTurboPrefix.pch`;
|
|
116911
117459
|
const pchFlag = files2[pchPath] ? [`.unsafeFlags(${JSON.stringify(["-include", pchPath])})`] : [];
|
|
@@ -116941,7 +117489,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
116941
117489
|
const ndebug = options2.configuration === "Release" ? ["-DNDEBUG"] : [];
|
|
116942
117490
|
await prepareNitroSourceDependencies(options2);
|
|
116943
117491
|
const workspace = installedXcodeWorkspace(options2.projectRoot);
|
|
116944
|
-
const installedRoot2 =
|
|
117492
|
+
const installedRoot2 = import_node_fs165.default.realpathSync(options2.projectRoot);
|
|
116945
117493
|
const autolinked = await iosAutolinkedDependencies(
|
|
116946
117494
|
options2.appRoot ?? options2.projectRoot
|
|
116947
117495
|
);
|
|
@@ -116956,11 +117504,11 @@ async function prepareNitroCompileInput(options2) {
|
|
|
116956
117504
|
peerPackageRoots: autolinked.map(({ root }) => root)
|
|
116957
117505
|
});
|
|
116958
117506
|
const activePods = autolinked.flatMap(
|
|
116959
|
-
({ name: name3, root, podspecPath }) => !answered.has(name3) && podspecPath !== null && activeNitroRoots.has(
|
|
117507
|
+
({ name: name3, root, podspecPath }) => !answered.has(name3) && podspecPath !== null && activeNitroRoots.has(import_node_fs165.default.realpathSync(root)) ? [{ name: name3, root, podspecPath }] : []
|
|
116960
117508
|
);
|
|
116961
117509
|
const podSources = (pod) => [
|
|
116962
117510
|
...podspecSourceFiles2(pod, options2.appRoot ?? options2.projectRoot),
|
|
116963
|
-
...nitrogenGeneratedSources(
|
|
117511
|
+
...nitrogenGeneratedSources(import_node_path166.default.dirname(pod.podspecPath))
|
|
116964
117512
|
].map((file) => projectSourceKey([installedRoot2], file));
|
|
116965
117513
|
let nativeSourceKeys;
|
|
116966
117514
|
if (workspace) {
|
|
@@ -116982,7 +117530,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
116982
117530
|
const collection = collectNitroSources(
|
|
116983
117531
|
{ ...options2, peerPackageRoots: autolinked.map(({ root }) => root) },
|
|
116984
117532
|
nativeSourceKeys,
|
|
116985
|
-
|
|
117533
|
+
import_node_fs165.default.realpathSync(options2.appRoot ?? options2.projectRoot)
|
|
116986
117534
|
);
|
|
116987
117535
|
const providerNames = new Set(collection.providers.map(({ name: name3 }) => name3));
|
|
116988
117536
|
const installedLibraries = workspace ? installedNativeLibraries(
|
|
@@ -117053,7 +117601,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
117053
117601
|
)
|
|
117054
117602
|
);
|
|
117055
117603
|
const views = new Set(
|
|
117056
|
-
|
|
117604
|
+
import_node_fs165.default.readdirSync(import_node_path166.default.join(collection.nitro.root, "cpp/views"))
|
|
117057
117605
|
);
|
|
117058
117606
|
for (const [file, source] of Object.entries(collection.files))
|
|
117059
117607
|
if (file.endsWith("/NitroModules-umbrella.h"))
|
|
@@ -117122,8 +117670,8 @@ async function prepareNitroCompileInput(options2) {
|
|
|
117122
117670
|
([file, text7]) => /\.(?:h|hh|hpp|hxx|c|cc|cpp|cxx|m|mm)$/.test(file) && REACT_VERSION_PATTERN.test(text7)
|
|
117123
117671
|
);
|
|
117124
117672
|
if (reactProviders.length > 0 || usesReactHeaders) {
|
|
117125
|
-
const nitroReactCodegenDir =
|
|
117126
|
-
|
|
117673
|
+
const nitroReactCodegenDir = import_node_fs165.default.mkdtempSync(
|
|
117674
|
+
import_node_path166.default.join(import_node_os33.default.tmpdir(), "peach-nitro-react-")
|
|
117127
117675
|
);
|
|
117128
117676
|
let support;
|
|
117129
117677
|
try {
|
|
@@ -117138,7 +117686,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
117138
117686
|
installedPods: nativeLibraries
|
|
117139
117687
|
});
|
|
117140
117688
|
} finally {
|
|
117141
|
-
|
|
117689
|
+
import_node_fs165.default.rmSync(nitroReactCodegenDir, { recursive: true, force: true });
|
|
117142
117690
|
}
|
|
117143
117691
|
if (support.providers.length > 0 || usesReactHeaders && support.targets.some(({ name: name3 }) => name3 === TURBO_CORE_TARGET)) {
|
|
117144
117692
|
linkReactNativeCore(
|
|
@@ -117208,23 +117756,23 @@ async function prepareNitroCompileInput(options2) {
|
|
|
117208
117756
|
);
|
|
117209
117757
|
for (const [name3, pod] of nativeLibraries) {
|
|
117210
117758
|
if (pod.library === void 0) continue;
|
|
117211
|
-
const library =
|
|
117759
|
+
const library = import_node_fs165.default.readFileSync(pod.library).toString("base64");
|
|
117212
117760
|
input.libraries ??= {};
|
|
117213
117761
|
input.libraries[nitroProviderTarget({ name: name3 })] = library;
|
|
117214
117762
|
}
|
|
117215
|
-
const key2 = (0,
|
|
117763
|
+
const key2 = (0, import_node_crypto99.createHash)("sha256").update(
|
|
117216
117764
|
collection.providers.map(({ root, hybridObjects }) => `${root}\0${hybridObjects.join(",")}`).join("\0")
|
|
117217
|
-
).update("\0").update(
|
|
117218
|
-
const packagePath =
|
|
117765
|
+
).update("\0").update(import_node_fs165.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
|
|
117766
|
+
const packagePath = import_node_path166.default.join(import_node_os33.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
|
|
117219
117767
|
const sharedLibrary = [...nativeLibraries.values()].find(
|
|
117220
117768
|
(pod) => pod.sharedLibrary
|
|
117221
117769
|
)?.sharedLibrary;
|
|
117222
117770
|
if (sharedLibrary) {
|
|
117223
|
-
|
|
117224
|
-
const core =
|
|
117225
|
-
|
|
117771
|
+
import_node_fs165.default.mkdirSync(packagePath, { recursive: true });
|
|
117772
|
+
const core = import_node_path166.default.join(packagePath, "adapter.a");
|
|
117773
|
+
import_node_fs165.default.writeFileSync(core, Buffer.from(adapter.base64, "base64"));
|
|
117226
117774
|
input.libraries ??= {};
|
|
117227
|
-
input.libraries.NitroCore =
|
|
117775
|
+
input.libraries.NitroCore = import_node_fs165.default.readFileSync(
|
|
117228
117776
|
combineNativeStaticLibraries([core, sharedLibrary], options2.moduleRoot)
|
|
117229
117777
|
).toString("base64");
|
|
117230
117778
|
}
|
|
@@ -117236,7 +117784,7 @@ async function compileNitroModule(options2) {
|
|
|
117236
117784
|
packagePath,
|
|
117237
117785
|
new Map(
|
|
117238
117786
|
Object.entries(input.files).map(([file, source]) => [
|
|
117239
|
-
|
|
117787
|
+
import_node_path166.default.join(packagePath, file),
|
|
117240
117788
|
source
|
|
117241
117789
|
])
|
|
117242
117790
|
)
|
|
@@ -117262,21 +117810,21 @@ async function compileNitroModule(options2) {
|
|
|
117262
117810
|
};
|
|
117263
117811
|
}
|
|
117264
117812
|
function nitrogenGeneratedSources(podDirectory) {
|
|
117265
|
-
const generated =
|
|
117266
|
-
const sources = (directory2, extension) =>
|
|
117813
|
+
const generated = import_node_path166.default.join(podDirectory, "nitrogen", "generated");
|
|
117814
|
+
const sources = (directory2, extension) => import_node_fs165.default.existsSync(directory2) ? import_node_fs165.default.readdirSync(directory2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile() && extension.test(entry.name)).map((entry) => import_node_path166.default.join(entry.parentPath, entry.name)) : [];
|
|
117267
117815
|
return [
|
|
117268
|
-
...sources(
|
|
117269
|
-
...sources(
|
|
117816
|
+
...sources(import_node_path166.default.join(generated, "shared"), /\.(h|hpp|c|cpp|swift)$/),
|
|
117817
|
+
...sources(import_node_path166.default.join(generated, "ios"), /\.(h|hpp|c|cpp|mm|swift)$/)
|
|
117270
117818
|
];
|
|
117271
117819
|
}
|
|
117272
|
-
var
|
|
117820
|
+
var import_node_crypto99, import_node_fs165, import_node_os33, import_node_path166, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
|
|
117273
117821
|
var init_nitro_compile = __esm({
|
|
117274
117822
|
"src/nitro-compile.ts"() {
|
|
117275
117823
|
"use strict";
|
|
117276
|
-
|
|
117277
|
-
|
|
117824
|
+
import_node_crypto99 = require("node:crypto");
|
|
117825
|
+
import_node_fs165 = __toESM(require("node:fs"), 1);
|
|
117278
117826
|
import_node_os33 = __toESM(require("node:os"), 1);
|
|
117279
|
-
|
|
117827
|
+
import_node_path166 = __toESM(require("node:path"), 1);
|
|
117280
117828
|
init_answeredNativePackages();
|
|
117281
117829
|
init_installed_native_libraries();
|
|
117282
117830
|
init_native_app_identity_project();
|
|
@@ -117350,29 +117898,29 @@ var init_nitro_compile = __esm({
|
|
|
117350
117898
|
});
|
|
117351
117899
|
|
|
117352
117900
|
// src/nitro-compiler-digest.ts
|
|
117353
|
-
var
|
|
117901
|
+
var import_node_crypto100, import_node_fs166, import_node_path167;
|
|
117354
117902
|
var init_nitro_compiler_digest = __esm({
|
|
117355
117903
|
"src/nitro-compiler-digest.ts"() {
|
|
117356
117904
|
"use strict";
|
|
117357
|
-
|
|
117358
|
-
|
|
117359
|
-
|
|
117905
|
+
import_node_crypto100 = require("node:crypto");
|
|
117906
|
+
import_node_fs166 = require("node:fs");
|
|
117907
|
+
import_node_path167 = __toESM(require("node:path"), 1);
|
|
117360
117908
|
init_swift_compiler_digest();
|
|
117361
117909
|
}
|
|
117362
117910
|
});
|
|
117363
117911
|
|
|
117364
117912
|
// src/nitro-superset-inputs.ts
|
|
117365
117913
|
async function nitroSupersetInputs(options2) {
|
|
117366
|
-
const resolve10 = (0,
|
|
117914
|
+
const resolve10 = (0, import_node_module24.createRequire)((0, import_node_path168.join)(options2.appRoot, "package.json")).resolve;
|
|
117367
117915
|
const pin2 = swiftNativePin();
|
|
117368
117916
|
const inputs2 = {
|
|
117369
117917
|
configuration: options2.configuration,
|
|
117370
117918
|
"ios-deployment-target": options2.iosDeploymentTarget,
|
|
117371
|
-
"react-native": packageVersion((0,
|
|
117919
|
+
"react-native": packageVersion((0, import_node_path168.dirname)(resolve10("react-native/package.json"))),
|
|
117372
117920
|
"swift-distribution": pin2.distribution.id,
|
|
117373
117921
|
"nitro-runtime": JSON.stringify(pin2.adapters.nitro)
|
|
117374
117922
|
};
|
|
117375
|
-
const nitroModules = (0,
|
|
117923
|
+
const nitroModules = (0, import_node_path168.dirname)(resolve10("react-native-nitro-modules/package.json"));
|
|
117376
117924
|
for (const { name: name3, root } of [
|
|
117377
117925
|
...options2.providers,
|
|
117378
117926
|
{ name: "react-native-nitro-modules", root: nitroModules }
|
|
@@ -117380,16 +117928,16 @@ async function nitroSupersetInputs(options2) {
|
|
|
117380
117928
|
inputs2[`provider:${name3}`] = `${packageVersion(root)}\0${await packageTreeDigest(root)}`;
|
|
117381
117929
|
return inputs2;
|
|
117382
117930
|
}
|
|
117383
|
-
var
|
|
117931
|
+
var import_node_fs167, import_node_module24, import_node_path168, packageVersion;
|
|
117384
117932
|
var init_nitro_superset_inputs = __esm({
|
|
117385
117933
|
"src/nitro-superset-inputs.ts"() {
|
|
117386
117934
|
"use strict";
|
|
117387
|
-
|
|
117388
|
-
|
|
117389
|
-
|
|
117935
|
+
import_node_fs167 = require("node:fs");
|
|
117936
|
+
import_node_module24 = require("node:module");
|
|
117937
|
+
import_node_path168 = require("node:path");
|
|
117390
117938
|
init_package_tree_digest();
|
|
117391
117939
|
init_swift_native_pin();
|
|
117392
|
-
packageVersion = (root) => JSON.parse((0,
|
|
117940
|
+
packageVersion = (root) => JSON.parse((0, import_node_fs167.readFileSync)((0, import_node_path168.join)(root, "package.json"), "utf8")).version;
|
|
117393
117941
|
}
|
|
117394
117942
|
});
|
|
117395
117943
|
|
|
@@ -117492,7 +118040,7 @@ var init_nitro_superset = __esm({
|
|
|
117492
118040
|
init_nitroContract();
|
|
117493
118041
|
init_swift_standin_digest();
|
|
117494
118042
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
117495
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
118043
|
+
NITRO_COMPILER_DIGEST = true ? "eed806fdf8f576fc444103efccda681c66fca69eedfa8abe6f1303adf03406c6" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
117496
118044
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
117497
118045
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
117498
118046
|
published3 = /* @__PURE__ */ new Map();
|
|
@@ -117520,7 +118068,7 @@ __export(nitro_bundle_exports, {
|
|
|
117520
118068
|
handleNitroRequest: () => handleNitroRequest
|
|
117521
118069
|
});
|
|
117522
118070
|
async function compileNitroApp(appRoot, origin, configure, moduleRoot, shared = true, iosTarget, answered) {
|
|
117523
|
-
appRoot =
|
|
118071
|
+
appRoot = import_node_fs168.default.realpathSync(appRoot);
|
|
117524
118072
|
const selection = await selectCompiledNitroProviders(appRoot, answered);
|
|
117525
118073
|
if (!selection) return null;
|
|
117526
118074
|
const { packageRoots, answers: answers2 } = selection;
|
|
@@ -117543,7 +118091,7 @@ async function compileNitroApp(appRoot, origin, configure, moduleRoot, shared =
|
|
|
117543
118091
|
const { artifact, collection } = await compileNitroModule({
|
|
117544
118092
|
appRoot: projectRoot,
|
|
117545
118093
|
packageRoots: packageRoots.map(
|
|
117546
|
-
(root) =>
|
|
118094
|
+
(root) => import_node_path169.default.resolve(projectRoot, import_node_path169.default.relative(appRoot, root))
|
|
117547
118095
|
),
|
|
117548
118096
|
answers: answers2,
|
|
117549
118097
|
moduleRoot: module2,
|
|
@@ -117605,14 +118153,14 @@ function compiledModuleRequestHandler(label, compile2, options2) {
|
|
|
117605
118153
|
res.setHeader("Cross-Origin-Resource-Policy", "cross-origin");
|
|
117606
118154
|
const root = url.searchParams.get("root");
|
|
117607
118155
|
const host2 = req.headers.host;
|
|
117608
|
-
if (req.method !== "GET" || !root || !
|
|
118156
|
+
if (req.method !== "GET" || !root || !import_node_path169.default.isAbsolute(root) || !host2) {
|
|
117609
118157
|
res.writeHead(400);
|
|
117610
118158
|
res.end(`${label} compilation needs GET with an absolute app root`);
|
|
117611
118159
|
return;
|
|
117612
118160
|
}
|
|
117613
118161
|
try {
|
|
117614
118162
|
const iosTarget = url.searchParams.get("iosTarget") ?? void 0;
|
|
117615
|
-
const app =
|
|
118163
|
+
const app = import_node_fs168.default.realpathSync(root);
|
|
117616
118164
|
const key2 = `${host2}\0${app}\0${iosTarget ?? ""}\0${url.searchParams.get("configuration") ?? ""}`;
|
|
117617
118165
|
const assetOrigin = `http://${host2}`;
|
|
117618
118166
|
const build2 = () => compile2(app, assetOrigin, iosTarget, url.searchParams);
|
|
@@ -117639,12 +118187,12 @@ function compiledModuleRequestHandler(label, compile2, options2) {
|
|
|
117639
118187
|
}
|
|
117640
118188
|
};
|
|
117641
118189
|
}
|
|
117642
|
-
var
|
|
118190
|
+
var import_node_fs168, import_node_path169, NITRO_ROUTE, handleNitroRequest;
|
|
117643
118191
|
var init_nitro_bundle = __esm({
|
|
117644
118192
|
"src/nitro-bundle.ts"() {
|
|
117645
118193
|
"use strict";
|
|
117646
|
-
|
|
117647
|
-
|
|
118194
|
+
import_node_fs168 = __toESM(require("node:fs"), 1);
|
|
118195
|
+
import_node_path169 = __toESM(require("node:path"), 1);
|
|
117648
118196
|
init_app_config();
|
|
117649
118197
|
init_backend_origin();
|
|
117650
118198
|
init_expo_native_workspace();
|
|
@@ -117680,7 +118228,7 @@ __export(expo_widgets_bundle_exports, {
|
|
|
117680
118228
|
handleExpoWidgetsRequest: () => handleExpoWidgetsRequest
|
|
117681
118229
|
});
|
|
117682
118230
|
async function buildExpoWidgetsBundle(appRoot, origin = "") {
|
|
117683
|
-
const require2 = (0,
|
|
118231
|
+
const require2 = (0, import_node_module25.createRequire)(import_node_path170.default.join(appRoot, "package.json"));
|
|
117684
118232
|
let manifest;
|
|
117685
118233
|
try {
|
|
117686
118234
|
manifest = require2.resolve("expo-widgets/package.json");
|
|
@@ -117689,16 +118237,16 @@ async function buildExpoWidgetsBundle(appRoot, origin = "") {
|
|
|
117689
118237
|
return null;
|
|
117690
118238
|
throw error;
|
|
117691
118239
|
}
|
|
117692
|
-
const packageDir =
|
|
118240
|
+
const packageDir = import_node_path170.default.dirname(manifest);
|
|
117693
118241
|
const runtimeBundle = await withSwiftRootLock(
|
|
117694
|
-
|
|
118242
|
+
import_node_path170.default.join(await import_promises19.default.realpath(packageDir), "bundle"),
|
|
117695
118243
|
async () => {
|
|
117696
118244
|
await (0, import_node_util23.promisify)(import_node_child_process76.execFile)(
|
|
117697
118245
|
process.env.NODE_BINARY || "node",
|
|
117698
|
-
[
|
|
118246
|
+
[import_node_path170.default.join(packageDir, "scripts/build-bundle.mjs"), appRoot],
|
|
117699
118247
|
{ cwd: appRoot, maxBuffer: 16 * 1024 * 1024 }
|
|
117700
118248
|
);
|
|
117701
|
-
return import_promises19.default.readFile(
|
|
118249
|
+
return import_promises19.default.readFile(import_node_path170.default.join(packageDir, "bundle/build/ExpoWidgets.bundle"), "utf8");
|
|
117702
118250
|
}
|
|
117703
118251
|
);
|
|
117704
118252
|
const catalog = await stageExpoWidgetAssets(appRoot, origin);
|
|
@@ -117709,14 +118257,14 @@ async function buildExpoWidgetsBundle(appRoot, origin = "") {
|
|
|
117709
118257
|
}
|
|
117710
118258
|
};
|
|
117711
118259
|
}
|
|
117712
|
-
var import_node_child_process76, import_promises19,
|
|
118260
|
+
var import_node_child_process76, import_promises19, import_node_module25, import_node_path170, import_node_util23, EXPO_WIDGETS_ROUTE, handleExpoWidgetsRequest;
|
|
117713
118261
|
var init_expo_widgets_bundle = __esm({
|
|
117714
118262
|
"src/expo-widgets-bundle.ts"() {
|
|
117715
118263
|
"use strict";
|
|
117716
118264
|
import_node_child_process76 = require("node:child_process");
|
|
117717
118265
|
import_promises19 = __toESM(require("node:fs/promises"), 1);
|
|
117718
|
-
|
|
117719
|
-
|
|
118266
|
+
import_node_module25 = require("node:module");
|
|
118267
|
+
import_node_path170 = __toESM(require("node:path"), 1);
|
|
117720
118268
|
import_node_util23 = require("node:util");
|
|
117721
118269
|
init_expo_widget_assets();
|
|
117722
118270
|
init_staged_host_files();
|
|
@@ -118307,16 +118855,16 @@ async function oneSDKLinkSources(appRoot, preparedRoot, options2 = {}) {
|
|
|
118307
118855
|
const selected = await selectOneSDK(appRoot);
|
|
118308
118856
|
if (!selected) throw new Error("prepared app has no One SDK imports");
|
|
118309
118857
|
const { one, frameworks } = selected;
|
|
118310
|
-
const sourceRoot =
|
|
118858
|
+
const sourceRoot = import_node_path171.default.join(preparedRoot, ONE_SDK_SOURCE_DIRECTORY);
|
|
118311
118859
|
const generated = readOneSDKSourceManifest(
|
|
118312
|
-
JSON.parse(
|
|
118860
|
+
JSON.parse(import_node_fs169.default.readFileSync(import_node_path171.default.join(sourceRoot, "manifest.json"), "utf8"))
|
|
118313
118861
|
);
|
|
118314
118862
|
const { generation } = JSON.parse(
|
|
118315
|
-
|
|
118863
|
+
import_node_fs169.default.readFileSync(import_node_path171.default.join(one, "ios-bindings/manifest.json"), "utf8")
|
|
118316
118864
|
);
|
|
118317
118865
|
if (generated.generation !== generation) {
|
|
118318
118866
|
const { version: version2 } = JSON.parse(
|
|
118319
|
-
|
|
118867
|
+
import_node_fs169.default.readFileSync(import_node_path171.default.join(one, "package.json"), "utf8")
|
|
118320
118868
|
);
|
|
118321
118869
|
throw new Error(
|
|
118322
118870
|
`${appRoot} has One ${version2} installed, which differs from the One its lockfile resolves. Install its dependencies, restart its dev server and open it again.`
|
|
@@ -118336,12 +118884,12 @@ async function oneSDKLinkSources(appRoot, preparedRoot, options2 = {}) {
|
|
|
118336
118884
|
"SDKViews/OneNativeViewsTable.swift"
|
|
118337
118885
|
])
|
|
118338
118886
|
targets.set(
|
|
118339
|
-
`Sources/One/${
|
|
118340
|
-
|
|
118887
|
+
`Sources/One/${import_node_path171.default.basename(source)}`,
|
|
118888
|
+
import_node_fs169.default.readFileSync(import_node_path171.default.join(one, "ios", source), "utf8")
|
|
118341
118889
|
);
|
|
118342
118890
|
for (const name3 of generated.files) {
|
|
118343
118891
|
const filePath = `Sources/OneSDKBindings/${name3}`;
|
|
118344
|
-
const source =
|
|
118892
|
+
const source = import_node_fs169.default.readFileSync(import_node_path171.default.join(sourceRoot, name3), "utf8");
|
|
118345
118893
|
if (options2.shard) {
|
|
118346
118894
|
for (const [shardedName, shardedSource] of shardOneSDKBindingSource(
|
|
118347
118895
|
filePath,
|
|
@@ -118369,10 +118917,10 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
|
|
|
118369
118917
|
const optimize = options2.optimize ?? true;
|
|
118370
118918
|
const sources = await oneSDKLinkSources(appRoot, preparedRoot, { shard: !optimize });
|
|
118371
118919
|
const moduleRoot = moduleRootOverride ?? (await resolveSwiftModule()).root;
|
|
118372
|
-
const packagePath =
|
|
118920
|
+
const packagePath = import_node_path171.default.join(
|
|
118373
118921
|
swiftCacheDir(),
|
|
118374
118922
|
"peach-one-sdk-swift",
|
|
118375
|
-
(0,
|
|
118923
|
+
(0, import_node_crypto101.createHash)("sha256").update(import_node_fs169.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
|
|
118376
118924
|
"sdk"
|
|
118377
118925
|
);
|
|
118378
118926
|
const bindingFlags = optimize ? '["-suppress-warnings"]' : '["-suppress-warnings", "-Onone", "-no-whole-module-optimization"]';
|
|
@@ -118391,10 +118939,10 @@ let package = Package(name: "OneSDKGuest", targets: [
|
|
|
118391
118939
|
for (const [name3, source] of sources.targets) files2.set(name3, source);
|
|
118392
118940
|
for (const [name3, source] of sources.entry) files2.set(`Sources/App/${name3}`, source);
|
|
118393
118941
|
files2.set("Sources/App/App.swift", oneSDKApp);
|
|
118394
|
-
|
|
118942
|
+
import_node_fs169.default.mkdirSync(packagePath, { recursive: true });
|
|
118395
118943
|
syncSwiftTree(
|
|
118396
118944
|
packagePath,
|
|
118397
|
-
new Map([...files2].map(([name3, source]) => [
|
|
118945
|
+
new Map([...files2].map(([name3, source]) => [import_node_path171.default.join(packagePath, name3), source]))
|
|
118398
118946
|
);
|
|
118399
118947
|
const project2 = projectFor(packagePath);
|
|
118400
118948
|
project2.oneModule = false;
|
|
@@ -118419,13 +118967,13 @@ async function buildOneSDKBundle(appRoot) {
|
|
|
118419
118967
|
assets: await compiledModuleAssets(compiled.artifact)
|
|
118420
118968
|
};
|
|
118421
118969
|
}
|
|
118422
|
-
var
|
|
118970
|
+
var import_node_crypto101, import_node_fs169, import_node_path171, ONE_SDK_ROUTE, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES, handleOneSDKRequest;
|
|
118423
118971
|
var init_one_sdk_bundle = __esm({
|
|
118424
118972
|
"src/one-sdk-bundle.ts"() {
|
|
118425
118973
|
"use strict";
|
|
118426
|
-
|
|
118427
|
-
|
|
118428
|
-
|
|
118974
|
+
import_node_crypto101 = require("node:crypto");
|
|
118975
|
+
import_node_fs169 = __toESM(require("node:fs"), 1);
|
|
118976
|
+
import_node_path171 = __toESM(require("node:path"), 1);
|
|
118429
118977
|
init_expo_native_workspace();
|
|
118430
118978
|
init_nitro_bundle();
|
|
118431
118979
|
init_one_sdk_preparation();
|
|
@@ -118502,8 +119050,8 @@ async function compileTurboApp(appRoot, origin, moduleRoot, iosTarget, prepareRe
|
|
|
118502
119050
|
}
|
|
118503
119051
|
const { artifact, collection } = await compileTurboModule({
|
|
118504
119052
|
appRoot,
|
|
118505
|
-
reactNativeRoot:
|
|
118506
|
-
(0,
|
|
119053
|
+
reactNativeRoot: import_node_path172.default.dirname(
|
|
119054
|
+
(0, import_node_module26.createRequire)(import_node_path172.default.join(projectRoot, "package.json")).resolve(
|
|
118507
119055
|
"react-native/package.json"
|
|
118508
119056
|
)
|
|
118509
119057
|
),
|
|
@@ -118541,12 +119089,12 @@ async function buildTurboBundle(appRoot, moduleRoot, prepareReactNativeCore) {
|
|
|
118541
119089
|
assets: compiled.artifact ? await compiledModuleAssets(compiled.artifact) : []
|
|
118542
119090
|
};
|
|
118543
119091
|
}
|
|
118544
|
-
var
|
|
119092
|
+
var import_node_module26, import_node_path172, TURBO_ROUTE, handleTurboRequest;
|
|
118545
119093
|
var init_turbo_bundle = __esm({
|
|
118546
119094
|
"src/turbo-bundle.ts"() {
|
|
118547
119095
|
"use strict";
|
|
118548
|
-
|
|
118549
|
-
|
|
119096
|
+
import_node_module26 = require("node:module");
|
|
119097
|
+
import_node_path172 = __toESM(require("node:path"), 1);
|
|
118550
119098
|
init_app_project();
|
|
118551
119099
|
init_app_config();
|
|
118552
119100
|
init_expo_native_prebuilt();
|
|
@@ -118598,7 +119146,7 @@ var init_androidAutolinkingContract = __esm({
|
|
|
118598
119146
|
|
|
118599
119147
|
// src/android-autolinking.ts
|
|
118600
119148
|
async function resolveExpoAndroidAutolinking(appRoot) {
|
|
118601
|
-
const root =
|
|
119149
|
+
const root = import_node_fs170.default.realpathSync(appRoot);
|
|
118602
119150
|
const existing = resolving.get(root);
|
|
118603
119151
|
if (existing) return existing;
|
|
118604
119152
|
const pending = resolveAndroidModules(root);
|
|
@@ -118612,7 +119160,7 @@ async function resolveExpoAndroidAutolinking(appRoot) {
|
|
|
118612
119160
|
async function resolveAndroidModules(appRoot) {
|
|
118613
119161
|
let autolinker;
|
|
118614
119162
|
try {
|
|
118615
|
-
autolinker = (0,
|
|
119163
|
+
autolinker = (0, import_node_module27.createRequire)(import_node_path173.default.join(appRoot, "package.json")).resolve(
|
|
118616
119164
|
"expo-modules-autolinking/package.json"
|
|
118617
119165
|
);
|
|
118618
119166
|
} catch (error) {
|
|
@@ -118620,7 +119168,7 @@ async function resolveAndroidModules(appRoot) {
|
|
|
118620
119168
|
throw error;
|
|
118621
119169
|
}
|
|
118622
119170
|
const output = await runAutolinker(
|
|
118623
|
-
|
|
119171
|
+
import_node_path173.default.join(import_node_path173.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
|
|
118624
119172
|
["resolve", "--platform", "android", "--project-root", appRoot, "--json"],
|
|
118625
119173
|
{
|
|
118626
119174
|
timeout: 3e4,
|
|
@@ -118666,13 +119214,13 @@ async function resolveReactNativeAndroidAutolinking(appRoot) {
|
|
|
118666
119214
|
}
|
|
118667
119215
|
return linked;
|
|
118668
119216
|
}
|
|
118669
|
-
var
|
|
119217
|
+
var import_node_fs170, import_node_module27, import_node_path173, resolving;
|
|
118670
119218
|
var init_android_autolinking = __esm({
|
|
118671
119219
|
"src/android-autolinking.ts"() {
|
|
118672
119220
|
"use strict";
|
|
118673
|
-
|
|
118674
|
-
|
|
118675
|
-
|
|
119221
|
+
import_node_fs170 = __toESM(require("node:fs"), 1);
|
|
119222
|
+
import_node_module27 = require("node:module");
|
|
119223
|
+
import_node_path173 = __toESM(require("node:path"), 1);
|
|
118676
119224
|
init_androidAutolinkingContract();
|
|
118677
119225
|
init_autolinker_process();
|
|
118678
119226
|
init_is_record();
|
|
@@ -118683,8 +119231,8 @@ var init_android_autolinking = __esm({
|
|
|
118683
119231
|
|
|
118684
119232
|
// src/android-bridge-dependencies.ts
|
|
118685
119233
|
async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
118686
|
-
const root =
|
|
118687
|
-
if (!
|
|
119234
|
+
const root = import_node_path174.default.join(appRoot, "android");
|
|
119235
|
+
if (!import_node_fs171.default.existsSync(import_node_path174.default.join(root, "gradlew"))) return null;
|
|
118688
119236
|
const dependencies = (await resolveReactNativeAndroidAutolinking(appRoot)).flatMap(
|
|
118689
119237
|
(dependency) => dependency.sourceDir === null || dependency.packageInstance === null ? [] : [
|
|
118690
119238
|
{
|
|
@@ -118698,7 +119246,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
118698
119246
|
const models = await resolveAndroidGradleSources({
|
|
118699
119247
|
root,
|
|
118700
119248
|
projects: [
|
|
118701
|
-
|
|
119249
|
+
import_node_path174.default.join(root, "app"),
|
|
118702
119250
|
...dependencies.map((dependency) => dependency.sourceDir)
|
|
118703
119251
|
],
|
|
118704
119252
|
variant: "debug"
|
|
@@ -118708,7 +119256,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
118708
119256
|
const toolchain = readToolchain(moduleRoot);
|
|
118709
119257
|
const [sdk2, ready] = await Promise.all([
|
|
118710
119258
|
installKotlinSdkArchive(
|
|
118711
|
-
|
|
119259
|
+
import_node_fs171.default.readFileSync(import_node_path174.default.join(moduleRoot, "sdk.tar.gz")),
|
|
118712
119260
|
toolchain.compiler
|
|
118713
119261
|
),
|
|
118714
119262
|
ensureToolchain(toolchain)
|
|
@@ -118716,7 +119264,7 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
118716
119264
|
const packages = [];
|
|
118717
119265
|
for (const dependency of dependencies) {
|
|
118718
119266
|
const model = models.find(
|
|
118719
|
-
(entry) => entry.projectDir ===
|
|
119267
|
+
(entry) => entry.projectDir === import_node_fs171.default.realpathSync(dependency.sourceDir)
|
|
118720
119268
|
);
|
|
118721
119269
|
try {
|
|
118722
119270
|
const className2 = /^import\s+([\w.]+)\s*;$/.exec(
|
|
@@ -118755,12 +119303,12 @@ async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
|
118755
119303
|
}
|
|
118756
119304
|
return packages.length ? { applicationId, packages } : null;
|
|
118757
119305
|
}
|
|
118758
|
-
var
|
|
119306
|
+
var import_node_fs171, import_node_path174;
|
|
118759
119307
|
var init_android_bridge_dependencies = __esm({
|
|
118760
119308
|
"src/android-bridge-dependencies.ts"() {
|
|
118761
119309
|
"use strict";
|
|
118762
|
-
|
|
118763
|
-
|
|
119310
|
+
import_node_fs171 = __toESM(require("node:fs"), 1);
|
|
119311
|
+
import_node_path174 = __toESM(require("node:path"), 1);
|
|
118764
119312
|
init_android_autolinking();
|
|
118765
119313
|
init_android_gradle_sources();
|
|
118766
119314
|
init_java_module_abi();
|
|
@@ -118788,8 +119336,8 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
118788
119336
|
for (const project2 of entry.projects) {
|
|
118789
119337
|
if (!isRecord(project2) || typeof project2.sourceDir !== "string" || !Array.isArray(project2.modules))
|
|
118790
119338
|
throw new Error("invalid Expo Android project");
|
|
118791
|
-
const sourceDir =
|
|
118792
|
-
const installed2 = sourceDir.split(
|
|
119339
|
+
const sourceDir = import_node_fs172.default.realpathSync(project2.sourceDir);
|
|
119340
|
+
const installed2 = sourceDir.split(import_node_path175.default.sep).includes("node_modules");
|
|
118793
119341
|
if (installed2) {
|
|
118794
119342
|
if (typeof entry.packageName !== "string") continue;
|
|
118795
119343
|
if (peachAnsweredNativePackages().has(entry.packageName)) {
|
|
@@ -118817,9 +119365,9 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
118817
119365
|
group.unsupported ??= reason;
|
|
118818
119366
|
};
|
|
118819
119367
|
const walk4 = (dir) => {
|
|
118820
|
-
if (!
|
|
118821
|
-
for (const child of
|
|
118822
|
-
const file =
|
|
119368
|
+
if (!import_node_fs172.default.existsSync(dir)) return;
|
|
119369
|
+
for (const child of import_node_fs172.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
119370
|
+
const file = import_node_path175.default.join(dir, child.name);
|
|
118823
119371
|
if (child.isSymbolicLink()) reject(`Expo Kotlin source is a symlink: ${file}`);
|
|
118824
119372
|
else if (child.isDirectory()) walk4(file);
|
|
118825
119373
|
else if (child.name.endsWith(".java"))
|
|
@@ -118827,8 +119375,8 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
118827
119375
|
else if (child.name.endsWith(".kt")) group.sources.push(file);
|
|
118828
119376
|
}
|
|
118829
119377
|
};
|
|
118830
|
-
walk4(
|
|
118831
|
-
walk4(
|
|
119378
|
+
walk4(import_node_path175.default.join(sourceDir, "src", "main", "java"));
|
|
119379
|
+
walk4(import_node_path175.default.join(sourceDir, "src", "main", "kotlin"));
|
|
118832
119380
|
result.push(group);
|
|
118833
119381
|
}
|
|
118834
119382
|
}
|
|
@@ -118841,7 +119389,7 @@ async function collectBridgePackages(appRoot) {
|
|
|
118841
119389
|
);
|
|
118842
119390
|
const app = androidAppSources(appRoot);
|
|
118843
119391
|
if (!app || !app.kotlin.some(
|
|
118844
|
-
(file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(
|
|
119392
|
+
(file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(import_node_fs172.default.readFileSync(file, "utf8"))
|
|
118845
119393
|
))
|
|
118846
119394
|
return dependencies;
|
|
118847
119395
|
const { scanBridgeFiles: scanBridgeFiles2 } = await Promise.resolve().then(() => (init_kotlin_host(), kotlin_host_exports));
|
|
@@ -118956,7 +119504,7 @@ async function handleExpoKotlinRequest(req, res) {
|
|
|
118956
119504
|
return true;
|
|
118957
119505
|
}
|
|
118958
119506
|
const root = url.searchParams.get("root");
|
|
118959
|
-
if (!root || !
|
|
119507
|
+
if (!root || !import_node_path175.default.isAbsolute(root)) {
|
|
118960
119508
|
res.writeHead(400);
|
|
118961
119509
|
res.end("missing absolute app root");
|
|
118962
119510
|
return true;
|
|
@@ -118987,12 +119535,12 @@ async function handleExpoKotlinRequest(req, res) {
|
|
|
118987
119535
|
}
|
|
118988
119536
|
return true;
|
|
118989
119537
|
}
|
|
118990
|
-
var
|
|
119538
|
+
var import_node_fs172, import_node_path175, EXPO_KOTLIN_ROUTE, compiling;
|
|
118991
119539
|
var init_expo_kotlin_host = __esm({
|
|
118992
119540
|
"src/expo-kotlin-host.ts"() {
|
|
118993
119541
|
"use strict";
|
|
118994
|
-
|
|
118995
|
-
|
|
119542
|
+
import_node_fs172 = __toESM(require("node:fs"), 1);
|
|
119543
|
+
import_node_path175 = __toESM(require("node:path"), 1);
|
|
118996
119544
|
init_android_autolinking();
|
|
118997
119545
|
init_android_bridge_dependencies();
|
|
118998
119546
|
init_android_bridge_packages();
|
|
@@ -119015,14 +119563,14 @@ function sharedDesktopAuthAccounts(user) {
|
|
|
119015
119563
|
function getBaseDir() {
|
|
119016
119564
|
const explicit = process.env[SESSION_FILE_ENV];
|
|
119017
119565
|
if (explicit?.trim()) {
|
|
119018
|
-
return (0,
|
|
119566
|
+
return (0, import_node_path176.dirname)((0, import_node_path176.resolve)(explicit));
|
|
119019
119567
|
}
|
|
119020
119568
|
return electronUserDataDir();
|
|
119021
119569
|
}
|
|
119022
119570
|
function getSharedDesktopAuthFilePath() {
|
|
119023
119571
|
const explicit = process.env[SESSION_FILE_ENV];
|
|
119024
|
-
if (explicit?.trim()) return (0,
|
|
119025
|
-
return (0,
|
|
119572
|
+
if (explicit?.trim()) return (0, import_node_path176.resolve)(explicit);
|
|
119573
|
+
return (0, import_node_path176.join)(getBaseDir(), "desktop-auth.json");
|
|
119026
119574
|
}
|
|
119027
119575
|
function normalizeUser(input) {
|
|
119028
119576
|
if (!input || typeof input !== "object") return null;
|
|
@@ -119072,27 +119620,27 @@ function normalizeSession(input) {
|
|
|
119072
119620
|
}
|
|
119073
119621
|
function readSharedDesktopAuthSession() {
|
|
119074
119622
|
const filepath = getSharedDesktopAuthFilePath();
|
|
119075
|
-
if (!(0,
|
|
119623
|
+
if (!(0, import_node_fs173.existsSync)(filepath)) return null;
|
|
119076
119624
|
try {
|
|
119077
|
-
const parsed2 = JSON.parse((0,
|
|
119625
|
+
const parsed2 = JSON.parse((0, import_node_fs173.readFileSync)(filepath, "utf8"));
|
|
119078
119626
|
const normalized = normalizeSession(parsed2);
|
|
119079
119627
|
if (!normalized) {
|
|
119080
|
-
(0,
|
|
119628
|
+
(0, import_node_fs173.rmSync)(filepath, { force: true });
|
|
119081
119629
|
return null;
|
|
119082
119630
|
}
|
|
119083
119631
|
return normalized;
|
|
119084
119632
|
} catch {
|
|
119085
|
-
(0,
|
|
119633
|
+
(0, import_node_fs173.rmSync)(filepath, { force: true });
|
|
119086
119634
|
return null;
|
|
119087
119635
|
}
|
|
119088
119636
|
}
|
|
119089
|
-
var
|
|
119637
|
+
var import_node_crypto102, import_node_fs173, import_node_path176, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
|
|
119090
119638
|
var init_shared_session = __esm({
|
|
119091
119639
|
"src/auth/shared-session.ts"() {
|
|
119092
119640
|
"use strict";
|
|
119093
|
-
|
|
119094
|
-
|
|
119095
|
-
|
|
119641
|
+
import_node_crypto102 = require("node:crypto");
|
|
119642
|
+
import_node_fs173 = require("node:fs");
|
|
119643
|
+
import_node_path176 = require("node:path");
|
|
119096
119644
|
init_home_paths();
|
|
119097
119645
|
init_public_brand();
|
|
119098
119646
|
SESSION_VERSION = 1;
|
|
@@ -119127,31 +119675,31 @@ var init_run_rnx = __esm({
|
|
|
119127
119675
|
|
|
119128
119676
|
// cli/secure-file.ts
|
|
119129
119677
|
function writeSecureJsonAtomic(filepath, value, { durable = true } = {}) {
|
|
119130
|
-
(0,
|
|
119131
|
-
const temporary = `${filepath}.tmp-${process.pid}-${(0,
|
|
119678
|
+
(0, import_node_fs174.mkdirSync)((0, import_node_path177.dirname)(filepath), { recursive: true });
|
|
119679
|
+
const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto103.randomUUID)()}`;
|
|
119132
119680
|
let descriptor = null;
|
|
119133
119681
|
try {
|
|
119134
|
-
descriptor = (0,
|
|
119135
|
-
(0,
|
|
119136
|
-
(0,
|
|
119682
|
+
descriptor = (0, import_node_fs174.openSync)(temporary, "wx", 384);
|
|
119683
|
+
(0, import_node_fs174.fchmodSync)(descriptor, 384);
|
|
119684
|
+
(0, import_node_fs174.writeFileSync)(descriptor, `${JSON.stringify(value, null, 2)}
|
|
119137
119685
|
`);
|
|
119138
|
-
if (durable) (0,
|
|
119139
|
-
(0,
|
|
119686
|
+
if (durable) (0, import_node_fs174.fsyncSync)(descriptor);
|
|
119687
|
+
(0, import_node_fs174.closeSync)(descriptor);
|
|
119140
119688
|
descriptor = null;
|
|
119141
|
-
(0,
|
|
119689
|
+
(0, import_node_fs174.renameSync)(temporary, filepath);
|
|
119142
119690
|
} catch (error) {
|
|
119143
|
-
if (descriptor !== null) (0,
|
|
119144
|
-
(0,
|
|
119691
|
+
if (descriptor !== null) (0, import_node_fs174.closeSync)(descriptor);
|
|
119692
|
+
(0, import_node_fs174.rmSync)(temporary, { force: true });
|
|
119145
119693
|
throw error;
|
|
119146
119694
|
}
|
|
119147
119695
|
}
|
|
119148
|
-
var
|
|
119696
|
+
var import_node_crypto103, import_node_fs174, import_node_path177;
|
|
119149
119697
|
var init_secure_file = __esm({
|
|
119150
119698
|
"cli/secure-file.ts"() {
|
|
119151
119699
|
"use strict";
|
|
119152
|
-
|
|
119153
|
-
|
|
119154
|
-
|
|
119700
|
+
import_node_crypto103 = require("node:crypto");
|
|
119701
|
+
import_node_fs174 = require("node:fs");
|
|
119702
|
+
import_node_path177 = require("node:path");
|
|
119155
119703
|
}
|
|
119156
119704
|
});
|
|
119157
119705
|
|
|
@@ -119201,25 +119749,25 @@ function isCliApiKeySecret(secret) {
|
|
|
119201
119749
|
return secret.startsWith("sk_rnx_");
|
|
119202
119750
|
}
|
|
119203
119751
|
function savedApiKeyFile() {
|
|
119204
|
-
return
|
|
119752
|
+
return import_node_path178.default.join(rnxHomeDir(), "api-key.json");
|
|
119205
119753
|
}
|
|
119206
119754
|
function readApiKeyFile(file) {
|
|
119207
|
-
if (!(0,
|
|
119208
|
-
const secret = (0,
|
|
119755
|
+
if (!(0, import_node_fs175.existsSync)(file)) return null;
|
|
119756
|
+
const secret = (0, import_node_fs175.readFileSync)(file, "utf8").trim();
|
|
119209
119757
|
return isCliApiKeySecret(secret) ? secret : null;
|
|
119210
119758
|
}
|
|
119211
119759
|
function saveApiKey(secret) {
|
|
119212
119760
|
writeSecureJsonAtomic(savedApiKeyFile(), { secret });
|
|
119213
119761
|
}
|
|
119214
119762
|
function forgetApiKey() {
|
|
119215
|
-
if (!(0,
|
|
119216
|
-
(0,
|
|
119763
|
+
if (!(0, import_node_fs175.existsSync)(savedApiKeyFile())) return false;
|
|
119764
|
+
(0, import_node_fs175.rmSync)(savedApiKeyFile());
|
|
119217
119765
|
return true;
|
|
119218
119766
|
}
|
|
119219
119767
|
function readSavedApiKey() {
|
|
119220
|
-
if (!(0,
|
|
119768
|
+
if (!(0, import_node_fs175.existsSync)(savedApiKeyFile())) return null;
|
|
119221
119769
|
const saved = savedKeySchema.safeParse(
|
|
119222
|
-
JSON.parse((0,
|
|
119770
|
+
JSON.parse((0, import_node_fs175.readFileSync)(savedApiKeyFile(), "utf8"))
|
|
119223
119771
|
);
|
|
119224
119772
|
return saved.success && isCliApiKeySecret(saved.data.secret) ? saved.data.secret : null;
|
|
119225
119773
|
}
|
|
@@ -119277,12 +119825,12 @@ function authHeaderOrExit(commandLabel) {
|
|
|
119277
119825
|
);
|
|
119278
119826
|
rnxExit(1);
|
|
119279
119827
|
}
|
|
119280
|
-
var
|
|
119828
|
+
var import_node_fs175, import_node_path178, import_zod3, GITHUB_TOKEN_PREFIXES, DOWNLOADED_API_KEY_FILE, savedKeySchema, CHOOSE_ACCOUNT_HINT;
|
|
119281
119829
|
var init_auth = __esm({
|
|
119282
119830
|
"cli/auth.ts"() {
|
|
119283
119831
|
"use strict";
|
|
119284
|
-
|
|
119285
|
-
|
|
119832
|
+
import_node_fs175 = require("node:fs");
|
|
119833
|
+
import_node_path178 = __toESM(require("node:path"), 1);
|
|
119286
119834
|
import_zod3 = require("peachsim/vendor/zod");
|
|
119287
119835
|
init_shared_session();
|
|
119288
119836
|
init_home_paths();
|
|
@@ -120085,8 +120633,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
|
|
|
120085
120633
|
}
|
|
120086
120634
|
const out = [];
|
|
120087
120635
|
for (const dir of dirs) {
|
|
120088
|
-
const
|
|
120089
|
-
if (!out.includes(
|
|
120636
|
+
const path160 = `${dir}/${filename}`;
|
|
120637
|
+
if (!out.includes(path160)) out.push(path160);
|
|
120090
120638
|
}
|
|
120091
120639
|
if (!out.includes(filename)) out.push(filename);
|
|
120092
120640
|
return out;
|
|
@@ -120559,16 +121107,16 @@ function parseAbsoluteUrl(input) {
|
|
|
120559
121107
|
}
|
|
120560
121108
|
function parseFileUrl(input) {
|
|
120561
121109
|
const match = fileRegex.exec(input);
|
|
120562
|
-
const
|
|
120563
|
-
return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(
|
|
121110
|
+
const path160 = match[2];
|
|
121111
|
+
return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path160) ? path160 : "/" + path160, match[3] || "", match[4] || "");
|
|
120564
121112
|
}
|
|
120565
|
-
function makeUrl(scheme, user, host2, port,
|
|
121113
|
+
function makeUrl(scheme, user, host2, port, path160, query, hash) {
|
|
120566
121114
|
return {
|
|
120567
121115
|
scheme,
|
|
120568
121116
|
user,
|
|
120569
121117
|
host: host2,
|
|
120570
121118
|
port,
|
|
120571
|
-
path:
|
|
121119
|
+
path: path160,
|
|
120572
121120
|
query,
|
|
120573
121121
|
hash,
|
|
120574
121122
|
type: 7
|
|
@@ -120598,11 +121146,11 @@ function parseUrl(input) {
|
|
|
120598
121146
|
url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
|
|
120599
121147
|
return url;
|
|
120600
121148
|
}
|
|
120601
|
-
function stripPathFilename(
|
|
120602
|
-
if (
|
|
120603
|
-
return
|
|
120604
|
-
const index =
|
|
120605
|
-
return
|
|
121149
|
+
function stripPathFilename(path160) {
|
|
121150
|
+
if (path160.endsWith("/.."))
|
|
121151
|
+
return path160;
|
|
121152
|
+
const index = path160.lastIndexOf("/");
|
|
121153
|
+
return path160.slice(0, index + 1);
|
|
120606
121154
|
}
|
|
120607
121155
|
function mergePaths(url, base2) {
|
|
120608
121156
|
normalizePath(base2, base2.type);
|
|
@@ -120640,14 +121188,14 @@ function normalizePath(url, type) {
|
|
|
120640
121188
|
pieces[pointer2++] = piece;
|
|
120641
121189
|
positive++;
|
|
120642
121190
|
}
|
|
120643
|
-
let
|
|
121191
|
+
let path160 = "";
|
|
120644
121192
|
for (let i = 1; i < pointer2; i++) {
|
|
120645
|
-
|
|
121193
|
+
path160 += "/" + pieces[i];
|
|
120646
121194
|
}
|
|
120647
|
-
if (!
|
|
120648
|
-
|
|
121195
|
+
if (!path160 || addTrailingSlash && !path160.endsWith("/..")) {
|
|
121196
|
+
path160 += "/";
|
|
120649
121197
|
}
|
|
120650
|
-
url.path =
|
|
121198
|
+
url.path = path160;
|
|
120651
121199
|
}
|
|
120652
121200
|
function resolve7(input, base2) {
|
|
120653
121201
|
if (!input && !base2)
|
|
@@ -120688,13 +121236,13 @@ function resolve7(input, base2) {
|
|
|
120688
121236
|
case 3:
|
|
120689
121237
|
return queryHash;
|
|
120690
121238
|
case 4: {
|
|
120691
|
-
const
|
|
120692
|
-
if (!
|
|
121239
|
+
const path160 = url.path.slice(1);
|
|
121240
|
+
if (!path160)
|
|
120693
121241
|
return queryHash || ".";
|
|
120694
|
-
if (isRelative(base2 || input) && !isRelative(
|
|
120695
|
-
return "./" +
|
|
121242
|
+
if (isRelative(base2 || input) && !isRelative(path160)) {
|
|
121243
|
+
return "./" + path160 + queryHash;
|
|
120696
121244
|
}
|
|
120697
|
-
return
|
|
121245
|
+
return path160 + queryHash;
|
|
120698
121246
|
}
|
|
120699
121247
|
case 5:
|
|
120700
121248
|
return url.path + queryHash;
|
|
@@ -120712,10 +121260,10 @@ var init_resolve_uri = __esm({
|
|
|
120712
121260
|
});
|
|
120713
121261
|
|
|
120714
121262
|
// ../../node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
|
|
120715
|
-
function stripFilename(
|
|
120716
|
-
if (!
|
|
120717
|
-
const index =
|
|
120718
|
-
return
|
|
121263
|
+
function stripFilename(path160) {
|
|
121264
|
+
if (!path160) return "";
|
|
121265
|
+
const index = path160.lastIndexOf("/");
|
|
121266
|
+
return path160.slice(0, index + 1);
|
|
120719
121267
|
}
|
|
120720
121268
|
function resolver(mapUrl, sourceRoot) {
|
|
120721
121269
|
const from = stripFilename(mapUrl);
|
|
@@ -121511,13 +122059,13 @@ function createCloudSession(input) {
|
|
|
121511
122059
|
}
|
|
121512
122060
|
return session;
|
|
121513
122061
|
}
|
|
121514
|
-
var
|
|
122062
|
+
var import_node_crypto104, import_node_fs176, import_node_path179, CLOUD_SESSION_VERSION, MAX_ENCODED_SESSION_BYTES, RNX_SHELL_UPDATE_PREFIX, RNX_SHELL_UPDATE_SET_PREFIX, RNX_SHELL_UPDATE_UNSET;
|
|
121515
122063
|
var init_cloud_session = __esm({
|
|
121516
122064
|
"cli/cloud-session.ts"() {
|
|
121517
122065
|
"use strict";
|
|
121518
|
-
|
|
121519
|
-
|
|
121520
|
-
|
|
122066
|
+
import_node_crypto104 = require("node:crypto");
|
|
122067
|
+
import_node_fs176 = require("node:fs");
|
|
122068
|
+
import_node_path179 = require("node:path");
|
|
121521
122069
|
init_backend_origin();
|
|
121522
122070
|
init_home_paths();
|
|
121523
122071
|
init_is_record();
|
|
@@ -121600,12 +122148,12 @@ var init_run_registry = __esm({
|
|
|
121600
122148
|
});
|
|
121601
122149
|
|
|
121602
122150
|
// cli/stream-record.ts
|
|
121603
|
-
var
|
|
122151
|
+
var import_node_fs177, import_node_path180, import_zod4, sceneCommandEndpoint, streamRecord;
|
|
121604
122152
|
var init_stream_record = __esm({
|
|
121605
122153
|
"cli/stream-record.ts"() {
|
|
121606
122154
|
"use strict";
|
|
121607
|
-
|
|
121608
|
-
|
|
122155
|
+
import_node_fs177 = require("node:fs");
|
|
122156
|
+
import_node_path180 = require("node:path");
|
|
121609
122157
|
import_zod4 = require("peachsim/vendor/zod");
|
|
121610
122158
|
init_home_paths();
|
|
121611
122159
|
init_secure_file();
|
|
@@ -121661,27 +122209,27 @@ function resolveCloudOrigin(value) {
|
|
|
121661
122209
|
return normalizeCloudOrigin(source);
|
|
121662
122210
|
}
|
|
121663
122211
|
function readImmutableBundleSource(bundlePath, command) {
|
|
121664
|
-
const filepath = (0,
|
|
121665
|
-
if ((0,
|
|
122212
|
+
const filepath = (0, import_node_path181.resolve)(bundlePath);
|
|
122213
|
+
if ((0, import_node_path181.extname)(filepath) === ".hbc") {
|
|
121666
122214
|
const platform3 = filepath.includes("/android/") ? "android" : "ios";
|
|
121667
122215
|
throw new Error(
|
|
121668
122216
|
`${command} cannot preview Hermes bytecode (${bundlePath}). Export plain JavaScript with \`npx expo export --platform ${platform3} --no-bytecode\` and preview the .js bundle instead.`
|
|
121669
122217
|
);
|
|
121670
122218
|
}
|
|
121671
|
-
if ((0,
|
|
122219
|
+
if ((0, import_node_path181.extname)(filepath) !== ".js") {
|
|
121672
122220
|
throw new Error(`${command} requires one local .js bundle`);
|
|
121673
122221
|
}
|
|
121674
|
-
const descriptor = (0,
|
|
122222
|
+
const descriptor = (0, import_node_fs178.openSync)(filepath, "r");
|
|
121675
122223
|
try {
|
|
121676
|
-
const before = (0,
|
|
122224
|
+
const before = (0, import_node_fs178.fstatSync)(descriptor, { bigint: true });
|
|
121677
122225
|
if (!before.isFile()) {
|
|
121678
122226
|
throw new Error(`${command} bundle must be a regular local file`);
|
|
121679
122227
|
}
|
|
121680
122228
|
if (before.size <= 0n) {
|
|
121681
122229
|
throw new Error(`${command} bundle is empty`);
|
|
121682
122230
|
}
|
|
121683
|
-
const bytes = (0,
|
|
121684
|
-
const after = (0,
|
|
122231
|
+
const bytes = (0, import_node_fs178.readFileSync)(descriptor);
|
|
122232
|
+
const after = (0, import_node_fs178.fstatSync)(descriptor, { bigint: true });
|
|
121685
122233
|
if (before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeNs !== after.mtimeNs || bytes.length !== Number(before.size)) {
|
|
121686
122234
|
throw new Error(`${command} bundle changed while it was being read`);
|
|
121687
122235
|
}
|
|
@@ -121693,7 +122241,7 @@ function readImmutableBundleSource(bundlePath, command) {
|
|
|
121693
122241
|
}
|
|
121694
122242
|
return source;
|
|
121695
122243
|
} finally {
|
|
121696
|
-
(0,
|
|
122244
|
+
(0, import_node_fs178.closeSync)(descriptor);
|
|
121697
122245
|
}
|
|
121698
122246
|
}
|
|
121699
122247
|
async function fetchBundleSource(bundleUrl, command) {
|
|
@@ -121747,15 +122295,15 @@ async function loadBundleSource(bundleInput, command) {
|
|
|
121747
122295
|
return source;
|
|
121748
122296
|
}
|
|
121749
122297
|
function listMetroAssetDest(assetsPath) {
|
|
121750
|
-
const directory2 = (0,
|
|
121751
|
-
if (!(0,
|
|
121752
|
-
const skipNested = (0,
|
|
122298
|
+
const directory2 = (0, import_node_path181.resolve)(assetsPath);
|
|
122299
|
+
if (!(0, import_node_fs178.existsSync)(directory2)) return { directory: directory2, files: [], truncated: false };
|
|
122300
|
+
const skipNested = (0, import_node_fs178.existsSync)((0, import_node_path181.join)(directory2, "package.json"));
|
|
121753
122301
|
const files2 = [];
|
|
121754
122302
|
let truncated = false;
|
|
121755
122303
|
const walk4 = (dir, prefix) => {
|
|
121756
122304
|
let entries2;
|
|
121757
122305
|
try {
|
|
121758
|
-
entries2 = (0,
|
|
122306
|
+
entries2 = (0, import_node_fs178.readdirSync)(dir, { withFileTypes: true });
|
|
121759
122307
|
} catch {
|
|
121760
122308
|
return;
|
|
121761
122309
|
}
|
|
@@ -121767,7 +122315,7 @@ function listMetroAssetDest(assetsPath) {
|
|
|
121767
122315
|
if (entry.isDirectory()) {
|
|
121768
122316
|
if (entry.name === ".git") continue;
|
|
121769
122317
|
if (skipNested && PROJECT_ONLY_DIRECTORIES.has(entry.name)) continue;
|
|
121770
|
-
walk4((0,
|
|
122318
|
+
walk4((0, import_node_path181.join)(dir, entry.name), prefix ? `${prefix}/${entry.name}` : entry.name);
|
|
121771
122319
|
} else if (entry.isFile()) {
|
|
121772
122320
|
files2.push(prefix ? `${prefix}/${entry.name}` : entry.name);
|
|
121773
122321
|
}
|
|
@@ -121777,7 +122325,7 @@ function listMetroAssetDest(assetsPath) {
|
|
|
121777
122325
|
return { directory: directory2, files: files2, truncated };
|
|
121778
122326
|
}
|
|
121779
122327
|
function metroDescriptorHash(scaleBytes) {
|
|
121780
|
-
const hasher = (0,
|
|
122328
|
+
const hasher = (0, import_node_crypto105.createHash)("md5");
|
|
121781
122329
|
for (const bytes of scaleBytes) hasher.update(bytes);
|
|
121782
122330
|
return hasher.digest("hex");
|
|
121783
122331
|
}
|
|
@@ -121802,11 +122350,11 @@ function distinctByContent(directory2, options2) {
|
|
|
121802
122350
|
for (const relative5 of options2) {
|
|
121803
122351
|
let bytes;
|
|
121804
122352
|
try {
|
|
121805
|
-
bytes = (0,
|
|
122353
|
+
bytes = (0, import_node_fs178.readFileSync)((0, import_node_path181.join)(directory2, relative5));
|
|
121806
122354
|
} catch {
|
|
121807
122355
|
continue;
|
|
121808
122356
|
}
|
|
121809
|
-
const digest3 = (0,
|
|
122357
|
+
const digest3 = (0, import_node_crypto105.createHash)("md5").update(bytes).digest("hex");
|
|
121810
122358
|
if (!byContent.has(digest3)) byContent.set(digest3, relative5);
|
|
121811
122359
|
}
|
|
121812
122360
|
return [...byContent.values()];
|
|
@@ -121848,13 +122396,13 @@ function placeMetroDescriptor(listing, descriptor) {
|
|
|
121848
122396
|
let bytes;
|
|
121849
122397
|
try {
|
|
121850
122398
|
bytes = combination.map(
|
|
121851
|
-
(relative5) => (0,
|
|
122399
|
+
(relative5) => (0, import_node_fs178.readFileSync)((0, import_node_path181.join)(listing.directory, relative5))
|
|
121852
122400
|
);
|
|
121853
122401
|
} catch {
|
|
121854
122402
|
continue;
|
|
121855
122403
|
}
|
|
121856
122404
|
const identical = fileHashes2 ? bytes.every((file, index) => {
|
|
121857
|
-
const digest3 = (0,
|
|
122405
|
+
const digest3 = (0, import_node_crypto105.createHash)("md5").update(file).digest("hex");
|
|
121858
122406
|
return descriptor.scales.some(
|
|
121859
122407
|
(scale, declared) => scale === scales[index] && fileHashes2[declared] === digest3
|
|
121860
122408
|
);
|
|
@@ -121876,10 +122424,10 @@ function unverifiedContentKey(dest, fileDigests2) {
|
|
|
121876
122424
|
return JSON.stringify(
|
|
121877
122425
|
dest.placements.map(
|
|
121878
122426
|
(placement) => placement.verified ? null : [...placement.files].map(([scale, relative5]) => {
|
|
121879
|
-
const file = (0,
|
|
122427
|
+
const file = (0, import_node_path181.join)(dest.directory, relative5);
|
|
121880
122428
|
let digest3 = fileDigests2.get(file);
|
|
121881
122429
|
if (digest3 === void 0) {
|
|
121882
|
-
digest3 = (0,
|
|
122430
|
+
digest3 = (0, import_node_crypto105.createHash)("sha256").update((0, import_node_fs178.readFileSync)(file)).digest("hex");
|
|
121883
122431
|
fileDigests2.set(file, digest3);
|
|
121884
122432
|
}
|
|
121885
122433
|
return [scale, digest3];
|
|
@@ -121888,42 +122436,42 @@ function unverifiedContentKey(dest, fileDigests2) {
|
|
|
121888
122436
|
);
|
|
121889
122437
|
}
|
|
121890
122438
|
function findExpoExportRoot(bundleDirectory) {
|
|
121891
|
-
let directory2 = (0,
|
|
122439
|
+
let directory2 = (0, import_node_path181.resolve)(bundleDirectory);
|
|
121892
122440
|
for (let depth = 0; depth < 6; depth++) {
|
|
121893
|
-
const metadata = (0,
|
|
121894
|
-
if ((0,
|
|
122441
|
+
const metadata = (0, import_node_path181.join)(directory2, "metadata.json");
|
|
122442
|
+
if ((0, import_node_fs178.existsSync)(metadata) && (0, import_node_fs178.existsSync)((0, import_node_path181.join)(directory2, "assets"))) {
|
|
121895
122443
|
try {
|
|
121896
|
-
if ((0,
|
|
122444
|
+
if ((0, import_node_fs178.readFileSync)(metadata, "utf8").includes('"fileMetadata"')) {
|
|
121897
122445
|
return directory2;
|
|
121898
122446
|
}
|
|
121899
122447
|
} catch {
|
|
121900
122448
|
}
|
|
121901
122449
|
}
|
|
121902
|
-
const parent = (0,
|
|
122450
|
+
const parent = (0, import_node_path181.dirname)(directory2);
|
|
121903
122451
|
if (parent === directory2) return null;
|
|
121904
122452
|
directory2 = parent;
|
|
121905
122453
|
}
|
|
121906
122454
|
return null;
|
|
121907
122455
|
}
|
|
121908
122456
|
function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory) {
|
|
121909
|
-
const bundleDirectory = (0,
|
|
122457
|
+
const bundleDirectory = (0, import_node_path181.dirname)((0, import_node_path181.resolve)(bundlePath));
|
|
121910
122458
|
const expoRoot = assetsDirectory || isRemoteBundleInput(bundlePath) ? null : findExpoExportRoot(bundleDirectory);
|
|
121911
|
-
const candidates = assetsDirectory ? [(0,
|
|
121912
|
-
...expoRoot ? [(0,
|
|
121913
|
-
(0,
|
|
122459
|
+
const candidates = assetsDirectory ? [(0, import_node_path181.resolve)(assetsDirectory)] : [
|
|
122460
|
+
...expoRoot ? [(0, import_node_path181.join)(expoRoot, "assets")] : [],
|
|
122461
|
+
(0, import_node_path181.join)(bundleDirectory, "assets"),
|
|
121914
122462
|
bundleDirectory,
|
|
121915
|
-
(0,
|
|
122463
|
+
(0, import_node_path181.resolve)(bundleDirectory, "..", "assets")
|
|
121916
122464
|
];
|
|
121917
122465
|
const cwd = process.cwd();
|
|
121918
122466
|
let projectDirectory = null;
|
|
121919
122467
|
for (const start of assetsDirectory ? [] : [bundleDirectory, cwd]) {
|
|
121920
|
-
let directory2 = (0,
|
|
122468
|
+
let directory2 = (0, import_node_path181.resolve)(start);
|
|
121921
122469
|
while (true) {
|
|
121922
122470
|
if (detectProject(directory2)?.hasMetroConfig) {
|
|
121923
122471
|
projectDirectory = directory2;
|
|
121924
122472
|
break;
|
|
121925
122473
|
}
|
|
121926
|
-
const parent = (0,
|
|
122474
|
+
const parent = (0, import_node_path181.dirname)(directory2);
|
|
121927
122475
|
if (parent === directory2) break;
|
|
121928
122476
|
directory2 = parent;
|
|
121929
122477
|
}
|
|
@@ -121931,11 +122479,11 @@ function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory)
|
|
|
121931
122479
|
}
|
|
121932
122480
|
if (projectDirectory) {
|
|
121933
122481
|
candidates.push(
|
|
121934
|
-
(0,
|
|
121935
|
-
(0,
|
|
121936
|
-
(0,
|
|
121937
|
-
(0,
|
|
121938
|
-
(0,
|
|
122482
|
+
(0, import_node_path181.join)(projectDirectory, "assets"),
|
|
122483
|
+
(0, import_node_path181.join)(projectDirectory, "dist"),
|
|
122484
|
+
(0, import_node_path181.join)(projectDirectory, "dist", "assets"),
|
|
122485
|
+
(0, import_node_path181.join)(projectDirectory, "build"),
|
|
122486
|
+
(0, import_node_path181.join)(projectDirectory, "build", "assets")
|
|
121939
122487
|
);
|
|
121940
122488
|
}
|
|
121941
122489
|
const searched = [];
|
|
@@ -121943,7 +122491,7 @@ function searchMetroAssetDest(bundlePath, descriptors, command, assetsDirectory)
|
|
|
121943
122491
|
const stale = [];
|
|
121944
122492
|
let truncated = false;
|
|
121945
122493
|
for (const candidate of candidates) {
|
|
121946
|
-
const directory2 = (0,
|
|
122494
|
+
const directory2 = (0, import_node_path181.resolve)(candidate);
|
|
121947
122495
|
if (searched.includes(directory2)) continue;
|
|
121948
122496
|
searched.push(directory2);
|
|
121949
122497
|
const listing = listMetroAssetDest(directory2);
|
|
@@ -122024,20 +122572,20 @@ async function produceCloudArtifact(bundlePath, maxBytes = MAX_RNX_CLOUD_BUNDLE_
|
|
|
122024
122572
|
}
|
|
122025
122573
|
function bundleAppProject(bundlePath) {
|
|
122026
122574
|
if (isRemoteBundleInput(bundlePath)) return null;
|
|
122027
|
-
for (let dir = (0,
|
|
122028
|
-
const manifest = (0,
|
|
122029
|
-
if ((0,
|
|
122030
|
-
const json = JSON.parse((0,
|
|
122575
|
+
for (let dir = (0, import_node_path181.dirname)((0, import_node_path181.resolve)(bundlePath)); ; dir = (0, import_node_path181.dirname)(dir)) {
|
|
122576
|
+
const manifest = (0, import_node_path181.join)(dir, "package.json");
|
|
122577
|
+
if ((0, import_node_fs178.existsSync)(manifest)) {
|
|
122578
|
+
const json = JSON.parse((0, import_node_fs178.readFileSync)(manifest, "utf8"));
|
|
122031
122579
|
if (isRecord(json) && [json.dependencies, json.devDependencies].some(
|
|
122032
122580
|
(dependencies) => isRecord(dependencies) && "react-native" in dependencies
|
|
122033
122581
|
))
|
|
122034
122582
|
return dir;
|
|
122035
122583
|
}
|
|
122036
|
-
if ((0,
|
|
122584
|
+
if ((0, import_node_path181.dirname)(dir) === dir) return null;
|
|
122037
122585
|
}
|
|
122038
122586
|
}
|
|
122039
122587
|
async function embedBundleAssets(bundlePath, command, assetPolicy, assetsDirectory, assetServer, nativeProjectDir) {
|
|
122040
|
-
const project2 = nativeProjectDir ? (0,
|
|
122588
|
+
const project2 = nativeProjectDir ? (0, import_node_path181.resolve)(nativeProjectDir) : bundleAppProject(bundlePath);
|
|
122041
122589
|
const loaded4 = await loadBundleSource(bundlePath, command);
|
|
122042
122590
|
const source = project2 && !readPackageVersionsFooter(loaded4)?.["react-native"] ? insertPackageVersionsFooter(
|
|
122043
122591
|
loaded4,
|
|
@@ -122078,7 +122626,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy, assetsDirecto
|
|
|
122078
122626
|
);
|
|
122079
122627
|
}
|
|
122080
122628
|
const relative5 = placement?.files.get(variant2.scale);
|
|
122081
|
-
if (relative5 && dest) return (0,
|
|
122629
|
+
if (relative5 && dest) return (0, import_node_fs178.readFileSync)((0, import_node_path181.join)(dest.directory, relative5));
|
|
122082
122630
|
if (assetServer) {
|
|
122083
122631
|
const filename2 = metroAssetScaleFilename(
|
|
122084
122632
|
variant2.descriptor.name,
|
|
@@ -122126,7 +122674,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy, assetsDirecto
|
|
|
122126
122674
|
);
|
|
122127
122675
|
const classic = metroIosAssetDestRelatives(variant2.descriptor.httpServerLocation, filename)[0] ?? filename;
|
|
122128
122676
|
throw new Error(
|
|
122129
|
-
`${command} could not read ${(0,
|
|
122677
|
+
`${command} could not read ${(0, import_node_path181.join)(dest?.directory ?? ".", classic)} for ${variant2.descriptor.name}.${variant2.descriptor.type} at scale ${variant2.scale}, and has no stand-in for a .${variant2.descriptor.type} asset. Rebuild with \`react-native bundle --assets-dest\`.`
|
|
122130
122678
|
);
|
|
122131
122679
|
});
|
|
122132
122680
|
return {
|
|
@@ -122168,7 +122716,7 @@ async function produceArtifact(prepared, maxBytes, command) {
|
|
|
122168
122716
|
}
|
|
122169
122717
|
return {
|
|
122170
122718
|
bytes,
|
|
122171
|
-
sha256: (0,
|
|
122719
|
+
sha256: (0, import_node_crypto105.createHash)("sha256").update(bytes).digest("hex"),
|
|
122172
122720
|
receipt: artifact.receipt,
|
|
122173
122721
|
assetsDirectory: prepared.dest?.directory ?? null,
|
|
122174
122722
|
warnings
|
|
@@ -122273,13 +122821,13 @@ async function createCloudBox(options2) {
|
|
|
122273
122821
|
warnings: artifact.warnings
|
|
122274
122822
|
};
|
|
122275
122823
|
}
|
|
122276
|
-
var
|
|
122824
|
+
var import_node_crypto105, import_node_fs178, import_node_path181, import_node_vm, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, PREVIEW_COMMAND, NanoDevelopmentOnlyError, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS;
|
|
122277
122825
|
var init_cloud_client = __esm({
|
|
122278
122826
|
"cli/cloud-client.ts"() {
|
|
122279
122827
|
"use strict";
|
|
122280
|
-
|
|
122281
|
-
|
|
122282
|
-
|
|
122828
|
+
import_node_crypto105 = require("node:crypto");
|
|
122829
|
+
import_node_fs178 = require("node:fs");
|
|
122830
|
+
import_node_path181 = require("node:path");
|
|
122283
122831
|
import_node_vm = require("node:vm");
|
|
122284
122832
|
init_package_versions();
|
|
122285
122833
|
init_metroAssetArtifact();
|