peachsim 0.1.2438 → 0.1.2439
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/README.md +30 -98
- package/cli/app-catalog.ts +4 -73
- package/cli/catalog/content.ts +1 -1
- package/cli/cloud-box-artifact.ts +26 -39
- package/cli/cloud-client.ts +69 -117
- package/cli/cloud-session.ts +2 -9
- package/cli/commands/box.ts +6 -6
- package/cli/commands/control.ts +4 -11
- package/cli/commands/flow.ts +5 -9
- package/cli/commands/kotlin.ts +2 -1
- package/cli/commands/platform.ts +21 -39
- package/cli/commands/record-three.ts +1 -1
- package/cli/commands/shell-url.ts +29 -23
- package/cli/dev-build-freshness.ts +4 -3
- package/cli/native-input.ts +2 -2
- package/cli/outbound-endpoints.ts +20 -45
- package/cli/remote-project-bundle.ts +8 -14
- package/cli/remote-simulators.ts +1 -1
- package/cli/send-to-box.ts +2 -1
- package/detox/jest-preset.cjs +1 -1
- package/detox/jest-transform.cjs +40 -2
- package/dist-lib/agent-daemon-client.cjs +34 -24
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +19 -17
- package/dist-lib/auth/shared-session.cjs +18 -16
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +20 -583
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +17 -99
- package/dist-lib/bundle-channel.cjs +8718 -5552
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +13 -363
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +34 -155
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +26 -155
- package/dist-lib/config.cjs +1 -4
- package/dist-lib/config.mjs +11 -30
- package/dist-lib/detox/index.cjs +2554 -230
- package/dist-lib/detox/jest-preset.cjs +1 -1
- package/dist-lib/detox/jest-transform.cjs +40 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/acorn-FGE4PYDJ.mjs +50 -0
- package/dist-lib/esm-chunks/chunk-2EUHEBIJ.mjs +664 -0
- package/dist-lib/esm-chunks/chunk-2NPABFPN.mjs +5719 -0
- package/dist-lib/esm-chunks/chunk-4ZFNH7TU.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-5T4XBUJP.mjs +1353 -0
- package/dist-lib/esm-chunks/chunk-6VY6HTJC.mjs +18951 -0
- package/dist-lib/esm-chunks/chunk-7HANEMO4.mjs +188 -0
- package/dist-lib/esm-chunks/chunk-C3WBGYP6.mjs +186 -0
- package/dist-lib/esm-chunks/chunk-CVGDRROP.mjs +57 -0
- package/dist-lib/esm-chunks/chunk-DADGQELM.mjs +375 -0
- package/dist-lib/esm-chunks/chunk-DEGYKHN7.mjs +12 -0
- package/dist-lib/esm-chunks/chunk-HIDNO3RP.mjs +10992 -0
- package/dist-lib/esm-chunks/chunk-HSADZOVN.mjs +30 -0
- package/dist-lib/esm-chunks/chunk-IWJUYJQO.mjs +42 -0
- package/dist-lib/esm-chunks/chunk-JCKI3VZ6.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-KSQ5KM5Y.mjs +17 -0
- package/dist-lib/esm-chunks/chunk-KVTIDLBK.mjs +598 -0
- package/dist-lib/esm-chunks/chunk-MIQSRBVU.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-YB27R6JG.mjs +115 -0
- package/dist-lib/esm-chunks/metro-layout-parser-MVUAXRUJ.mjs +58 -0
- package/dist-lib/expo-swift-bundle.cjs +7856 -4707
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +16 -165
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +15658 -11404
- package/dist-lib/host/fetch-proxy-handler.cjs +3927 -342
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -1
- package/dist-lib/host/replacement-module-handler.cjs +4 -4
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +9145 -32150
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +2 -2
- package/dist-lib/kotlin-host.cjs +260 -253
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +5 -13
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +5 -6
- package/dist-lib/metro-production-bundle.cjs +22 -3
- package/dist-lib/metro-production-bundle.mjs +26 -92
- package/dist-lib/native-app-identity-project.cjs +663 -451
- package/dist-lib/native-app-identity-project.mjs +509 -2318
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +27 -1340
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +5 -18
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -1
- package/dist-lib/plist.cjs +2 -2
- package/dist-lib/plist.mjs +5 -7
- package/dist-lib/profiles.cjs +2 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +246 -187
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +1059 -1238
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -1
- package/dist-lib/reap-browser.cjs +18 -7
- package/dist-lib/scripts/dev-server-scanner.cjs +6 -230
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +22 -78
- package/dist-lib/skills.cjs +21657 -17374
- package/dist-lib/swift-compile.cjs +1343 -1318
- package/dist-lib/swift-compile.mjs +68 -19013
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +35 -630
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +9 -24
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +18061 -0
- package/dist-lib/vendor/acorn.cjs +5699 -0
- package/dist-lib/vendor/bplist-parser.cjs +1589 -0
- package/dist-lib/vendor/ignore.cjs +455 -0
- package/dist-lib/vendor/magic-string.cjs +1693 -0
- package/dist-lib/vendor/plist.cjs +10978 -0
- package/dist-lib/vendor/smol-toml.cjs +768 -0
- package/dist-lib/vendor/stream-json.cjs +1997 -0
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +23593 -0
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +15750 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +11316 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +482 -0
- package/dist-lib/vendor/sucrase.cjs +23593 -0
- package/dist-lib/vendor/terser.cjs +36874 -0
- package/dist-lib/vendor/valibot.cjs +6253 -0
- package/dist-lib/vendor/zod.cjs +23262 -0
- package/dist-lib/worklet-executable.cjs +3 -3
- package/dist-lib/worklet-executable.mjs +11 -16
- package/dist-types/packages/peach-engine/src/config.d.ts +1 -1
- package/kotlin/fork/NOTICE +3 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/kotlin/toolchain.json +6 -6
- package/package.json +17 -121
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +13 -223
- package/src/android-autolinking.ts +2 -2
- package/src/bundle-channel.mjs +3 -15
- package/src/cloud-contract.ts +3 -4
- package/src/config.ts +0 -5
- package/src/host/bridge-host.ts +19 -1
- package/src/host/server-scan-handler.ts +1 -9
- package/src/index.ts +0 -2
- package/src/kotlin-host.ts +1 -2
- package/src/kotlinDiscoveryContract.ts +1 -0
- package/src/metro-production-bundle.ts +28 -6
- package/src/native-seam-manifest.ts +0 -13
- package/src/one-native-app-catalog.ts +8 -27
- package/src/one-native-app-config.ts +95 -0
- package/src/one-native-source.ts +250 -0
- package/src/one-widget-metadata.ts +45 -126
- package/src/oneWidgetContract.ts +80 -117
- package/src/serverDiscoveryContract.ts +0 -1
- package/src/simulator-route.ts +8 -0
- package/src/vite-plugin.ts +2 -2
- package/src/xcode-project.ts +1 -1
- package/dist-lib/metro.cjs +0 -27984
- package/dist-lib/vite-swift.cjs +0 -43376
- package/dist-lib/vite.cjs +0 -21456
- package/src/androidAutolinkingContract.ts +0 -48
- package/src/androidRootModuleContract.ts +0 -39
- package/src/dev-server-open.ts +0 -92
- package/src/metro-plugin.ts +0 -578
- package/src/one-widget-discovery.ts +0 -23
- package/src/swift-vite-lifetime.ts +0 -42
- package/src/vite-plugin-one.ts +0 -746
- package/src/vite-plugin-swift.ts +0 -225
- package/src/vite.d.ts +0 -10
package/dist-lib/kotlin-host.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2439 | (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;
|
|
@@ -44,7 +44,7 @@ var init_is_record = __esm({
|
|
|
44
44
|
|
|
45
45
|
// src/process-table.ts
|
|
46
46
|
function linuxClockTicks() {
|
|
47
|
-
const auxv = (0,
|
|
47
|
+
const auxv = (0, import_node_fs2.readFileSync)("/proc/self/auxv");
|
|
48
48
|
const word = (offset) => (0, import_node_os.endianness)() === "LE" ? auxv.readBigUInt64LE(offset) : auxv.readBigUInt64BE(offset);
|
|
49
49
|
for (let offset = 0; offset + 16 <= auxv.length; offset += 16) {
|
|
50
50
|
if (word(offset) !== 17n) continue;
|
|
@@ -58,19 +58,19 @@ function linuxClockTicks() {
|
|
|
58
58
|
function readProcessTable(timeoutMs = 1e4, pid) {
|
|
59
59
|
if (process.platform === "linux") {
|
|
60
60
|
clockTicks ??= linuxClockTicks();
|
|
61
|
-
const boot = /^btime (\d+)$/m.exec((0,
|
|
61
|
+
const boot = /^btime (\d+)$/m.exec((0, import_node_fs2.readFileSync)("/proc/stat", "utf8"));
|
|
62
62
|
if (!boot) throw new Error("unreadable process boot time");
|
|
63
63
|
const bootMs = Number(boot[1]) * 1e3;
|
|
64
64
|
const deadline = Date.now() + timeoutMs;
|
|
65
65
|
const rows2 = [];
|
|
66
|
-
const names = pid === void 0 ? (0,
|
|
66
|
+
const names = pid === void 0 ? (0, import_node_fs2.readdirSync)("/proc") : [String(pid)];
|
|
67
67
|
for (const name of names) {
|
|
68
68
|
if (!/^\d+$/.test(name)) continue;
|
|
69
69
|
if (Date.now() >= deadline)
|
|
70
70
|
throw new Error("process inspection exceeded its deadline");
|
|
71
71
|
let stat;
|
|
72
72
|
try {
|
|
73
|
-
stat = (0,
|
|
73
|
+
stat = (0, import_node_fs2.readFileSync)(`/proc/${name}/stat`, "utf8");
|
|
74
74
|
} catch (error) {
|
|
75
75
|
if (error instanceof Error && "code" in error && error.code === "ENOENT") continue;
|
|
76
76
|
throw error;
|
|
@@ -125,12 +125,12 @@ function readProcessTable(timeoutMs = 1e4, pid) {
|
|
|
125
125
|
});
|
|
126
126
|
return pid === void 0 ? rows : rows.filter((row) => row.pid === pid);
|
|
127
127
|
}
|
|
128
|
-
var import_node_child_process,
|
|
128
|
+
var import_node_child_process, import_node_fs2, import_node_os, clockTicks;
|
|
129
129
|
var init_process_table = __esm({
|
|
130
130
|
"src/process-table.ts"() {
|
|
131
131
|
"use strict";
|
|
132
132
|
import_node_child_process = require("node:child_process");
|
|
133
|
-
|
|
133
|
+
import_node_fs2 = require("node:fs");
|
|
134
134
|
import_node_os = require("node:os");
|
|
135
135
|
}
|
|
136
136
|
});
|
|
@@ -147,11 +147,11 @@ function listProcessChildren(parents, timeoutMs = 1e4) {
|
|
|
147
147
|
for (const parent of parents) {
|
|
148
148
|
try {
|
|
149
149
|
const tasks = `/proc/${parent}/task`;
|
|
150
|
-
for (const thread of (0,
|
|
150
|
+
for (const thread of (0, import_node_fs3.readdirSync)(tasks)) {
|
|
151
151
|
if (Date.now() >= deadline)
|
|
152
152
|
throw new Error("process descendant inspection exceeded its deadline");
|
|
153
153
|
try {
|
|
154
|
-
lists.push((0,
|
|
154
|
+
lists.push((0, import_node_fs3.readFileSync)(`${tasks}/${thread}/children`, "utf8"));
|
|
155
155
|
} catch (error) {
|
|
156
156
|
if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
|
|
157
157
|
throw error;
|
|
@@ -193,9 +193,9 @@ function signalProcessGroup(child, signal) {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
async function protectProcessFreeze(rootPid) {
|
|
196
|
-
const directory = (0,
|
|
197
|
-
const journal = (0,
|
|
198
|
-
(0,
|
|
196
|
+
const directory = (0, import_node_fs3.mkdtempSync)((0, import_node_path2.join)((0, import_node_os2.tmpdir)(), "peach-process-freeze-"));
|
|
197
|
+
const journal = (0, import_node_path2.join)(directory, "targets");
|
|
198
|
+
(0, import_node_fs3.writeFileSync)(journal, `group ${rootPid}
|
|
199
199
|
pid ${rootPid}
|
|
200
200
|
`, { mode: 384 });
|
|
201
201
|
const guard = (0, import_node_child_process2.spawn)(
|
|
@@ -246,7 +246,7 @@ pid ${rootPid}
|
|
|
246
246
|
if (!(control instanceof import_node_stream.Duplex) || !output) {
|
|
247
247
|
guard.kill();
|
|
248
248
|
await closed;
|
|
249
|
-
(0,
|
|
249
|
+
(0, import_node_fs3.rmSync)(directory, { recursive: true, force: true });
|
|
250
250
|
throw new Error("process freeze guard control pipe is unavailable");
|
|
251
251
|
}
|
|
252
252
|
control.on("error", () => {
|
|
@@ -279,20 +279,20 @@ pid ${rootPid}
|
|
|
279
279
|
} catch (error) {
|
|
280
280
|
control.destroy();
|
|
281
281
|
await closed;
|
|
282
|
-
(0,
|
|
282
|
+
(0, import_node_fs3.rmSync)(directory, { recursive: true, force: true });
|
|
283
283
|
throw error;
|
|
284
284
|
}
|
|
285
285
|
return {
|
|
286
286
|
record(pid) {
|
|
287
287
|
if (guardClosed || control.destroyed)
|
|
288
288
|
throw new Error("process freeze guard exited during capture");
|
|
289
|
-
(0,
|
|
289
|
+
(0, import_node_fs3.appendFileSync)(journal, `pid ${pid}
|
|
290
290
|
`);
|
|
291
291
|
},
|
|
292
292
|
async release(disarm) {
|
|
293
293
|
control.end(disarm ? "disarm\n" : void 0);
|
|
294
294
|
await closed;
|
|
295
|
-
(0,
|
|
295
|
+
(0, import_node_fs3.rmSync)(directory, { recursive: true, force: true });
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
298
|
}
|
|
@@ -442,14 +442,14 @@ async function terminateProcessGroup(child, signal = "SIGTERM", gracefulTimeoutM
|
|
|
442
442
|
}
|
|
443
443
|
if (inspectionError) throw inspectionError;
|
|
444
444
|
}
|
|
445
|
-
var import_node_child_process2,
|
|
445
|
+
var import_node_child_process2, import_node_fs3, import_node_os2, import_node_path2, import_node_stream, import_promises, GRACEFUL_TIMEOUT_MS, FORCED_EXIT_TIMEOUT_MS, INSPECTION_TIMEOUT_MS, FREEZE_GUARD_NAME;
|
|
446
446
|
var init_process_group = __esm({
|
|
447
447
|
"src/process-group.ts"() {
|
|
448
448
|
"use strict";
|
|
449
449
|
import_node_child_process2 = require("node:child_process");
|
|
450
|
-
|
|
450
|
+
import_node_fs3 = require("node:fs");
|
|
451
451
|
import_node_os2 = require("node:os");
|
|
452
|
-
|
|
452
|
+
import_node_path2 = require("node:path");
|
|
453
453
|
import_node_stream = require("node:stream");
|
|
454
454
|
import_promises = require("node:timers/promises");
|
|
455
455
|
init_process_table();
|
|
@@ -468,9 +468,12 @@ var init_version = __esm({
|
|
|
468
468
|
});
|
|
469
469
|
|
|
470
470
|
// ../contrast-runtime-delivery/src/product.ts
|
|
471
|
+
var import_node_fs4, import_node_path3;
|
|
471
472
|
var init_product = __esm({
|
|
472
473
|
"../contrast-runtime-delivery/src/product.ts"() {
|
|
473
474
|
"use strict";
|
|
475
|
+
import_node_fs4 = __toESM(require("node:fs"), 1);
|
|
476
|
+
import_node_path3 = __toESM(require("node:path"), 1);
|
|
474
477
|
init_version();
|
|
475
478
|
}
|
|
476
479
|
});
|
|
@@ -485,33 +488,33 @@ var init_packs = __esm({
|
|
|
485
488
|
// ../contrast-runtime-delivery/src/index.ts
|
|
486
489
|
async function installVerifiedTarball(tarball) {
|
|
487
490
|
const { destDir, installedMarker, signal } = tarball;
|
|
488
|
-
|
|
489
|
-
const presentAtStart =
|
|
491
|
+
import_node_fs5.default.mkdirSync(import_node_path4.default.dirname(destDir), { recursive: true });
|
|
492
|
+
const presentAtStart = import_node_fs5.default.existsSync(import_node_path4.default.join(destDir, installedMarker));
|
|
490
493
|
const lock = `${destDir}.lock`;
|
|
491
494
|
for (; ; ) {
|
|
492
495
|
signal?.throwIfAborted();
|
|
493
496
|
try {
|
|
494
|
-
|
|
497
|
+
import_node_fs5.default.writeFileSync(lock, String(process.pid), { flag: "wx" });
|
|
495
498
|
break;
|
|
496
499
|
} catch (err) {
|
|
497
500
|
if (!isErrnoCode(err, "EEXIST")) throw err;
|
|
498
|
-
if (lockOwnerGone(lock))
|
|
501
|
+
if (lockOwnerGone(lock)) import_node_fs5.default.rmSync(lock, { force: true });
|
|
499
502
|
else await new Promise((resolve) => setTimeout(resolve, 250));
|
|
500
503
|
}
|
|
501
504
|
}
|
|
502
505
|
try {
|
|
503
|
-
if (!presentAtStart &&
|
|
506
|
+
if (!presentAtStart && import_node_fs5.default.existsSync(import_node_path4.default.join(destDir, installedMarker))) {
|
|
504
507
|
await tarball.verify?.(destDir);
|
|
505
508
|
return;
|
|
506
509
|
}
|
|
507
510
|
await installVerifiedTarballLocked(tarball, presentAtStart);
|
|
508
511
|
} finally {
|
|
509
|
-
|
|
512
|
+
import_node_fs5.default.rmSync(lock, { force: true });
|
|
510
513
|
}
|
|
511
514
|
}
|
|
512
515
|
function lockOwnerGone(lock) {
|
|
513
516
|
try {
|
|
514
|
-
process.kill(Number(
|
|
517
|
+
process.kill(Number(import_node_fs5.default.readFileSync(lock, "utf8")), 0);
|
|
515
518
|
return false;
|
|
516
519
|
} catch (err) {
|
|
517
520
|
return !isErrnoCode(err, "EPERM", "ENOENT");
|
|
@@ -520,10 +523,10 @@ function lockOwnerGone(lock) {
|
|
|
520
523
|
async function installVerifiedTarballLocked(tarball, presentAtStart) {
|
|
521
524
|
const { url, digest, destDir, installedMarker, label, signal } = tarball;
|
|
522
525
|
signal?.throwIfAborted();
|
|
523
|
-
const downloadDir =
|
|
524
|
-
const archivePath =
|
|
525
|
-
const tmpDir =
|
|
526
|
-
|
|
526
|
+
const downloadDir = import_node_fs5.default.mkdtempSync(import_node_path4.default.join(import_node_os3.default.tmpdir(), "runtime-delivery-download-"));
|
|
527
|
+
const archivePath = import_node_path4.default.join(downloadDir, "archive");
|
|
528
|
+
const tmpDir = import_node_fs5.default.mkdtempSync(
|
|
529
|
+
import_node_path4.default.join(import_node_path4.default.dirname(destDir), `.installing-${import_node_path4.default.basename(destDir)}-`)
|
|
527
530
|
);
|
|
528
531
|
try {
|
|
529
532
|
for (let attempt = 1; ; attempt++) {
|
|
@@ -552,39 +555,39 @@ async function installVerifiedTarballLocked(tarball, presentAtStart) {
|
|
|
552
555
|
signal
|
|
553
556
|
);
|
|
554
557
|
signal?.throwIfAborted();
|
|
555
|
-
if (!
|
|
558
|
+
if (!import_node_fs5.default.existsSync(import_node_path4.default.join(tmpDir, installedMarker))) {
|
|
556
559
|
throw new Error(`extracted tarball for ${label} is missing ${installedMarker}`);
|
|
557
560
|
}
|
|
558
561
|
await tarball.verify?.(tmpDir);
|
|
559
562
|
signal?.throwIfAborted();
|
|
560
563
|
try {
|
|
561
|
-
|
|
564
|
+
import_node_fs5.default.renameSync(tmpDir, destDir);
|
|
562
565
|
} catch (err) {
|
|
563
566
|
if (!isErrnoCode(err, "ENOTEMPTY", "EEXIST")) throw err;
|
|
564
|
-
if (!presentAtStart &&
|
|
567
|
+
if (!presentAtStart && import_node_fs5.default.existsSync(import_node_path4.default.join(destDir, installedMarker))) {
|
|
565
568
|
await tarball.verify?.(destDir);
|
|
566
569
|
return;
|
|
567
570
|
}
|
|
568
571
|
const aside = `${tmpDir}-replaced`;
|
|
569
572
|
try {
|
|
570
|
-
|
|
573
|
+
import_node_fs5.default.renameSync(destDir, aside);
|
|
571
574
|
} catch (moveErr) {
|
|
572
575
|
if (!isErrnoCode(moveErr, "ENOENT")) throw moveErr;
|
|
573
576
|
}
|
|
574
577
|
try {
|
|
575
|
-
|
|
578
|
+
import_node_fs5.default.renameSync(tmpDir, destDir);
|
|
576
579
|
} catch (landErr) {
|
|
577
|
-
if (!isErrnoCode(landErr, "ENOTEMPTY", "EEXIST") || !
|
|
580
|
+
if (!isErrnoCode(landErr, "ENOTEMPTY", "EEXIST") || !import_node_fs5.default.existsSync(import_node_path4.default.join(destDir, installedMarker))) {
|
|
578
581
|
throw landErr;
|
|
579
582
|
}
|
|
580
583
|
await tarball.verify?.(destDir);
|
|
581
584
|
} finally {
|
|
582
|
-
|
|
585
|
+
import_node_fs5.default.rmSync(aside, { recursive: true, force: true });
|
|
583
586
|
}
|
|
584
587
|
}
|
|
585
588
|
} finally {
|
|
586
|
-
|
|
587
|
-
|
|
589
|
+
import_node_fs5.default.rmSync(tmpDir, { recursive: true, force: true });
|
|
590
|
+
import_node_fs5.default.rmSync(downloadDir, { recursive: true, force: true });
|
|
588
591
|
}
|
|
589
592
|
}
|
|
590
593
|
function isErrnoCode(err, ...codes) {
|
|
@@ -608,7 +611,7 @@ async function waitRetryDelay(ms, signal) {
|
|
|
608
611
|
});
|
|
609
612
|
}
|
|
610
613
|
async function downloadToFile(url, destPath, signal) {
|
|
611
|
-
|
|
614
|
+
import_node_fs5.default.mkdirSync(import_node_path4.default.dirname(destPath), { recursive: true });
|
|
612
615
|
const tmp = `${destPath}.partial`;
|
|
613
616
|
for (let attempt = 1; attempt <= 4; attempt++) {
|
|
614
617
|
signal?.throwIfAborted();
|
|
@@ -621,7 +624,7 @@ async function downloadToFile(url, destPath, signal) {
|
|
|
621
624
|
throw new DownloadHttpError(res.status, res.statusText, url);
|
|
622
625
|
}
|
|
623
626
|
reader = res.body.getReader();
|
|
624
|
-
handle = await
|
|
627
|
+
handle = await import_node_fs5.default.promises.open(tmp, "w");
|
|
625
628
|
let written = 0;
|
|
626
629
|
for (; ; ) {
|
|
627
630
|
signal?.throwIfAborted();
|
|
@@ -648,7 +651,7 @@ async function downloadToFile(url, destPath, signal) {
|
|
|
648
651
|
}
|
|
649
652
|
}
|
|
650
653
|
signal?.throwIfAborted();
|
|
651
|
-
|
|
654
|
+
import_node_fs5.default.renameSync(tmp, destPath);
|
|
652
655
|
completed = true;
|
|
653
656
|
return;
|
|
654
657
|
} catch (err) {
|
|
@@ -657,7 +660,7 @@ async function downloadToFile(url, destPath, signal) {
|
|
|
657
660
|
if (reader && !completed) await reader.cancel().catch(() => {
|
|
658
661
|
});
|
|
659
662
|
try {
|
|
660
|
-
|
|
663
|
+
import_node_fs5.default.unlinkSync(tmp);
|
|
661
664
|
} catch {
|
|
662
665
|
}
|
|
663
666
|
const nonRetryable = err instanceof DownloadHttpError && !err.retryable;
|
|
@@ -668,7 +671,7 @@ async function downloadToFile(url, destPath, signal) {
|
|
|
668
671
|
}
|
|
669
672
|
async function digestFile(filePath, algorithm, encoding, signal) {
|
|
670
673
|
const hash = import_node_crypto.default.createHash(algorithm);
|
|
671
|
-
await (0, import_promises2.pipeline)(
|
|
674
|
+
await (0, import_promises2.pipeline)(import_node_fs5.default.createReadStream(filePath), hash, { signal });
|
|
672
675
|
return hash.digest(encoding);
|
|
673
676
|
}
|
|
674
677
|
function extractZip(zipPath, destDir, signal) {
|
|
@@ -683,15 +686,15 @@ async function extractTarball(tarPath, zstd, destDir, stripComponents, signal) {
|
|
|
683
686
|
});
|
|
684
687
|
await runExtractor("tar", ["--ignore-zeros", ...args], signal, {
|
|
685
688
|
cwd: destDir,
|
|
686
|
-
stdin: (stdin) => (0, import_promises2.pipeline)(
|
|
689
|
+
stdin: (stdin) => (0, import_promises2.pipeline)(import_node_fs5.default.createReadStream(tarPath), decoder, stdin, { signal })
|
|
687
690
|
});
|
|
688
691
|
return;
|
|
689
692
|
}
|
|
690
|
-
const archive =
|
|
693
|
+
const archive = import_node_fs5.default.openSync(tarPath, "r");
|
|
691
694
|
try {
|
|
692
695
|
await runExtractor("tar", args, signal, { cwd: destDir, stdin: archive });
|
|
693
696
|
} finally {
|
|
694
|
-
|
|
697
|
+
import_node_fs5.default.closeSync(archive);
|
|
695
698
|
}
|
|
696
699
|
}
|
|
697
700
|
async function runExtractor(command, args, signal, input) {
|
|
@@ -741,15 +744,15 @@ async function runExtractor(command, args, signal, input) {
|
|
|
741
744
|
await stopping;
|
|
742
745
|
}
|
|
743
746
|
}
|
|
744
|
-
var import_node_child_process3, import_node_crypto,
|
|
747
|
+
var import_node_child_process3, import_node_crypto, import_node_fs5, import_node_os3, import_node_path4, import_promises2, import_node_zlib, DownloadHttpError;
|
|
745
748
|
var init_src = __esm({
|
|
746
749
|
"../contrast-runtime-delivery/src/index.ts"() {
|
|
747
750
|
"use strict";
|
|
748
751
|
import_node_child_process3 = require("node:child_process");
|
|
749
752
|
import_node_crypto = __toESM(require("node:crypto"), 1);
|
|
750
|
-
|
|
753
|
+
import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
751
754
|
import_node_os3 = __toESM(require("node:os"), 1);
|
|
752
|
-
|
|
755
|
+
import_node_path4 = __toESM(require("node:path"), 1);
|
|
753
756
|
import_promises2 = require("node:stream/promises");
|
|
754
757
|
import_node_zlib = __toESM(require("node:zlib"), 1);
|
|
755
758
|
init_process_group();
|
|
@@ -768,18 +771,20 @@ var init_src = __esm({
|
|
|
768
771
|
|
|
769
772
|
// src/home-paths.ts
|
|
770
773
|
function ambientHomeDir() {
|
|
771
|
-
return
|
|
774
|
+
return import_node_path5.default.join((0, import_node_os4.homedir)(), ".peach");
|
|
772
775
|
}
|
|
773
776
|
function rnxHomeDir() {
|
|
774
777
|
const override = process.env[PEACH_HOME_ENV];
|
|
775
|
-
return override && override.length > 0 ?
|
|
778
|
+
return override && override.length > 0 ? import_node_path5.default.resolve(override) : ambientHomeDir();
|
|
776
779
|
}
|
|
777
|
-
var import_node_os4,
|
|
780
|
+
var import_node_crypto2, import_node_fs6, import_node_os4, import_node_path5, PEACH_HOME_ENV, DAEMON_LOCKFILE_MAX_BYTES;
|
|
778
781
|
var init_home_paths = __esm({
|
|
779
782
|
"src/home-paths.ts"() {
|
|
780
783
|
"use strict";
|
|
784
|
+
import_node_crypto2 = require("node:crypto");
|
|
785
|
+
import_node_fs6 = __toESM(require("node:fs"), 1);
|
|
781
786
|
import_node_os4 = require("node:os");
|
|
782
|
-
|
|
787
|
+
import_node_path5 = __toESM(require("node:path"), 1);
|
|
783
788
|
PEACH_HOME_ENV = "PEACH_HOME";
|
|
784
789
|
DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
|
|
785
790
|
}
|
|
@@ -787,16 +792,16 @@ var init_home_paths = __esm({
|
|
|
787
792
|
|
|
788
793
|
// src/kotlin-toolchain.ts
|
|
789
794
|
async function runKotlinTool(toolchain, sdkRoot, tool, args, maxBuffer = 16 * 1024 * 1024) {
|
|
790
|
-
const lib =
|
|
795
|
+
const lib = import_node_path6.default.resolve(import_node_path6.default.dirname(toolchain.kotlinc), "../lib");
|
|
791
796
|
const { stdout } = await run(
|
|
792
|
-
|
|
797
|
+
import_node_path6.default.join(toolchain.javaHome, "bin", "java"),
|
|
793
798
|
[
|
|
794
799
|
"-cp",
|
|
795
800
|
[
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
].join(
|
|
801
|
+
import_node_path6.default.join(sdkRoot, "tools.jar"),
|
|
802
|
+
import_node_path6.default.join(lib, "kotlin-compiler.jar"),
|
|
803
|
+
import_node_path6.default.join(lib, "kotlin-stdlib.jar")
|
|
804
|
+
].join(import_node_path6.default.delimiter),
|
|
800
805
|
tool,
|
|
801
806
|
...args
|
|
802
807
|
],
|
|
@@ -806,7 +811,7 @@ async function runKotlinTool(toolchain, sdkRoot, tool, args, maxBuffer = 16 * 10
|
|
|
806
811
|
}
|
|
807
812
|
function readToolchain(moduleRoot) {
|
|
808
813
|
const parsed = JSON.parse(
|
|
809
|
-
|
|
814
|
+
import_node_fs7.default.readFileSync(import_node_path6.default.join(moduleRoot, "toolchain.json"), "utf8")
|
|
810
815
|
);
|
|
811
816
|
const download = (value) => {
|
|
812
817
|
if (!isRecord(value) || typeof value.url !== "string" || typeof value.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(value.sha256))
|
|
@@ -851,37 +856,37 @@ function readToolchain(moduleRoot) {
|
|
|
851
856
|
};
|
|
852
857
|
}
|
|
853
858
|
function kotlinHome() {
|
|
854
|
-
return
|
|
859
|
+
return import_node_path6.default.join(rnxHomeDir(), "kotlin");
|
|
855
860
|
}
|
|
856
861
|
async function fetchVerified(download, target) {
|
|
857
|
-
if (
|
|
858
|
-
if ((0,
|
|
862
|
+
if (import_node_fs7.default.existsSync(target)) {
|
|
863
|
+
if ((0, import_node_crypto3.createHash)("sha256").update(import_node_fs7.default.readFileSync(target)).digest("hex") !== download.sha256)
|
|
859
864
|
throw new Error(
|
|
860
|
-
`cached Kotlin download differs from its pin: ${
|
|
865
|
+
`cached Kotlin download differs from its pin: ${import_node_path6.default.basename(target)}`
|
|
861
866
|
);
|
|
862
867
|
return;
|
|
863
868
|
}
|
|
864
869
|
const response = await fetch(download.url);
|
|
865
870
|
if (!response.ok) throw new Error(`${download.url} answered ${response.status}`);
|
|
866
871
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
867
|
-
const digest = (0,
|
|
872
|
+
const digest = (0, import_node_crypto3.createHash)("sha256").update(bytes).digest("hex");
|
|
868
873
|
if (digest !== download.sha256)
|
|
869
874
|
throw new Error(`${download.url} has sha256 ${digest}, expected ${download.sha256}`);
|
|
870
|
-
|
|
875
|
+
import_node_fs7.default.mkdirSync(import_node_path6.default.dirname(target), { recursive: true });
|
|
871
876
|
const partial = `${target}.${process.pid}.partial`;
|
|
872
|
-
|
|
873
|
-
|
|
877
|
+
import_node_fs7.default.writeFileSync(partial, bytes);
|
|
878
|
+
import_node_fs7.default.renameSync(partial, target);
|
|
874
879
|
}
|
|
875
880
|
function ensureToolchain(toolchain) {
|
|
876
881
|
const key = JSON.stringify(toolchain);
|
|
877
882
|
const pending = toolchains.get(key);
|
|
878
883
|
if (pending) return pending;
|
|
879
884
|
const ready = (async () => {
|
|
880
|
-
const dir =
|
|
881
|
-
const compilerDir =
|
|
885
|
+
const dir = import_node_path6.default.join(kotlinHome(), toolchain.compiler.version);
|
|
886
|
+
const compilerDir = import_node_path6.default.join(dir, `compiler-${toolchain.compiler.sha256}`);
|
|
882
887
|
const installedMarker = "bin/kotlinc-wasm";
|
|
883
|
-
const kotlinc =
|
|
884
|
-
if (!
|
|
888
|
+
const kotlinc = import_node_path6.default.join(compilerDir, installedMarker);
|
|
889
|
+
if (!import_node_fs7.default.existsSync(kotlinc))
|
|
885
890
|
await installVerifiedTarball({
|
|
886
891
|
url: toolchain.compiler.url,
|
|
887
892
|
digest: {
|
|
@@ -894,7 +899,7 @@ function ensureToolchain(toolchain) {
|
|
|
894
899
|
stripComponents: 1,
|
|
895
900
|
label: `Kotlin compiler ${toolchain.compiler.version}`
|
|
896
901
|
});
|
|
897
|
-
const java = process.env.JAVA_HOME ?
|
|
902
|
+
const java = process.env.JAVA_HOME ? import_node_path6.default.join(process.env.JAVA_HOME, "bin", "java") : "java";
|
|
898
903
|
const { stderr } = await run(java, ["-XshowSettings:properties", "-version"]).catch(
|
|
899
904
|
() => {
|
|
900
905
|
throw new Error(
|
|
@@ -903,11 +908,11 @@ function ensureToolchain(toolchain) {
|
|
|
903
908
|
}
|
|
904
909
|
);
|
|
905
910
|
const javaHome = /^\s*java\.home\s*=\s*(.+)$/m.exec(stderr)?.[1]?.trim();
|
|
906
|
-
if (!javaHome || !
|
|
911
|
+
if (!javaHome || !import_node_path6.default.isAbsolute(javaHome))
|
|
907
912
|
throw new Error("the configured Java runtime did not report an absolute java.home");
|
|
908
|
-
const libraries = [
|
|
913
|
+
const libraries = [import_node_path6.default.join(compilerDir, "lib", "kotlin-stdlib-wasm-js.klib")];
|
|
909
914
|
for (const library of toolchain.libraries) {
|
|
910
|
-
const target =
|
|
915
|
+
const target = import_node_path6.default.join(dir, library.name);
|
|
911
916
|
await fetchVerified(library, target);
|
|
912
917
|
libraries.push(target);
|
|
913
918
|
}
|
|
@@ -919,14 +924,14 @@ function ensureToolchain(toolchain) {
|
|
|
919
924
|
toolchains.set(key, ready);
|
|
920
925
|
return ready;
|
|
921
926
|
}
|
|
922
|
-
var import_node_child_process4,
|
|
927
|
+
var import_node_child_process4, import_node_crypto3, import_node_fs7, import_node_path6, import_node_util, run, toolchains;
|
|
923
928
|
var init_kotlin_toolchain = __esm({
|
|
924
929
|
"src/kotlin-toolchain.ts"() {
|
|
925
930
|
"use strict";
|
|
926
931
|
import_node_child_process4 = require("node:child_process");
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
932
|
+
import_node_crypto3 = require("node:crypto");
|
|
933
|
+
import_node_fs7 = __toESM(require("node:fs"), 1);
|
|
934
|
+
import_node_path6 = __toESM(require("node:path"), 1);
|
|
930
935
|
import_node_util = require("node:util");
|
|
931
936
|
init_src();
|
|
932
937
|
init_home_paths();
|
|
@@ -954,25 +959,25 @@ async function resolveAndroidGradleSources(request) {
|
|
|
954
959
|
let { root } = request;
|
|
955
960
|
const { projects: projectDirs, variant, includeJavaClasspath = false } = request;
|
|
956
961
|
if (projectDirs.length === 0) return [];
|
|
957
|
-
if (!
|
|
962
|
+
if (!import_node_path10.default.isAbsolute(root) || projectDirs.some((dir) => !import_node_path10.default.isAbsolute(dir)))
|
|
958
963
|
throw new Error("Android Gradle source selection requires absolute project paths");
|
|
959
964
|
if (!variant) throw new Error("Android Gradle source selection requires a variant");
|
|
960
|
-
root =
|
|
961
|
-
const projects = [...new Set(projectDirs.map((dir) =>
|
|
962
|
-
const parent =
|
|
963
|
-
|
|
964
|
-
const work =
|
|
965
|
-
const task = `peachAndroidSources${(0,
|
|
966
|
-
const script =
|
|
965
|
+
root = import_node_fs11.default.realpathSync(root);
|
|
966
|
+
const projects = [...new Set(projectDirs.map((dir) => import_node_fs11.default.realpathSync(dir)))];
|
|
967
|
+
const parent = import_node_path10.default.join(kotlinHome(), "gradle-sources");
|
|
968
|
+
import_node_fs11.default.mkdirSync(parent, { recursive: true });
|
|
969
|
+
const work = import_node_fs11.default.mkdtempSync(import_node_path10.default.join(parent, ".query-"));
|
|
970
|
+
const task = `peachAndroidSources${(0, import_node_crypto7.randomBytes)(8).toString("hex")}`;
|
|
971
|
+
const script = import_node_path10.default.join(work, "sources.gradle");
|
|
967
972
|
const encoded = Buffer.from(
|
|
968
973
|
JSON.stringify({ root, projects, variant, includeJavaClasspath, output: work, task })
|
|
969
974
|
).toString("base64");
|
|
970
|
-
|
|
975
|
+
import_node_fs11.default.writeFileSync(script, modelQuery.replace("__PEACH_REQUEST__", encoded));
|
|
971
976
|
try {
|
|
972
977
|
await run4(
|
|
973
978
|
"bash",
|
|
974
979
|
[
|
|
975
|
-
|
|
980
|
+
import_node_path10.default.join(root, "gradlew"),
|
|
976
981
|
"--init-script",
|
|
977
982
|
script,
|
|
978
983
|
`${task}All`,
|
|
@@ -991,13 +996,13 @@ async function resolveAndroidGradleSources(request) {
|
|
|
991
996
|
);
|
|
992
997
|
return projects.map((projectDir, index) => {
|
|
993
998
|
const value = JSON.parse(
|
|
994
|
-
|
|
999
|
+
import_node_fs11.default.readFileSync(import_node_path10.default.join(work, `${index}.json`), "utf8")
|
|
995
1000
|
);
|
|
996
1001
|
if (!isRecord(value) || value.projectDir !== projectDir || value.variant !== variant || 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))
|
|
997
1002
|
throw new Error("Gradle printed an invalid Android project source model");
|
|
998
1003
|
const paths = (field) => {
|
|
999
1004
|
const list = value[field];
|
|
1000
|
-
if (!Array.isArray(list) || !list.every((file) => typeof file === "string" &&
|
|
1005
|
+
if (!Array.isArray(list) || !list.every((file) => typeof file === "string" && import_node_path10.default.isAbsolute(file)))
|
|
1001
1006
|
throw new Error(`Gradle printed invalid Android ${field} paths`);
|
|
1002
1007
|
return list.map(String);
|
|
1003
1008
|
};
|
|
@@ -1033,17 +1038,17 @@ async function resolveAndroidGradleSources(request) {
|
|
|
1033
1038
|
};
|
|
1034
1039
|
});
|
|
1035
1040
|
} finally {
|
|
1036
|
-
|
|
1041
|
+
import_node_fs11.default.rmSync(work, { recursive: true, force: true });
|
|
1037
1042
|
}
|
|
1038
1043
|
}
|
|
1039
|
-
var import_node_child_process7,
|
|
1044
|
+
var import_node_child_process7, import_node_crypto7, import_node_fs11, import_node_path10, import_node_util4, run4, modelQuery;
|
|
1040
1045
|
var init_android_gradle_sources = __esm({
|
|
1041
1046
|
"src/android-gradle-sources.ts"() {
|
|
1042
1047
|
"use strict";
|
|
1043
1048
|
import_node_child_process7 = require("node:child_process");
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1049
|
+
import_node_crypto7 = require("node:crypto");
|
|
1050
|
+
import_node_fs11 = __toESM(require("node:fs"), 1);
|
|
1051
|
+
import_node_path10 = __toESM(require("node:path"), 1);
|
|
1047
1052
|
import_node_util4 = require("node:util");
|
|
1048
1053
|
init_forked_script_contract();
|
|
1049
1054
|
init_is_record();
|
|
@@ -1146,7 +1151,6 @@ gradle.projectsEvaluated {
|
|
|
1146
1151
|
// src/kotlin-host.ts
|
|
1147
1152
|
var kotlin_host_exports = {};
|
|
1148
1153
|
__export(kotlin_host_exports, {
|
|
1149
|
-
KOTLIN_PACKAGE_PATH: () => KOTLIN_PACKAGE_PATH,
|
|
1150
1154
|
expoKotlinArtifact: () => expoKotlinArtifact,
|
|
1151
1155
|
kotlinAppArtifact: () => kotlinAppArtifact,
|
|
1152
1156
|
kotlinArtifact: () => kotlinArtifact,
|
|
@@ -1159,14 +1163,16 @@ __export(kotlin_host_exports, {
|
|
|
1159
1163
|
});
|
|
1160
1164
|
module.exports = __toCommonJS(kotlin_host_exports);
|
|
1161
1165
|
var import_node_child_process8 = require("node:child_process");
|
|
1162
|
-
var
|
|
1163
|
-
var
|
|
1166
|
+
var import_node_crypto8 = require("node:crypto");
|
|
1167
|
+
var import_node_fs12 = __toESM(require("node:fs"), 1);
|
|
1164
1168
|
var import_node_module = require("node:module");
|
|
1165
|
-
var
|
|
1169
|
+
var import_node_path11 = __toESM(require("node:path"), 1);
|
|
1166
1170
|
var import_node_util5 = require("node:util");
|
|
1167
|
-
var import_acorn2 = require("acorn");
|
|
1171
|
+
var import_acorn2 = require("peachsim/vendor/acorn");
|
|
1168
1172
|
|
|
1169
1173
|
// src/android-bridge-packages.ts
|
|
1174
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
1175
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
1170
1176
|
init_is_record();
|
|
1171
1177
|
function readBridgeMethod(value) {
|
|
1172
1178
|
if (!isRecord(value) || typeof value.name !== "string" || typeof value.blocking !== "boolean" || value.returns !== null && typeof value.returns !== "string" || !Array.isArray(value.params))
|
|
@@ -1248,27 +1254,27 @@ init_is_record();
|
|
|
1248
1254
|
|
|
1249
1255
|
// src/java-module-abi.ts
|
|
1250
1256
|
var import_node_child_process5 = require("node:child_process");
|
|
1251
|
-
var
|
|
1252
|
-
var
|
|
1253
|
-
var
|
|
1257
|
+
var import_node_crypto4 = require("node:crypto");
|
|
1258
|
+
var import_node_fs8 = __toESM(require("node:fs"), 1);
|
|
1259
|
+
var import_node_path7 = __toESM(require("node:path"), 1);
|
|
1254
1260
|
var import_node_util2 = require("node:util");
|
|
1255
1261
|
init_is_record();
|
|
1256
1262
|
init_kotlin_toolchain();
|
|
1257
1263
|
var run2 = (0, import_node_util2.promisify)(import_node_child_process5.execFile);
|
|
1258
1264
|
var JAVA_BINDINGS_INITIALIZER = "initializeJavaBindings";
|
|
1259
1265
|
async function readJavaModuleSpecs(files, sdkRoot, toolchain) {
|
|
1260
|
-
const digest = (0,
|
|
1261
|
-
const parent =
|
|
1262
|
-
|
|
1263
|
-
const work =
|
|
1266
|
+
const digest = (0, import_node_crypto4.createHash)("sha256");
|
|
1267
|
+
const parent = import_node_path7.default.join(kotlinHome(), "java-specs");
|
|
1268
|
+
import_node_fs8.default.mkdirSync(parent, { recursive: true });
|
|
1269
|
+
const work = import_node_fs8.default.mkdtempSync(import_node_path7.default.join(parent, ".read-"));
|
|
1264
1270
|
try {
|
|
1265
1271
|
const origins = /* @__PURE__ */ new Map();
|
|
1266
1272
|
for (const [index, file] of files.entries()) {
|
|
1267
|
-
const bytes =
|
|
1273
|
+
const bytes = import_node_fs8.default.readFileSync(file);
|
|
1268
1274
|
digest.update(file).update("\0").update(bytes).update("\0");
|
|
1269
|
-
const target =
|
|
1270
|
-
|
|
1271
|
-
|
|
1275
|
+
const target = import_node_path7.default.join(work, String(index), import_node_path7.default.basename(file));
|
|
1276
|
+
import_node_fs8.default.mkdirSync(import_node_path7.default.dirname(target));
|
|
1277
|
+
import_node_fs8.default.writeFileSync(target, bytes);
|
|
1272
1278
|
origins.set(target, file);
|
|
1273
1279
|
}
|
|
1274
1280
|
const stdout = await runKotlinTool(
|
|
@@ -1301,20 +1307,20 @@ ${diagnostic.trim()}`, { cause });
|
|
|
1301
1307
|
});
|
|
1302
1308
|
return { sha256: digest.digest("hex"), specs };
|
|
1303
1309
|
} finally {
|
|
1304
|
-
|
|
1310
|
+
import_node_fs8.default.rmSync(work, { recursive: true, force: true });
|
|
1305
1311
|
}
|
|
1306
1312
|
}
|
|
1307
1313
|
async function compileJavaModuleAbi(input) {
|
|
1308
1314
|
const { specs, work, hash, toolchain, libraries, sdkRoot, sdkLibrary, language } = input;
|
|
1309
|
-
const directory =
|
|
1310
|
-
|
|
1315
|
+
const directory = import_node_path7.default.join(work, "java-abi");
|
|
1316
|
+
import_node_fs8.default.mkdirSync(directory);
|
|
1311
1317
|
const sources = specs.specs.map((spec, index) => {
|
|
1312
|
-
const target =
|
|
1313
|
-
|
|
1318
|
+
const target = import_node_path7.default.join(directory, `Spec${index}.kt`);
|
|
1319
|
+
import_node_fs8.default.writeFileSync(target, spec.source);
|
|
1314
1320
|
return target;
|
|
1315
1321
|
});
|
|
1316
|
-
const initializer =
|
|
1317
|
-
|
|
1322
|
+
const initializer = import_node_path7.default.join(directory, "Bindings.kt");
|
|
1323
|
+
import_node_fs8.default.writeFileSync(
|
|
1318
1324
|
initializer,
|
|
1319
1325
|
[
|
|
1320
1326
|
"package dev.peach.jni",
|
|
@@ -1328,8 +1334,8 @@ async function compileJavaModuleAbi(input) {
|
|
|
1328
1334
|
"-J-Xmx2g",
|
|
1329
1335
|
"-Xwasm-target=js",
|
|
1330
1336
|
"-libraries",
|
|
1331
|
-
libraries.join(
|
|
1332
|
-
`-Xplugin=${
|
|
1337
|
+
libraries.join(import_node_path7.default.delimiter),
|
|
1338
|
+
`-Xplugin=${import_node_path7.default.join(sdkRoot, "plugin.jar")}`,
|
|
1333
1339
|
`-Xfriend-modules=${sdkLibrary}`,
|
|
1334
1340
|
"-language-version",
|
|
1335
1341
|
language,
|
|
@@ -1345,18 +1351,18 @@ async function compileJavaModuleAbi(input) {
|
|
|
1345
1351
|
],
|
|
1346
1352
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
1347
1353
|
);
|
|
1348
|
-
const library =
|
|
1354
|
+
const library = import_node_path7.default.join(directory, "java-abi.klib");
|
|
1349
1355
|
await runKotlinTool(
|
|
1350
1356
|
toolchain,
|
|
1351
1357
|
sdkRoot,
|
|
1352
1358
|
"dev.peach.tools.platform.JavaPlatformTypesKt",
|
|
1353
|
-
[
|
|
1359
|
+
[import_node_path7.default.join(directory, `${name}.klib`), library]
|
|
1354
1360
|
);
|
|
1355
1361
|
return library;
|
|
1356
1362
|
}
|
|
1357
1363
|
|
|
1358
1364
|
// src/kotlin-instance-source.ts
|
|
1359
|
-
var import_acorn = require("acorn");
|
|
1365
|
+
var import_acorn = require("peachsim/vendor/acorn");
|
|
1360
1366
|
function bindingNames(pattern) {
|
|
1361
1367
|
if (pattern.type === "Identifier") return [pattern.name];
|
|
1362
1368
|
if (pattern.type === "ObjectPattern")
|
|
@@ -1463,9 +1469,9 @@ return { peachDisposeInstance, ${exports2.map((item) => `${JSON.stringify(item.e
|
|
|
1463
1469
|
|
|
1464
1470
|
// src/kotlin-sdk.ts
|
|
1465
1471
|
var import_node_child_process6 = require("node:child_process");
|
|
1466
|
-
var
|
|
1467
|
-
var
|
|
1468
|
-
var
|
|
1472
|
+
var import_node_crypto5 = require("node:crypto");
|
|
1473
|
+
var import_node_fs9 = __toESM(require("node:fs"), 1);
|
|
1474
|
+
var import_node_path8 = __toESM(require("node:path"), 1);
|
|
1469
1475
|
var import_node_util3 = require("node:util");
|
|
1470
1476
|
init_kotlin_toolchain();
|
|
1471
1477
|
|
|
@@ -1544,55 +1550,55 @@ function readKotlinSdkManifest(source, compilerSha256) {
|
|
|
1544
1550
|
var run3 = (0, import_node_util3.promisify)(import_node_child_process6.execFile);
|
|
1545
1551
|
function verifyKotlinSdkDirectory(root, compiler) {
|
|
1546
1552
|
const expectedNames = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
1547
|
-
const names =
|
|
1553
|
+
const names = import_node_fs9.default.readdirSync(root);
|
|
1548
1554
|
if (names.length !== expectedNames.length || names.some((name) => !expectedNames.includes(name)))
|
|
1549
1555
|
throw new Error("Kotlin SDK directory contains unexpected inputs");
|
|
1550
|
-
const manifestStat =
|
|
1556
|
+
const manifestStat = import_node_fs9.default.lstatSync(import_node_path8.default.join(root, "manifest.json"));
|
|
1551
1557
|
if (!manifestStat.isFile() || manifestStat.nlink !== 1)
|
|
1552
1558
|
throw new Error("Kotlin SDK manifest is not a regular file");
|
|
1553
1559
|
const manifest = readKotlinSdkManifest(
|
|
1554
|
-
|
|
1560
|
+
import_node_fs9.default.readFileSync(import_node_path8.default.join(root, "manifest.json"), "utf8"),
|
|
1555
1561
|
compiler.upstreamSha256
|
|
1556
1562
|
);
|
|
1557
1563
|
for (const [name, expected] of Object.entries(manifest.files)) {
|
|
1558
|
-
const target =
|
|
1559
|
-
const stat =
|
|
1564
|
+
const target = import_node_path8.default.join(root, name);
|
|
1565
|
+
const stat = import_node_fs9.default.lstatSync(target);
|
|
1560
1566
|
if (!stat.isFile() || stat.nlink !== 1)
|
|
1561
1567
|
throw new Error(`Kotlin SDK binary is not a regular file: ${name}`);
|
|
1562
|
-
const bytes =
|
|
1563
|
-
if (bytes.length !== expected.bytes || (0,
|
|
1568
|
+
const bytes = import_node_fs9.default.readFileSync(target);
|
|
1569
|
+
if (bytes.length !== expected.bytes || (0, import_node_crypto5.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
|
|
1564
1570
|
throw new Error(`Kotlin SDK binary differs from its manifest: ${name}`);
|
|
1565
1571
|
}
|
|
1566
1572
|
return manifest;
|
|
1567
1573
|
}
|
|
1568
1574
|
async function installKotlinSdkArchive(archive, compiler) {
|
|
1569
|
-
const sha256 = (0,
|
|
1570
|
-
const parent =
|
|
1571
|
-
const root =
|
|
1572
|
-
if (
|
|
1575
|
+
const sha256 = (0, import_node_crypto5.createHash)("sha256").update(archive).digest("hex");
|
|
1576
|
+
const parent = import_node_path8.default.join(kotlinHome(), "sdk");
|
|
1577
|
+
const root = import_node_path8.default.join(parent, sha256);
|
|
1578
|
+
if (import_node_fs9.default.existsSync(root))
|
|
1573
1579
|
return { root, sha256, manifest: verifyKotlinSdkDirectory(root, compiler) };
|
|
1574
|
-
|
|
1575
|
-
const work =
|
|
1580
|
+
import_node_fs9.default.mkdirSync(parent, { recursive: true });
|
|
1581
|
+
const work = import_node_fs9.default.mkdtempSync(import_node_path8.default.join(parent, ".install-"));
|
|
1576
1582
|
try {
|
|
1577
|
-
const packed =
|
|
1578
|
-
|
|
1583
|
+
const packed = import_node_path8.default.join(work, "sdk.tar.gz");
|
|
1584
|
+
import_node_fs9.default.writeFileSync(packed, archive);
|
|
1579
1585
|
const { stdout } = await run3("tar", ["-tzf", packed]);
|
|
1580
1586
|
const names = stdout.trim().split("\n");
|
|
1581
1587
|
const expected = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
1582
1588
|
if (names.length !== expected.length || new Set(names).size !== names.length || names.some((name) => !expected.includes(name)))
|
|
1583
1589
|
throw new Error("Kotlin SDK archive contains unexpected inputs");
|
|
1584
1590
|
await run3("tar", ["-xzf", packed, "-C", work, "--", ...expected]);
|
|
1585
|
-
|
|
1591
|
+
import_node_fs9.default.rmSync(packed);
|
|
1586
1592
|
const manifest = verifyKotlinSdkDirectory(work, compiler);
|
|
1587
1593
|
try {
|
|
1588
|
-
|
|
1594
|
+
import_node_fs9.default.renameSync(work, root);
|
|
1589
1595
|
} catch (error) {
|
|
1590
|
-
if (!
|
|
1596
|
+
if (!import_node_fs9.default.existsSync(root)) throw error;
|
|
1591
1597
|
verifyKotlinSdkDirectory(root, compiler);
|
|
1592
1598
|
}
|
|
1593
1599
|
return { root, sha256, manifest };
|
|
1594
1600
|
} finally {
|
|
1595
|
-
|
|
1601
|
+
import_node_fs9.default.rmSync(work, { recursive: true, force: true });
|
|
1596
1602
|
}
|
|
1597
1603
|
}
|
|
1598
1604
|
|
|
@@ -1675,10 +1681,13 @@ function viewModelClasses(rows) {
|
|
|
1675
1681
|
});
|
|
1676
1682
|
}
|
|
1677
1683
|
|
|
1684
|
+
// src/kotlinDiscoveryContract.ts
|
|
1685
|
+
var KOTLIN_PACKAGE_PATH = "/__peach/kotlin-package";
|
|
1686
|
+
|
|
1678
1687
|
// src/kotlin-module.ts
|
|
1679
|
-
var
|
|
1680
|
-
var
|
|
1681
|
-
var
|
|
1688
|
+
var import_node_crypto6 = require("node:crypto");
|
|
1689
|
+
var import_node_fs10 = __toESM(require("node:fs"), 1);
|
|
1690
|
+
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
1682
1691
|
var import_node_url = require("node:url");
|
|
1683
1692
|
|
|
1684
1693
|
// cli/standalone.ts
|
|
@@ -1690,33 +1699,33 @@ init_is_record();
|
|
|
1690
1699
|
var installedRoot;
|
|
1691
1700
|
function peachKotlinModuleRoot() {
|
|
1692
1701
|
if (!IS_STANDALONE)
|
|
1693
|
-
return
|
|
1702
|
+
return import_node_path9.default.resolve(import_node_path9.default.dirname((0, import_node_url.fileURLToPath)(__sootsim_import_meta_url)), "..", "kotlin");
|
|
1694
1703
|
if (installedRoot) return installedRoot;
|
|
1695
1704
|
const files = JSON.parse(__PEACH_BUNDLED_KOTLIN__);
|
|
1696
|
-
const digest = (0,
|
|
1697
|
-
const parent =
|
|
1698
|
-
const root =
|
|
1699
|
-
|
|
1700
|
-
if (!
|
|
1701
|
-
const pending =
|
|
1705
|
+
const digest = (0, import_node_crypto6.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
|
|
1706
|
+
const parent = import_node_path9.default.join(rnxHomeDir(), "kotlin", "modules");
|
|
1707
|
+
const root = import_node_path9.default.join(parent, digest);
|
|
1708
|
+
import_node_fs10.default.mkdirSync(parent, { recursive: true });
|
|
1709
|
+
if (!import_node_fs10.default.existsSync(root)) {
|
|
1710
|
+
const pending = import_node_fs10.default.mkdtempSync(import_node_path9.default.join(parent, ".install-"));
|
|
1702
1711
|
try {
|
|
1703
1712
|
for (const [name, contents] of Object.entries(files)) {
|
|
1704
|
-
const file =
|
|
1705
|
-
|
|
1706
|
-
|
|
1713
|
+
const file = import_node_path9.default.join(pending, name);
|
|
1714
|
+
import_node_fs10.default.mkdirSync(import_node_path9.default.dirname(file), { recursive: true });
|
|
1715
|
+
import_node_fs10.default.writeFileSync(file, Buffer.from(contents, "base64"));
|
|
1707
1716
|
}
|
|
1708
1717
|
try {
|
|
1709
|
-
|
|
1718
|
+
import_node_fs10.default.renameSync(pending, root);
|
|
1710
1719
|
} catch (error) {
|
|
1711
1720
|
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY")
|
|
1712
1721
|
throw error;
|
|
1713
1722
|
}
|
|
1714
1723
|
} finally {
|
|
1715
|
-
|
|
1724
|
+
import_node_fs10.default.rmSync(pending, { recursive: true, force: true });
|
|
1716
1725
|
}
|
|
1717
1726
|
}
|
|
1718
1727
|
for (const [name, contents] of Object.entries(files)) {
|
|
1719
|
-
if (!
|
|
1728
|
+
if (!import_node_fs10.default.readFileSync(import_node_path9.default.join(root, name)).equals(Buffer.from(contents, "base64")))
|
|
1720
1729
|
throw new Error(`packaged Kotlin module differs from this CLI: ${name}`);
|
|
1721
1730
|
}
|
|
1722
1731
|
installedRoot = root;
|
|
@@ -1727,17 +1736,17 @@ function peachKotlinModuleRoot() {
|
|
|
1727
1736
|
var run5 = (0, import_node_util5.promisify)(import_node_child_process8.execFile);
|
|
1728
1737
|
function loadKotlinSdk(moduleRoot, toolchain) {
|
|
1729
1738
|
return installKotlinSdkArchive(
|
|
1730
|
-
|
|
1739
|
+
import_node_fs12.default.readFileSync(import_node_path11.default.join(moduleRoot, "sdk.tar.gz")),
|
|
1731
1740
|
toolchain.compiler
|
|
1732
1741
|
);
|
|
1733
1742
|
}
|
|
1734
1743
|
var KOTLIN_ARTIFACT_PREFIX = "/__peach/kotlin-artifact/";
|
|
1735
1744
|
function appKotlinLanguage(root) {
|
|
1736
|
-
const reactNative =
|
|
1737
|
-
(0, import_node_module.createRequire)(
|
|
1745
|
+
const reactNative = import_node_path11.default.dirname(
|
|
1746
|
+
(0, import_node_module.createRequire)(import_node_path11.default.join(root, "package.json")).resolve("react-native/package.json")
|
|
1738
1747
|
);
|
|
1739
|
-
const versions =
|
|
1740
|
-
|
|
1748
|
+
const versions = import_node_fs12.default.readFileSync(
|
|
1749
|
+
import_node_path11.default.join(reactNative, "gradle", "libs.versions.toml"),
|
|
1741
1750
|
"utf8"
|
|
1742
1751
|
);
|
|
1743
1752
|
const match = /^kotlin\s*=\s*"(\d+)\.(\d+)/m.exec(versions);
|
|
@@ -1759,9 +1768,9 @@ var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
|
1759
1768
|
function kotlinSources(root, skip = SKIP_DIRS) {
|
|
1760
1769
|
const sources = [];
|
|
1761
1770
|
const walk = (dir) => {
|
|
1762
|
-
for (const entry of
|
|
1771
|
+
for (const entry of import_node_fs12.default.readdirSync(dir, { withFileTypes: true })) {
|
|
1763
1772
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
1764
|
-
const full =
|
|
1773
|
+
const full = import_node_path11.default.join(dir, entry.name);
|
|
1765
1774
|
if (entry.isDirectory()) walk(full);
|
|
1766
1775
|
else if (entry.isFile() && entry.name.endsWith(".kt")) sources.push(full);
|
|
1767
1776
|
}
|
|
@@ -1831,7 +1840,7 @@ function entrySource(ids) {
|
|
|
1831
1840
|
var BUILD_FORMAT = 22;
|
|
1832
1841
|
var builds = /* @__PURE__ */ new Map();
|
|
1833
1842
|
function buildsDir() {
|
|
1834
|
-
return
|
|
1843
|
+
return import_node_path11.default.join(kotlinHome(), "builds");
|
|
1835
1844
|
}
|
|
1836
1845
|
async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
|
|
1837
1846
|
const { kotlinSourceId, nativeSourceContract, renderKotlinSourceGlue } = await import("vxrn/native-source-contract");
|
|
@@ -1844,7 +1853,7 @@ async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
|
|
|
1844
1853
|
const viewIds = [];
|
|
1845
1854
|
let usesCompose = false;
|
|
1846
1855
|
for (const file of sources) {
|
|
1847
|
-
const source =
|
|
1856
|
+
const source = import_node_fs12.default.readFileSync(file, "utf8");
|
|
1848
1857
|
if (/\bandroidx\.compose\./.test(source)) usesCompose = true;
|
|
1849
1858
|
const contract = nativeSourceContract(file, source);
|
|
1850
1859
|
if (contract.modules.length === 0 && contract.views.length === 0) continue;
|
|
@@ -1934,11 +1943,11 @@ function readExpoTypes(output) {
|
|
|
1934
1943
|
}
|
|
1935
1944
|
var toolScans = /* @__PURE__ */ new Map();
|
|
1936
1945
|
async function scanSources(tool, parse3, toolchain, moduleRoot, files) {
|
|
1937
|
-
const digest = (0,
|
|
1946
|
+
const digest = (0, import_node_crypto8.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
|
|
1938
1947
|
const sdk = await loadKotlinSdk(moduleRoot, toolchain);
|
|
1939
|
-
digest.update(
|
|
1948
|
+
digest.update(import_node_fs12.default.readFileSync(import_node_path11.default.join(moduleRoot, "sdk.tar.gz")));
|
|
1940
1949
|
digest.update(tool);
|
|
1941
|
-
for (const file of files) digest.update(`${file}\0${
|
|
1950
|
+
for (const file of files) digest.update(`${file}\0${import_node_fs12.default.readFileSync(file, "utf8")}\0`);
|
|
1942
1951
|
const key = digest.digest("hex");
|
|
1943
1952
|
let scan = toolScans.get(key);
|
|
1944
1953
|
if (!scan) {
|
|
@@ -1953,7 +1962,7 @@ async function scanSources(tool, parse3, toolchain, moduleRoot, files) {
|
|
|
1953
1962
|
async function scanExpoTypes(toolchain, moduleRoot, sources) {
|
|
1954
1963
|
const candidates = sources.filter(
|
|
1955
1964
|
(file) => /\bRecord\b|\benum\s+class\b|\bExpoComposeView\b|\bExpoView\b|\bComposeProps\b|:\s*(?:[A-Za-z0-9_.]+\.)?(?:View|FrameLayout|LinearLayout|ViewGroup)\b/.test(
|
|
1956
|
-
|
|
1965
|
+
import_node_fs12.default.readFileSync(file, "utf8")
|
|
1957
1966
|
)
|
|
1958
1967
|
);
|
|
1959
1968
|
if (candidates.length === 0) return [];
|
|
@@ -2142,7 +2151,7 @@ function expoTypeSources(files) {
|
|
|
2142
2151
|
)
|
|
2143
2152
|
];
|
|
2144
2153
|
if (edits.length > 0 || views.length > 0) {
|
|
2145
|
-
let text =
|
|
2154
|
+
let text = import_node_fs12.default.readFileSync(file.file, "utf8").replaceAll("\r\n", "\n");
|
|
2146
2155
|
for (const { range, owner, field } of edits.sort((a, b) => b.range[0] - a.range[0]))
|
|
2147
2156
|
text = `${text.slice(0, range[0])}dev.peach.expo.PeachExpoTypes.initial(${owner}::class, ${literal(field.key)}, ${field.required}) { ${text.slice(range[0], range[1])} }${text.slice(range[1])}`;
|
|
2148
2157
|
if (views.length > 0) {
|
|
@@ -2158,7 +2167,7 @@ function expoTypeSources(files) {
|
|
|
2158
2167
|
`${file.package ? `${file.package}.` : ""}peachExpoViews${index}()`
|
|
2159
2168
|
);
|
|
2160
2169
|
}
|
|
2161
|
-
const name = `PeachExpoSource_${index}_${
|
|
2170
|
+
const name = `PeachExpoSource_${index}_${import_node_path11.default.basename(file.file)}`;
|
|
2162
2171
|
generated[name] = text;
|
|
2163
2172
|
origins[name] = file.file;
|
|
2164
2173
|
}
|
|
@@ -2200,7 +2209,7 @@ async function expoKotlinArtifact(root, moduleRoot, origin, modules) {
|
|
|
2200
2209
|
const language = appKotlinLanguage(root);
|
|
2201
2210
|
const scanned = await scanExpoTypes(toolchain, moduleRoot, modules.sources);
|
|
2202
2211
|
const usesCompose = scanned.some((file) => file.views.length > 0) || modules.sources.some(
|
|
2203
|
-
(file) => /\bandroidx\.compose\./.test(
|
|
2212
|
+
(file) => /\bandroidx\.compose\./.test(import_node_fs12.default.readFileSync(file, "utf8"))
|
|
2204
2213
|
);
|
|
2205
2214
|
const types = expoTypeSources(scanned);
|
|
2206
2215
|
const rewritten = new Set(Object.values(types.origins));
|
|
@@ -2430,7 +2439,7 @@ function appResourceSources(app) {
|
|
|
2430
2439
|
entries: app.drawables.map((drawable) => ({
|
|
2431
2440
|
name: drawable.name,
|
|
2432
2441
|
init: `listOf(
|
|
2433
|
-
${drawable.files.map((file) => drawableInit(file,
|
|
2442
|
+
${drawable.files.map((file) => drawableInit(file, import_node_path11.default.relative(app.moduleDir, file.file))).join(",\n")}
|
|
2434
2443
|
)`
|
|
2435
2444
|
}))
|
|
2436
2445
|
},
|
|
@@ -2554,7 +2563,7 @@ function drawableInit(drawable, file) {
|
|
|
2554
2563
|
if (drawable.kind === "xml") return `PeachDrawable.Xml(${where})`;
|
|
2555
2564
|
if (drawable.kind === "bitmap")
|
|
2556
2565
|
return `PeachDrawable.Bitmap(${where}, ${drawable.ninePatch}, ${literal(
|
|
2557
|
-
|
|
2566
|
+
import_node_fs12.default.readFileSync(drawable.file).toString("base64")
|
|
2558
2567
|
)})`;
|
|
2559
2568
|
const vector = drawable.vector;
|
|
2560
2569
|
const float = (value) => `${value}f`;
|
|
@@ -2618,8 +2627,8 @@ async function compileKotlin(input, origin) {
|
|
|
2618
2627
|
javaSpecs = []
|
|
2619
2628
|
} = input;
|
|
2620
2629
|
const sdk = await loadKotlinSdk(moduleRoot, toolchain);
|
|
2621
|
-
const plugin =
|
|
2622
|
-
const sdkLibrary =
|
|
2630
|
+
const plugin = import_node_path11.default.join(sdk.root, "plugin.jar");
|
|
2631
|
+
const sdkLibrary = import_node_path11.default.join(sdk.root, `${sdkProfile}.klib`);
|
|
2623
2632
|
const javaRead = javaSpecs.length ? await readJavaModuleSpecs(javaSpecs, sdk.root, await ensureToolchain(toolchain)) : null;
|
|
2624
2633
|
const java = javaRead && javaRead.specs.some((spec) => !spec.application) ? { ...javaRead, specs: javaRead.specs.filter((spec) => !spec.application) } : null;
|
|
2625
2634
|
const applicationJava = javaRead?.specs.filter((spec) => spec.application) ?? [];
|
|
@@ -2647,9 +2656,9 @@ async function compileKotlin(input, origin) {
|
|
|
2647
2656
|
};
|
|
2648
2657
|
const inputs = sources.map((file) => ({
|
|
2649
2658
|
file,
|
|
2650
|
-
bytes:
|
|
2659
|
+
bytes: import_node_fs12.default.readFileSync(file)
|
|
2651
2660
|
}));
|
|
2652
|
-
const digest = (0,
|
|
2661
|
+
const digest = (0, import_node_crypto8.createHash)("sha256");
|
|
2653
2662
|
digest.update(
|
|
2654
2663
|
JSON.stringify({
|
|
2655
2664
|
format: BUILD_FORMAT,
|
|
@@ -2662,7 +2671,7 @@ async function compileKotlin(input, origin) {
|
|
|
2662
2671
|
})
|
|
2663
2672
|
);
|
|
2664
2673
|
for (const { file, bytes } of inputs)
|
|
2665
|
-
digest.update(
|
|
2674
|
+
digest.update(import_node_path11.default.relative(root, file)).update("\0").update(bytes).update("\0");
|
|
2666
2675
|
if (viewModels) digest.update(viewModels.toolClass);
|
|
2667
2676
|
for (const [name, text] of Object.entries(generated))
|
|
2668
2677
|
digest.update(`${name}\0${text}\0`);
|
|
@@ -2671,39 +2680,39 @@ async function compileKotlin(input, origin) {
|
|
|
2671
2680
|
url: `${origin}${KOTLIN_ARTIFACT_PREFIX}${hash}/app.mjs`,
|
|
2672
2681
|
hash
|
|
2673
2682
|
};
|
|
2674
|
-
const out =
|
|
2675
|
-
if (
|
|
2683
|
+
const out = import_node_path11.default.join(buildsDir(), hash);
|
|
2684
|
+
if (import_node_fs12.default.existsSync(import_node_path11.default.join(out, "js", "app.wasm"))) return artifact;
|
|
2676
2685
|
const pending = builds.get(hash);
|
|
2677
2686
|
if (pending) return pending;
|
|
2678
2687
|
const build = (async () => {
|
|
2679
2688
|
const ready = await ensureToolchain(toolchain);
|
|
2680
2689
|
const { kotlinc } = ready;
|
|
2681
|
-
const libraries = [...ready.libraries, sdkLibrary,
|
|
2682
|
-
const composeRuntime =
|
|
2690
|
+
const libraries = [...ready.libraries, sdkLibrary, import_node_path11.default.join(sdk.root, "java.klib")];
|
|
2691
|
+
const composeRuntime = import_node_path11.default.join(
|
|
2683
2692
|
kotlinHome(),
|
|
2684
2693
|
toolchain.compiler.version,
|
|
2685
2694
|
toolchain.composeRuntime.name
|
|
2686
2695
|
);
|
|
2687
2696
|
if (usesCompose) {
|
|
2688
2697
|
for (const library of toolchain.composeLibraries) {
|
|
2689
|
-
const target =
|
|
2698
|
+
const target = import_node_path11.default.join(kotlinHome(), toolchain.compiler.version, library.name);
|
|
2690
2699
|
await fetchVerified(library, target);
|
|
2691
2700
|
libraries.push(target);
|
|
2692
2701
|
}
|
|
2693
2702
|
await fetchVerified(toolchain.composeRuntime, composeRuntime);
|
|
2694
2703
|
}
|
|
2695
|
-
|
|
2696
|
-
const work =
|
|
2697
|
-
const javaLibrary = java ?
|
|
2704
|
+
import_node_fs12.default.mkdirSync(buildsDir(), { recursive: true });
|
|
2705
|
+
const work = import_node_fs12.default.mkdtempSync(import_node_path11.default.join(buildsDir(), `${hash}-`));
|
|
2706
|
+
const javaLibrary = java ? import_node_path11.default.join(work, "java-abi", "java-abi.klib") : null;
|
|
2698
2707
|
if (javaLibrary) libraries.push(javaLibrary);
|
|
2699
|
-
const generatedDir =
|
|
2700
|
-
|
|
2708
|
+
const generatedDir = import_node_path11.default.join(work, "generated");
|
|
2709
|
+
import_node_fs12.default.mkdirSync(generatedDir);
|
|
2701
2710
|
for (const [name, text] of Object.entries(generated))
|
|
2702
|
-
|
|
2711
|
+
import_node_fs12.default.writeFileSync(import_node_path11.default.join(generatedDir, name), text);
|
|
2703
2712
|
const compiledSources = inputs.map(({ file, bytes }, index) => {
|
|
2704
|
-
const target =
|
|
2705
|
-
|
|
2706
|
-
|
|
2713
|
+
const target = import_node_path11.default.join(work, "sources", String(index), import_node_path11.default.basename(file));
|
|
2714
|
+
import_node_fs12.default.mkdirSync(import_node_path11.default.dirname(target), { recursive: true });
|
|
2715
|
+
import_node_fs12.default.writeFileSync(target, bytes);
|
|
2707
2716
|
return { file, target };
|
|
2708
2717
|
});
|
|
2709
2718
|
const common = [
|
|
@@ -2712,19 +2721,19 @@ async function compileKotlin(input, origin) {
|
|
|
2712
2721
|
"-Xallow-kotlin-package",
|
|
2713
2722
|
"-Xwasm-target=js",
|
|
2714
2723
|
"-libraries",
|
|
2715
|
-
libraries.join(
|
|
2724
|
+
libraries.join(import_node_path11.default.delimiter)
|
|
2716
2725
|
];
|
|
2717
2726
|
const compileKlib = (outputDir) => run5(
|
|
2718
2727
|
kotlinc,
|
|
2719
2728
|
[
|
|
2720
2729
|
...common,
|
|
2721
2730
|
`-Xplugin=${plugin}`,
|
|
2722
|
-
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(
|
|
2731
|
+
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path11.default.delimiter)}`,
|
|
2723
2732
|
...usesCompose ? [
|
|
2724
|
-
`-Xplugin=${
|
|
2733
|
+
`-Xplugin=${import_node_path11.default.resolve(import_node_path11.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
|
|
2725
2734
|
] : [],
|
|
2726
2735
|
...usesSerialization ? [
|
|
2727
|
-
`-Xplugin=${
|
|
2736
|
+
`-Xplugin=${import_node_path11.default.resolve(import_node_path11.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
|
|
2728
2737
|
] : [],
|
|
2729
2738
|
"-language-version",
|
|
2730
2739
|
language,
|
|
@@ -2737,7 +2746,7 @@ async function compileKotlin(input, origin) {
|
|
|
2737
2746
|
"-ir-output-name",
|
|
2738
2747
|
"app",
|
|
2739
2748
|
...compiledSources.map(({ target }) => target),
|
|
2740
|
-
...Object.keys(generated).map((name) =>
|
|
2749
|
+
...Object.keys(generated).map((name) => import_node_path11.default.join(generatedDir, name))
|
|
2741
2750
|
],
|
|
2742
2751
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
2743
2752
|
);
|
|
@@ -2756,31 +2765,31 @@ async function compileKotlin(input, origin) {
|
|
|
2756
2765
|
if (viewModels && inputs.some(
|
|
2757
2766
|
({ file, bytes }) => sources.includes(file) && bytes.includes("ViewModel")
|
|
2758
2767
|
)) {
|
|
2759
|
-
await compileKlib(
|
|
2768
|
+
await compileKlib(import_node_path11.default.join(work, "abi"));
|
|
2760
2769
|
const stdout = await runKotlinTool(
|
|
2761
2770
|
ready,
|
|
2762
2771
|
sdk.root,
|
|
2763
2772
|
viewModels.toolClass,
|
|
2764
|
-
[
|
|
2773
|
+
[import_node_path11.default.join(work, "abi")],
|
|
2765
2774
|
64 * 1024 * 1024
|
|
2766
2775
|
);
|
|
2767
|
-
|
|
2768
|
-
|
|
2776
|
+
import_node_fs12.default.writeFileSync(
|
|
2777
|
+
import_node_path11.default.join(generatedDir, viewModels.file),
|
|
2769
2778
|
viewModels.render(viewModelClasses(readAbiClasses(stdout)))
|
|
2770
2779
|
);
|
|
2771
2780
|
}
|
|
2772
|
-
await compileKlib(
|
|
2781
|
+
await compileKlib(import_node_path11.default.join(work, "klib"));
|
|
2773
2782
|
await run5(
|
|
2774
2783
|
kotlinc,
|
|
2775
2784
|
[
|
|
2776
2785
|
...common,
|
|
2777
2786
|
"-nowarn",
|
|
2778
2787
|
"-Xpartial-linkage-loglevel=error",
|
|
2779
|
-
`-Xinclude=${
|
|
2788
|
+
`-Xinclude=${import_node_path11.default.join(work, "klib")}`,
|
|
2780
2789
|
"-Xir-produce-js",
|
|
2781
2790
|
"-Xir-dce",
|
|
2782
2791
|
"-ir-output-dir",
|
|
2783
|
-
|
|
2792
|
+
import_node_path11.default.join(work, "js"),
|
|
2784
2793
|
"-ir-output-name",
|
|
2785
2794
|
"app"
|
|
2786
2795
|
],
|
|
@@ -2793,10 +2802,10 @@ async function compileKotlin(input, origin) {
|
|
|
2793
2802
|
composeRuntime,
|
|
2794
2803
|
"skiko.mjs",
|
|
2795
2804
|
"-d",
|
|
2796
|
-
|
|
2805
|
+
import_node_path11.default.join(work, "js")
|
|
2797
2806
|
]);
|
|
2798
|
-
const skikoPath =
|
|
2799
|
-
const upstream = (0, import_acorn2.parse)(
|
|
2807
|
+
const skikoPath = import_node_path11.default.join(work, "js", "skiko.mjs");
|
|
2808
|
+
const upstream = (0, import_acorn2.parse)(import_node_fs12.default.readFileSync(skikoPath, "utf8"), {
|
|
2800
2809
|
ecmaVersion: "latest",
|
|
2801
2810
|
sourceType: "module"
|
|
2802
2811
|
});
|
|
@@ -2818,7 +2827,7 @@ async function compileKotlin(input, origin) {
|
|
|
2818
2827
|
"GL",
|
|
2819
2828
|
...bindings
|
|
2820
2829
|
];
|
|
2821
|
-
|
|
2830
|
+
import_node_fs12.default.writeFileSync(
|
|
2822
2831
|
skikoPath,
|
|
2823
2832
|
[
|
|
2824
2833
|
"const runtime = globalThis.__peachKotlinSkiko;",
|
|
@@ -2832,10 +2841,10 @@ async function compileKotlin(input, origin) {
|
|
|
2832
2841
|
if (usesCompose) {
|
|
2833
2842
|
for (const library of toolchain.composeJsLibraries) {
|
|
2834
2843
|
let imported = false;
|
|
2835
|
-
for (const file of
|
|
2844
|
+
for (const file of import_node_fs12.default.readdirSync(import_node_path11.default.join(work, "js"))) {
|
|
2836
2845
|
if (!file.endsWith(".mjs")) continue;
|
|
2837
|
-
const target =
|
|
2838
|
-
const source =
|
|
2846
|
+
const target = import_node_path11.default.join(work, "js", file);
|
|
2847
|
+
const source = import_node_fs12.default.readFileSync(target, "utf8");
|
|
2839
2848
|
let next = source;
|
|
2840
2849
|
for (const quote of ["'", '"'])
|
|
2841
2850
|
next = next.replaceAll(
|
|
@@ -2843,11 +2852,11 @@ async function compileKotlin(input, origin) {
|
|
|
2843
2852
|
`from ${quote}./${library.file}${quote}`
|
|
2844
2853
|
);
|
|
2845
2854
|
if (next === source) continue;
|
|
2846
|
-
|
|
2855
|
+
import_node_fs12.default.writeFileSync(target, next);
|
|
2847
2856
|
imported = true;
|
|
2848
2857
|
}
|
|
2849
2858
|
if (!imported) continue;
|
|
2850
|
-
const archive =
|
|
2859
|
+
const archive = import_node_path11.default.join(
|
|
2851
2860
|
kotlinHome(),
|
|
2852
2861
|
toolchain.compiler.version,
|
|
2853
2862
|
library.name
|
|
@@ -2856,24 +2865,24 @@ async function compileKotlin(input, origin) {
|
|
|
2856
2865
|
const { stdout } = await run5("tar", ["-xOf", archive, library.archiveEntry], {
|
|
2857
2866
|
maxBuffer: 16 * 1024 * 1024
|
|
2858
2867
|
});
|
|
2859
|
-
|
|
2868
|
+
import_node_fs12.default.writeFileSync(import_node_path11.default.join(work, "js", library.file), stdout);
|
|
2860
2869
|
}
|
|
2861
2870
|
}
|
|
2862
2871
|
} catch (error) {
|
|
2863
|
-
|
|
2872
|
+
import_node_fs12.default.rmSync(work, { recursive: true, force: true });
|
|
2864
2873
|
let output = isRecord(error) ? `${String(error.stderr ?? "")}${String(error.stdout ?? "")}` : "";
|
|
2865
2874
|
for (const [name, source] of Object.entries(origins))
|
|
2866
|
-
output = output.replaceAll(
|
|
2875
|
+
output = output.replaceAll(import_node_path11.default.join(generatedDir, name), source);
|
|
2867
2876
|
for (const [index, spec] of applicationJava.entries())
|
|
2868
2877
|
output = output.replaceAll(
|
|
2869
|
-
|
|
2878
|
+
import_node_path11.default.join(generatedDir, `JavaApplication${index}.kt`),
|
|
2870
2879
|
spec.file
|
|
2871
2880
|
);
|
|
2872
2881
|
for (const { file, target } of compiledSources)
|
|
2873
|
-
output = output.replaceAll(target, file).replaceAll(
|
|
2882
|
+
output = output.replaceAll(target, file).replaceAll(import_node_path11.default.relative(process.cwd(), target), file);
|
|
2874
2883
|
for (const [index, spec] of (java?.specs ?? []).entries())
|
|
2875
2884
|
output = output.replaceAll(
|
|
2876
|
-
|
|
2885
|
+
import_node_path11.default.join(work, "java-abi", `Spec${index}.kt`),
|
|
2877
2886
|
spec.file
|
|
2878
2887
|
);
|
|
2879
2888
|
output = output.replace(
|
|
@@ -2888,9 +2897,9 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
2888
2897
|
const seams = [
|
|
2889
2898
|
["process.release.name", "process.release?.name"]
|
|
2890
2899
|
];
|
|
2891
|
-
const js =
|
|
2900
|
+
const js = import_node_fs12.default.readdirSync(import_node_path11.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
|
|
2892
2901
|
if (js.some(
|
|
2893
|
-
(file) =>
|
|
2902
|
+
(file) => import_node_fs12.default.readFileSync(import_node_path11.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
|
|
2894
2903
|
))
|
|
2895
2904
|
seams.push([
|
|
2896
2905
|
"(typeof(window) !== 'undefined' && window != null && typeof(window.addEventListener) === 'function') ? window : null",
|
|
@@ -2899,12 +2908,12 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
2899
2908
|
for (const [from, to] of seams) {
|
|
2900
2909
|
let patched = 0;
|
|
2901
2910
|
for (const file of js) {
|
|
2902
|
-
const target =
|
|
2903
|
-
const text =
|
|
2911
|
+
const target = import_node_path11.default.join(work, "js", file);
|
|
2912
|
+
const text = import_node_fs12.default.readFileSync(target, "utf8");
|
|
2904
2913
|
const next = text.replaceAll(from, to);
|
|
2905
2914
|
if (next !== text) {
|
|
2906
2915
|
patched++;
|
|
2907
|
-
|
|
2916
|
+
import_node_fs12.default.writeFileSync(target, next);
|
|
2908
2917
|
}
|
|
2909
2918
|
}
|
|
2910
2919
|
if (patched === 0)
|
|
@@ -2912,11 +2921,11 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
2912
2921
|
`kotlin output no longer contains ${from}; recheck how it detects its host in Peach`
|
|
2913
2922
|
);
|
|
2914
2923
|
}
|
|
2915
|
-
const entry =
|
|
2916
|
-
const entrySource2 =
|
|
2917
|
-
const importsPath =
|
|
2924
|
+
const entry = import_node_path11.default.join(work, "js/app.mjs");
|
|
2925
|
+
const entrySource2 = import_node_fs12.default.readFileSync(entry, "utf8");
|
|
2926
|
+
const importsPath = import_node_path11.default.join(work, "js/app.import-object.mjs");
|
|
2918
2927
|
const importsFactory = kotlinInstanceSource(
|
|
2919
|
-
|
|
2928
|
+
import_node_fs12.default.readFileSync(importsPath, "utf8"),
|
|
2920
2929
|
"createKotlinImportObject"
|
|
2921
2930
|
);
|
|
2922
2931
|
const runtimeFactory = kotlinInstanceSource(
|
|
@@ -2924,9 +2933,9 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
2924
2933
|
"createKotlinInstance",
|
|
2925
2934
|
/* @__PURE__ */ new Map([["./app.import-object.mjs", "createKotlinImportObject"]])
|
|
2926
2935
|
);
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2936
|
+
import_node_fs12.default.writeFileSync(importsPath, importsFactory.source);
|
|
2937
|
+
import_node_fs12.default.writeFileSync(import_node_path11.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
|
|
2938
|
+
import_node_fs12.default.writeFileSync(
|
|
2930
2939
|
entry,
|
|
2931
2940
|
[
|
|
2932
2941
|
"import { createKotlinInstance } from './app-runtime.mjs';",
|
|
@@ -2939,10 +2948,10 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
2939
2948
|
].join("\n")
|
|
2940
2949
|
);
|
|
2941
2950
|
try {
|
|
2942
|
-
|
|
2951
|
+
import_node_fs12.default.renameSync(work, out);
|
|
2943
2952
|
} catch (error) {
|
|
2944
|
-
if (!
|
|
2945
|
-
|
|
2953
|
+
if (!import_node_fs12.default.existsSync(import_node_path11.default.join(out, "js", "app.wasm"))) throw error;
|
|
2954
|
+
import_node_fs12.default.rmSync(work, { recursive: true, force: true });
|
|
2946
2955
|
}
|
|
2947
2956
|
return artifact;
|
|
2948
2957
|
})().finally(() => builds.delete(hash));
|
|
@@ -2954,24 +2963,24 @@ var CONTENT_TYPES = {
|
|
|
2954
2963
|
".wasm": "application/wasm"
|
|
2955
2964
|
};
|
|
2956
2965
|
function kotlinArtifactFiles(hash) {
|
|
2957
|
-
const dir =
|
|
2958
|
-
return
|
|
2959
|
-
const contentType = CONTENT_TYPES[
|
|
2966
|
+
const dir = import_node_path11.default.join(buildsDir(), hash, "js");
|
|
2967
|
+
return import_node_fs12.default.readdirSync(dir).sort().map((name) => {
|
|
2968
|
+
const contentType = CONTENT_TYPES[import_node_path11.default.extname(name)];
|
|
2960
2969
|
if (!contentType) throw new Error(`unexpected kotlin artifact file ${name}`);
|
|
2961
|
-
return { name, bytes:
|
|
2970
|
+
return { name, bytes: import_node_fs12.default.readFileSync(import_node_path11.default.join(dir, name)), contentType };
|
|
2962
2971
|
});
|
|
2963
2972
|
}
|
|
2964
2973
|
function serveKotlinArtifact(pathname, res) {
|
|
2965
2974
|
if (!pathname.startsWith(KOTLIN_ARTIFACT_PREFIX)) return false;
|
|
2966
2975
|
const [hash, file, ...rest] = pathname.slice(KOTLIN_ARTIFACT_PREFIX.length).split("/");
|
|
2967
|
-
const type = file ? CONTENT_TYPES[
|
|
2976
|
+
const type = file ? CONTENT_TYPES[import_node_path11.default.extname(file)] : void 0;
|
|
2968
2977
|
if (!hash || !/^[0-9a-f]+$/.test(hash) || !file || rest.length > 0 || !type || file.includes("..")) {
|
|
2969
2978
|
res.statusCode = 404;
|
|
2970
2979
|
res.end("not a kotlin artifact");
|
|
2971
2980
|
return true;
|
|
2972
2981
|
}
|
|
2973
|
-
const target =
|
|
2974
|
-
if (!
|
|
2982
|
+
const target = import_node_path11.default.join(buildsDir(), hash, "js", file);
|
|
2983
|
+
if (!import_node_fs12.default.existsSync(target)) {
|
|
2975
2984
|
res.statusCode = 404;
|
|
2976
2985
|
res.end(`kotlin artifact ${hash}/${file} was not built`);
|
|
2977
2986
|
return true;
|
|
@@ -2979,10 +2988,9 @@ function serveKotlinArtifact(pathname, res) {
|
|
|
2979
2988
|
res.setHeader("access-control-allow-origin", "*");
|
|
2980
2989
|
res.setHeader("content-type", type);
|
|
2981
2990
|
res.setHeader("cache-control", "public, max-age=31536000, immutable");
|
|
2982
|
-
res.end(
|
|
2991
|
+
res.end(import_node_fs12.default.readFileSync(target));
|
|
2983
2992
|
return true;
|
|
2984
2993
|
}
|
|
2985
|
-
var KOTLIN_PACKAGE_PATH = "/__peach/kotlin-package";
|
|
2986
2994
|
async function serveKotlinRequest(pathname, res, app) {
|
|
2987
2995
|
if (serveKotlinArtifact(pathname, res)) return true;
|
|
2988
2996
|
if (pathname !== KOTLIN_PACKAGE_PATH) return false;
|
|
@@ -2999,7 +3007,6 @@ async function serveKotlinRequest(pathname, res, app) {
|
|
|
2999
3007
|
}
|
|
3000
3008
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3001
3009
|
0 && (module.exports = {
|
|
3002
|
-
KOTLIN_PACKAGE_PATH,
|
|
3003
3010
|
expoKotlinArtifact,
|
|
3004
3011
|
kotlinAppArtifact,
|
|
3005
3012
|
kotlinArtifact,
|