peachsim 0.1.2194 → 0.1.2197
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 +4 -1
- package/cli/commands/control.ts +2 -0
- package/cli/commands/kotlin.ts +10 -3
- package/cli/commands/package.ts +2 -0
- package/cli/native-input.ts +2 -0
- package/cli/outbound-endpoints.ts +1 -1
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +986 -785
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +3 -3
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +991 -790
- package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +2 -2
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +82 -13
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +2 -2
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +1 -1
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +65 -62
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +1513 -1264
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +1 -1
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +2 -2
- package/dist-lib/vite.cjs +2 -2
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/src/android-bridge-dependencies.ts +93 -0
- package/src/android-bridge-packages.ts +1 -0
- package/src/android-gradle-sources.ts +76 -9
- package/src/androidGradleContract.ts +8 -0
- package/src/expo-kotlin-host.ts +20 -7
- package/src/expoKotlinContract.ts +1 -1
- package/src/java-module-abi.ts +7 -1
- package/src/kotlin-app.ts +120 -63
- package/src/kotlin-host.ts +1 -0
- package/src/kotlinSdkContract.ts +8 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2197 | (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;
|
|
@@ -3293,17 +3293,17 @@ function visit(node, visitor) {
|
|
|
3293
3293
|
} else
|
|
3294
3294
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
3295
3295
|
}
|
|
3296
|
-
function visit_(key2, node, visitor,
|
|
3297
|
-
const ctrl = callVisitor(key2, node, visitor,
|
|
3296
|
+
function visit_(key2, node, visitor, path98) {
|
|
3297
|
+
const ctrl = callVisitor(key2, node, visitor, path98);
|
|
3298
3298
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
3299
|
-
replaceNode(key2,
|
|
3300
|
-
return visit_(key2, ctrl, visitor,
|
|
3299
|
+
replaceNode(key2, path98, ctrl);
|
|
3300
|
+
return visit_(key2, ctrl, visitor, path98);
|
|
3301
3301
|
}
|
|
3302
3302
|
if (typeof ctrl !== "symbol") {
|
|
3303
3303
|
if (isCollection(node)) {
|
|
3304
|
-
|
|
3304
|
+
path98 = Object.freeze(path98.concat(node));
|
|
3305
3305
|
for (let i = 0; i < node.items.length; ++i) {
|
|
3306
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
3306
|
+
const ci = visit_(i, node.items[i], visitor, path98);
|
|
3307
3307
|
if (typeof ci === "number")
|
|
3308
3308
|
i = ci - 1;
|
|
3309
3309
|
else if (ci === BREAK)
|
|
@@ -3314,13 +3314,13 @@ function visit_(key2, node, visitor, path97) {
|
|
|
3314
3314
|
}
|
|
3315
3315
|
}
|
|
3316
3316
|
} else if (isPair(node)) {
|
|
3317
|
-
|
|
3318
|
-
const ck = visit_("key", node.key, visitor,
|
|
3317
|
+
path98 = Object.freeze(path98.concat(node));
|
|
3318
|
+
const ck = visit_("key", node.key, visitor, path98);
|
|
3319
3319
|
if (ck === BREAK)
|
|
3320
3320
|
return BREAK;
|
|
3321
3321
|
else if (ck === REMOVE)
|
|
3322
3322
|
node.key = null;
|
|
3323
|
-
const cv = visit_("value", node.value, visitor,
|
|
3323
|
+
const cv = visit_("value", node.value, visitor, path98);
|
|
3324
3324
|
if (cv === BREAK)
|
|
3325
3325
|
return BREAK;
|
|
3326
3326
|
else if (cv === REMOVE)
|
|
@@ -3338,17 +3338,17 @@ async function visitAsync(node, visitor) {
|
|
|
3338
3338
|
} else
|
|
3339
3339
|
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
3340
3340
|
}
|
|
3341
|
-
async function visitAsync_(key2, node, visitor,
|
|
3342
|
-
const ctrl = await callVisitor(key2, node, visitor,
|
|
3341
|
+
async function visitAsync_(key2, node, visitor, path98) {
|
|
3342
|
+
const ctrl = await callVisitor(key2, node, visitor, path98);
|
|
3343
3343
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
3344
|
-
replaceNode(key2,
|
|
3345
|
-
return visitAsync_(key2, ctrl, visitor,
|
|
3344
|
+
replaceNode(key2, path98, ctrl);
|
|
3345
|
+
return visitAsync_(key2, ctrl, visitor, path98);
|
|
3346
3346
|
}
|
|
3347
3347
|
if (typeof ctrl !== "symbol") {
|
|
3348
3348
|
if (isCollection(node)) {
|
|
3349
|
-
|
|
3349
|
+
path98 = Object.freeze(path98.concat(node));
|
|
3350
3350
|
for (let i = 0; i < node.items.length; ++i) {
|
|
3351
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
3351
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path98);
|
|
3352
3352
|
if (typeof ci === "number")
|
|
3353
3353
|
i = ci - 1;
|
|
3354
3354
|
else if (ci === BREAK)
|
|
@@ -3359,13 +3359,13 @@ async function visitAsync_(key2, node, visitor, path97) {
|
|
|
3359
3359
|
}
|
|
3360
3360
|
}
|
|
3361
3361
|
} else if (isPair(node)) {
|
|
3362
|
-
|
|
3363
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
3362
|
+
path98 = Object.freeze(path98.concat(node));
|
|
3363
|
+
const ck = await visitAsync_("key", node.key, visitor, path98);
|
|
3364
3364
|
if (ck === BREAK)
|
|
3365
3365
|
return BREAK;
|
|
3366
3366
|
else if (ck === REMOVE)
|
|
3367
3367
|
node.key = null;
|
|
3368
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
3368
|
+
const cv = await visitAsync_("value", node.value, visitor, path98);
|
|
3369
3369
|
if (cv === BREAK)
|
|
3370
3370
|
return BREAK;
|
|
3371
3371
|
else if (cv === REMOVE)
|
|
@@ -3392,23 +3392,23 @@ function initVisitor(visitor) {
|
|
|
3392
3392
|
}
|
|
3393
3393
|
return visitor;
|
|
3394
3394
|
}
|
|
3395
|
-
function callVisitor(key2, node, visitor,
|
|
3395
|
+
function callVisitor(key2, node, visitor, path98) {
|
|
3396
3396
|
if (typeof visitor === "function")
|
|
3397
|
-
return visitor(key2, node,
|
|
3397
|
+
return visitor(key2, node, path98);
|
|
3398
3398
|
if (isMap(node))
|
|
3399
|
-
return visitor.Map?.(key2, node,
|
|
3399
|
+
return visitor.Map?.(key2, node, path98);
|
|
3400
3400
|
if (isSeq(node))
|
|
3401
|
-
return visitor.Seq?.(key2, node,
|
|
3401
|
+
return visitor.Seq?.(key2, node, path98);
|
|
3402
3402
|
if (isPair(node))
|
|
3403
|
-
return visitor.Pair?.(key2, node,
|
|
3403
|
+
return visitor.Pair?.(key2, node, path98);
|
|
3404
3404
|
if (isScalar(node))
|
|
3405
|
-
return visitor.Scalar?.(key2, node,
|
|
3405
|
+
return visitor.Scalar?.(key2, node, path98);
|
|
3406
3406
|
if (isAlias(node))
|
|
3407
|
-
return visitor.Alias?.(key2, node,
|
|
3407
|
+
return visitor.Alias?.(key2, node, path98);
|
|
3408
3408
|
return void 0;
|
|
3409
3409
|
}
|
|
3410
|
-
function replaceNode(key2,
|
|
3411
|
-
const parent =
|
|
3410
|
+
function replaceNode(key2, path98, node) {
|
|
3411
|
+
const parent = path98[path98.length - 1];
|
|
3412
3412
|
if (isCollection(parent)) {
|
|
3413
3413
|
parent.items[key2] = node;
|
|
3414
3414
|
} else if (isPair(parent)) {
|
|
@@ -4017,10 +4017,10 @@ var init_createNode = __esm({
|
|
|
4017
4017
|
});
|
|
4018
4018
|
|
|
4019
4019
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
4020
|
-
function collectionFromPath(schema4,
|
|
4020
|
+
function collectionFromPath(schema4, path98, value) {
|
|
4021
4021
|
let v6 = value;
|
|
4022
|
-
for (let i =
|
|
4023
|
-
const k =
|
|
4022
|
+
for (let i = path98.length - 1; i >= 0; --i) {
|
|
4023
|
+
const k = path98[i];
|
|
4024
4024
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
4025
4025
|
const a = [];
|
|
4026
4026
|
a[k] = v6;
|
|
@@ -4046,7 +4046,7 @@ var init_Collection = __esm({
|
|
|
4046
4046
|
init_createNode();
|
|
4047
4047
|
init_identity();
|
|
4048
4048
|
init_Node();
|
|
4049
|
-
isEmptyPath = (
|
|
4049
|
+
isEmptyPath = (path98) => path98 == null || typeof path98 === "object" && !!path98[Symbol.iterator]().next().done;
|
|
4050
4050
|
Collection = class extends NodeBase {
|
|
4051
4051
|
constructor(type, schema4) {
|
|
4052
4052
|
super(type);
|
|
@@ -4076,11 +4076,11 @@ var init_Collection = __esm({
|
|
|
4076
4076
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
4077
4077
|
* that already exists in the map.
|
|
4078
4078
|
*/
|
|
4079
|
-
addIn(
|
|
4080
|
-
if (isEmptyPath(
|
|
4079
|
+
addIn(path98, value) {
|
|
4080
|
+
if (isEmptyPath(path98))
|
|
4081
4081
|
this.add(value);
|
|
4082
4082
|
else {
|
|
4083
|
-
const [key2, ...rest] =
|
|
4083
|
+
const [key2, ...rest] = path98;
|
|
4084
4084
|
const node = this.get(key2, true);
|
|
4085
4085
|
if (isCollection(node))
|
|
4086
4086
|
node.addIn(rest, value);
|
|
@@ -4094,8 +4094,8 @@ var init_Collection = __esm({
|
|
|
4094
4094
|
* Removes a value from the collection.
|
|
4095
4095
|
* @returns `true` if the item was found and removed.
|
|
4096
4096
|
*/
|
|
4097
|
-
deleteIn(
|
|
4098
|
-
const [key2, ...rest] =
|
|
4097
|
+
deleteIn(path98) {
|
|
4098
|
+
const [key2, ...rest] = path98;
|
|
4099
4099
|
if (rest.length === 0)
|
|
4100
4100
|
return this.delete(key2);
|
|
4101
4101
|
const node = this.get(key2, true);
|
|
@@ -4109,8 +4109,8 @@ var init_Collection = __esm({
|
|
|
4109
4109
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
4110
4110
|
* `true` (collections are always returned intact).
|
|
4111
4111
|
*/
|
|
4112
|
-
getIn(
|
|
4113
|
-
const [key2, ...rest] =
|
|
4112
|
+
getIn(path98, keepScalar) {
|
|
4113
|
+
const [key2, ...rest] = path98;
|
|
4114
4114
|
const node = this.get(key2, true);
|
|
4115
4115
|
if (rest.length === 0)
|
|
4116
4116
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -4128,8 +4128,8 @@ var init_Collection = __esm({
|
|
|
4128
4128
|
/**
|
|
4129
4129
|
* Checks if the collection includes a value with the key `key`.
|
|
4130
4130
|
*/
|
|
4131
|
-
hasIn(
|
|
4132
|
-
const [key2, ...rest] =
|
|
4131
|
+
hasIn(path98) {
|
|
4132
|
+
const [key2, ...rest] = path98;
|
|
4133
4133
|
if (rest.length === 0)
|
|
4134
4134
|
return this.has(key2);
|
|
4135
4135
|
const node = this.get(key2, true);
|
|
@@ -4139,8 +4139,8 @@ var init_Collection = __esm({
|
|
|
4139
4139
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
4140
4140
|
* boolean to add/remove the item from the set.
|
|
4141
4141
|
*/
|
|
4142
|
-
setIn(
|
|
4143
|
-
const [key2, ...rest] =
|
|
4142
|
+
setIn(path98, value) {
|
|
4143
|
+
const [key2, ...rest] = path98;
|
|
4144
4144
|
if (rest.length === 0) {
|
|
4145
4145
|
this.set(key2, value);
|
|
4146
4146
|
} else {
|
|
@@ -6609,9 +6609,9 @@ var init_Document = __esm({
|
|
|
6609
6609
|
this.contents.add(value);
|
|
6610
6610
|
}
|
|
6611
6611
|
/** Adds a value to the document. */
|
|
6612
|
-
addIn(
|
|
6612
|
+
addIn(path98, value) {
|
|
6613
6613
|
if (assertCollection(this.contents))
|
|
6614
|
-
this.contents.addIn(
|
|
6614
|
+
this.contents.addIn(path98, value);
|
|
6615
6615
|
}
|
|
6616
6616
|
/**
|
|
6617
6617
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -6686,14 +6686,14 @@ var init_Document = __esm({
|
|
|
6686
6686
|
* Removes a value from the document.
|
|
6687
6687
|
* @returns `true` if the item was found and removed.
|
|
6688
6688
|
*/
|
|
6689
|
-
deleteIn(
|
|
6690
|
-
if (isEmptyPath(
|
|
6689
|
+
deleteIn(path98) {
|
|
6690
|
+
if (isEmptyPath(path98)) {
|
|
6691
6691
|
if (this.contents == null)
|
|
6692
6692
|
return false;
|
|
6693
6693
|
this.contents = null;
|
|
6694
6694
|
return true;
|
|
6695
6695
|
}
|
|
6696
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
6696
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path98) : false;
|
|
6697
6697
|
}
|
|
6698
6698
|
/**
|
|
6699
6699
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -6708,10 +6708,10 @@ var init_Document = __esm({
|
|
|
6708
6708
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
6709
6709
|
* `true` (collections are always returned intact).
|
|
6710
6710
|
*/
|
|
6711
|
-
getIn(
|
|
6712
|
-
if (isEmptyPath(
|
|
6711
|
+
getIn(path98, keepScalar) {
|
|
6712
|
+
if (isEmptyPath(path98))
|
|
6713
6713
|
return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
|
|
6714
|
-
return isCollection(this.contents) ? this.contents.getIn(
|
|
6714
|
+
return isCollection(this.contents) ? this.contents.getIn(path98, keepScalar) : void 0;
|
|
6715
6715
|
}
|
|
6716
6716
|
/**
|
|
6717
6717
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -6722,10 +6722,10 @@ var init_Document = __esm({
|
|
|
6722
6722
|
/**
|
|
6723
6723
|
* Checks if the document includes a value at `path`.
|
|
6724
6724
|
*/
|
|
6725
|
-
hasIn(
|
|
6726
|
-
if (isEmptyPath(
|
|
6725
|
+
hasIn(path98) {
|
|
6726
|
+
if (isEmptyPath(path98))
|
|
6727
6727
|
return this.contents !== void 0;
|
|
6728
|
-
return isCollection(this.contents) ? this.contents.hasIn(
|
|
6728
|
+
return isCollection(this.contents) ? this.contents.hasIn(path98) : false;
|
|
6729
6729
|
}
|
|
6730
6730
|
/**
|
|
6731
6731
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -6742,13 +6742,13 @@ var init_Document = __esm({
|
|
|
6742
6742
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
6743
6743
|
* boolean to add/remove the item from the set.
|
|
6744
6744
|
*/
|
|
6745
|
-
setIn(
|
|
6746
|
-
if (isEmptyPath(
|
|
6745
|
+
setIn(path98, value) {
|
|
6746
|
+
if (isEmptyPath(path98)) {
|
|
6747
6747
|
this.contents = value;
|
|
6748
6748
|
} else if (this.contents == null) {
|
|
6749
|
-
this.contents = collectionFromPath(this.schema, Array.from(
|
|
6749
|
+
this.contents = collectionFromPath(this.schema, Array.from(path98), value);
|
|
6750
6750
|
} else if (assertCollection(this.contents)) {
|
|
6751
|
-
this.contents.setIn(
|
|
6751
|
+
this.contents.setIn(path98, value);
|
|
6752
6752
|
}
|
|
6753
6753
|
}
|
|
6754
6754
|
/**
|
|
@@ -8672,15 +8672,15 @@ function visit2(cst, visitor) {
|
|
|
8672
8672
|
cst = { start: cst.start, value: cst.value };
|
|
8673
8673
|
_visit(Object.freeze([]), cst, visitor);
|
|
8674
8674
|
}
|
|
8675
|
-
function _visit(
|
|
8676
|
-
let ctrl = visitor(item,
|
|
8675
|
+
function _visit(path98, item, visitor) {
|
|
8676
|
+
let ctrl = visitor(item, path98);
|
|
8677
8677
|
if (typeof ctrl === "symbol")
|
|
8678
8678
|
return ctrl;
|
|
8679
8679
|
for (const field of ["key", "value"]) {
|
|
8680
8680
|
const token = item[field];
|
|
8681
8681
|
if (token && "items" in token) {
|
|
8682
8682
|
for (let i = 0; i < token.items.length; ++i) {
|
|
8683
|
-
const ci = _visit(Object.freeze(
|
|
8683
|
+
const ci = _visit(Object.freeze(path98.concat([[field, i]])), token.items[i], visitor);
|
|
8684
8684
|
if (typeof ci === "number")
|
|
8685
8685
|
i = ci - 1;
|
|
8686
8686
|
else if (ci === BREAK2)
|
|
@@ -8691,10 +8691,10 @@ function _visit(path97, item, visitor) {
|
|
|
8691
8691
|
}
|
|
8692
8692
|
}
|
|
8693
8693
|
if (typeof ctrl === "function" && field === "key")
|
|
8694
|
-
ctrl = ctrl(item,
|
|
8694
|
+
ctrl = ctrl(item, path98);
|
|
8695
8695
|
}
|
|
8696
8696
|
}
|
|
8697
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
8697
|
+
return typeof ctrl === "function" ? ctrl(item, path98) : ctrl;
|
|
8698
8698
|
}
|
|
8699
8699
|
var BREAK2, SKIP2, REMOVE2;
|
|
8700
8700
|
var init_cst_visit = __esm({
|
|
@@ -8706,9 +8706,9 @@ var init_cst_visit = __esm({
|
|
|
8706
8706
|
visit2.BREAK = BREAK2;
|
|
8707
8707
|
visit2.SKIP = SKIP2;
|
|
8708
8708
|
visit2.REMOVE = REMOVE2;
|
|
8709
|
-
visit2.itemAtPath = (cst,
|
|
8709
|
+
visit2.itemAtPath = (cst, path98) => {
|
|
8710
8710
|
let item = cst;
|
|
8711
|
-
for (const [field, index] of
|
|
8711
|
+
for (const [field, index] of path98) {
|
|
8712
8712
|
const tok = item?.[field];
|
|
8713
8713
|
if (tok && "items" in tok) {
|
|
8714
8714
|
item = tok.items[index];
|
|
@@ -8717,9 +8717,9 @@ var init_cst_visit = __esm({
|
|
|
8717
8717
|
}
|
|
8718
8718
|
return item;
|
|
8719
8719
|
};
|
|
8720
|
-
visit2.parentCollection = (cst,
|
|
8721
|
-
const parent = visit2.itemAtPath(cst,
|
|
8722
|
-
const field =
|
|
8720
|
+
visit2.parentCollection = (cst, path98) => {
|
|
8721
|
+
const parent = visit2.itemAtPath(cst, path98.slice(0, -1));
|
|
8722
|
+
const field = path98[path98.length - 1][0];
|
|
8723
8723
|
const coll = parent?.[field];
|
|
8724
8724
|
if (coll && "items" in coll)
|
|
8725
8725
|
return coll;
|
|
@@ -10026,14 +10026,14 @@ var init_parser = __esm({
|
|
|
10026
10026
|
case "scalar":
|
|
10027
10027
|
case "single-quoted-scalar":
|
|
10028
10028
|
case "double-quoted-scalar": {
|
|
10029
|
-
const
|
|
10029
|
+
const fs75 = this.flowScalar(this.type);
|
|
10030
10030
|
if (atNextItem || it.value) {
|
|
10031
|
-
map2.items.push({ start, key:
|
|
10031
|
+
map2.items.push({ start, key: fs75, sep: [] });
|
|
10032
10032
|
this.onKeyLine = true;
|
|
10033
10033
|
} else if (it.sep) {
|
|
10034
|
-
this.stack.push(
|
|
10034
|
+
this.stack.push(fs75);
|
|
10035
10035
|
} else {
|
|
10036
|
-
Object.assign(it, { key:
|
|
10036
|
+
Object.assign(it, { key: fs75, sep: [] });
|
|
10037
10037
|
this.onKeyLine = true;
|
|
10038
10038
|
}
|
|
10039
10039
|
return;
|
|
@@ -10161,13 +10161,13 @@ var init_parser = __esm({
|
|
|
10161
10161
|
case "scalar":
|
|
10162
10162
|
case "single-quoted-scalar":
|
|
10163
10163
|
case "double-quoted-scalar": {
|
|
10164
|
-
const
|
|
10164
|
+
const fs75 = this.flowScalar(this.type);
|
|
10165
10165
|
if (!it || it.value)
|
|
10166
|
-
fc.items.push({ start: [], key:
|
|
10166
|
+
fc.items.push({ start: [], key: fs75, sep: [] });
|
|
10167
10167
|
else if (it.sep)
|
|
10168
|
-
this.stack.push(
|
|
10168
|
+
this.stack.push(fs75);
|
|
10169
10169
|
else
|
|
10170
|
-
Object.assign(it, { key:
|
|
10170
|
+
Object.assign(it, { key: fs75, sep: [] });
|
|
10171
10171
|
return;
|
|
10172
10172
|
}
|
|
10173
10173
|
case "flow-map-end":
|
|
@@ -10577,8 +10577,8 @@ function metadataValue(value, key2) {
|
|
|
10577
10577
|
if (!value || typeof value !== "object") return void 0;
|
|
10578
10578
|
return Object.getOwnPropertyDescriptor(value, key2)?.value;
|
|
10579
10579
|
}
|
|
10580
|
-
function readProjectJson(
|
|
10581
|
-
const text6 = readProjectMetadata(
|
|
10580
|
+
function readProjectJson(path98, files2 = nodeRepoFileReader) {
|
|
10581
|
+
const text6 = readProjectMetadata(path98, files2);
|
|
10582
10582
|
if (text6 === null) return null;
|
|
10583
10583
|
try {
|
|
10584
10584
|
const value = JSON.parse(text6);
|
|
@@ -11294,8 +11294,8 @@ export *
|
|
|
11294
11294
|
}`;
|
|
11295
11295
|
}
|
|
11296
11296
|
function swiftPackageIdentity(url) {
|
|
11297
|
-
const
|
|
11298
|
-
return (
|
|
11297
|
+
const path98 = url.endsWith("/") ? url.slice(0, -1) : url;
|
|
11298
|
+
return (path98.split("/").pop() ?? path98).replace(/\.git$/, "").toLowerCase();
|
|
11299
11299
|
}
|
|
11300
11300
|
function clangSettingEntries(settings, tool) {
|
|
11301
11301
|
return (settings ?? []).flatMap(
|
|
@@ -11996,14 +11996,14 @@ function addAsset(into, asset) {
|
|
|
11996
11996
|
function checkStack(dir, type, devices) {
|
|
11997
11997
|
const sets = (parent, allowed) => (0, import_node_fs17.readdirSync)(parent, { withFileTypes: true }).flatMap((entry) => {
|
|
11998
11998
|
if (entry.name.startsWith(".") || entry.isFile()) return [];
|
|
11999
|
-
const
|
|
11999
|
+
const path98 = (0, import_node_path15.join)(parent, entry.name);
|
|
12000
12000
|
const extension = (0, import_node_path15.extname)(entry.name);
|
|
12001
12001
|
if (!entry.isDirectory() || !allowed.includes(extension))
|
|
12002
12002
|
return refuse(
|
|
12003
|
-
|
|
12003
|
+
path98,
|
|
12004
12004
|
`image stack content other than ${allowed.join(", ")} is unproven`
|
|
12005
12005
|
);
|
|
12006
|
-
return [{ path:
|
|
12006
|
+
return [{ path: path98, extension }];
|
|
12007
12007
|
});
|
|
12008
12008
|
for (const layer of sets(dir, [`.${type}layer`, ".imageset", ".colorset"])) {
|
|
12009
12009
|
if (layer.extension !== `.${type}layer`) continue;
|
|
@@ -12015,37 +12015,37 @@ function checkStack(dir, type, devices) {
|
|
|
12015
12015
|
function walk(dir, into, devices, extensions) {
|
|
12016
12016
|
for (const entry of (0, import_node_fs17.readdirSync)(dir, { withFileTypes: true })) {
|
|
12017
12017
|
if (entry.name.startsWith(".") || entry.isFile()) continue;
|
|
12018
|
-
const
|
|
12019
|
-
if (!entry.isDirectory()) return refuse(
|
|
12018
|
+
const path98 = (0, import_node_path15.join)(dir, entry.name);
|
|
12019
|
+
if (!entry.isDirectory()) return refuse(path98, "it is neither a file nor a directory");
|
|
12020
12020
|
const extension = (0, import_node_path15.extname)(entry.name).slice(1);
|
|
12021
12021
|
const type = extension.toLowerCase();
|
|
12022
12022
|
const base = entry.name.slice(0, entry.name.length - extension.length - 1);
|
|
12023
12023
|
if (type !== extension && knownTypes.has(type))
|
|
12024
|
-
return refuse(
|
|
12024
|
+
return refuse(path98, "its type extension is not lowercase");
|
|
12025
12025
|
if (type === "colorset" || type === "imageset" || type === "symbolset") {
|
|
12026
12026
|
addAsset(into, {
|
|
12027
12027
|
kind: type === "colorset" ? "color" : "image",
|
|
12028
12028
|
name: base,
|
|
12029
|
-
...assetState(
|
|
12029
|
+
...assetState(path98, type, devices),
|
|
12030
12030
|
extensions,
|
|
12031
|
-
source:
|
|
12031
|
+
source: path98
|
|
12032
12032
|
});
|
|
12033
12033
|
continue;
|
|
12034
12034
|
}
|
|
12035
12035
|
if (silentTypes.has(type)) continue;
|
|
12036
12036
|
if (stackTypes.has(type)) {
|
|
12037
|
-
checkStack(
|
|
12037
|
+
checkStack(path98, type, devices);
|
|
12038
12038
|
continue;
|
|
12039
12039
|
}
|
|
12040
|
-
if (unprovenTypes.has(type)) return refuse(
|
|
12040
|
+
if (unprovenTypes.has(type)) return refuse(path98, `${type} assets are unproven`);
|
|
12041
12041
|
const name3 = type === "spriteatlas" ? base : entry.name;
|
|
12042
|
-
if (!folderProperties((0, import_node_path15.join)(
|
|
12043
|
-
walk(
|
|
12042
|
+
if (!folderProperties((0, import_node_path15.join)(path98, "Contents.json")).namespace) {
|
|
12043
|
+
walk(path98, into, devices, extensions);
|
|
12044
12044
|
continue;
|
|
12045
12045
|
}
|
|
12046
|
-
const child = into.namespaces.get(name3) ?? scope(
|
|
12046
|
+
const child = into.namespaces.get(name3) ?? scope(path98);
|
|
12047
12047
|
into.namespaces.set(name3, child);
|
|
12048
|
-
walk(
|
|
12048
|
+
walk(path98, child, devices, extensions);
|
|
12049
12049
|
}
|
|
12050
12050
|
}
|
|
12051
12051
|
function words(name3) {
|
|
@@ -12092,11 +12092,11 @@ function members(into, kind, prefix, extensions) {
|
|
|
12092
12092
|
const assets2 = /* @__PURE__ */ new Set();
|
|
12093
12093
|
const out = [];
|
|
12094
12094
|
for (const entry of entries) {
|
|
12095
|
-
const
|
|
12095
|
+
const path98 = `${prefix}${entry.name}`;
|
|
12096
12096
|
const source = entry.child ? entry.child.source : entry.asset.source;
|
|
12097
12097
|
if (Array.from(entry.name).some((char) => char.charCodeAt(0) > 127))
|
|
12098
12098
|
refuse(source, "its name is not ASCII");
|
|
12099
|
-
const named = (text7) => `The \\"${escape(
|
|
12099
|
+
const named = (text7) => `The \\"${escape(path98)}\\" ${text7}`;
|
|
12100
12100
|
if (entry.child) {
|
|
12101
12101
|
const text7 = symbol(entry.name, true);
|
|
12102
12102
|
if (!text7)
|
|
@@ -12119,9 +12119,9 @@ function members(into, kind, prefix, extensions) {
|
|
|
12119
12119
|
namespaces.add(text7);
|
|
12120
12120
|
out.push({
|
|
12121
12121
|
type: "namespace",
|
|
12122
|
-
path:
|
|
12122
|
+
path: path98,
|
|
12123
12123
|
symbol: spelled(text7),
|
|
12124
|
-
members: members(entry.child, kind, `${
|
|
12124
|
+
members: members(entry.child, kind, `${path98}/`, extensions)
|
|
12125
12125
|
});
|
|
12126
12126
|
}
|
|
12127
12127
|
continue;
|
|
@@ -12148,7 +12148,7 @@ function members(into, kind, prefix, extensions) {
|
|
|
12148
12148
|
else if (!omitted)
|
|
12149
12149
|
out.push({
|
|
12150
12150
|
type: "asset",
|
|
12151
|
-
path:
|
|
12151
|
+
path: path98,
|
|
12152
12152
|
name: entry.name,
|
|
12153
12153
|
symbol: spelled(text6),
|
|
12154
12154
|
thinnable: asset.thinnable,
|
|
@@ -12430,8 +12430,8 @@ var init_xcode_asset_symbols = __esm({
|
|
|
12430
12430
|
import_node_path15 = require("node:path");
|
|
12431
12431
|
Refusal = class extends Error {
|
|
12432
12432
|
};
|
|
12433
|
-
refuse = (
|
|
12434
|
-
throw new Refusal(`Generated asset symbols are unproven for ${
|
|
12433
|
+
refuse = (path98, reason) => {
|
|
12434
|
+
throw new Refusal(`Generated asset symbols are unproven for ${path98}: ${reason}`);
|
|
12435
12435
|
};
|
|
12436
12436
|
isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12437
12437
|
scope = (source) => ({
|
|
@@ -12877,11 +12877,11 @@ function catalogDigest(directory2) {
|
|
|
12877
12877
|
for (const entry of (0, import_node_fs18.readdirSync)(dir, { withFileTypes: true }).sort(
|
|
12878
12878
|
(a, b) => a.name.localeCompare(b.name)
|
|
12879
12879
|
)) {
|
|
12880
|
-
const
|
|
12881
|
-
if (entry.isDirectory()) walk3(
|
|
12882
|
-
else if (entry.isFile() && (0, import_node_fs18.statSync)(
|
|
12883
|
-
hashes.push([(0, import_node_path16.relative)(directory2,
|
|
12884
|
-
else throw new Error(`Unsupported asset catalog entry: ${
|
|
12880
|
+
const path98 = (0, import_node_path16.join)(dir, entry.name);
|
|
12881
|
+
if (entry.isDirectory()) walk3(path98);
|
|
12882
|
+
else if (entry.isFile() && (0, import_node_fs18.statSync)(path98).size <= 64 * 1024 * 1024)
|
|
12883
|
+
hashes.push([(0, import_node_path16.relative)(directory2, path98), sha2562((0, import_node_fs18.readFileSync)(path98))]);
|
|
12884
|
+
else throw new Error(`Unsupported asset catalog entry: ${path98}`);
|
|
12885
12885
|
}
|
|
12886
12886
|
};
|
|
12887
12887
|
walk3(directory2);
|
|
@@ -12892,7 +12892,7 @@ function symbolSource(plan, root) {
|
|
|
12892
12892
|
const known = symbolTexts.get(key2);
|
|
12893
12893
|
if (known !== void 0) return { status: "source", text: known };
|
|
12894
12894
|
const source = assetSymbolSource(
|
|
12895
|
-
plan.catalogs.map(({ path:
|
|
12895
|
+
plan.catalogs.map(({ path: path98 }) => (0, import_node_path16.join)(root, path98)),
|
|
12896
12896
|
plan.settings
|
|
12897
12897
|
);
|
|
12898
12898
|
if (source.status === "source") symbolTexts.set(key2, source.text);
|
|
@@ -12950,9 +12950,9 @@ function planAssetSymbols(resources, root, settings) {
|
|
|
12950
12950
|
`Generated asset symbols are proven only for TARGETED_DEVICE_FAMILY 1, 2, 1,2, 1,7, 1,2,6 or 1,2,7; this target resolves to "${families}".`
|
|
12951
12951
|
);
|
|
12952
12952
|
const plan = {
|
|
12953
|
-
catalogs: catalogs.map((
|
|
12954
|
-
path:
|
|
12955
|
-
sha256: catalogDigest((0, import_node_path16.join)(root,
|
|
12953
|
+
catalogs: catalogs.map((path98) => ({
|
|
12954
|
+
path: path98,
|
|
12955
|
+
sha256: catalogDigest((0, import_node_path16.join)(root, path98))
|
|
12956
12956
|
})),
|
|
12957
12957
|
settings: { deployment: target, devices, extensions: extensions === "YES" }
|
|
12958
12958
|
};
|
|
@@ -15985,10 +15985,10 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
15985
15985
|
const enclosing = scopes.length > 0 ? scopes[scopes.length - 1].prefix : [];
|
|
15986
15986
|
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] !== "<") {
|
|
15987
15987
|
const name3 = scope2[4];
|
|
15988
|
-
const
|
|
15989
|
-
if (!byPath.has(
|
|
15988
|
+
const path98 = scopeOf(name3, enclosing, false);
|
|
15989
|
+
if (!byPath.has(path98.join(".")) && (path98.length === 1 || byPath.has(path98.slice(0, -1).join(".")))) {
|
|
15990
15990
|
const keptAttrs = [...(scope2[1] ?? "").matchAll(/@\w+(?:\([^)]*\))?/g)].map((attr) => attr[0]).filter((attr) => !attr.startsWith("@objc"));
|
|
15991
|
-
const id = `s:peach-synthesized-${module2}-${
|
|
15991
|
+
const id = `s:peach-synthesized-${module2}-${path98.join(".")}`;
|
|
15992
15992
|
const body = [];
|
|
15993
15993
|
let inner = 1;
|
|
15994
15994
|
let closed = false;
|
|
@@ -16043,15 +16043,15 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
16043
16043
|
symbols.push({
|
|
16044
16044
|
kind: { identifier: "swift.enum" },
|
|
16045
16045
|
identifier: { precise: id },
|
|
16046
|
-
pathComponents:
|
|
16046
|
+
pathComponents: path98,
|
|
16047
16047
|
declarationFragments: fragments,
|
|
16048
16048
|
accessLevel: "public"
|
|
16049
16049
|
});
|
|
16050
|
-
if (
|
|
16050
|
+
if (path98.length > 1)
|
|
16051
16051
|
relationships.push({
|
|
16052
16052
|
kind: "memberOf",
|
|
16053
16053
|
source: id,
|
|
16054
|
-
target: byPath.get(
|
|
16054
|
+
target: byPath.get(path98.slice(0, -1).join("."))
|
|
16055
16055
|
});
|
|
16056
16056
|
for (const kase of cases) {
|
|
16057
16057
|
const memberId = `${id}-${kase.leaf}`;
|
|
@@ -16060,7 +16060,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
16060
16060
|
symbols.push({
|
|
16061
16061
|
kind: { identifier: "swift.enum.case" },
|
|
16062
16062
|
identifier: { precise: memberId },
|
|
16063
|
-
pathComponents: [...
|
|
16063
|
+
pathComponents: [...path98, kase.leaf],
|
|
16064
16064
|
declarationFragments: [
|
|
16065
16065
|
{ kind: "keyword", spelling: "case" },
|
|
16066
16066
|
{ kind: "text", spelling: " " },
|
|
@@ -16076,7 +16076,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
16076
16076
|
symbols.push({
|
|
16077
16077
|
kind: { identifier: "swift.init" },
|
|
16078
16078
|
identifier: { precise: initId },
|
|
16079
|
-
pathComponents: [...
|
|
16079
|
+
pathComponents: [...path98, "init(rawValue:)"],
|
|
16080
16080
|
declarationFragments: [
|
|
16081
16081
|
{ kind: "keyword", spelling: "init" },
|
|
16082
16082
|
{ kind: "text", spelling: "?(" },
|
|
@@ -16145,7 +16145,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16145
16145
|
})
|
|
16146
16146
|
)
|
|
16147
16147
|
);
|
|
16148
|
-
const trap = (
|
|
16148
|
+
const trap = (path98) => `fatalError("${path98} is ${options.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
|
|
16149
16149
|
const skipped = [];
|
|
16150
16150
|
const behavior = options.behavior ?? /* @__PURE__ */ new Map();
|
|
16151
16151
|
const used = /* @__PURE__ */ new Set();
|
|
@@ -16495,34 +16495,34 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16495
16495
|
lines.push(...physical);
|
|
16496
16496
|
owners.push(...physical.map(() => current2));
|
|
16497
16497
|
};
|
|
16498
|
-
const emitAt = (
|
|
16499
|
-
if (omit.has(
|
|
16498
|
+
const emitAt = (path98, line) => {
|
|
16499
|
+
if (omit.has(path98)) return;
|
|
16500
16500
|
const previous = current2;
|
|
16501
|
-
current2 =
|
|
16501
|
+
current2 = path98;
|
|
16502
16502
|
emit(line);
|
|
16503
16503
|
current2 = previous;
|
|
16504
16504
|
};
|
|
16505
16505
|
const emitInertState = (id, indent2, build) => {
|
|
16506
|
-
const
|
|
16506
|
+
const path98 = pathOf(byId.get(id));
|
|
16507
16507
|
emitAt(hiddenInit(id), `${indent2}init(_peachInert: Void) { ${build} }`);
|
|
16508
16508
|
const list2 = conforms.get(id) ?? [];
|
|
16509
16509
|
const has = (name3) => (children.get(id) ?? []).some((member) => leaf(member) === name3);
|
|
16510
16510
|
if (list2.includes("Encodable") && !has("encode(to:)"))
|
|
16511
16511
|
emitAt(
|
|
16512
|
-
`${
|
|
16512
|
+
`${path98}.encode(to:)`,
|
|
16513
16513
|
`${indent2}public func encode(to encoder: Encoder) throws {}`
|
|
16514
16514
|
);
|
|
16515
16515
|
if (list2.includes("Decodable") && !has("init(from:)"))
|
|
16516
16516
|
emitAt(
|
|
16517
|
-
`${
|
|
16517
|
+
`${path98}.init(from:)`,
|
|
16518
16518
|
`${indent2}public init(from decoder: Decoder) throws { self.init(_peachInert: ()) }`
|
|
16519
16519
|
);
|
|
16520
16520
|
};
|
|
16521
16521
|
const scoped = (body) => (symbol2, ...rest) => {
|
|
16522
|
-
const
|
|
16523
|
-
if (omit.has(
|
|
16522
|
+
const path98 = pathOf(symbol2);
|
|
16523
|
+
if (omit.has(path98)) return void skipped.push({ path: path98, reason: omit.get(path98) });
|
|
16524
16524
|
const previous = current2;
|
|
16525
|
-
current2 =
|
|
16525
|
+
current2 = path98;
|
|
16526
16526
|
try {
|
|
16527
16527
|
body(symbol2, ...rest);
|
|
16528
16528
|
} finally {
|
|
@@ -16554,7 +16554,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16554
16554
|
};
|
|
16555
16555
|
const emitMember = scoped(
|
|
16556
16556
|
(member, indent2, context) => {
|
|
16557
|
-
const
|
|
16557
|
+
const path98 = pathOf(member);
|
|
16558
16558
|
if (TYPE_KINDS.has(member.kind.identifier)) {
|
|
16559
16559
|
const origin = origins.get(member.identifier.precise)?.split(".")[0];
|
|
16560
16560
|
const parent = owner.get(member.identifier.precise);
|
|
@@ -16571,7 +16571,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16571
16571
|
))
|
|
16572
16572
|
return;
|
|
16573
16573
|
if (!MEMBER_KINDS.has(member.kind.identifier)) {
|
|
16574
|
-
skipped.push({ path:
|
|
16574
|
+
skipped.push({ path: path98, reason: `unhandled ${member.kind.identifier}` });
|
|
16575
16575
|
return;
|
|
16576
16576
|
}
|
|
16577
16577
|
const { 1: spelledAttrs, 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
@@ -16579,27 +16579,27 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16579
16579
|
/@(\w+)(?:\([^)]*\))?\s*/g,
|
|
16580
16580
|
(attr, name3) => typeByPath.has(name3) ? "" : attr
|
|
16581
16581
|
) : spelledAttrs;
|
|
16582
|
-
const attrs = options.unobjc?.has(
|
|
16582
|
+
const attrs = options.unobjc?.has(path98) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : wrapped;
|
|
16583
16583
|
const modifiers = /^((?:(?:required|final|override|convenience|unowned(?:\(\w+\))?|weak|lazy|nonisolated|mutating|nonmutating) )*)(.*)$/s.exec(
|
|
16584
16584
|
rest
|
|
16585
16585
|
);
|
|
16586
16586
|
const flags = new Set(
|
|
16587
16587
|
modifiers[1].trim().split(/\s+/).filter(Boolean).map((flag) => flag.replace(/\(.*/, ""))
|
|
16588
16588
|
);
|
|
16589
|
-
const requiredInit = context.inClass && !!options.requiredInits?.has(
|
|
16590
|
-
const restatesRequired = context.inClass &&
|
|
16589
|
+
const requiredInit = context.inClass && !!options.requiredInits?.has(path98);
|
|
16590
|
+
const restatesRequired = context.inClass && path98.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
|
|
16591
16591
|
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
16592
16592
|
);
|
|
16593
16593
|
const required = context.inClass && (flags.has("required") || requiredInit || restatesRequired);
|
|
16594
16594
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
16595
16595
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
16596
16596
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
16597
|
-
const override = context.inClass && !options.plain?.has(
|
|
16597
|
+
const override = context.inClass && !options.plain?.has(path98) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path98) || isObjC(member) && path98.endsWith(".init()")) ? "override " : "";
|
|
16598
16598
|
const head = `${indent2}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
16599
|
-
const measured = behavior.get(
|
|
16600
|
-
if (measured) used.add(
|
|
16599
|
+
const measured = behavior.get(path98);
|
|
16600
|
+
if (measured) used.add(path98);
|
|
16601
16601
|
const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
|
|
16602
|
-
const body = overloadBody ?? measured?.body ?? (options.inert ? inertBody(member) : trap(
|
|
16602
|
+
const body = overloadBody ?? measured?.body ?? (options.inert ? inertBody(member) : trap(path98));
|
|
16603
16603
|
switch (member.kind.identifier) {
|
|
16604
16604
|
case "swift.property":
|
|
16605
16605
|
case "swift.type.property":
|
|
@@ -16612,13 +16612,13 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16612
16612
|
const parameter = !measured && !options.inert && !settable && /:\s*some\s/.test(decl) ? opaqueParameter(member) : void 0;
|
|
16613
16613
|
const getter = parameter ? `return ({ () -> ${parameter} in ${body} })()` : body;
|
|
16614
16614
|
const computed = decl.replace(/^((?:static |class )*)let /, "$1var ");
|
|
16615
|
-
const wrapper = options.projections?.get(
|
|
16615
|
+
const wrapper = options.projections?.get(path98);
|
|
16616
16616
|
if (wrapper) {
|
|
16617
16617
|
const type = /^var\s+`?\w+`?\s*:\s*(.+)$/s.exec(computed)?.[1];
|
|
16618
|
-
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [
|
|
16618
|
+
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path98]);
|
|
16619
16619
|
if (!initial)
|
|
16620
16620
|
return void skipped.push({
|
|
16621
|
-
path:
|
|
16621
|
+
path: path98,
|
|
16622
16622
|
reason: `wrapped by ${wrapper} with no inert initial value`
|
|
16623
16623
|
});
|
|
16624
16624
|
const own = new RegExp(
|
|
@@ -16639,7 +16639,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16639
16639
|
return;
|
|
16640
16640
|
}
|
|
16641
16641
|
emit(
|
|
16642
|
-
`${head}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options.inert ? "" : trap(
|
|
16642
|
+
`${head}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options.inert ? "" : trap(path98))} }` : ""} }`
|
|
16643
16643
|
);
|
|
16644
16644
|
return;
|
|
16645
16645
|
}
|
|
@@ -16698,7 +16698,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16698
16698
|
};
|
|
16699
16699
|
const emitType = scoped(
|
|
16700
16700
|
(symbol2, indent2) => {
|
|
16701
|
-
const
|
|
16701
|
+
const path98 = pathOf(symbol2);
|
|
16702
16702
|
const id = symbol2.identifier.precise;
|
|
16703
16703
|
const inner = `${indent2} `;
|
|
16704
16704
|
switch (symbol2.kind.identifier) {
|
|
@@ -16715,10 +16715,10 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16715
16715
|
case "swift.class": {
|
|
16716
16716
|
const shape = header(symbol2, "class", indent2);
|
|
16717
16717
|
if (!shape)
|
|
16718
|
-
return void skipped.push({ path:
|
|
16719
|
-
const parent = options.superclasses?.get(
|
|
16718
|
+
return void skipped.push({ path: path98, reason: `unparsed class ${text(symbol2)}` });
|
|
16719
|
+
const parent = options.superclasses?.get(path98) ?? superclass.get(id);
|
|
16720
16720
|
const blocked = classBlocked(id);
|
|
16721
|
-
if (blocked) return void skipped.push({ path:
|
|
16721
|
+
if (blocked) return void skipped.push({ path: path98, reason: blocked });
|
|
16722
16722
|
const ancestors = /* @__PURE__ */ new Set();
|
|
16723
16723
|
const inherited = /* @__PURE__ */ new Set();
|
|
16724
16724
|
for (let at = superId.get(id); at; at = superId.get(at)) {
|
|
@@ -16734,7 +16734,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16734
16734
|
"Equatable",
|
|
16735
16735
|
"CustomStringConvertible",
|
|
16736
16736
|
"CustomDebugStringConvertible"
|
|
16737
|
-
].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(
|
|
16737
|
+
].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(path98)?.has(name3)
|
|
16738
16738
|
)
|
|
16739
16739
|
].filter((name3, at, all2) => all2.indexOf(name3) === at);
|
|
16740
16740
|
const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
|
|
@@ -16746,9 +16746,9 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16746
16746
|
`${indent2}${shape.attrs}${objcName ? `@objc(${objcName}) ` : ""}${shape.final}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
|
|
16747
16747
|
);
|
|
16748
16748
|
const members2 = membersOf(id);
|
|
16749
|
-
const extra = options.behavior?.get(
|
|
16749
|
+
const extra = options.behavior?.get(path98)?.members;
|
|
16750
16750
|
if (extra) {
|
|
16751
|
-
used.add(
|
|
16751
|
+
used.add(path98);
|
|
16752
16752
|
emit(`${inner}${extra}`);
|
|
16753
16753
|
}
|
|
16754
16754
|
for (const member of members2)
|
|
@@ -16804,11 +16804,11 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16804
16804
|
if (protocol && member.kind.identifier === "swift.method" && leaf(member).endsWith("()") && have.has(`instance|leaf|${leaf(member).slice(0, -2)}`))
|
|
16805
16805
|
propertyWitnesses.push({
|
|
16806
16806
|
owner: current2,
|
|
16807
|
-
head: `extension ${pathOf(protocol)} where Self: ${
|
|
16807
|
+
head: `extension ${pathOf(protocol)} where Self: ${path98} {`,
|
|
16808
16808
|
member,
|
|
16809
|
-
path:
|
|
16809
|
+
path: path98
|
|
16810
16810
|
});
|
|
16811
|
-
else emitWitness(member, inner,
|
|
16811
|
+
else emitWitness(member, inner, path98, open && isObjC(member));
|
|
16812
16812
|
}
|
|
16813
16813
|
}
|
|
16814
16814
|
if (options.inert && designated2 && classBuild(id) === "hidden")
|
|
@@ -16816,13 +16816,13 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16816
16816
|
const coder = members2.some((member) => leaf(member) === "init(coder:)");
|
|
16817
16817
|
if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
16818
16818
|
emit(
|
|
16819
|
-
`${inner}public required init?(coder: NSCoder) { ${options.inert ? "return nil" : trap(`${
|
|
16819
|
+
`${inner}public required init?(coder: NSCoder) { ${options.inert ? "return nil" : trap(`${path98}.init(coder:)`)} }`
|
|
16820
16820
|
);
|
|
16821
16821
|
if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
|
|
16822
16822
|
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
16823
16823
|
))
|
|
16824
16824
|
emit(
|
|
16825
|
-
`${inner}public required init() { ${options.inert ? superInit(id) : trap(`${
|
|
16825
|
+
`${inner}public required init() { ${options.inert ? superInit(id) : trap(`${path98}.init()`)} }`
|
|
16826
16826
|
);
|
|
16827
16827
|
emit(`${indent2}}`);
|
|
16828
16828
|
return;
|
|
@@ -16830,7 +16830,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16830
16830
|
case "swift.struct": {
|
|
16831
16831
|
const shape = header(symbol2, "struct", indent2);
|
|
16832
16832
|
if (!shape)
|
|
16833
|
-
return void skipped.push({ path:
|
|
16833
|
+
return void skipped.push({ path: path98, reason: `unparsed struct ${text(symbol2)}` });
|
|
16834
16834
|
const members2 = membersOf(id);
|
|
16835
16835
|
const raw2 = rawType(members2);
|
|
16836
16836
|
const list2 = inheritance(id);
|
|
@@ -16871,7 +16871,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16871
16871
|
emitInertState(
|
|
16872
16872
|
id,
|
|
16873
16873
|
inner,
|
|
16874
|
-
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [
|
|
16874
|
+
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path98]) ?? "0"}` : ""
|
|
16875
16875
|
);
|
|
16876
16876
|
emit(`${indent2}}`);
|
|
16877
16877
|
return;
|
|
@@ -16879,7 +16879,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16879
16879
|
case "swift.enum": {
|
|
16880
16880
|
const shape = header(symbol2, "enum", indent2);
|
|
16881
16881
|
if (!shape)
|
|
16882
|
-
return void skipped.push({ path:
|
|
16882
|
+
return void skipped.push({ path: path98, reason: `unparsed enum ${text(symbol2)}` });
|
|
16883
16883
|
const members2 = membersOf(id);
|
|
16884
16884
|
const cases = members2.filter(
|
|
16885
16885
|
(member) => member.kind.identifier === "swift.enum.case"
|
|
@@ -16889,7 +16889,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16889
16889
|
const missing2 = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
|
|
16890
16890
|
if (raw2 && (isObjC(symbol2) || /^c:@C?M@[^@]+@E@/.test(id)) && missing2.length > 0)
|
|
16891
16891
|
return void skipped.push({
|
|
16892
|
-
path:
|
|
16892
|
+
path: path98,
|
|
16893
16893
|
reason: `no header value for ${missing2.map(leaf).join(", ")}`
|
|
16894
16894
|
});
|
|
16895
16895
|
const list2 = inheritance(id, raw2 ?? void 0).filter(
|
|
@@ -16929,8 +16929,8 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16929
16929
|
});
|
|
16930
16930
|
}
|
|
16931
16931
|
if (options.inert) {
|
|
16932
|
-
const value = options.trapped?.has(hiddenInit(id)) ? null : inertValue(
|
|
16933
|
-
emitInertState(id, inner, value === null ? trap(
|
|
16932
|
+
const value = options.trapped?.has(hiddenInit(id)) ? null : inertValue(path98, /* @__PURE__ */ new Set(), []);
|
|
16933
|
+
emitInertState(id, inner, value === null ? trap(path98) : `self = ${value}`);
|
|
16934
16934
|
}
|
|
16935
16935
|
emit(`${indent2}}`);
|
|
16936
16936
|
return;
|
|
@@ -16939,14 +16939,14 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16939
16939
|
const shape = header(symbol2, "protocol", indent2);
|
|
16940
16940
|
if (!shape)
|
|
16941
16941
|
return void skipped.push({
|
|
16942
|
-
path:
|
|
16942
|
+
path: path98,
|
|
16943
16943
|
reason: `unparsed protocol ${text(symbol2)}`
|
|
16944
16944
|
});
|
|
16945
16945
|
const native = nativeObjcProtocols.has(id);
|
|
16946
16946
|
const objcName = native ? /^c:objc\(pl\)(\w+)$/.exec(id)?.[1] : void 0;
|
|
16947
16947
|
if (native && !objcName)
|
|
16948
16948
|
return void skipped.push({
|
|
16949
|
-
path:
|
|
16949
|
+
path: path98,
|
|
16950
16950
|
reason: `unknown Objective-C protocol identity ${id}`
|
|
16951
16951
|
});
|
|
16952
16952
|
const list2 = [
|
|
@@ -16974,7 +16974,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
16974
16974
|
}
|
|
16975
16975
|
emit(`${indent2}}`);
|
|
16976
16976
|
if (defaults.length > 0) {
|
|
16977
|
-
emit(`${indent2}extension ${
|
|
16977
|
+
emit(`${indent2}extension ${path98} {`);
|
|
16978
16978
|
for (const member of defaults) {
|
|
16979
16979
|
const decl = text(member);
|
|
16980
16980
|
if (optional3.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
|
|
@@ -17066,7 +17066,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
17066
17066
|
};
|
|
17067
17067
|
const atWidth = (value, raw2) => (raw2 === "UInt" || raw2 === "Swift.UInt") && value === "18446744073709551615" ? "4294967295" : (raw2 === "Int" || raw2 === "Swift.Int") && value === "9223372036854775807" ? "2147483647" : (raw2 === "Int" || raw2 === "Swift.Int") && value === "-9223372036854775808" ? "-2147483648" : value;
|
|
17068
17068
|
const emitGlobal = scoped((symbol2) => {
|
|
17069
|
-
const
|
|
17069
|
+
const path98 = pathOf(symbol2);
|
|
17070
17070
|
const kind = symbol2.kind.identifier;
|
|
17071
17071
|
if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
|
|
17072
17072
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol2));
|
|
@@ -17075,20 +17075,20 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
17075
17075
|
if (leaf(symbol2).endsWith("(_:)") && !/^(?:prefix|infix|postfix)\b/.test(spelled2))
|
|
17076
17076
|
spelled2 = `prefix ${spelled2}`;
|
|
17077
17077
|
}
|
|
17078
|
-
const measured = behavior.get(
|
|
17079
|
-
if (measured) used.add(
|
|
17078
|
+
const measured = behavior.get(path98);
|
|
17079
|
+
if (measured) used.add(path98);
|
|
17080
17080
|
const overloadBody = /\basync\b/.test(spelled2) ? measured?.asyncBody : /\bResult</.test(spelled2) ? measured?.resultBody : void 0;
|
|
17081
17081
|
emit(
|
|
17082
|
-
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options.inert ? inertBody(symbol2) : trap(
|
|
17082
|
+
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path98))} }`
|
|
17083
17083
|
);
|
|
17084
17084
|
} else if (kind === "swift.var") {
|
|
17085
17085
|
const parsed = splitAccessors(text(symbol2).replace(/^let /, "var "));
|
|
17086
|
-
const measured = behavior.get(
|
|
17087
|
-
if (measured) used.add(
|
|
17086
|
+
const measured = behavior.get(path98);
|
|
17087
|
+
if (measured) used.add(path98);
|
|
17088
17088
|
emit(
|
|
17089
|
-
`public ${parsed.decl} { ${measured?.body ?? (options.inert ? inertBody(symbol2) : trap(
|
|
17089
|
+
`public ${parsed.decl} { ${measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path98))} }`
|
|
17090
17090
|
);
|
|
17091
|
-
} else skipped.push({ path:
|
|
17091
|
+
} else skipped.push({ path: path98, reason: `unhandled top-level ${kind}` });
|
|
17092
17092
|
});
|
|
17093
17093
|
const cExports = new Set(
|
|
17094
17094
|
[...byId.values()].flatMap((symbol2) => {
|
|
@@ -17105,7 +17105,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
17105
17105
|
return !name3 || !cExports.has(`${name3}|${text(symbol2)}`);
|
|
17106
17106
|
}).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
|
|
17107
17107
|
for (const symbol2 of roots) {
|
|
17108
|
-
const
|
|
17108
|
+
const path98 = pathOf(symbol2);
|
|
17109
17109
|
if (TYPE_KINDS.has(symbol2.kind.identifier)) emitType(symbol2, "");
|
|
17110
17110
|
else emitGlobal(symbol2);
|
|
17111
17111
|
}
|
|
@@ -17166,9 +17166,9 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
17166
17166
|
"#endif",
|
|
17167
17167
|
""
|
|
17168
17168
|
];
|
|
17169
|
-
for (const
|
|
17170
|
-
if (!used.has(
|
|
17171
|
-
skipped.push({ path:
|
|
17169
|
+
for (const path98 of behavior.keys())
|
|
17170
|
+
if (!used.has(path98))
|
|
17171
|
+
skipped.push({ path: path98, reason: "behavior names no emitted declaration" });
|
|
17172
17172
|
return {
|
|
17173
17173
|
source: `${[...banner, ...lines].join("\n")}
|
|
17174
17174
|
`,
|
|
@@ -19365,9 +19365,9 @@ function originalColumn(line, column) {
|
|
|
19365
19365
|
}
|
|
19366
19366
|
function designTimeDiagnostic(output2, files2) {
|
|
19367
19367
|
const rewritten = /* @__PURE__ */ new Map();
|
|
19368
|
-
const linesOf = (
|
|
19368
|
+
const linesOf = (path98) => {
|
|
19369
19369
|
const file = Object.keys(files2).find(
|
|
19370
|
-
(name3) => name3.endsWith(".swift") && (
|
|
19370
|
+
(name3) => name3.endsWith(".swift") && (path98 === name3 || path98.endsWith(`/${name3}`))
|
|
19371
19371
|
);
|
|
19372
19372
|
if (file === void 0) return null;
|
|
19373
19373
|
let lines = rewritten.get(file);
|
|
@@ -38887,7 +38887,7 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
|
|
|
38887
38887
|
expoModule: moduleDir ? (0, import_node_path60.relative)(appDir, moduleDir) || "." : null,
|
|
38888
38888
|
optional: optional3,
|
|
38889
38889
|
swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
|
|
38890
|
-
(
|
|
38890
|
+
(path98) => path98.endsWith(".swift") && [...(readSmallFile(path98) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
|
|
38891
38891
|
(match) => match[1] === name3
|
|
38892
38892
|
)
|
|
38893
38893
|
) : false,
|
|
@@ -40047,8 +40047,8 @@ function imagesetFiles(images) {
|
|
|
40047
40047
|
];
|
|
40048
40048
|
}).sort((a, b) => a.scale - b.scale);
|
|
40049
40049
|
}
|
|
40050
|
-
function flatScale(
|
|
40051
|
-
const match = /@([23])x\.[^./]+$/.exec(
|
|
40050
|
+
function flatScale(path98) {
|
|
40051
|
+
const match = /@([23])x\.[^./]+$/.exec(path98);
|
|
40052
40052
|
return match ? Number(match[1]) : 1;
|
|
40053
40053
|
}
|
|
40054
40054
|
function providesNamespace(text6) {
|
|
@@ -40075,8 +40075,8 @@ function catalogEntryName(contentsPath, kind, readText2) {
|
|
|
40075
40075
|
}
|
|
40076
40076
|
return segments.join("/");
|
|
40077
40077
|
}
|
|
40078
|
-
function isFlatResourceImage(
|
|
40079
|
-
return
|
|
40078
|
+
function isFlatResourceImage(path98) {
|
|
40079
|
+
return path98.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path98));
|
|
40080
40080
|
}
|
|
40081
40081
|
function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
40082
40082
|
const table = [];
|
|
@@ -40089,7 +40089,7 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
|
40089
40089
|
seen.set(bundlePath, names);
|
|
40090
40090
|
return { bundlePath, names };
|
|
40091
40091
|
};
|
|
40092
|
-
const catalogs = paths.filter((
|
|
40092
|
+
const catalogs = paths.filter((path98) => baseOf(path98) === "Contents.json");
|
|
40093
40093
|
for (const contentsPath of catalogs) {
|
|
40094
40094
|
const name3 = catalogEntryName(contentsPath, ".imageset", readText2);
|
|
40095
40095
|
if (name3 === null) continue;
|
|
@@ -40121,13 +40121,13 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
|
40121
40121
|
...intent === "template" || intent === "original" ? { renderingMode: intent } : {}
|
|
40122
40122
|
});
|
|
40123
40123
|
}
|
|
40124
|
-
for (const
|
|
40125
|
-
if (!isFlatResourceImage(
|
|
40126
|
-
const name3 = baseOf(
|
|
40127
|
-
const { bundlePath, names } = namesFor(
|
|
40124
|
+
for (const path98 of paths) {
|
|
40125
|
+
if (!isFlatResourceImage(path98)) continue;
|
|
40126
|
+
const name3 = baseOf(path98).slice(0, -extOf(path98).length);
|
|
40127
|
+
const { bundlePath, names } = namesFor(path98);
|
|
40128
40128
|
if (name3 === "" || names.has(name3)) continue;
|
|
40129
40129
|
names.add(name3);
|
|
40130
|
-
table.push({ name: name3, file:
|
|
40130
|
+
table.push({ name: name3, file: path98, scale: flatScale(path98), bundlePath });
|
|
40131
40131
|
}
|
|
40132
40132
|
return table;
|
|
40133
40133
|
}
|
|
@@ -40162,7 +40162,7 @@ function colorsetValue(color) {
|
|
|
40162
40162
|
}
|
|
40163
40163
|
function enumerateBundleColors(paths, readText2) {
|
|
40164
40164
|
const table = {};
|
|
40165
|
-
for (const contentsPath of paths.filter((
|
|
40165
|
+
for (const contentsPath of paths.filter((path98) => baseOf(path98) === "Contents.json")) {
|
|
40166
40166
|
const name3 = catalogEntryName(contentsPath, ".colorset", readText2);
|
|
40167
40167
|
if (name3 === null || name3 in table) continue;
|
|
40168
40168
|
let colors;
|
|
@@ -40226,8 +40226,8 @@ function axisExtremes(points) {
|
|
|
40226
40226
|
function pathBounds(d) {
|
|
40227
40227
|
const xs = [];
|
|
40228
40228
|
const ys = [];
|
|
40229
|
-
for (const
|
|
40230
|
-
(0, import_svgpath.default)(
|
|
40229
|
+
for (const path98 of d)
|
|
40230
|
+
(0, import_svgpath.default)(path98).abs().unshort().unarc().iterate((segment2, _index, x, y) => {
|
|
40231
40231
|
const [command, ...args] = segment2;
|
|
40232
40232
|
if (command === "M" || command === "L") {
|
|
40233
40233
|
xs.push(Number(args[0]));
|
|
@@ -40254,7 +40254,7 @@ function guide(svg, id, axis) {
|
|
|
40254
40254
|
}
|
|
40255
40255
|
function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
40256
40256
|
const table = {};
|
|
40257
|
-
for (const contentsPath of paths.filter((
|
|
40257
|
+
for (const contentsPath of paths.filter((path98) => baseOf(path98) === "Contents.json")) {
|
|
40258
40258
|
const name3 = catalogEntryName(contentsPath, ".symbolset", readText2);
|
|
40259
40259
|
if (name3 === null) continue;
|
|
40260
40260
|
const bundle = bundleForFile(contentsPath);
|
|
@@ -40313,8 +40313,8 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
|
40313
40313
|
advance,
|
|
40314
40314
|
box: [12 - wide / 2, 12 - tall / 2, wide, tall],
|
|
40315
40315
|
...customLayout ? { customLayout } : {},
|
|
40316
|
-
layers: d.map((
|
|
40317
|
-
d: (0, import_svgpath.default)(
|
|
40316
|
+
layers: d.map((path98) => ({
|
|
40317
|
+
d: (0, import_svgpath.default)(path98).abs().scale(em).translate(translateX, translateY).round(3).toString()
|
|
40318
40318
|
}))
|
|
40319
40319
|
};
|
|
40320
40320
|
table[vectorKey] = vector;
|
|
@@ -40325,18 +40325,18 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
|
40325
40325
|
}
|
|
40326
40326
|
return table;
|
|
40327
40327
|
}
|
|
40328
|
-
function isCopiedResource(
|
|
40329
|
-
if (copiedBundle ||
|
|
40328
|
+
function isCopiedResource(path98, copiedBundle) {
|
|
40329
|
+
if (copiedBundle || path98.split("/").some((segment2) => /\.(atlasc|bundle|storyboardc|nib)$/.test(segment2)))
|
|
40330
40330
|
return true;
|
|
40331
|
-
const ext = extOf(
|
|
40331
|
+
const ext = extOf(path98);
|
|
40332
40332
|
if (ext === ".json" || ext === ".xcstrings") return true;
|
|
40333
|
-
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !
|
|
40333
|
+
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !path98.split("/").some((segment2) => segment2.endsWith(".xcassets"));
|
|
40334
40334
|
}
|
|
40335
40335
|
function enumerateBundleResources(paths, copiedBundle = false) {
|
|
40336
40336
|
const found = [];
|
|
40337
40337
|
const seen = /* @__PURE__ */ new Set();
|
|
40338
40338
|
const ordered = [...paths].filter(
|
|
40339
|
-
(
|
|
40339
|
+
(path98) => path98.split("/").includes("Resources") && path98.split("/").every((segment2) => segment2 !== "" && segment2 !== "..") && isCopiedResource(path98, copiedBundle)
|
|
40340
40340
|
).sort((a, b) => {
|
|
40341
40341
|
const aDepth = a.split("/").length;
|
|
40342
40342
|
const bDepth = b.split("/").length;
|
|
@@ -40482,31 +40482,31 @@ function tokens(text6) {
|
|
|
40482
40482
|
}
|
|
40483
40483
|
return result;
|
|
40484
40484
|
}
|
|
40485
|
-
function qualified(language, key2,
|
|
40486
|
-
return `(${language}: ${key2}${
|
|
40485
|
+
function qualified(language, key2, path98) {
|
|
40486
|
+
return `(${language}: ${key2}${path98 === "" ? "" : "|==|" + path98})`;
|
|
40487
40487
|
}
|
|
40488
|
-
function requiresNumber(language, key2,
|
|
40488
|
+
function requiresNumber(language, key2, path98) {
|
|
40489
40489
|
return Error(
|
|
40490
|
-
"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,
|
|
40490
|
+
"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, path98)
|
|
40491
40491
|
);
|
|
40492
40492
|
}
|
|
40493
|
-
function moreThanOne(language, key2,
|
|
40493
|
+
function moreThanOne(language, key2, path98) {
|
|
40494
40494
|
return Error(
|
|
40495
|
-
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2,
|
|
40495
|
+
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path98)
|
|
40496
40496
|
);
|
|
40497
40497
|
}
|
|
40498
40498
|
function schemaPath(segments) {
|
|
40499
40499
|
return segments.map((segment2) => `'${segment2}'`).join(" -> ");
|
|
40500
40500
|
}
|
|
40501
|
-
function checkUnitShape(node,
|
|
40501
|
+
function checkUnitShape(node, path98) {
|
|
40502
40502
|
const raw2 = node.stringUnit;
|
|
40503
40503
|
if (raw2 === void 0)
|
|
40504
|
-
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(
|
|
40504
|
+
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path98)}`);
|
|
40505
40505
|
if (raw2 === null)
|
|
40506
|
-
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(
|
|
40506
|
+
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path98)}`);
|
|
40507
40507
|
if (!isRecord3(raw2))
|
|
40508
|
-
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(
|
|
40509
|
-
const unitPath = [...
|
|
40508
|
+
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path98)}`);
|
|
40509
|
+
const unitPath = [...path98, "stringUnit"];
|
|
40510
40510
|
if (!Object.hasOwn(raw2, "state"))
|
|
40511
40511
|
throw Error(`Missing required key 'state' inside ${schemaPath(unitPath)}`);
|
|
40512
40512
|
const state = raw2.state;
|
|
@@ -40523,38 +40523,38 @@ function checkUnitShape(node, path97) {
|
|
|
40523
40523
|
throw Error(`Expected string for key 'value' inside ${schemaPath(unitPath)}`);
|
|
40524
40524
|
return value;
|
|
40525
40525
|
}
|
|
40526
|
-
function checkPluralShape(node,
|
|
40526
|
+
function checkPluralShape(node, path98) {
|
|
40527
40527
|
for (const [category, raw2] of Object.entries(node)) {
|
|
40528
|
-
const categoryPath = [...
|
|
40528
|
+
const categoryPath = [...path98, category];
|
|
40529
40529
|
if (raw2 === null)
|
|
40530
40530
|
throw Error(
|
|
40531
|
-
`Missing required value for key '${category}' inside ${schemaPath(
|
|
40531
|
+
`Missing required value for key '${category}' inside ${schemaPath(path98)}`
|
|
40532
40532
|
);
|
|
40533
40533
|
if (!isRecord3(raw2))
|
|
40534
|
-
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(
|
|
40534
|
+
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path98)}`);
|
|
40535
40535
|
checkUnitShape(raw2, categoryPath);
|
|
40536
40536
|
}
|
|
40537
40537
|
}
|
|
40538
|
-
function checkLocalizationShape(node,
|
|
40538
|
+
function checkLocalizationShape(node, path98, deviceValue = false) {
|
|
40539
40539
|
if (node === null)
|
|
40540
40540
|
throw Error(
|
|
40541
|
-
`Missing required value for key '${
|
|
40541
|
+
`Missing required value for key '${path98[path98.length - 1]}' inside ${schemaPath(path98.slice(0, -1))}`
|
|
40542
40542
|
);
|
|
40543
40543
|
if (!isRecord3(node))
|
|
40544
40544
|
throw Error(
|
|
40545
|
-
`Expected dictionary for key '${
|
|
40545
|
+
`Expected dictionary for key '${path98[path98.length - 1]}' inside ${schemaPath(path98.slice(0, -1))}`
|
|
40546
40546
|
);
|
|
40547
|
-
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations,
|
|
40547
|
+
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path98);
|
|
40548
40548
|
if (!deviceValue && Object.hasOwn(node, "substitutions"))
|
|
40549
|
-
checkSubstitutionsShape(node.substitutions,
|
|
40550
|
-
if (!Object.hasOwn(node, "variations")) checkUnitShape(node,
|
|
40549
|
+
checkSubstitutionsShape(node.substitutions, path98);
|
|
40550
|
+
if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path98);
|
|
40551
40551
|
}
|
|
40552
|
-
function checkVariationsShape(variations,
|
|
40552
|
+
function checkVariationsShape(variations, path98) {
|
|
40553
40553
|
if (variations === null)
|
|
40554
|
-
throw Error(`Missing required value for key 'variations' inside ${schemaPath(
|
|
40554
|
+
throw Error(`Missing required value for key 'variations' inside ${schemaPath(path98)}`);
|
|
40555
40555
|
if (!isRecord3(variations))
|
|
40556
|
-
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(
|
|
40557
|
-
const variationsPath = [...
|
|
40556
|
+
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path98)}`);
|
|
40557
|
+
const variationsPath = [...path98, "variations"];
|
|
40558
40558
|
for (const [type, raw2] of Object.entries(variations)) {
|
|
40559
40559
|
if (raw2 === null)
|
|
40560
40560
|
throw Error(
|
|
@@ -40580,11 +40580,11 @@ function checkVariationsShape(variations, path97) {
|
|
|
40580
40580
|
}
|
|
40581
40581
|
}
|
|
40582
40582
|
}
|
|
40583
|
-
function checkSubstitutionsShape(substitutions,
|
|
40583
|
+
function checkSubstitutionsShape(substitutions, path98) {
|
|
40584
40584
|
if (substitutions === null) return;
|
|
40585
40585
|
if (!isRecord3(substitutions))
|
|
40586
|
-
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(
|
|
40587
|
-
const substitutionsPath = [...
|
|
40586
|
+
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path98)}`);
|
|
40587
|
+
const substitutionsPath = [...path98, "substitutions"];
|
|
40588
40588
|
for (const [name3, raw2] of Object.entries(substitutions)) {
|
|
40589
40589
|
const subPath = [...substitutionsPath, name3];
|
|
40590
40590
|
if (raw2 === null)
|
|
@@ -40626,10 +40626,10 @@ function scanSpecs(forms) {
|
|
|
40626
40626
|
}
|
|
40627
40627
|
return specs;
|
|
40628
40628
|
}
|
|
40629
|
-
function inferPlural(forms, language, key2,
|
|
40629
|
+
function inferPlural(forms, language, key2, path98) {
|
|
40630
40630
|
const specs = scanSpecs(forms);
|
|
40631
|
-
if (specs.size === 0) throw requiresNumber(language, key2,
|
|
40632
|
-
if (specs.size > 1) throw moreThanOne(language, key2,
|
|
40631
|
+
if (specs.size === 0) throw requiresNumber(language, key2, path98);
|
|
40632
|
+
if (specs.size > 1) throw moreThanOne(language, key2, path98);
|
|
40633
40633
|
return [...specs.values()][0] ?? { specifier: "", argument: 0 };
|
|
40634
40634
|
}
|
|
40635
40635
|
function unit(value) {
|
|
@@ -41098,8 +41098,8 @@ function plist3(value, depth) {
|
|
|
41098
41098
|
}
|
|
41099
41099
|
function compileStringCatalog(source, name3) {
|
|
41100
41100
|
return Object.fromEntries(
|
|
41101
|
-
Object.entries(compileCatalogTables(source, name3)).map(([
|
|
41102
|
-
|
|
41101
|
+
Object.entries(compileCatalogTables(source, name3)).map(([path98, table]) => [
|
|
41102
|
+
path98,
|
|
41103
41103
|
'<?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' + plist3(table, 0) + "</plist>\n"
|
|
41104
41104
|
])
|
|
41105
41105
|
);
|
|
@@ -42725,7 +42725,7 @@ function resolveSwiftPackages(options) {
|
|
|
42725
42725
|
headers.set(name3, import_node_path69.default.relative(binary2.dir, dir));
|
|
42726
42726
|
};
|
|
42727
42727
|
visit3(pkg, binary2.target);
|
|
42728
|
-
binary2.headerDependencies = [...headers].map(([module2,
|
|
42728
|
+
binary2.headerDependencies = [...headers].map(([module2, path98]) => ({ module: module2, path: path98 }));
|
|
42729
42729
|
}
|
|
42730
42730
|
for (const owner of options.owners ?? []) {
|
|
42731
42731
|
const found = productClosure(owner.products);
|
|
@@ -42940,7 +42940,7 @@ var init_swift_standin_digest = __esm({
|
|
|
42940
42940
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
42941
42941
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
42942
42942
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
42943
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
42943
|
+
STANDIN_SOURCE_DIGEST = true ? "afff2f6ba145885813b507114e72f9218f9a815a257ab2e44f7da376b7bf5cd1" : standinSourceDigest();
|
|
42944
42944
|
}
|
|
42945
42945
|
});
|
|
42946
42946
|
|
|
@@ -47382,8 +47382,8 @@ function sourceEntryPath() {
|
|
|
47382
47382
|
return null;
|
|
47383
47383
|
}
|
|
47384
47384
|
}
|
|
47385
|
-
function isCliEntry(
|
|
47386
|
-
const name3 = (0, import_node_path77.basename)(
|
|
47385
|
+
function isCliEntry(path98) {
|
|
47386
|
+
const name3 = (0, import_node_path77.basename)(path98);
|
|
47387
47387
|
return name3 === "bin.ts" || name3 === "bin.js";
|
|
47388
47388
|
}
|
|
47389
47389
|
function rnxSelfInvocation() {
|
|
@@ -52230,11 +52230,11 @@ function stringList(value) {
|
|
|
52230
52230
|
function externalSpecMembers(root, requested) {
|
|
52231
52231
|
const children = (spec) => Array.isArray(spec.subspecs) ? spec.subspecs.filter(object5) : [];
|
|
52232
52232
|
const chains = /* @__PURE__ */ new Map();
|
|
52233
|
-
const select = (
|
|
52234
|
-
const key2 =
|
|
52233
|
+
const select = (path98) => {
|
|
52234
|
+
const key2 = path98.join("/");
|
|
52235
52235
|
if (chains.has(key2)) return;
|
|
52236
52236
|
const chain = [root];
|
|
52237
|
-
for (const part of
|
|
52237
|
+
for (const part of path98) {
|
|
52238
52238
|
const child = children(chain.at(-1)).find((sub) => sub.name === part);
|
|
52239
52239
|
if (!child) throw new Error(`${String(root.name)} has no subspec ${key2}`);
|
|
52240
52240
|
chain.push(child);
|
|
@@ -52243,7 +52243,7 @@ function externalSpecMembers(root, requested) {
|
|
|
52243
52243
|
const spec = chain.at(-1);
|
|
52244
52244
|
const defaults = stringList(spec.default_subspecs ?? spec.default_subspec);
|
|
52245
52245
|
const activated = defaults[0] === "none" ? [] : defaults.length > 0 ? defaults : children(spec).map((sub) => String(sub.name));
|
|
52246
|
-
for (const name3 of activated) select([...
|
|
52246
|
+
for (const name3 of activated) select([...path98, ...name3.split("/")]);
|
|
52247
52247
|
for (const member of chain)
|
|
52248
52248
|
for (const dependencies of [member.dependencies, iosOf(member)?.dependencies])
|
|
52249
52249
|
for (const dependency of object5(dependencies) ? Object.keys(dependencies) : []) {
|
|
@@ -54848,9 +54848,9 @@ async function packageTreeDigest(root) {
|
|
|
54848
54848
|
(a, b) => a.name.localeCompare(b.name)
|
|
54849
54849
|
)) {
|
|
54850
54850
|
if (entry.name === "node_modules") continue;
|
|
54851
|
-
const
|
|
54852
|
-
if (entry.isDirectory()) walk3((0, import_node_path86.join)(directory2, entry.name), `${
|
|
54853
|
-
else if (entry.isFile()) files2.push(
|
|
54851
|
+
const path98 = `${relative4}${entry.name}`;
|
|
54852
|
+
if (entry.isDirectory()) walk3((0, import_node_path86.join)(directory2, entry.name), `${path98}/`);
|
|
54853
|
+
else if (entry.isFile()) files2.push(path98);
|
|
54854
54854
|
}
|
|
54855
54855
|
};
|
|
54856
54856
|
walk3(root, "");
|
|
@@ -55008,7 +55008,7 @@ var init_nitro_superset = __esm({
|
|
|
55008
55008
|
init_nitroContract();
|
|
55009
55009
|
init_swift_standin_digest();
|
|
55010
55010
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
55011
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
55011
|
+
NITRO_COMPILER_DIGEST = true ? "476dc80dfe13d046b6e1e4401add50aab58adb46496109e4a66c3681a8325ee8" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
55012
55012
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
55013
55013
|
nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
|
|
55014
55014
|
published = /* @__PURE__ */ new Map();
|
|
@@ -56233,7 +56233,7 @@ var init_expo_native_compiler_digest = __esm({
|
|
|
56233
56233
|
|
|
56234
56234
|
// src/expo-native-prebuilt.ts
|
|
56235
56235
|
function expoNativeCompilerDigestValue() {
|
|
56236
|
-
return true ? "
|
|
56236
|
+
return true ? "f762ea33a95654cc6dff527029e56f7d981bb2bf78a66b40799cf4af340546c3" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
56237
56237
|
}
|
|
56238
56238
|
function readSources(value) {
|
|
56239
56239
|
const sources = isRecord(value) ? value.sources : null;
|
|
@@ -59979,6 +59979,37 @@ async function resolveAndroidModules(appRoot) {
|
|
|
59979
59979
|
throw new Error("invalid Expo Android autolinking entry");
|
|
59980
59980
|
return resolved.modules;
|
|
59981
59981
|
}
|
|
59982
|
+
async function resolveReactNativeAndroidAutolinking(appRoot) {
|
|
59983
|
+
const config = await reactNativeAutolinkingConfig(appRoot, "android");
|
|
59984
|
+
if (!isRecord(config) || !isRecord(config.dependencies))
|
|
59985
|
+
throw new Error(`${appRoot}: React Native autolinking config has no dependencies`);
|
|
59986
|
+
const linked = [];
|
|
59987
|
+
for (const [name3, dependency] of Object.entries(config.dependencies)) {
|
|
59988
|
+
if (!isRecord(dependency) || !isRecord(dependency.platforms))
|
|
59989
|
+
throw new Error(
|
|
59990
|
+
`${appRoot}: React Native autolinking dependency ${name3} is malformed`
|
|
59991
|
+
);
|
|
59992
|
+
const android = dependency.platforms.android;
|
|
59993
|
+
if (android == null) continue;
|
|
59994
|
+
if (!isRecord(android) || typeof dependency.root !== "string")
|
|
59995
|
+
throw new Error(
|
|
59996
|
+
`${appRoot}: React Native autolinking dependency ${name3} has no Android project`
|
|
59997
|
+
);
|
|
59998
|
+
const string5 = (field) => {
|
|
59999
|
+
const value = android[field];
|
|
60000
|
+
if (value == null || typeof value === "string") return value ?? null;
|
|
60001
|
+
throw new Error(`${appRoot}: Android dependency ${name3} has invalid ${field}`);
|
|
60002
|
+
};
|
|
60003
|
+
linked.push({
|
|
60004
|
+
name: name3,
|
|
60005
|
+
root: dependency.root,
|
|
60006
|
+
sourceDir: string5("sourceDir"),
|
|
60007
|
+
packageImportPath: string5("packageImportPath"),
|
|
60008
|
+
packageInstance: string5("packageInstance")
|
|
60009
|
+
});
|
|
60010
|
+
}
|
|
60011
|
+
return linked;
|
|
60012
|
+
}
|
|
59982
60013
|
var import_node_child_process45, import_node_fs98, import_node_module17, import_node_path97, import_node_util17, run8, resolving;
|
|
59983
60014
|
var init_android_autolinking = __esm({
|
|
59984
60015
|
"src/android-autolinking.ts"() {
|
|
@@ -59998,6 +60029,199 @@ var init_android_autolinking = __esm({
|
|
|
59998
60029
|
}
|
|
59999
60030
|
});
|
|
60000
60031
|
|
|
60032
|
+
// src/android-gradle-sources.ts
|
|
60033
|
+
var android_gradle_sources_exports = {};
|
|
60034
|
+
__export(android_gradle_sources_exports, {
|
|
60035
|
+
resolveAndroidGradleSources: () => resolveAndroidGradleSources
|
|
60036
|
+
});
|
|
60037
|
+
async function resolveAndroidGradleSources(request) {
|
|
60038
|
+
let { root } = request;
|
|
60039
|
+
const { projects: projectDirs, variant: variant2 } = request;
|
|
60040
|
+
if (projectDirs.length === 0) return [];
|
|
60041
|
+
if (!import_node_path98.default.isAbsolute(root) || projectDirs.some((dir) => !import_node_path98.default.isAbsolute(dir)))
|
|
60042
|
+
throw new Error("Android Gradle source selection requires absolute project paths");
|
|
60043
|
+
if (!variant2) throw new Error("Android Gradle source selection requires a variant");
|
|
60044
|
+
root = import_node_fs99.default.realpathSync(root);
|
|
60045
|
+
const projects2 = [...new Set(projectDirs.map((dir) => import_node_fs99.default.realpathSync(dir)))];
|
|
60046
|
+
const parent = import_node_path98.default.join(kotlinHome(), "gradle-sources");
|
|
60047
|
+
import_node_fs99.default.mkdirSync(parent, { recursive: true });
|
|
60048
|
+
const work = import_node_fs99.default.mkdtempSync(import_node_path98.default.join(parent, ".query-"));
|
|
60049
|
+
const task = `peachAndroidSources${(0, import_node_crypto52.randomBytes)(8).toString("hex")}`;
|
|
60050
|
+
const script = import_node_path98.default.join(work, "sources.gradle");
|
|
60051
|
+
const encoded = Buffer.from(
|
|
60052
|
+
JSON.stringify({ root, projects: projects2, variant: variant2, output: work, task })
|
|
60053
|
+
).toString("base64");
|
|
60054
|
+
import_node_fs99.default.writeFileSync(script, modelQuery.replace("__PEACH_REQUEST__", encoded));
|
|
60055
|
+
try {
|
|
60056
|
+
await run9(
|
|
60057
|
+
"bash",
|
|
60058
|
+
[
|
|
60059
|
+
import_node_path98.default.join(root, "gradlew"),
|
|
60060
|
+
"--init-script",
|
|
60061
|
+
script,
|
|
60062
|
+
`${task}All`,
|
|
60063
|
+
"--no-daemon",
|
|
60064
|
+
"--no-configuration-cache",
|
|
60065
|
+
"--no-configure-on-demand",
|
|
60066
|
+
"--max-workers=1",
|
|
60067
|
+
"--console=plain"
|
|
60068
|
+
],
|
|
60069
|
+
{
|
|
60070
|
+
cwd: root,
|
|
60071
|
+
timeout: 3e5,
|
|
60072
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
60073
|
+
env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" }
|
|
60074
|
+
}
|
|
60075
|
+
);
|
|
60076
|
+
return projects2.map((projectDir, index) => {
|
|
60077
|
+
const value = JSON.parse(
|
|
60078
|
+
import_node_fs99.default.readFileSync(import_node_path98.default.join(work, `${index}.json`), "utf8")
|
|
60079
|
+
);
|
|
60080
|
+
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))
|
|
60081
|
+
throw new Error("Gradle printed an invalid Android project source model");
|
|
60082
|
+
const sources = (field) => {
|
|
60083
|
+
const list2 = value[field];
|
|
60084
|
+
if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" && import_node_path98.default.isAbsolute(file)))
|
|
60085
|
+
throw new Error(`Gradle printed invalid Android ${field} source paths`);
|
|
60086
|
+
return list2.map(String);
|
|
60087
|
+
};
|
|
60088
|
+
if (!Array.isArray(value.dependencies))
|
|
60089
|
+
throw new Error("Gradle printed invalid Android dependencies");
|
|
60090
|
+
const dependencies = value.dependencies.map(
|
|
60091
|
+
(entry) => {
|
|
60092
|
+
if (isRecord(entry) && typeof entry.name === "string" && entry.name) {
|
|
60093
|
+
if (entry.kind === "module" && typeof entry.group === "string" && entry.group && typeof entry.version === "string" && entry.version)
|
|
60094
|
+
return {
|
|
60095
|
+
kind: entry.kind,
|
|
60096
|
+
group: entry.group,
|
|
60097
|
+
name: entry.name,
|
|
60098
|
+
version: entry.version
|
|
60099
|
+
};
|
|
60100
|
+
if (entry.kind === "project" || entry.kind === "file")
|
|
60101
|
+
return { kind: entry.kind, name: entry.name };
|
|
60102
|
+
}
|
|
60103
|
+
throw new Error("Gradle printed an invalid Android dependency");
|
|
60104
|
+
}
|
|
60105
|
+
);
|
|
60106
|
+
return {
|
|
60107
|
+
projectDir,
|
|
60108
|
+
projectPath: value.projectPath,
|
|
60109
|
+
variant: variant2,
|
|
60110
|
+
applicationId: value.applicationId,
|
|
60111
|
+
namespace: value.namespace,
|
|
60112
|
+
targetSdk: value.targetSdk,
|
|
60113
|
+
kotlin: sources("kotlin"),
|
|
60114
|
+
java: sources("java"),
|
|
60115
|
+
dependencies
|
|
60116
|
+
};
|
|
60117
|
+
});
|
|
60118
|
+
} finally {
|
|
60119
|
+
import_node_fs99.default.rmSync(work, { recursive: true, force: true });
|
|
60120
|
+
}
|
|
60121
|
+
}
|
|
60122
|
+
var import_node_child_process46, import_node_crypto52, import_node_fs99, import_node_path98, import_node_util18, run9, modelQuery;
|
|
60123
|
+
var init_android_gradle_sources = __esm({
|
|
60124
|
+
"src/android-gradle-sources.ts"() {
|
|
60125
|
+
"use strict";
|
|
60126
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60127
|
+
import_node_child_process46 = require("node:child_process");
|
|
60128
|
+
import_node_crypto52 = require("node:crypto");
|
|
60129
|
+
import_node_fs99 = __toESM(require("node:fs"), 1);
|
|
60130
|
+
import_node_path98 = __toESM(require("node:path"), 1);
|
|
60131
|
+
import_node_util18 = require("node:util");
|
|
60132
|
+
init_forked_script_contract();
|
|
60133
|
+
init_is_record();
|
|
60134
|
+
init_kotlin_toolchain();
|
|
60135
|
+
run9 = (0, import_node_util18.promisify)(import_node_child_process46.execFile);
|
|
60136
|
+
modelQuery = `
|
|
60137
|
+
import groovy.json.JsonOutput
|
|
60138
|
+
import groovy.json.JsonSlurper
|
|
60139
|
+
import org.gradle.api.artifacts.FileCollectionDependency
|
|
60140
|
+
import org.gradle.api.artifacts.component.ModuleComponentIdentifier
|
|
60141
|
+
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
|
|
60142
|
+
import org.gradle.api.artifacts.result.ResolvedDependencyResult
|
|
60143
|
+
import org.gradle.api.attributes.Category
|
|
60144
|
+
|
|
60145
|
+
def request = new JsonSlurper().parseText(new String(Base64.decoder.decode('__PEACH_REQUEST__'), 'UTF-8'))
|
|
60146
|
+
def selectedVariants = [:]
|
|
60147
|
+
gradle.beforeProject { project ->
|
|
60148
|
+
def directory = project.projectDir.canonicalPath
|
|
60149
|
+
if (project.rootProject.projectDir.canonicalPath != request.root || !request.projects.contains(directory)) return
|
|
60150
|
+
['com.android.application', 'com.android.library'].each { plugin ->
|
|
60151
|
+
project.pluginManager.withPlugin(plugin) {
|
|
60152
|
+
def components = project.extensions.getByName('androidComponents')
|
|
60153
|
+
components.onVariants(components.selector().withName(request.variant)) { variant ->
|
|
60154
|
+
selectedVariants[directory] = variant
|
|
60155
|
+
}
|
|
60156
|
+
}
|
|
60157
|
+
}
|
|
60158
|
+
}
|
|
60159
|
+
gradle.projectsEvaluated {
|
|
60160
|
+
if (gradle.rootProject.projectDir.canonicalPath != request.root) return
|
|
60161
|
+
def selected = []
|
|
60162
|
+
request.projects.eachWithIndex { directory, index ->
|
|
60163
|
+
def matches = gradle.rootProject.allprojects.findAll { it.projectDir.canonicalPath == directory }
|
|
60164
|
+
if (matches.size() != 1) throw new GradleException('Expected one Android project for ' + directory)
|
|
60165
|
+
def project = matches[0]
|
|
60166
|
+
if (project.pluginManager.hasPlugin('org.jetbrains.kotlin.multiplatform')) {
|
|
60167
|
+
throw new GradleException('Kotlin multiplatform source selection is not supported: ' + project.path)
|
|
60168
|
+
}
|
|
60169
|
+
def library = project.pluginManager.hasPlugin('com.android.library')
|
|
60170
|
+
if (!library && !project.pluginManager.hasPlugin('com.android.application')) {
|
|
60171
|
+
throw new GradleException('Project has no Android application or library plugin: ' + project.path)
|
|
60172
|
+
}
|
|
60173
|
+
def variant = selectedVariants[directory]
|
|
60174
|
+
if (variant == null) throw new GradleException('Android variant ' + request.variant + ' is absent: ' + project.path)
|
|
60175
|
+
def generators = []
|
|
60176
|
+
if (project.pluginManager.hasPlugin('com.facebook.react')) {
|
|
60177
|
+
generators.add(project.tasks.named('generateCodegenArtifactsFromSchema'))
|
|
60178
|
+
}
|
|
60179
|
+
def kotlin = project.tasks.findByName('compile' + variant.name.capitalize() + 'Kotlin')
|
|
60180
|
+
def kotlinSources = kotlin == null ? project.files() : kotlin.sources
|
|
60181
|
+
def javaSources = project.tasks.named('compile' + variant.name.capitalize() + 'JavaWithJavac').get().source
|
|
60182
|
+
def query = project.tasks.register(request.task) {
|
|
60183
|
+
dependsOn(generators)
|
|
60184
|
+
dependsOn(kotlinSources.buildDependencies, javaSources.buildDependencies)
|
|
60185
|
+
doLast {
|
|
60186
|
+
def files = (kotlinSources.files + javaSources.files).unique()
|
|
60187
|
+
def unknown = files.find { !it.name.endsWith('.kt') && !it.name.endsWith('.java') }
|
|
60188
|
+
if (unknown != null) throw new GradleException('Unsupported Android source: ' + unknown)
|
|
60189
|
+
def dependencies = [variant.compileConfiguration, variant.runtimeConfiguration].collectMany { configuration ->
|
|
60190
|
+
def modules = configuration.incoming.resolutionResult.rootComponent.get().dependencies.findAll { !it.constraint }.collectMany { dependency ->
|
|
60191
|
+
if (!(dependency instanceof ResolvedDependencyResult)) throw new GradleException('Unresolved Android dependency: ' + dependency.requested, dependency.failure)
|
|
60192
|
+
def category = dependency.resolvedVariant.attributes.getAttribute(Category.CATEGORY_ATTRIBUTE)?.name
|
|
60193
|
+
if (category == Category.REGULAR_PLATFORM || category == Category.ENFORCED_PLATFORM) return []
|
|
60194
|
+
def id = dependency.selected.id
|
|
60195
|
+
if (id instanceof ModuleComponentIdentifier) return [[kind:'module', group:id.group, name:id.module, version:id.version]]
|
|
60196
|
+
if (id instanceof ProjectComponentIdentifier) return [[kind:'project', name:id.displayName]]
|
|
60197
|
+
throw new GradleException('Unsupported Android dependency component: ' + id.displayName)
|
|
60198
|
+
}
|
|
60199
|
+
def local = configuration.allDependencies.withType(FileCollectionDependency).collectMany { dependency ->
|
|
60200
|
+
dependency.files.files.collect { [kind:'file', name:it.absolutePath] }
|
|
60201
|
+
}
|
|
60202
|
+
modules + local
|
|
60203
|
+
}.unique()
|
|
60204
|
+
new File(request.output, index.toString() + '.json').text = JsonOutput.toJson([
|
|
60205
|
+
projectDir:project.projectDir.canonicalPath,
|
|
60206
|
+
projectPath:project.path,
|
|
60207
|
+
variant:variant.name,
|
|
60208
|
+
applicationId:library ? null : variant.applicationId.get(),
|
|
60209
|
+
namespace:variant.namespace.get(),
|
|
60210
|
+
targetSdk:library ? null : variant.targetSdk.apiLevel,
|
|
60211
|
+
kotlin:files.findAll { it.name.endsWith('.kt') }.collect { it.absolutePath }.sort(),
|
|
60212
|
+
java:files.findAll { it.name.endsWith('.java') }.collect { it.absolutePath }.sort(),
|
|
60213
|
+
dependencies:dependencies
|
|
60214
|
+
])
|
|
60215
|
+
}
|
|
60216
|
+
}
|
|
60217
|
+
selected.add(query)
|
|
60218
|
+
}
|
|
60219
|
+
gradle.rootProject.tasks.register(request.task + 'All') { dependsOn(selected) }
|
|
60220
|
+
}
|
|
60221
|
+
`;
|
|
60222
|
+
}
|
|
60223
|
+
});
|
|
60224
|
+
|
|
60001
60225
|
// src/android-bridge-packages.ts
|
|
60002
60226
|
function readBridgeMethod(value) {
|
|
60003
60227
|
if (!isRecord(value) || typeof value.name !== "string" || typeof value.blocking !== "boolean" || value.returns !== null && typeof value.returns !== "string" || !Array.isArray(value.params))
|
|
@@ -60043,27 +60267,27 @@ function readBridgeFiles(output2) {
|
|
|
60043
60267
|
});
|
|
60044
60268
|
}
|
|
60045
60269
|
function androidAppSources(appRoot) {
|
|
60046
|
-
const moduleDir =
|
|
60047
|
-
const gradle = ["build.gradle", "build.gradle.kts"].map((name3) =>
|
|
60270
|
+
const moduleDir = import_node_path99.default.join(appRoot, "android", "app");
|
|
60271
|
+
const gradle = ["build.gradle", "build.gradle.kts"].map((name3) => import_node_path99.default.join(moduleDir, name3)).find((file) => import_node_fs100.default.existsSync(file));
|
|
60048
60272
|
if (!gradle) return null;
|
|
60049
60273
|
const id = /\bapplicationId\s*=?\s*["']([^"']+)["']/.exec(
|
|
60050
|
-
|
|
60274
|
+
import_node_fs100.default.readFileSync(gradle, "utf8")
|
|
60051
60275
|
);
|
|
60052
60276
|
if (!id) throw new Error(`${gradle}: no applicationId`);
|
|
60053
60277
|
const kotlin = [];
|
|
60054
60278
|
const java = [];
|
|
60055
60279
|
const walk3 = (dir) => {
|
|
60056
|
-
if (!
|
|
60057
|
-
for (const child of
|
|
60058
|
-
const file =
|
|
60280
|
+
if (!import_node_fs100.default.existsSync(dir)) return;
|
|
60281
|
+
for (const child of import_node_fs100.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
60282
|
+
const file = import_node_path99.default.join(dir, child.name);
|
|
60059
60283
|
if (child.isSymbolicLink()) throw new Error(`Android source is a symlink: ${file}`);
|
|
60060
60284
|
if (child.isDirectory()) walk3(file);
|
|
60061
60285
|
else if (child.name.endsWith(".kt")) kotlin.push(file);
|
|
60062
60286
|
else if (child.name.endsWith(".java")) java.push(file);
|
|
60063
60287
|
}
|
|
60064
60288
|
};
|
|
60065
|
-
walk3(
|
|
60066
|
-
walk3(
|
|
60289
|
+
walk3(import_node_path99.default.join(moduleDir, "src", "main", "java"));
|
|
60290
|
+
walk3(import_node_path99.default.join(moduleDir, "src", "main", "kotlin"));
|
|
60067
60291
|
return { applicationId: id[1], kotlin, java };
|
|
60068
60292
|
}
|
|
60069
60293
|
function declares(source, owner, name3) {
|
|
@@ -60072,7 +60296,7 @@ function declares(source, owner, name3) {
|
|
|
60072
60296
|
}
|
|
60073
60297
|
function selectBridgePackages(applicationId, files2, javaFiles) {
|
|
60074
60298
|
const texts = new Map(
|
|
60075
|
-
files2.map((file) => [file.file,
|
|
60299
|
+
files2.map((file) => [file.file, import_node_fs100.default.readFileSync(file.file, "utf8")])
|
|
60076
60300
|
);
|
|
60077
60301
|
const owners = /* @__PURE__ */ new Map();
|
|
60078
60302
|
for (const file of files2)
|
|
@@ -60080,8 +60304,8 @@ function selectBridgePackages(applicationId, files2, javaFiles) {
|
|
|
60080
60304
|
owners.set(name3, [...owners.get(name3) ?? [], file]);
|
|
60081
60305
|
const javaDeclarations = javaFiles.map((file) => ({
|
|
60082
60306
|
file,
|
|
60083
|
-
package: /^\s*package\s+([\w.]+)\s*;/m.exec(
|
|
60084
|
-
name:
|
|
60307
|
+
package: /^\s*package\s+([\w.]+)\s*;/m.exec(import_node_fs100.default.readFileSync(file, "utf8"))?.[1] ?? "",
|
|
60308
|
+
name: import_node_path99.default.basename(file, ".java")
|
|
60085
60309
|
}));
|
|
60086
60310
|
const closure = (root) => {
|
|
60087
60311
|
const seen = /* @__PURE__ */ new Set([root]);
|
|
@@ -60154,65 +60378,15 @@ function moduleName(text6, className2) {
|
|
|
60154
60378
|
);
|
|
60155
60379
|
return match ? match[1] : null;
|
|
60156
60380
|
}
|
|
60157
|
-
var
|
|
60381
|
+
var import_node_fs100, import_node_path99, qualified2;
|
|
60158
60382
|
var init_android_bridge_packages = __esm({
|
|
60159
60383
|
"src/android-bridge-packages.ts"() {
|
|
60160
60384
|
"use strict";
|
|
60161
60385
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60162
|
-
import_node_fs99 = __toESM(require("node:fs"), 1);
|
|
60163
|
-
import_node_path98 = __toESM(require("node:path"), 1);
|
|
60164
|
-
init_is_record();
|
|
60165
|
-
qualified2 = (file, name3) => file.package ? `${file.package}.${name3}` : name3;
|
|
60166
|
-
}
|
|
60167
|
-
});
|
|
60168
|
-
|
|
60169
|
-
// src/kotlin-module.ts
|
|
60170
|
-
function peachKotlinModuleRoot() {
|
|
60171
|
-
if (!IS_STANDALONE)
|
|
60172
|
-
return import_node_path99.default.resolve(import_node_path99.default.dirname((0, import_node_url7.fileURLToPath)(__sootsim_import_meta_url)), "..", "kotlin");
|
|
60173
|
-
if (installedRoot) return installedRoot;
|
|
60174
|
-
const files2 = __PEACH_BUNDLED_KOTLIN__;
|
|
60175
|
-
const digest4 = (0, import_node_crypto52.createHash)("sha256").update(JSON.stringify(files2)).digest("hex");
|
|
60176
|
-
const parent = import_node_path99.default.join(rnxHomeDir(), "kotlin", "modules");
|
|
60177
|
-
const root = import_node_path99.default.join(parent, digest4);
|
|
60178
|
-
import_node_fs100.default.mkdirSync(parent, { recursive: true });
|
|
60179
|
-
if (!import_node_fs100.default.existsSync(root)) {
|
|
60180
|
-
const pending = import_node_fs100.default.mkdtempSync(import_node_path99.default.join(parent, ".install-"));
|
|
60181
|
-
try {
|
|
60182
|
-
for (const [name3, contents] of Object.entries(files2)) {
|
|
60183
|
-
const file = import_node_path99.default.join(pending, name3);
|
|
60184
|
-
import_node_fs100.default.mkdirSync(import_node_path99.default.dirname(file), { recursive: true });
|
|
60185
|
-
import_node_fs100.default.writeFileSync(file, Buffer.from(contents, "base64"));
|
|
60186
|
-
}
|
|
60187
|
-
try {
|
|
60188
|
-
import_node_fs100.default.renameSync(pending, root);
|
|
60189
|
-
} catch (error) {
|
|
60190
|
-
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY")
|
|
60191
|
-
throw error;
|
|
60192
|
-
}
|
|
60193
|
-
} finally {
|
|
60194
|
-
import_node_fs100.default.rmSync(pending, { recursive: true, force: true });
|
|
60195
|
-
}
|
|
60196
|
-
}
|
|
60197
|
-
for (const [name3, contents] of Object.entries(files2)) {
|
|
60198
|
-
if (!import_node_fs100.default.readFileSync(import_node_path99.default.join(root, name3)).equals(Buffer.from(contents, "base64")))
|
|
60199
|
-
throw new Error(`packaged Kotlin module differs from this CLI: ${name3}`);
|
|
60200
|
-
}
|
|
60201
|
-
installedRoot = root;
|
|
60202
|
-
return root;
|
|
60203
|
-
}
|
|
60204
|
-
var import_node_crypto52, import_node_fs100, import_node_path99, import_node_url7, installedRoot;
|
|
60205
|
-
var init_kotlin_module = __esm({
|
|
60206
|
-
"src/kotlin-module.ts"() {
|
|
60207
|
-
"use strict";
|
|
60208
|
-
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60209
|
-
import_node_crypto52 = require("node:crypto");
|
|
60210
60386
|
import_node_fs100 = __toESM(require("node:fs"), 1);
|
|
60211
60387
|
import_node_path99 = __toESM(require("node:path"), 1);
|
|
60212
|
-
import_node_url7 = require("node:url");
|
|
60213
|
-
init_standalone();
|
|
60214
|
-
init_home_paths();
|
|
60215
60388
|
init_is_record();
|
|
60389
|
+
qualified2 = (file, name3) => file.package ? `${file.package}.${name3}` : name3;
|
|
60216
60390
|
}
|
|
60217
60391
|
});
|
|
60218
60392
|
|
|
@@ -60232,7 +60406,7 @@ async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
|
|
|
60232
60406
|
import_node_fs101.default.writeFileSync(target, bytes);
|
|
60233
60407
|
origins.set(target, file);
|
|
60234
60408
|
}
|
|
60235
|
-
const { stdout } = await
|
|
60409
|
+
const { stdout } = await run10(
|
|
60236
60410
|
import_node_path100.default.join(toolchain.javaHome, "bin", "java"),
|
|
60237
60411
|
[
|
|
60238
60412
|
"-cp",
|
|
@@ -60245,7 +60419,14 @@ async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
|
|
|
60245
60419
|
...origins.keys()
|
|
60246
60420
|
],
|
|
60247
60421
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
60248
|
-
)
|
|
60422
|
+
).catch((cause) => {
|
|
60423
|
+
if (!isRecord(cause) || typeof cause.stderr !== "string") throw cause;
|
|
60424
|
+
let diagnostic = cause.stderr;
|
|
60425
|
+
for (const [temporary, original] of origins)
|
|
60426
|
+
diagnostic = diagnostic.replaceAll(temporary, original);
|
|
60427
|
+
throw new Error(`Java module read failed:
|
|
60428
|
+
${diagnostic.trim()}`, { cause });
|
|
60429
|
+
});
|
|
60249
60430
|
const specs = stdout.split("\n").filter(Boolean).map((line) => {
|
|
60250
60431
|
const row = JSON.parse(line);
|
|
60251
60432
|
if (!isRecord(row) || typeof row.file !== "string" || typeof row.className !== "string" || row.name !== null && typeof row.name !== "string" || typeof row.source !== "string" || !Array.isArray(row.methods))
|
|
@@ -60283,7 +60464,7 @@ async function compileJavaModuleAbi(input) {
|
|
|
60283
60464
|
].join("\n")
|
|
60284
60465
|
);
|
|
60285
60466
|
const name3 = `peach-java-abi-${hash}`;
|
|
60286
|
-
await
|
|
60467
|
+
await run10(
|
|
60287
60468
|
toolchain.kotlinc,
|
|
60288
60469
|
[
|
|
60289
60470
|
"-J-Xmx2g",
|
|
@@ -60307,7 +60488,7 @@ async function compileJavaModuleAbi(input) {
|
|
|
60307
60488
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
60308
60489
|
);
|
|
60309
60490
|
const library = import_node_path100.default.join(directory2, "java-abi.klib");
|
|
60310
|
-
await
|
|
60491
|
+
await run10(
|
|
60311
60492
|
import_node_path100.default.join(toolchain.javaHome, "bin", "java"),
|
|
60312
60493
|
[
|
|
60313
60494
|
"-cp",
|
|
@@ -60324,24 +60505,308 @@ async function compileJavaModuleAbi(input) {
|
|
|
60324
60505
|
);
|
|
60325
60506
|
return library;
|
|
60326
60507
|
}
|
|
60327
|
-
var
|
|
60508
|
+
var import_node_child_process47, import_node_crypto53, import_node_fs101, import_node_path100, import_node_util19, run10, JAVA_BINDINGS_INITIALIZER;
|
|
60328
60509
|
var init_java_module_abi = __esm({
|
|
60329
60510
|
"src/java-module-abi.ts"() {
|
|
60330
60511
|
"use strict";
|
|
60331
60512
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60332
|
-
|
|
60513
|
+
import_node_child_process47 = require("node:child_process");
|
|
60333
60514
|
import_node_crypto53 = require("node:crypto");
|
|
60334
60515
|
import_node_fs101 = __toESM(require("node:fs"), 1);
|
|
60335
60516
|
import_node_path100 = __toESM(require("node:path"), 1);
|
|
60336
|
-
|
|
60517
|
+
import_node_util19 = require("node:util");
|
|
60337
60518
|
init_android_bridge_packages();
|
|
60338
60519
|
init_is_record();
|
|
60339
60520
|
init_kotlin_toolchain();
|
|
60340
|
-
|
|
60521
|
+
run10 = (0, import_node_util19.promisify)(import_node_child_process47.execFile);
|
|
60341
60522
|
JAVA_BINDINGS_INITIALIZER = "initializeJavaBindings";
|
|
60342
60523
|
}
|
|
60343
60524
|
});
|
|
60344
60525
|
|
|
60526
|
+
// src/kotlinSdkContract.ts
|
|
60527
|
+
function readKotlinSdkManifest(source, compilerSha256) {
|
|
60528
|
+
const value = JSON.parse(source);
|
|
60529
|
+
if (!isRecord(value) || value.format !== 1 || value.abi !== 1 || value.compilerSha256 !== compilerSha256 || typeof value.sourceDigest !== "string" || !/^[a-f0-9]{64}$/.test(value.sourceDigest) || !isRecord(value.files) || Object.keys(value.files).length !== KOTLIN_SDK_FILES.length)
|
|
60530
|
+
throw new Error("Kotlin SDK manifest is incompatible with this compiler");
|
|
60531
|
+
const files2 = {};
|
|
60532
|
+
for (const name3 of KOTLIN_SDK_FILES) {
|
|
60533
|
+
const file = value.files[name3];
|
|
60534
|
+
if (!isRecord(file) || typeof file.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(file.sha256) || typeof file.bytes !== "number" || !Number.isSafeInteger(file.bytes) || file.bytes < 1)
|
|
60535
|
+
throw new Error(`Kotlin SDK has no verified binary ${name3}`);
|
|
60536
|
+
files2[name3] = { sha256: file.sha256, bytes: file.bytes };
|
|
60537
|
+
}
|
|
60538
|
+
return {
|
|
60539
|
+
format: 1,
|
|
60540
|
+
abi: 1,
|
|
60541
|
+
compilerSha256,
|
|
60542
|
+
sourceDigest: value.sourceDigest,
|
|
60543
|
+
files: files2
|
|
60544
|
+
};
|
|
60545
|
+
}
|
|
60546
|
+
var platform, KOTLIN_SDK_PROFILES, KOTLIN_SDK_FILES;
|
|
60547
|
+
var init_kotlinSdkContract = __esm({
|
|
60548
|
+
"src/kotlinSdkContract.ts"() {
|
|
60549
|
+
"use strict";
|
|
60550
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60551
|
+
init_is_record();
|
|
60552
|
+
platform = ["Sources", "JniPlatformSources", "JniSources"];
|
|
60553
|
+
KOTLIN_SDK_PROFILES = {
|
|
60554
|
+
core: { compose: false, directories: platform },
|
|
60555
|
+
compose: { compose: true, directories: platform },
|
|
60556
|
+
views: { compose: true, directories: [...platform, "ComposeSources"] },
|
|
60557
|
+
jni: { compose: false, directories: [...platform, "JniTransportSources"] },
|
|
60558
|
+
jniCompose: {
|
|
60559
|
+
compose: true,
|
|
60560
|
+
directories: [...platform, "JniTransportSources"]
|
|
60561
|
+
},
|
|
60562
|
+
jniViews: {
|
|
60563
|
+
compose: true,
|
|
60564
|
+
directories: [...platform, "JniTransportSources", "ComposeSources"]
|
|
60565
|
+
},
|
|
60566
|
+
expo: {
|
|
60567
|
+
compose: false,
|
|
60568
|
+
directories: [...platform, "ExpoSources", "BridgeSources", "AndroidViewSources"]
|
|
60569
|
+
},
|
|
60570
|
+
expoCompose: {
|
|
60571
|
+
compose: true,
|
|
60572
|
+
directories: [
|
|
60573
|
+
...platform,
|
|
60574
|
+
"ExpoSources",
|
|
60575
|
+
"BridgeSources",
|
|
60576
|
+
"AndroidViewSources",
|
|
60577
|
+
"ComposeSources",
|
|
60578
|
+
"AndroidComposeSources",
|
|
60579
|
+
"ExpoComposeSources"
|
|
60580
|
+
]
|
|
60581
|
+
},
|
|
60582
|
+
app: {
|
|
60583
|
+
compose: true,
|
|
60584
|
+
directories: [
|
|
60585
|
+
...platform,
|
|
60586
|
+
"ComposeSources",
|
|
60587
|
+
"AppSources",
|
|
60588
|
+
"AndroidViewSources",
|
|
60589
|
+
"AndroidComposeSources"
|
|
60590
|
+
]
|
|
60591
|
+
}
|
|
60592
|
+
};
|
|
60593
|
+
KOTLIN_SDK_FILES = [
|
|
60594
|
+
"plugin.jar",
|
|
60595
|
+
"tools.jar",
|
|
60596
|
+
...Object.keys(KOTLIN_SDK_PROFILES).map((name3) => `${name3}.klib`)
|
|
60597
|
+
];
|
|
60598
|
+
}
|
|
60599
|
+
});
|
|
60600
|
+
|
|
60601
|
+
// src/kotlin-sdk.ts
|
|
60602
|
+
function verifyKotlinSdkDirectory(root, compilerSha256) {
|
|
60603
|
+
const expectedNames = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
60604
|
+
const names = import_node_fs102.default.readdirSync(root);
|
|
60605
|
+
if (names.length !== expectedNames.length || names.some((name3) => !expectedNames.includes(name3)))
|
|
60606
|
+
throw new Error("Kotlin SDK directory contains unexpected inputs");
|
|
60607
|
+
const manifestStat = import_node_fs102.default.lstatSync(import_node_path101.default.join(root, "manifest.json"));
|
|
60608
|
+
if (!manifestStat.isFile() || manifestStat.nlink !== 1)
|
|
60609
|
+
throw new Error("Kotlin SDK manifest is not a regular file");
|
|
60610
|
+
const manifest = readKotlinSdkManifest(
|
|
60611
|
+
import_node_fs102.default.readFileSync(import_node_path101.default.join(root, "manifest.json"), "utf8"),
|
|
60612
|
+
compilerSha256
|
|
60613
|
+
);
|
|
60614
|
+
for (const [name3, expected] of Object.entries(manifest.files)) {
|
|
60615
|
+
const target = import_node_path101.default.join(root, name3);
|
|
60616
|
+
const stat = import_node_fs102.default.lstatSync(target);
|
|
60617
|
+
if (!stat.isFile() || stat.nlink !== 1)
|
|
60618
|
+
throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
|
|
60619
|
+
const bytes = import_node_fs102.default.readFileSync(target);
|
|
60620
|
+
if (bytes.length !== expected.bytes || (0, import_node_crypto54.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
|
|
60621
|
+
throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
|
|
60622
|
+
}
|
|
60623
|
+
return manifest;
|
|
60624
|
+
}
|
|
60625
|
+
async function installKotlinSdkArchive(archive, compilerSha256) {
|
|
60626
|
+
const sha2564 = (0, import_node_crypto54.createHash)("sha256").update(archive).digest("hex");
|
|
60627
|
+
const parent = import_node_path101.default.join(kotlinHome(), "sdk");
|
|
60628
|
+
const root = import_node_path101.default.join(parent, sha2564);
|
|
60629
|
+
if (import_node_fs102.default.existsSync(root))
|
|
60630
|
+
return { root, sha256: sha2564, manifest: verifyKotlinSdkDirectory(root, compilerSha256) };
|
|
60631
|
+
import_node_fs102.default.mkdirSync(parent, { recursive: true });
|
|
60632
|
+
const work = import_node_fs102.default.mkdtempSync(import_node_path101.default.join(parent, ".install-"));
|
|
60633
|
+
try {
|
|
60634
|
+
const packed = import_node_path101.default.join(work, "sdk.tar.gz");
|
|
60635
|
+
import_node_fs102.default.writeFileSync(packed, archive);
|
|
60636
|
+
const { stdout } = await run11("tar", ["-tzf", packed]);
|
|
60637
|
+
const names = stdout.trim().split("\n");
|
|
60638
|
+
const expected = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
60639
|
+
if (names.length !== expected.length || new Set(names).size !== names.length || names.some((name3) => !expected.includes(name3)))
|
|
60640
|
+
throw new Error("Kotlin SDK archive contains unexpected inputs");
|
|
60641
|
+
await run11("tar", ["-xzf", packed, "-C", work, "--", ...expected]);
|
|
60642
|
+
import_node_fs102.default.rmSync(packed);
|
|
60643
|
+
const manifest = verifyKotlinSdkDirectory(work, compilerSha256);
|
|
60644
|
+
try {
|
|
60645
|
+
import_node_fs102.default.renameSync(work, root);
|
|
60646
|
+
} catch (error) {
|
|
60647
|
+
if (!import_node_fs102.default.existsSync(root)) throw error;
|
|
60648
|
+
verifyKotlinSdkDirectory(root, compilerSha256);
|
|
60649
|
+
}
|
|
60650
|
+
return { root, sha256: sha2564, manifest };
|
|
60651
|
+
} finally {
|
|
60652
|
+
import_node_fs102.default.rmSync(work, { recursive: true, force: true });
|
|
60653
|
+
}
|
|
60654
|
+
}
|
|
60655
|
+
var import_node_child_process48, import_node_crypto54, import_node_fs102, import_node_path101, import_node_util20, run11;
|
|
60656
|
+
var init_kotlin_sdk = __esm({
|
|
60657
|
+
"src/kotlin-sdk.ts"() {
|
|
60658
|
+
"use strict";
|
|
60659
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60660
|
+
import_node_child_process48 = require("node:child_process");
|
|
60661
|
+
import_node_crypto54 = require("node:crypto");
|
|
60662
|
+
import_node_fs102 = __toESM(require("node:fs"), 1);
|
|
60663
|
+
import_node_path101 = __toESM(require("node:path"), 1);
|
|
60664
|
+
import_node_util20 = require("node:util");
|
|
60665
|
+
init_kotlin_toolchain();
|
|
60666
|
+
init_kotlinSdkContract();
|
|
60667
|
+
run11 = (0, import_node_util20.promisify)(import_node_child_process48.execFile);
|
|
60668
|
+
}
|
|
60669
|
+
});
|
|
60670
|
+
|
|
60671
|
+
// src/android-bridge-dependencies.ts
|
|
60672
|
+
async function collectAndroidBridgeDependencies(appRoot, moduleRoot) {
|
|
60673
|
+
const root = import_node_path102.default.join(appRoot, "android");
|
|
60674
|
+
if (!import_node_fs103.default.existsSync(import_node_path102.default.join(root, "gradlew"))) return null;
|
|
60675
|
+
const dependencies = (await resolveReactNativeAndroidAutolinking(appRoot)).flatMap(
|
|
60676
|
+
(dependency) => dependency.sourceDir === null || dependency.packageInstance === null ? [] : [
|
|
60677
|
+
{
|
|
60678
|
+
...dependency,
|
|
60679
|
+
sourceDir: dependency.sourceDir,
|
|
60680
|
+
packageInstance: dependency.packageInstance
|
|
60681
|
+
}
|
|
60682
|
+
]
|
|
60683
|
+
);
|
|
60684
|
+
if (dependencies.length === 0) return null;
|
|
60685
|
+
const models = await resolveAndroidGradleSources({
|
|
60686
|
+
root,
|
|
60687
|
+
projects: [
|
|
60688
|
+
import_node_path102.default.join(root, "app"),
|
|
60689
|
+
...dependencies.map((dependency) => dependency.sourceDir)
|
|
60690
|
+
],
|
|
60691
|
+
variant: "debug"
|
|
60692
|
+
});
|
|
60693
|
+
const applicationId = models[0].applicationId;
|
|
60694
|
+
if (applicationId === null) throw new Error(`${root}/app is not an Android application`);
|
|
60695
|
+
const toolchain = readToolchain(moduleRoot);
|
|
60696
|
+
const [sdk, ready] = await Promise.all([
|
|
60697
|
+
installKotlinSdkArchive(
|
|
60698
|
+
import_node_fs103.default.readFileSync(import_node_path102.default.join(moduleRoot, "sdk.tar.gz")),
|
|
60699
|
+
toolchain.compiler.sha256
|
|
60700
|
+
),
|
|
60701
|
+
ensureToolchain(toolchain)
|
|
60702
|
+
]);
|
|
60703
|
+
const packages = [];
|
|
60704
|
+
for (const dependency of dependencies) {
|
|
60705
|
+
const model = models.find(
|
|
60706
|
+
(entry) => entry.projectDir === import_node_fs103.default.realpathSync(dependency.sourceDir)
|
|
60707
|
+
);
|
|
60708
|
+
try {
|
|
60709
|
+
const className2 = /^import\s+([\w.]+)\s*;$/.exec(
|
|
60710
|
+
dependency.packageImportPath ?? ""
|
|
60711
|
+
)?.[1];
|
|
60712
|
+
const constructor = /^new\s+([\w.]+)\s*\(\s*\)$/.exec(
|
|
60713
|
+
dependency.packageInstance
|
|
60714
|
+
)?.[1];
|
|
60715
|
+
if (!className2 || constructor !== className2 && constructor !== className2.split(".").pop())
|
|
60716
|
+
throw new Error(
|
|
60717
|
+
"native package registration requires a constructor without arguments"
|
|
60718
|
+
);
|
|
60719
|
+
const declarations = await readJavaModuleSpecs(model.java, sdk.root, ready);
|
|
60720
|
+
const modules = declarations.specs.flatMap(
|
|
60721
|
+
(spec) => spec.name === null ? [] : [
|
|
60722
|
+
{
|
|
60723
|
+
className: spec.className,
|
|
60724
|
+
name: spec.name,
|
|
60725
|
+
methods: spec.methods
|
|
60726
|
+
}
|
|
60727
|
+
]
|
|
60728
|
+
);
|
|
60729
|
+
if (modules.length === 0) continue;
|
|
60730
|
+
packages.push({
|
|
60731
|
+
className: className2,
|
|
60732
|
+
modules,
|
|
60733
|
+
sources: model.kotlin,
|
|
60734
|
+
javaSpecs: model.java,
|
|
60735
|
+
unsupported: null
|
|
60736
|
+
});
|
|
60737
|
+
} catch (error) {
|
|
60738
|
+
console.error(
|
|
60739
|
+
`[peach] ${dependency.name} native source is unavailable: ${error instanceof Error ? error.message : String(error)}`
|
|
60740
|
+
);
|
|
60741
|
+
}
|
|
60742
|
+
}
|
|
60743
|
+
return packages.length ? { applicationId, packages } : null;
|
|
60744
|
+
}
|
|
60745
|
+
var import_node_fs103, import_node_path102;
|
|
60746
|
+
var init_android_bridge_dependencies = __esm({
|
|
60747
|
+
"src/android-bridge-dependencies.ts"() {
|
|
60748
|
+
"use strict";
|
|
60749
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60750
|
+
import_node_fs103 = __toESM(require("node:fs"), 1);
|
|
60751
|
+
import_node_path102 = __toESM(require("node:path"), 1);
|
|
60752
|
+
init_android_autolinking();
|
|
60753
|
+
init_android_gradle_sources();
|
|
60754
|
+
init_java_module_abi();
|
|
60755
|
+
init_kotlin_sdk();
|
|
60756
|
+
init_kotlin_toolchain();
|
|
60757
|
+
}
|
|
60758
|
+
});
|
|
60759
|
+
|
|
60760
|
+
// src/kotlin-module.ts
|
|
60761
|
+
function peachKotlinModuleRoot() {
|
|
60762
|
+
if (!IS_STANDALONE)
|
|
60763
|
+
return import_node_path103.default.resolve(import_node_path103.default.dirname((0, import_node_url7.fileURLToPath)(__sootsim_import_meta_url)), "..", "kotlin");
|
|
60764
|
+
if (installedRoot) return installedRoot;
|
|
60765
|
+
const files2 = __PEACH_BUNDLED_KOTLIN__;
|
|
60766
|
+
const digest4 = (0, import_node_crypto55.createHash)("sha256").update(JSON.stringify(files2)).digest("hex");
|
|
60767
|
+
const parent = import_node_path103.default.join(rnxHomeDir(), "kotlin", "modules");
|
|
60768
|
+
const root = import_node_path103.default.join(parent, digest4);
|
|
60769
|
+
import_node_fs104.default.mkdirSync(parent, { recursive: true });
|
|
60770
|
+
if (!import_node_fs104.default.existsSync(root)) {
|
|
60771
|
+
const pending = import_node_fs104.default.mkdtempSync(import_node_path103.default.join(parent, ".install-"));
|
|
60772
|
+
try {
|
|
60773
|
+
for (const [name3, contents] of Object.entries(files2)) {
|
|
60774
|
+
const file = import_node_path103.default.join(pending, name3);
|
|
60775
|
+
import_node_fs104.default.mkdirSync(import_node_path103.default.dirname(file), { recursive: true });
|
|
60776
|
+
import_node_fs104.default.writeFileSync(file, Buffer.from(contents, "base64"));
|
|
60777
|
+
}
|
|
60778
|
+
try {
|
|
60779
|
+
import_node_fs104.default.renameSync(pending, root);
|
|
60780
|
+
} catch (error) {
|
|
60781
|
+
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY")
|
|
60782
|
+
throw error;
|
|
60783
|
+
}
|
|
60784
|
+
} finally {
|
|
60785
|
+
import_node_fs104.default.rmSync(pending, { recursive: true, force: true });
|
|
60786
|
+
}
|
|
60787
|
+
}
|
|
60788
|
+
for (const [name3, contents] of Object.entries(files2)) {
|
|
60789
|
+
if (!import_node_fs104.default.readFileSync(import_node_path103.default.join(root, name3)).equals(Buffer.from(contents, "base64")))
|
|
60790
|
+
throw new Error(`packaged Kotlin module differs from this CLI: ${name3}`);
|
|
60791
|
+
}
|
|
60792
|
+
installedRoot = root;
|
|
60793
|
+
return root;
|
|
60794
|
+
}
|
|
60795
|
+
var import_node_crypto55, import_node_fs104, import_node_path103, import_node_url7, installedRoot;
|
|
60796
|
+
var init_kotlin_module = __esm({
|
|
60797
|
+
"src/kotlin-module.ts"() {
|
|
60798
|
+
"use strict";
|
|
60799
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60800
|
+
import_node_crypto55 = require("node:crypto");
|
|
60801
|
+
import_node_fs104 = __toESM(require("node:fs"), 1);
|
|
60802
|
+
import_node_path103 = __toESM(require("node:path"), 1);
|
|
60803
|
+
import_node_url7 = require("node:url");
|
|
60804
|
+
init_standalone();
|
|
60805
|
+
init_home_paths();
|
|
60806
|
+
init_is_record();
|
|
60807
|
+
}
|
|
60808
|
+
});
|
|
60809
|
+
|
|
60345
60810
|
// src/kotlin-instance-source.ts
|
|
60346
60811
|
function bindingNames(pattern) {
|
|
60347
60812
|
if (pattern.type === "Identifier") return [pattern.name];
|
|
@@ -60455,144 +60920,6 @@ var init_kotlin_instance_source = __esm({
|
|
|
60455
60920
|
}
|
|
60456
60921
|
});
|
|
60457
60922
|
|
|
60458
|
-
// src/kotlinSdkContract.ts
|
|
60459
|
-
function readKotlinSdkManifest(source, compilerSha256) {
|
|
60460
|
-
const value = JSON.parse(source);
|
|
60461
|
-
if (!isRecord(value) || value.format !== 1 || value.abi !== 1 || value.compilerSha256 !== compilerSha256 || typeof value.sourceDigest !== "string" || !/^[a-f0-9]{64}$/.test(value.sourceDigest) || !isRecord(value.files) || Object.keys(value.files).length !== KOTLIN_SDK_FILES.length)
|
|
60462
|
-
throw new Error("Kotlin SDK manifest is incompatible with this compiler");
|
|
60463
|
-
const files2 = {};
|
|
60464
|
-
for (const name3 of KOTLIN_SDK_FILES) {
|
|
60465
|
-
const file = value.files[name3];
|
|
60466
|
-
if (!isRecord(file) || typeof file.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(file.sha256) || typeof file.bytes !== "number" || !Number.isSafeInteger(file.bytes) || file.bytes < 1)
|
|
60467
|
-
throw new Error(`Kotlin SDK has no verified binary ${name3}`);
|
|
60468
|
-
files2[name3] = { sha256: file.sha256, bytes: file.bytes };
|
|
60469
|
-
}
|
|
60470
|
-
return {
|
|
60471
|
-
format: 1,
|
|
60472
|
-
abi: 1,
|
|
60473
|
-
compilerSha256,
|
|
60474
|
-
sourceDigest: value.sourceDigest,
|
|
60475
|
-
files: files2
|
|
60476
|
-
};
|
|
60477
|
-
}
|
|
60478
|
-
var platform, KOTLIN_SDK_PROFILES, KOTLIN_SDK_FILES;
|
|
60479
|
-
var init_kotlinSdkContract = __esm({
|
|
60480
|
-
"src/kotlinSdkContract.ts"() {
|
|
60481
|
-
"use strict";
|
|
60482
|
-
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60483
|
-
init_is_record();
|
|
60484
|
-
platform = ["Sources", "JniPlatformSources", "JniSources"];
|
|
60485
|
-
KOTLIN_SDK_PROFILES = {
|
|
60486
|
-
core: { compose: false, directories: platform },
|
|
60487
|
-
compose: { compose: true, directories: platform },
|
|
60488
|
-
views: { compose: true, directories: [...platform, "ComposeSources"] },
|
|
60489
|
-
jni: { compose: false, directories: [...platform, "JniTransportSources"] },
|
|
60490
|
-
jniCompose: {
|
|
60491
|
-
compose: true,
|
|
60492
|
-
directories: [...platform, "JniTransportSources"]
|
|
60493
|
-
},
|
|
60494
|
-
jniViews: {
|
|
60495
|
-
compose: true,
|
|
60496
|
-
directories: [...platform, "JniTransportSources", "ComposeSources"]
|
|
60497
|
-
},
|
|
60498
|
-
expo: {
|
|
60499
|
-
compose: false,
|
|
60500
|
-
directories: [...platform, "ExpoSources", "BridgeSources", "AndroidViewSources"]
|
|
60501
|
-
},
|
|
60502
|
-
expoCompose: {
|
|
60503
|
-
compose: true,
|
|
60504
|
-
directories: [
|
|
60505
|
-
...platform,
|
|
60506
|
-
"ExpoSources",
|
|
60507
|
-
"BridgeSources",
|
|
60508
|
-
"AndroidViewSources",
|
|
60509
|
-
"ComposeSources",
|
|
60510
|
-
"ExpoComposeSources"
|
|
60511
|
-
]
|
|
60512
|
-
},
|
|
60513
|
-
app: {
|
|
60514
|
-
compose: true,
|
|
60515
|
-
directories: [...platform, "ComposeSources", "AppSources", "AndroidViewSources"]
|
|
60516
|
-
}
|
|
60517
|
-
};
|
|
60518
|
-
KOTLIN_SDK_FILES = [
|
|
60519
|
-
"plugin.jar",
|
|
60520
|
-
"tools.jar",
|
|
60521
|
-
...Object.keys(KOTLIN_SDK_PROFILES).map((name3) => `${name3}.klib`)
|
|
60522
|
-
];
|
|
60523
|
-
}
|
|
60524
|
-
});
|
|
60525
|
-
|
|
60526
|
-
// src/kotlin-sdk.ts
|
|
60527
|
-
function verifyKotlinSdkDirectory(root, compilerSha256) {
|
|
60528
|
-
const expectedNames = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
60529
|
-
const names = import_node_fs102.default.readdirSync(root);
|
|
60530
|
-
if (names.length !== expectedNames.length || names.some((name3) => !expectedNames.includes(name3)))
|
|
60531
|
-
throw new Error("Kotlin SDK directory contains unexpected inputs");
|
|
60532
|
-
const manifestStat = import_node_fs102.default.lstatSync(import_node_path101.default.join(root, "manifest.json"));
|
|
60533
|
-
if (!manifestStat.isFile() || manifestStat.nlink !== 1)
|
|
60534
|
-
throw new Error("Kotlin SDK manifest is not a regular file");
|
|
60535
|
-
const manifest = readKotlinSdkManifest(
|
|
60536
|
-
import_node_fs102.default.readFileSync(import_node_path101.default.join(root, "manifest.json"), "utf8"),
|
|
60537
|
-
compilerSha256
|
|
60538
|
-
);
|
|
60539
|
-
for (const [name3, expected] of Object.entries(manifest.files)) {
|
|
60540
|
-
const target = import_node_path101.default.join(root, name3);
|
|
60541
|
-
const stat = import_node_fs102.default.lstatSync(target);
|
|
60542
|
-
if (!stat.isFile() || stat.nlink !== 1)
|
|
60543
|
-
throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
|
|
60544
|
-
const bytes = import_node_fs102.default.readFileSync(target);
|
|
60545
|
-
if (bytes.length !== expected.bytes || (0, import_node_crypto54.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
|
|
60546
|
-
throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
|
|
60547
|
-
}
|
|
60548
|
-
return manifest;
|
|
60549
|
-
}
|
|
60550
|
-
async function installKotlinSdkArchive(archive, compilerSha256) {
|
|
60551
|
-
const sha2564 = (0, import_node_crypto54.createHash)("sha256").update(archive).digest("hex");
|
|
60552
|
-
const parent = import_node_path101.default.join(kotlinHome(), "sdk");
|
|
60553
|
-
const root = import_node_path101.default.join(parent, sha2564);
|
|
60554
|
-
if (import_node_fs102.default.existsSync(root))
|
|
60555
|
-
return { root, sha256: sha2564, manifest: verifyKotlinSdkDirectory(root, compilerSha256) };
|
|
60556
|
-
import_node_fs102.default.mkdirSync(parent, { recursive: true });
|
|
60557
|
-
const work = import_node_fs102.default.mkdtempSync(import_node_path101.default.join(parent, ".install-"));
|
|
60558
|
-
try {
|
|
60559
|
-
const packed = import_node_path101.default.join(work, "sdk.tar.gz");
|
|
60560
|
-
import_node_fs102.default.writeFileSync(packed, archive);
|
|
60561
|
-
const { stdout } = await run10("tar", ["-tzf", packed]);
|
|
60562
|
-
const names = stdout.trim().split("\n");
|
|
60563
|
-
const expected = ["manifest.json", ...KOTLIN_SDK_FILES];
|
|
60564
|
-
if (names.length !== expected.length || new Set(names).size !== names.length || names.some((name3) => !expected.includes(name3)))
|
|
60565
|
-
throw new Error("Kotlin SDK archive contains unexpected inputs");
|
|
60566
|
-
await run10("tar", ["-xzf", packed, "-C", work, "--", ...expected]);
|
|
60567
|
-
import_node_fs102.default.rmSync(packed);
|
|
60568
|
-
const manifest = verifyKotlinSdkDirectory(work, compilerSha256);
|
|
60569
|
-
try {
|
|
60570
|
-
import_node_fs102.default.renameSync(work, root);
|
|
60571
|
-
} catch (error) {
|
|
60572
|
-
if (!import_node_fs102.default.existsSync(root)) throw error;
|
|
60573
|
-
verifyKotlinSdkDirectory(root, compilerSha256);
|
|
60574
|
-
}
|
|
60575
|
-
return { root, sha256: sha2564, manifest };
|
|
60576
|
-
} finally {
|
|
60577
|
-
import_node_fs102.default.rmSync(work, { recursive: true, force: true });
|
|
60578
|
-
}
|
|
60579
|
-
}
|
|
60580
|
-
var import_node_child_process47, import_node_crypto54, import_node_fs102, import_node_path101, import_node_util19, run10;
|
|
60581
|
-
var init_kotlin_sdk = __esm({
|
|
60582
|
-
"src/kotlin-sdk.ts"() {
|
|
60583
|
-
"use strict";
|
|
60584
|
-
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60585
|
-
import_node_child_process47 = require("node:child_process");
|
|
60586
|
-
import_node_crypto54 = require("node:crypto");
|
|
60587
|
-
import_node_fs102 = __toESM(require("node:fs"), 1);
|
|
60588
|
-
import_node_path101 = __toESM(require("node:path"), 1);
|
|
60589
|
-
import_node_util19 = require("node:util");
|
|
60590
|
-
init_kotlin_toolchain();
|
|
60591
|
-
init_kotlinSdkContract();
|
|
60592
|
-
run10 = (0, import_node_util19.promisify)(import_node_child_process47.execFile);
|
|
60593
|
-
}
|
|
60594
|
-
});
|
|
60595
|
-
|
|
60596
60923
|
// src/kotlin-view-models.ts
|
|
60597
60924
|
function strings6(value) {
|
|
60598
60925
|
if (!Array.isArray(value) || !value.every((item) => typeof item === "string"))
|
|
@@ -60676,145 +61003,6 @@ var init_kotlin_view_models = __esm({
|
|
|
60676
61003
|
}
|
|
60677
61004
|
});
|
|
60678
61005
|
|
|
60679
|
-
// src/android-gradle-sources.ts
|
|
60680
|
-
var android_gradle_sources_exports = {};
|
|
60681
|
-
__export(android_gradle_sources_exports, {
|
|
60682
|
-
resolveAndroidGradleSources: () => resolveAndroidGradleSources
|
|
60683
|
-
});
|
|
60684
|
-
async function resolveAndroidGradleSources(request) {
|
|
60685
|
-
let { root } = request;
|
|
60686
|
-
const { projects: projectDirs, variant: variant2 } = request;
|
|
60687
|
-
if (projectDirs.length === 0) return [];
|
|
60688
|
-
if (!import_node_path102.default.isAbsolute(root) || projectDirs.some((dir) => !import_node_path102.default.isAbsolute(dir)))
|
|
60689
|
-
throw new Error("Android Gradle source selection requires absolute project paths");
|
|
60690
|
-
if (!variant2) throw new Error("Android Gradle source selection requires a variant");
|
|
60691
|
-
root = import_node_fs103.default.realpathSync(root);
|
|
60692
|
-
const projects2 = [...new Set(projectDirs.map((dir) => import_node_fs103.default.realpathSync(dir)))];
|
|
60693
|
-
const parent = import_node_path102.default.join(kotlinHome(), "gradle-sources");
|
|
60694
|
-
import_node_fs103.default.mkdirSync(parent, { recursive: true });
|
|
60695
|
-
const work = import_node_fs103.default.mkdtempSync(import_node_path102.default.join(parent, ".query-"));
|
|
60696
|
-
const task = `peachAndroidSources${(0, import_node_crypto55.randomBytes)(8).toString("hex")}`;
|
|
60697
|
-
const script = import_node_path102.default.join(work, "sources.gradle");
|
|
60698
|
-
const encoded = Buffer.from(
|
|
60699
|
-
JSON.stringify({ root, projects: projects2, variant: variant2, output: work, task })
|
|
60700
|
-
).toString("base64");
|
|
60701
|
-
import_node_fs103.default.writeFileSync(script, modelQuery.replace("__PEACH_REQUEST__", encoded));
|
|
60702
|
-
try {
|
|
60703
|
-
await run11(
|
|
60704
|
-
"bash",
|
|
60705
|
-
[
|
|
60706
|
-
import_node_path102.default.join(root, "gradlew"),
|
|
60707
|
-
"--init-script",
|
|
60708
|
-
script,
|
|
60709
|
-
`${task}All`,
|
|
60710
|
-
"--no-daemon",
|
|
60711
|
-
"--no-configuration-cache",
|
|
60712
|
-
"--max-workers=1",
|
|
60713
|
-
"--console=plain"
|
|
60714
|
-
],
|
|
60715
|
-
{
|
|
60716
|
-
cwd: root,
|
|
60717
|
-
timeout: 3e5,
|
|
60718
|
-
maxBuffer: 8 * 1024 * 1024,
|
|
60719
|
-
env: { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" }
|
|
60720
|
-
}
|
|
60721
|
-
);
|
|
60722
|
-
return projects2.map((projectDir, index) => {
|
|
60723
|
-
const value = JSON.parse(
|
|
60724
|
-
import_node_fs103.default.readFileSync(import_node_path102.default.join(work, `${index}.json`), "utf8")
|
|
60725
|
-
);
|
|
60726
|
-
if (!isRecord(value) || value.projectDir !== projectDir || value.variant !== variant2 || typeof value.projectPath !== "string" || value.applicationId !== null && typeof value.applicationId !== "string")
|
|
60727
|
-
throw new Error("Gradle printed an invalid Android project source model");
|
|
60728
|
-
const sources = (field) => {
|
|
60729
|
-
const list2 = value[field];
|
|
60730
|
-
if (!Array.isArray(list2) || !list2.every((file) => typeof file === "string" && import_node_path102.default.isAbsolute(file)))
|
|
60731
|
-
throw new Error(`Gradle printed invalid Android ${field} source paths`);
|
|
60732
|
-
return list2.map(String);
|
|
60733
|
-
};
|
|
60734
|
-
return {
|
|
60735
|
-
projectDir,
|
|
60736
|
-
projectPath: value.projectPath,
|
|
60737
|
-
variant: variant2,
|
|
60738
|
-
applicationId: value.applicationId,
|
|
60739
|
-
kotlin: sources("kotlin"),
|
|
60740
|
-
java: sources("java")
|
|
60741
|
-
};
|
|
60742
|
-
});
|
|
60743
|
-
} finally {
|
|
60744
|
-
import_node_fs103.default.rmSync(work, { recursive: true, force: true });
|
|
60745
|
-
}
|
|
60746
|
-
}
|
|
60747
|
-
var import_node_child_process48, import_node_crypto55, import_node_fs103, import_node_path102, import_node_util20, run11, modelQuery;
|
|
60748
|
-
var init_android_gradle_sources = __esm({
|
|
60749
|
-
"src/android-gradle-sources.ts"() {
|
|
60750
|
-
"use strict";
|
|
60751
|
-
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
60752
|
-
import_node_child_process48 = require("node:child_process");
|
|
60753
|
-
import_node_crypto55 = require("node:crypto");
|
|
60754
|
-
import_node_fs103 = __toESM(require("node:fs"), 1);
|
|
60755
|
-
import_node_path102 = __toESM(require("node:path"), 1);
|
|
60756
|
-
import_node_util20 = require("node:util");
|
|
60757
|
-
init_forked_script_contract();
|
|
60758
|
-
init_is_record();
|
|
60759
|
-
init_kotlin_toolchain();
|
|
60760
|
-
run11 = (0, import_node_util20.promisify)(import_node_child_process48.execFile);
|
|
60761
|
-
modelQuery = `
|
|
60762
|
-
import groovy.json.JsonOutput
|
|
60763
|
-
import groovy.json.JsonSlurper
|
|
60764
|
-
|
|
60765
|
-
def request = new JsonSlurper().parseText(new String(Base64.decoder.decode('__PEACH_REQUEST__'), 'UTF-8'))
|
|
60766
|
-
gradle.projectsEvaluated {
|
|
60767
|
-
if (gradle.rootProject.projectDir.canonicalPath != request.root) return
|
|
60768
|
-
def selected = []
|
|
60769
|
-
request.projects.eachWithIndex { directory, index ->
|
|
60770
|
-
def matches = gradle.rootProject.allprojects.findAll { it.projectDir.canonicalPath == directory }
|
|
60771
|
-
if (matches.size() != 1) throw new GradleException('Expected one Android project for ' + directory)
|
|
60772
|
-
def project = matches[0]
|
|
60773
|
-
if (project.pluginManager.hasPlugin('org.jetbrains.kotlin.multiplatform')) {
|
|
60774
|
-
throw new GradleException('Kotlin multiplatform source selection is not supported: ' + project.path)
|
|
60775
|
-
}
|
|
60776
|
-
def library = project.pluginManager.hasPlugin('com.android.library')
|
|
60777
|
-
if (!library && !project.pluginManager.hasPlugin('com.android.application')) {
|
|
60778
|
-
throw new GradleException('Project has no Android application or library plugin: ' + project.path)
|
|
60779
|
-
}
|
|
60780
|
-
def android = project.extensions.getByName('android')
|
|
60781
|
-
def variants = library ? android.libraryVariants : android.applicationVariants
|
|
60782
|
-
def variant = variants.find { it.name == request.variant }
|
|
60783
|
-
if (variant == null) throw new GradleException('Android variant ' + request.variant + ' is absent: ' + project.path)
|
|
60784
|
-
def generators = []
|
|
60785
|
-
def buildConfig = variant.generateBuildConfigProvider
|
|
60786
|
-
if (buildConfig != null) generators.add(buildConfig)
|
|
60787
|
-
if (project.pluginManager.hasPlugin('com.facebook.react')) {
|
|
60788
|
-
generators.add(project.tasks.named('generateCodegenArtifactsFromSchema'))
|
|
60789
|
-
}
|
|
60790
|
-
def kotlin = project.tasks.findByName('compile' + variant.name.capitalize() + 'Kotlin')
|
|
60791
|
-
def kotlinSources = kotlin == null ? project.files() : kotlin.sources
|
|
60792
|
-
def javaSources = variant.javaCompileProvider.get().source
|
|
60793
|
-
def query = project.tasks.register(request.task) {
|
|
60794
|
-
dependsOn(generators)
|
|
60795
|
-
dependsOn(kotlinSources.buildDependencies, javaSources.buildDependencies)
|
|
60796
|
-
doLast {
|
|
60797
|
-
def files = (kotlinSources.files + javaSources.files).unique()
|
|
60798
|
-
def unknown = files.find { !it.name.endsWith('.kt') && !it.name.endsWith('.java') }
|
|
60799
|
-
if (unknown != null) throw new GradleException('Unsupported Android source: ' + unknown)
|
|
60800
|
-
new File(request.output, index.toString() + '.json').text = JsonOutput.toJson([
|
|
60801
|
-
projectDir:project.projectDir.canonicalPath,
|
|
60802
|
-
projectPath:project.path,
|
|
60803
|
-
variant:variant.name,
|
|
60804
|
-
applicationId:library ? null : variant.applicationId,
|
|
60805
|
-
kotlin:files.findAll { it.name.endsWith('.kt') }.collect { it.absolutePath }.sort(),
|
|
60806
|
-
java:files.findAll { it.name.endsWith('.java') }.collect { it.absolutePath }.sort()
|
|
60807
|
-
])
|
|
60808
|
-
}
|
|
60809
|
-
}
|
|
60810
|
-
selected.add(query)
|
|
60811
|
-
}
|
|
60812
|
-
gradle.rootProject.tasks.register(request.task + 'All') { dependsOn(selected) }
|
|
60813
|
-
}
|
|
60814
|
-
`;
|
|
60815
|
-
}
|
|
60816
|
-
});
|
|
60817
|
-
|
|
60818
61006
|
// src/kotlin-host.ts
|
|
60819
61007
|
var kotlin_host_exports = {};
|
|
60820
61008
|
__export(kotlin_host_exports, {
|
|
@@ -60831,16 +61019,16 @@ __export(kotlin_host_exports, {
|
|
|
60831
61019
|
});
|
|
60832
61020
|
function loadKotlinSdk(moduleRoot, toolchain) {
|
|
60833
61021
|
return installKotlinSdkArchive(
|
|
60834
|
-
|
|
61022
|
+
import_node_fs105.default.readFileSync(import_node_path104.default.join(moduleRoot, "sdk.tar.gz")),
|
|
60835
61023
|
toolchain.compiler.sha256
|
|
60836
61024
|
);
|
|
60837
61025
|
}
|
|
60838
61026
|
function appKotlinLanguage(root) {
|
|
60839
|
-
const reactNative =
|
|
60840
|
-
(0, import_node_module18.createRequire)(
|
|
61027
|
+
const reactNative = import_node_path104.default.dirname(
|
|
61028
|
+
(0, import_node_module18.createRequire)(import_node_path104.default.join(root, "package.json")).resolve("react-native/package.json")
|
|
60841
61029
|
);
|
|
60842
|
-
const versions =
|
|
60843
|
-
|
|
61030
|
+
const versions = import_node_fs105.default.readFileSync(
|
|
61031
|
+
import_node_path104.default.join(reactNative, "gradle", "libs.versions.toml"),
|
|
60844
61032
|
"utf8"
|
|
60845
61033
|
);
|
|
60846
61034
|
const match = /^kotlin\s*=\s*"(\d+)\.(\d+)/m.exec(versions);
|
|
@@ -60851,9 +61039,9 @@ function appKotlinLanguage(root) {
|
|
|
60851
61039
|
function kotlinSources(root, skip = SKIP_DIRS) {
|
|
60852
61040
|
const sources = [];
|
|
60853
61041
|
const walk3 = (dir) => {
|
|
60854
|
-
for (const entry of
|
|
61042
|
+
for (const entry of import_node_fs105.default.readdirSync(dir, { withFileTypes: true })) {
|
|
60855
61043
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
60856
|
-
const full =
|
|
61044
|
+
const full = import_node_path104.default.join(dir, entry.name);
|
|
60857
61045
|
if (entry.isDirectory()) walk3(full);
|
|
60858
61046
|
else if (entry.isFile() && entry.name.endsWith(".kt")) sources.push(full);
|
|
60859
61047
|
}
|
|
@@ -60915,7 +61103,7 @@ function entrySource(ids) {
|
|
|
60915
61103
|
].join("\n");
|
|
60916
61104
|
}
|
|
60917
61105
|
function buildsDir() {
|
|
60918
|
-
return
|
|
61106
|
+
return import_node_path104.default.join(kotlinHome(), "builds");
|
|
60919
61107
|
}
|
|
60920
61108
|
async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
|
|
60921
61109
|
const { kotlinSourceId, nativeSourceContract, renderKotlinSourceGlue } = await import("vxrn/native-source-contract");
|
|
@@ -60928,7 +61116,7 @@ async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
|
|
|
60928
61116
|
const viewIds = [];
|
|
60929
61117
|
let usesCompose = false;
|
|
60930
61118
|
for (const file of sources) {
|
|
60931
|
-
const source =
|
|
61119
|
+
const source = import_node_fs105.default.readFileSync(file, "utf8");
|
|
60932
61120
|
if (/\bandroidx\.compose\./.test(source)) usesCompose = true;
|
|
60933
61121
|
const contract = nativeSourceContract(file, source);
|
|
60934
61122
|
if (contract.modules.length === 0 && contract.views.length === 0) continue;
|
|
@@ -61019,22 +61207,22 @@ function readExpoTypes(output2) {
|
|
|
61019
61207
|
async function scanSources(tool, parse12, toolchain, moduleRoot, files2) {
|
|
61020
61208
|
const digest4 = (0, import_node_crypto56.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
|
|
61021
61209
|
const sdk = await loadKotlinSdk(moduleRoot, toolchain);
|
|
61022
|
-
digest4.update(
|
|
61210
|
+
digest4.update(import_node_fs105.default.readFileSync(import_node_path104.default.join(moduleRoot, "sdk.tar.gz")));
|
|
61023
61211
|
digest4.update(tool);
|
|
61024
|
-
for (const file of files2) digest4.update(`${file}\0${
|
|
61212
|
+
for (const file of files2) digest4.update(`${file}\0${import_node_fs105.default.readFileSync(file, "utf8")}\0`);
|
|
61025
61213
|
const key2 = digest4.digest("hex");
|
|
61026
61214
|
let scan2 = toolScans.get(key2);
|
|
61027
61215
|
if (!scan2) {
|
|
61028
61216
|
scan2 = (async () => {
|
|
61029
61217
|
const { kotlinc } = await ensureToolchain(toolchain);
|
|
61030
61218
|
const { stdout } = await run12(
|
|
61031
|
-
|
|
61219
|
+
import_node_path104.default.join(import_node_path104.default.dirname(kotlinc), "kotlin"),
|
|
61032
61220
|
[
|
|
61033
61221
|
"-cp",
|
|
61034
61222
|
[
|
|
61035
|
-
|
|
61036
|
-
|
|
61037
|
-
].join(
|
|
61223
|
+
import_node_path104.default.resolve(import_node_path104.default.dirname(kotlinc), "../lib/kotlin-compiler.jar"),
|
|
61224
|
+
import_node_path104.default.join(sdk.root, "tools.jar")
|
|
61225
|
+
].join(import_node_path104.default.delimiter),
|
|
61038
61226
|
tool,
|
|
61039
61227
|
...files2
|
|
61040
61228
|
],
|
|
@@ -61052,7 +61240,7 @@ async function scanSources(tool, parse12, toolchain, moduleRoot, files2) {
|
|
|
61052
61240
|
async function scanExpoTypes(toolchain, moduleRoot, sources) {
|
|
61053
61241
|
const candidates = sources.filter(
|
|
61054
61242
|
(file) => /\bRecord\b|\benum\s+class\b|\bExpoComposeView\b|\bExpoView\b|\bComposeProps\b|:\s*(?:[A-Za-z0-9_.]+\.)?(?:View|FrameLayout|LinearLayout|ViewGroup)\b/.test(
|
|
61055
|
-
|
|
61243
|
+
import_node_fs105.default.readFileSync(file, "utf8")
|
|
61056
61244
|
)
|
|
61057
61245
|
);
|
|
61058
61246
|
if (candidates.length === 0) return [];
|
|
@@ -61196,7 +61384,7 @@ function expoTypeSources(files2) {
|
|
|
61196
61384
|
)
|
|
61197
61385
|
];
|
|
61198
61386
|
if (edits.length > 0 || views.length > 0) {
|
|
61199
|
-
let text6 =
|
|
61387
|
+
let text6 = import_node_fs105.default.readFileSync(file.file, "utf8").replaceAll("\r\n", "\n");
|
|
61200
61388
|
for (const { range: range2, owner, field } of edits.sort((a, b) => b.range[0] - a.range[0]))
|
|
61201
61389
|
text6 = `${text6.slice(0, range2[0])}dev.peach.expo.PeachExpoTypes.initial(${owner}::class, ${literal2(field.key)}, ${field.required}) { ${text6.slice(range2[0], range2[1])} }${text6.slice(range2[1])}`;
|
|
61202
61390
|
if (views.length > 0) {
|
|
@@ -61212,7 +61400,7 @@ function expoTypeSources(files2) {
|
|
|
61212
61400
|
`${file.package ? `${file.package}.` : ""}peachExpoViews${index}()`
|
|
61213
61401
|
);
|
|
61214
61402
|
}
|
|
61215
|
-
const name3 = `PeachExpoSource_${index}_${
|
|
61403
|
+
const name3 = `PeachExpoSource_${index}_${import_node_path104.default.basename(file.file)}`;
|
|
61216
61404
|
generated[name3] = text6;
|
|
61217
61405
|
origins[name3] = file.file;
|
|
61218
61406
|
}
|
|
@@ -61254,7 +61442,7 @@ async function expoKotlinArtifact(root, moduleRoot, origin, modules) {
|
|
|
61254
61442
|
const language = appKotlinLanguage(root);
|
|
61255
61443
|
const scanned = await scanExpoTypes(toolchain, moduleRoot, modules.sources);
|
|
61256
61444
|
const usesCompose = scanned.some((file) => file.views.length > 0) || modules.sources.some(
|
|
61257
|
-
(file) => /\bandroidx\.compose\./.test(
|
|
61445
|
+
(file) => /\bandroidx\.compose\./.test(import_node_fs105.default.readFileSync(file, "utf8"))
|
|
61258
61446
|
);
|
|
61259
61447
|
const types = expoTypeSources(scanned);
|
|
61260
61448
|
const rewritten = new Set(Object.values(types.origins));
|
|
@@ -61416,6 +61604,7 @@ async function kotlinAppArtifact(app, moduleRoot, origin) {
|
|
|
61416
61604
|
toolchain,
|
|
61417
61605
|
language: app.language,
|
|
61418
61606
|
sources: app.sources,
|
|
61607
|
+
javaSpecs: app.javaSources,
|
|
61419
61608
|
generated,
|
|
61420
61609
|
sdkProfile: "app",
|
|
61421
61610
|
usesCompose: true,
|
|
@@ -61468,7 +61657,7 @@ function appResourceSources(app) {
|
|
|
61468
61657
|
entries: app.drawables.map((drawable) => ({
|
|
61469
61658
|
name: drawable.name,
|
|
61470
61659
|
init: `listOf(
|
|
61471
|
-
${drawable.files.map((file) => drawableInit(file,
|
|
61660
|
+
${drawable.files.map((file) => drawableInit(file, import_node_path104.default.relative(app.moduleDir, file.file))).join(",\n")}
|
|
61472
61661
|
)`
|
|
61473
61662
|
}))
|
|
61474
61663
|
},
|
|
@@ -61537,7 +61726,7 @@ function drawableInit(drawable, file) {
|
|
|
61537
61726
|
if (drawable.kind === "xml") return `PeachDrawable.Xml(${where})`;
|
|
61538
61727
|
if (drawable.kind === "bitmap")
|
|
61539
61728
|
return `PeachDrawable.Bitmap(${where}, ${drawable.ninePatch}, ${literal2(
|
|
61540
|
-
|
|
61729
|
+
import_node_fs105.default.readFileSync(drawable.file).toString("base64")
|
|
61541
61730
|
)})`;
|
|
61542
61731
|
const vector = drawable.vector;
|
|
61543
61732
|
const float3 = (value) => `${value}f`;
|
|
@@ -61601,8 +61790,8 @@ async function compileKotlin(input, origin) {
|
|
|
61601
61790
|
javaSpecs = []
|
|
61602
61791
|
} = input;
|
|
61603
61792
|
const sdk = await loadKotlinSdk(moduleRoot, toolchain);
|
|
61604
|
-
const plugin =
|
|
61605
|
-
const sdkLibrary =
|
|
61793
|
+
const plugin = import_node_path104.default.join(sdk.root, "plugin.jar");
|
|
61794
|
+
const sdkLibrary = import_node_path104.default.join(sdk.root, `${sdkProfile}.klib`);
|
|
61606
61795
|
const java = javaSpecs.length ? await readJavaModuleSpecs(javaSpecs, sdk.root, await ensureToolchain(toolchain)) : null;
|
|
61607
61796
|
const generated = {
|
|
61608
61797
|
...sourceGenerated,
|
|
@@ -61625,7 +61814,7 @@ async function compileKotlin(input, origin) {
|
|
|
61625
61814
|
};
|
|
61626
61815
|
const inputs = sources.map((file) => ({
|
|
61627
61816
|
file,
|
|
61628
|
-
bytes:
|
|
61817
|
+
bytes: import_node_fs105.default.readFileSync(file)
|
|
61629
61818
|
}));
|
|
61630
61819
|
const digest4 = (0, import_node_crypto56.createHash)("sha256");
|
|
61631
61820
|
digest4.update(
|
|
@@ -61640,7 +61829,7 @@ async function compileKotlin(input, origin) {
|
|
|
61640
61829
|
})
|
|
61641
61830
|
);
|
|
61642
61831
|
for (const { file, bytes } of inputs)
|
|
61643
|
-
digest4.update(
|
|
61832
|
+
digest4.update(import_node_path104.default.relative(root, file)).update("\0").update(bytes).update("\0");
|
|
61644
61833
|
if (viewModels) digest4.update(viewModels.toolClass);
|
|
61645
61834
|
for (const [name3, text6] of Object.entries(generated))
|
|
61646
61835
|
digest4.update(`${name3}\0${text6}\0`);
|
|
@@ -61649,39 +61838,39 @@ async function compileKotlin(input, origin) {
|
|
|
61649
61838
|
url: `${origin}${KOTLIN_ARTIFACT_PREFIX}${hash}/app.mjs`,
|
|
61650
61839
|
hash
|
|
61651
61840
|
};
|
|
61652
|
-
const out =
|
|
61653
|
-
if (
|
|
61841
|
+
const out = import_node_path104.default.join(buildsDir(), hash);
|
|
61842
|
+
if (import_node_fs105.default.existsSync(import_node_path104.default.join(out, "js", "app.wasm"))) return artifact;
|
|
61654
61843
|
const pending = builds.get(hash);
|
|
61655
61844
|
if (pending) return pending;
|
|
61656
61845
|
const build = (async () => {
|
|
61657
61846
|
const ready = await ensureToolchain(toolchain);
|
|
61658
61847
|
const { kotlinc } = ready;
|
|
61659
61848
|
const libraries = [...ready.libraries, sdkLibrary];
|
|
61660
|
-
const composeRuntime =
|
|
61849
|
+
const composeRuntime = import_node_path104.default.join(
|
|
61661
61850
|
kotlinHome(),
|
|
61662
61851
|
toolchain.compiler.version,
|
|
61663
61852
|
toolchain.composeRuntime.name
|
|
61664
61853
|
);
|
|
61665
61854
|
if (usesCompose) {
|
|
61666
61855
|
for (const library of toolchain.composeLibraries) {
|
|
61667
|
-
const target =
|
|
61856
|
+
const target = import_node_path104.default.join(kotlinHome(), toolchain.compiler.version, library.name);
|
|
61668
61857
|
await fetchVerified(library, target);
|
|
61669
61858
|
libraries.push(target);
|
|
61670
61859
|
}
|
|
61671
61860
|
await fetchVerified(toolchain.composeRuntime, composeRuntime);
|
|
61672
61861
|
}
|
|
61673
|
-
|
|
61674
|
-
const work =
|
|
61675
|
-
const javaLibrary = java ?
|
|
61862
|
+
import_node_fs105.default.mkdirSync(buildsDir(), { recursive: true });
|
|
61863
|
+
const work = import_node_fs105.default.mkdtempSync(import_node_path104.default.join(buildsDir(), `${hash}-`));
|
|
61864
|
+
const javaLibrary = java ? import_node_path104.default.join(work, "java-abi", "java-abi.klib") : null;
|
|
61676
61865
|
if (javaLibrary) libraries.push(javaLibrary);
|
|
61677
|
-
const generatedDir =
|
|
61678
|
-
|
|
61866
|
+
const generatedDir = import_node_path104.default.join(work, "generated");
|
|
61867
|
+
import_node_fs105.default.mkdirSync(generatedDir);
|
|
61679
61868
|
for (const [name3, text6] of Object.entries(generated))
|
|
61680
|
-
|
|
61869
|
+
import_node_fs105.default.writeFileSync(import_node_path104.default.join(generatedDir, name3), text6);
|
|
61681
61870
|
const compiledSources = inputs.map(({ file, bytes }, index) => {
|
|
61682
|
-
const target =
|
|
61683
|
-
|
|
61684
|
-
|
|
61871
|
+
const target = import_node_path104.default.join(work, "sources", String(index), import_node_path104.default.basename(file));
|
|
61872
|
+
import_node_fs105.default.mkdirSync(import_node_path104.default.dirname(target), { recursive: true });
|
|
61873
|
+
import_node_fs105.default.writeFileSync(target, bytes);
|
|
61685
61874
|
return { file, target };
|
|
61686
61875
|
});
|
|
61687
61876
|
const common = [
|
|
@@ -61690,19 +61879,19 @@ async function compileKotlin(input, origin) {
|
|
|
61690
61879
|
"-Xallow-kotlin-package",
|
|
61691
61880
|
"-Xwasm-target=js",
|
|
61692
61881
|
"-libraries",
|
|
61693
|
-
libraries.join(
|
|
61882
|
+
libraries.join(import_node_path104.default.delimiter)
|
|
61694
61883
|
];
|
|
61695
61884
|
const compileKlib = (outputDir) => run12(
|
|
61696
61885
|
kotlinc,
|
|
61697
61886
|
[
|
|
61698
61887
|
...common,
|
|
61699
61888
|
`-Xplugin=${plugin}`,
|
|
61700
|
-
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(
|
|
61889
|
+
`-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path104.default.delimiter)}`,
|
|
61701
61890
|
...usesCompose ? [
|
|
61702
|
-
`-Xplugin=${
|
|
61891
|
+
`-Xplugin=${import_node_path104.default.resolve(import_node_path104.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
|
|
61703
61892
|
] : [],
|
|
61704
61893
|
...usesSerialization ? [
|
|
61705
|
-
`-Xplugin=${
|
|
61894
|
+
`-Xplugin=${import_node_path104.default.resolve(import_node_path104.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
|
|
61706
61895
|
] : [],
|
|
61707
61896
|
"-language-version",
|
|
61708
61897
|
language,
|
|
@@ -61715,7 +61904,7 @@ async function compileKotlin(input, origin) {
|
|
|
61715
61904
|
"-ir-output-name",
|
|
61716
61905
|
"app",
|
|
61717
61906
|
...compiledSources.map(({ target }) => target),
|
|
61718
|
-
...Object.keys(generated).map((name3) =>
|
|
61907
|
+
...Object.keys(generated).map((name3) => import_node_path104.default.join(generatedDir, name3))
|
|
61719
61908
|
],
|
|
61720
61909
|
{ maxBuffer: 16 * 1024 * 1024 }
|
|
61721
61910
|
);
|
|
@@ -61734,36 +61923,36 @@ async function compileKotlin(input, origin) {
|
|
|
61734
61923
|
if (viewModels && inputs.some(
|
|
61735
61924
|
({ file, bytes }) => sources.includes(file) && bytes.includes("ViewModel")
|
|
61736
61925
|
)) {
|
|
61737
|
-
await compileKlib(
|
|
61926
|
+
await compileKlib(import_node_path104.default.join(work, "abi"));
|
|
61738
61927
|
const { stdout } = await run12(
|
|
61739
|
-
|
|
61928
|
+
import_node_path104.default.join(import_node_path104.default.dirname(kotlinc), "kotlin"),
|
|
61740
61929
|
[
|
|
61741
61930
|
"-cp",
|
|
61742
61931
|
[
|
|
61743
|
-
|
|
61744
|
-
|
|
61745
|
-
].join(
|
|
61932
|
+
import_node_path104.default.resolve(import_node_path104.default.dirname(kotlinc), "../lib/kotlin-compiler.jar"),
|
|
61933
|
+
import_node_path104.default.join(sdk.root, "tools.jar")
|
|
61934
|
+
].join(import_node_path104.default.delimiter),
|
|
61746
61935
|
viewModels.toolClass,
|
|
61747
|
-
|
|
61936
|
+
import_node_path104.default.join(work, "abi")
|
|
61748
61937
|
],
|
|
61749
61938
|
{ maxBuffer: 64 * 1024 * 1024 }
|
|
61750
61939
|
);
|
|
61751
|
-
|
|
61752
|
-
|
|
61940
|
+
import_node_fs105.default.writeFileSync(
|
|
61941
|
+
import_node_path104.default.join(generatedDir, viewModels.file),
|
|
61753
61942
|
viewModels.render(viewModelClasses(readAbiClasses(stdout)))
|
|
61754
61943
|
);
|
|
61755
61944
|
}
|
|
61756
|
-
await compileKlib(
|
|
61945
|
+
await compileKlib(import_node_path104.default.join(work, "klib"));
|
|
61757
61946
|
await run12(
|
|
61758
61947
|
kotlinc,
|
|
61759
61948
|
[
|
|
61760
61949
|
...common,
|
|
61761
61950
|
"-nowarn",
|
|
61762
61951
|
"-Xpartial-linkage-loglevel=error",
|
|
61763
|
-
`-Xinclude=${
|
|
61952
|
+
`-Xinclude=${import_node_path104.default.join(work, "klib")}`,
|
|
61764
61953
|
"-Xir-produce-js",
|
|
61765
61954
|
"-ir-output-dir",
|
|
61766
|
-
|
|
61955
|
+
import_node_path104.default.join(work, "js"),
|
|
61767
61956
|
"-ir-output-name",
|
|
61768
61957
|
"app"
|
|
61769
61958
|
],
|
|
@@ -61776,10 +61965,10 @@ async function compileKotlin(input, origin) {
|
|
|
61776
61965
|
composeRuntime,
|
|
61777
61966
|
"skiko.mjs",
|
|
61778
61967
|
"-d",
|
|
61779
|
-
|
|
61968
|
+
import_node_path104.default.join(work, "js")
|
|
61780
61969
|
]);
|
|
61781
|
-
const skikoPath =
|
|
61782
|
-
const upstream = (0, import_acorn3.parse)(
|
|
61970
|
+
const skikoPath = import_node_path104.default.join(work, "js", "skiko.mjs");
|
|
61971
|
+
const upstream = (0, import_acorn3.parse)(import_node_fs105.default.readFileSync(skikoPath, "utf8"), {
|
|
61783
61972
|
ecmaVersion: "latest",
|
|
61784
61973
|
sourceType: "module"
|
|
61785
61974
|
});
|
|
@@ -61802,7 +61991,7 @@ async function compileKotlin(input, origin) {
|
|
|
61802
61991
|
"GL",
|
|
61803
61992
|
...bindings
|
|
61804
61993
|
];
|
|
61805
|
-
|
|
61994
|
+
import_node_fs105.default.writeFileSync(
|
|
61806
61995
|
skikoPath,
|
|
61807
61996
|
[
|
|
61808
61997
|
"const runtime = globalThis.__peachKotlinSkiko;",
|
|
@@ -61816,10 +62005,10 @@ async function compileKotlin(input, origin) {
|
|
|
61816
62005
|
if (usesCompose) {
|
|
61817
62006
|
for (const library of toolchain.composeJsLibraries) {
|
|
61818
62007
|
let imported = false;
|
|
61819
|
-
for (const file of
|
|
62008
|
+
for (const file of import_node_fs105.default.readdirSync(import_node_path104.default.join(work, "js"))) {
|
|
61820
62009
|
if (!file.endsWith(".mjs")) continue;
|
|
61821
|
-
const target =
|
|
61822
|
-
const source =
|
|
62010
|
+
const target = import_node_path104.default.join(work, "js", file);
|
|
62011
|
+
const source = import_node_fs105.default.readFileSync(target, "utf8");
|
|
61823
62012
|
let next = source;
|
|
61824
62013
|
for (const quote of ["'", '"'])
|
|
61825
62014
|
next = next.replaceAll(
|
|
@@ -61827,11 +62016,11 @@ async function compileKotlin(input, origin) {
|
|
|
61827
62016
|
`from ${quote}./${library.file}${quote}`
|
|
61828
62017
|
);
|
|
61829
62018
|
if (next === source) continue;
|
|
61830
|
-
|
|
62019
|
+
import_node_fs105.default.writeFileSync(target, next);
|
|
61831
62020
|
imported = true;
|
|
61832
62021
|
}
|
|
61833
62022
|
if (!imported) continue;
|
|
61834
|
-
const archive =
|
|
62023
|
+
const archive = import_node_path104.default.join(
|
|
61835
62024
|
kotlinHome(),
|
|
61836
62025
|
toolchain.compiler.version,
|
|
61837
62026
|
library.name
|
|
@@ -61840,19 +62029,19 @@ async function compileKotlin(input, origin) {
|
|
|
61840
62029
|
const { stdout } = await run12("tar", ["-xOf", archive, library.archiveEntry], {
|
|
61841
62030
|
maxBuffer: 16 * 1024 * 1024
|
|
61842
62031
|
});
|
|
61843
|
-
|
|
62032
|
+
import_node_fs105.default.writeFileSync(import_node_path104.default.join(work, "js", library.file), stdout);
|
|
61844
62033
|
}
|
|
61845
62034
|
}
|
|
61846
62035
|
} catch (error) {
|
|
61847
|
-
|
|
62036
|
+
import_node_fs105.default.rmSync(work, { recursive: true, force: true });
|
|
61848
62037
|
let output2 = isRecord(error) ? `${String(error.stderr ?? "")}${String(error.stdout ?? "")}` : "";
|
|
61849
62038
|
for (const [name3, source] of Object.entries(origins))
|
|
61850
|
-
output2 = output2.replaceAll(
|
|
62039
|
+
output2 = output2.replaceAll(import_node_path104.default.join(generatedDir, name3), source);
|
|
61851
62040
|
for (const { file, target } of compiledSources)
|
|
61852
|
-
output2 = output2.replaceAll(target, file).replaceAll(
|
|
62041
|
+
output2 = output2.replaceAll(target, file).replaceAll(import_node_path104.default.relative(process.cwd(), target), file);
|
|
61853
62042
|
for (const [index, spec] of (java?.specs ?? []).entries())
|
|
61854
62043
|
output2 = output2.replaceAll(
|
|
61855
|
-
|
|
62044
|
+
import_node_path104.default.join(work, "java-abi", `Spec${index}.kt`),
|
|
61856
62045
|
spec.file
|
|
61857
62046
|
);
|
|
61858
62047
|
output2 = output2.replace(
|
|
@@ -61867,9 +62056,9 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
61867
62056
|
const seams = [
|
|
61868
62057
|
["process.release.name", "process.release?.name"]
|
|
61869
62058
|
];
|
|
61870
|
-
const js =
|
|
62059
|
+
const js = import_node_fs105.default.readdirSync(import_node_path104.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
|
|
61871
62060
|
if (js.some(
|
|
61872
|
-
(file) =>
|
|
62061
|
+
(file) => import_node_fs105.default.readFileSync(import_node_path104.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
|
|
61873
62062
|
))
|
|
61874
62063
|
seams.push([
|
|
61875
62064
|
"(typeof(window) !== 'undefined' && window != null && typeof(window.addEventListener) === 'function') ? window : null",
|
|
@@ -61878,12 +62067,12 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
61878
62067
|
for (const [from, to] of seams) {
|
|
61879
62068
|
let patched = 0;
|
|
61880
62069
|
for (const file of js) {
|
|
61881
|
-
const target =
|
|
61882
|
-
const text6 =
|
|
62070
|
+
const target = import_node_path104.default.join(work, "js", file);
|
|
62071
|
+
const text6 = import_node_fs105.default.readFileSync(target, "utf8");
|
|
61883
62072
|
const next = text6.replaceAll(from, to);
|
|
61884
62073
|
if (next !== text6) {
|
|
61885
62074
|
patched++;
|
|
61886
|
-
|
|
62075
|
+
import_node_fs105.default.writeFileSync(target, next);
|
|
61887
62076
|
}
|
|
61888
62077
|
}
|
|
61889
62078
|
if (patched === 0)
|
|
@@ -61891,11 +62080,11 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
61891
62080
|
`kotlin output no longer contains ${from}; recheck how it detects its host in Peach`
|
|
61892
62081
|
);
|
|
61893
62082
|
}
|
|
61894
|
-
const entry =
|
|
61895
|
-
const entrySource2 =
|
|
61896
|
-
const importsPath =
|
|
62083
|
+
const entry = import_node_path104.default.join(work, "js/app.mjs");
|
|
62084
|
+
const entrySource2 = import_node_fs105.default.readFileSync(entry, "utf8");
|
|
62085
|
+
const importsPath = import_node_path104.default.join(work, "js/app.import-object.mjs");
|
|
61897
62086
|
const importsFactory = kotlinInstanceSource(
|
|
61898
|
-
|
|
62087
|
+
import_node_fs105.default.readFileSync(importsPath, "utf8"),
|
|
61899
62088
|
"createKotlinImportObject"
|
|
61900
62089
|
);
|
|
61901
62090
|
const runtimeFactory = kotlinInstanceSource(
|
|
@@ -61903,9 +62092,9 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
61903
62092
|
"createKotlinInstance",
|
|
61904
62093
|
/* @__PURE__ */ new Map([["./app.import-object.mjs", "createKotlinImportObject"]])
|
|
61905
62094
|
);
|
|
61906
|
-
|
|
61907
|
-
|
|
61908
|
-
|
|
62095
|
+
import_node_fs105.default.writeFileSync(importsPath, importsFactory.source);
|
|
62096
|
+
import_node_fs105.default.writeFileSync(import_node_path104.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
|
|
62097
|
+
import_node_fs105.default.writeFileSync(
|
|
61909
62098
|
entry,
|
|
61910
62099
|
[
|
|
61911
62100
|
"import { createKotlinInstance } from './app-runtime.mjs';",
|
|
@@ -61918,10 +62107,10 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
61918
62107
|
].join("\n")
|
|
61919
62108
|
);
|
|
61920
62109
|
try {
|
|
61921
|
-
|
|
62110
|
+
import_node_fs105.default.renameSync(work, out);
|
|
61922
62111
|
} catch (error) {
|
|
61923
|
-
if (!
|
|
61924
|
-
|
|
62112
|
+
if (!import_node_fs105.default.existsSync(import_node_path104.default.join(out, "js", "app.wasm"))) throw error;
|
|
62113
|
+
import_node_fs105.default.rmSync(work, { recursive: true, force: true });
|
|
61925
62114
|
}
|
|
61926
62115
|
return artifact;
|
|
61927
62116
|
})().finally(() => builds.delete(hash));
|
|
@@ -61929,24 +62118,24 @@ ${output2.trim() || (error instanceof Error ? error.message : String(error))}`
|
|
|
61929
62118
|
return build;
|
|
61930
62119
|
}
|
|
61931
62120
|
function kotlinArtifactFiles(hash) {
|
|
61932
|
-
const dir =
|
|
61933
|
-
return
|
|
61934
|
-
const contentType = CONTENT_TYPES[
|
|
62121
|
+
const dir = import_node_path104.default.join(buildsDir(), hash, "js");
|
|
62122
|
+
return import_node_fs105.default.readdirSync(dir).sort().map((name3) => {
|
|
62123
|
+
const contentType = CONTENT_TYPES[import_node_path104.default.extname(name3)];
|
|
61935
62124
|
if (!contentType) throw new Error(`unexpected kotlin artifact file ${name3}`);
|
|
61936
|
-
return { name: name3, bytes:
|
|
62125
|
+
return { name: name3, bytes: import_node_fs105.default.readFileSync(import_node_path104.default.join(dir, name3)), contentType };
|
|
61937
62126
|
});
|
|
61938
62127
|
}
|
|
61939
62128
|
function serveKotlinArtifact(pathname, res) {
|
|
61940
62129
|
if (!pathname.startsWith(KOTLIN_ARTIFACT_PREFIX)) return false;
|
|
61941
62130
|
const [hash, file, ...rest] = pathname.slice(KOTLIN_ARTIFACT_PREFIX.length).split("/");
|
|
61942
|
-
const type = file ? CONTENT_TYPES[
|
|
62131
|
+
const type = file ? CONTENT_TYPES[import_node_path104.default.extname(file)] : void 0;
|
|
61943
62132
|
if (!hash || !/^[0-9a-f]+$/.test(hash) || !file || rest.length > 0 || !type || file.includes("..")) {
|
|
61944
62133
|
res.statusCode = 404;
|
|
61945
62134
|
res.end("not a kotlin artifact");
|
|
61946
62135
|
return true;
|
|
61947
62136
|
}
|
|
61948
|
-
const target =
|
|
61949
|
-
if (!
|
|
62137
|
+
const target = import_node_path104.default.join(buildsDir(), hash, "js", file);
|
|
62138
|
+
if (!import_node_fs105.default.existsSync(target)) {
|
|
61950
62139
|
res.statusCode = 404;
|
|
61951
62140
|
res.end(`kotlin artifact ${hash}/${file} was not built`);
|
|
61952
62141
|
return true;
|
|
@@ -61954,7 +62143,7 @@ function serveKotlinArtifact(pathname, res) {
|
|
|
61954
62143
|
res.setHeader("access-control-allow-origin", "*");
|
|
61955
62144
|
res.setHeader("content-type", type);
|
|
61956
62145
|
res.setHeader("cache-control", "public, max-age=31536000, immutable");
|
|
61957
|
-
res.end(
|
|
62146
|
+
res.end(import_node_fs105.default.readFileSync(target));
|
|
61958
62147
|
return true;
|
|
61959
62148
|
}
|
|
61960
62149
|
async function serveKotlinRequest(pathname, res, app) {
|
|
@@ -61971,16 +62160,16 @@ async function serveKotlinRequest(pathname, res, app) {
|
|
|
61971
62160
|
}
|
|
61972
62161
|
return true;
|
|
61973
62162
|
}
|
|
61974
|
-
var import_node_child_process49, import_node_crypto56,
|
|
62163
|
+
var import_node_child_process49, import_node_crypto56, import_node_fs105, import_node_module18, import_node_path104, import_node_util21, import_acorn3, run12, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal2, CONTENT_TYPES, KOTLIN_PACKAGE_PATH;
|
|
61975
62164
|
var init_kotlin_host = __esm({
|
|
61976
62165
|
"src/kotlin-host.ts"() {
|
|
61977
62166
|
"use strict";
|
|
61978
62167
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
61979
62168
|
import_node_child_process49 = require("node:child_process");
|
|
61980
62169
|
import_node_crypto56 = require("node:crypto");
|
|
61981
|
-
|
|
62170
|
+
import_node_fs105 = __toESM(require("node:fs"), 1);
|
|
61982
62171
|
import_node_module18 = require("node:module");
|
|
61983
|
-
|
|
62172
|
+
import_node_path104 = __toESM(require("node:path"), 1);
|
|
61984
62173
|
import_node_util21 = require("node:util");
|
|
61985
62174
|
import_acorn3 = require("acorn");
|
|
61986
62175
|
init_android_bridge_packages();
|
|
@@ -62085,8 +62274,8 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
62085
62274
|
for (const project2 of entry.projects) {
|
|
62086
62275
|
if (!isRecord(project2) || typeof project2.sourceDir !== "string" || !Array.isArray(project2.modules))
|
|
62087
62276
|
throw new Error("invalid Expo Android project");
|
|
62088
|
-
const sourceDir =
|
|
62089
|
-
const installed = sourceDir.split(
|
|
62277
|
+
const sourceDir = import_node_fs106.default.realpathSync(project2.sourceDir);
|
|
62278
|
+
const installed = sourceDir.split(import_node_path105.default.sep).includes("node_modules");
|
|
62090
62279
|
if (installed) {
|
|
62091
62280
|
if (typeof entry.packageName !== "string") continue;
|
|
62092
62281
|
if (peachAnsweredNativePackages().has(entry.packageName)) {
|
|
@@ -62113,9 +62302,9 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
62113
62302
|
group.unsupported ??= reason;
|
|
62114
62303
|
};
|
|
62115
62304
|
const walk3 = (dir) => {
|
|
62116
|
-
if (!
|
|
62117
|
-
for (const child of
|
|
62118
|
-
const file =
|
|
62305
|
+
if (!import_node_fs106.default.existsSync(dir)) return;
|
|
62306
|
+
for (const child of import_node_fs106.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
62307
|
+
const file = import_node_path105.default.join(dir, child.name);
|
|
62119
62308
|
if (child.isSymbolicLink()) reject(`Expo Kotlin source is a symlink: ${file}`);
|
|
62120
62309
|
else if (child.isDirectory()) walk3(file);
|
|
62121
62310
|
else if (child.name.endsWith(".java"))
|
|
@@ -62123,23 +62312,28 @@ async function collectExpoKotlinModules(appRoot) {
|
|
|
62123
62312
|
else if (child.name.endsWith(".kt")) group.sources.push(file);
|
|
62124
62313
|
}
|
|
62125
62314
|
};
|
|
62126
|
-
walk3(
|
|
62127
|
-
walk3(
|
|
62315
|
+
walk3(import_node_path105.default.join(sourceDir, "src", "main", "java"));
|
|
62316
|
+
walk3(import_node_path105.default.join(sourceDir, "src", "main", "kotlin"));
|
|
62128
62317
|
result.push(group);
|
|
62129
62318
|
}
|
|
62130
62319
|
}
|
|
62131
62320
|
return result.length === 0 && !answeredInstalled ? null : result;
|
|
62132
62321
|
}
|
|
62133
62322
|
async function collectBridgePackages(appRoot) {
|
|
62323
|
+
const dependencies = await collectAndroidBridgeDependencies(
|
|
62324
|
+
appRoot,
|
|
62325
|
+
peachKotlinModuleRoot()
|
|
62326
|
+
);
|
|
62134
62327
|
const app = androidAppSources(appRoot);
|
|
62135
62328
|
if (!app || !app.kotlin.some(
|
|
62136
|
-
(file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(
|
|
62329
|
+
(file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(import_node_fs106.default.readFileSync(file, "utf8"))
|
|
62137
62330
|
))
|
|
62138
|
-
return
|
|
62331
|
+
return dependencies;
|
|
62139
62332
|
const { scanBridgeFiles: scanBridgeFiles2 } = await Promise.resolve().then(() => (init_kotlin_host(), kotlin_host_exports));
|
|
62140
62333
|
const files2 = await scanBridgeFiles2(peachKotlinModuleRoot(), app.kotlin);
|
|
62141
62334
|
const selection = selectBridgePackages(app.applicationId, files2, app.java);
|
|
62142
|
-
|
|
62335
|
+
const packages = [...dependencies?.packages ?? [], ...selection.packages];
|
|
62336
|
+
return packages.length ? { applicationId: dependencies?.applicationId ?? selection.applicationId, packages } : null;
|
|
62143
62337
|
}
|
|
62144
62338
|
async function compileExpoKotlinModules(root, origin) {
|
|
62145
62339
|
const expo = await collectExpoKotlinModules(root);
|
|
@@ -62193,20 +62387,26 @@ async function compileExpoKotlinModules(root, origin) {
|
|
|
62193
62387
|
const artifact = await expoKotlinArtifact2(root, peachKotlinModuleRoot(), origin, {
|
|
62194
62388
|
modules,
|
|
62195
62389
|
sources,
|
|
62390
|
+
javaSpecs: [...new Set(hosted.flatMap((entry) => entry.javaSpecs ?? []))],
|
|
62196
62391
|
bridge: selection && { applicationId: selection.applicationId, packages: hosted }
|
|
62197
62392
|
});
|
|
62198
62393
|
return result(artifact);
|
|
62199
62394
|
} catch (error) {
|
|
62200
62395
|
const message = error instanceof Error ? error.message : String(error);
|
|
62201
|
-
const errors = message.match(/^.+\.kt:\d+:\d+: error:.*$/gm);
|
|
62396
|
+
const errors = message.match(/^.+\.(?:kt|java):\d+:\d+: error:.*$/gm);
|
|
62202
62397
|
if (!errors) throw error;
|
|
62203
62398
|
const linesFor = (sources2) => errors.filter((line) => sources2.some((source) => line.startsWith(`${source}:`)));
|
|
62204
|
-
const broken = hosted.filter(
|
|
62399
|
+
const broken = hosted.filter(
|
|
62400
|
+
(entry) => linesFor([...entry.sources, ...entry.javaSpecs ?? []]).length > 0
|
|
62401
|
+
);
|
|
62205
62402
|
const brokenProjects = projects2.filter(
|
|
62206
62403
|
(project2) => project2.installed && linesFor(project2.sources).length > 0
|
|
62207
62404
|
);
|
|
62208
62405
|
if (broken.length > 0 || brokenProjects.length > 0) {
|
|
62209
|
-
drop(
|
|
62406
|
+
drop(
|
|
62407
|
+
broken,
|
|
62408
|
+
(entry) => linesFor([...entry.sources, ...entry.javaSpecs ?? []]).join("\n")
|
|
62409
|
+
);
|
|
62210
62410
|
dropProjects(brokenProjects, (project2) => linesFor(project2.sources).join("\n"));
|
|
62211
62411
|
continue;
|
|
62212
62412
|
}
|
|
@@ -62217,14 +62417,15 @@ async function compileExpoKotlinModules(root, origin) {
|
|
|
62217
62417
|
}
|
|
62218
62418
|
}
|
|
62219
62419
|
}
|
|
62220
|
-
var
|
|
62420
|
+
var import_node_fs106, import_node_path105;
|
|
62221
62421
|
var init_expo_kotlin_host = __esm({
|
|
62222
62422
|
"src/expo-kotlin-host.ts"() {
|
|
62223
62423
|
"use strict";
|
|
62224
62424
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
62225
|
-
|
|
62226
|
-
|
|
62425
|
+
import_node_fs106 = __toESM(require("node:fs"), 1);
|
|
62426
|
+
import_node_path105 = __toESM(require("node:path"), 1);
|
|
62227
62427
|
init_android_autolinking();
|
|
62428
|
+
init_android_bridge_dependencies();
|
|
62228
62429
|
init_android_bridge_packages();
|
|
62229
62430
|
init_answeredNativePackages();
|
|
62230
62431
|
init_backend_origin();
|
|
@@ -62648,16 +62849,16 @@ var init_replacementModule = __esm({
|
|
|
62648
62849
|
|
|
62649
62850
|
// src/host/replacement-module-handler.ts
|
|
62650
62851
|
function resolveReplacementModuleFile(fromFile, specifier) {
|
|
62651
|
-
const base =
|
|
62852
|
+
const base = import_node_path108.default.resolve(import_node_path108.default.dirname(fromFile), specifier);
|
|
62652
62853
|
const candidates = [
|
|
62653
62854
|
...REPLACEMENT_MODULE_EXTENSIONS.some(
|
|
62654
|
-
(ext) => ext ===
|
|
62855
|
+
(ext) => ext === import_node_path108.default.extname(base).toLowerCase()
|
|
62655
62856
|
) ? [base] : [],
|
|
62656
62857
|
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
|
|
62657
|
-
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) =>
|
|
62858
|
+
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path108.default.join(base, `index${ext}`))
|
|
62658
62859
|
];
|
|
62659
62860
|
const found = candidates.find(
|
|
62660
|
-
(candidate) => (0,
|
|
62861
|
+
(candidate) => (0, import_node_fs109.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
|
|
62661
62862
|
);
|
|
62662
62863
|
if (!found) {
|
|
62663
62864
|
throw new Error(
|
|
@@ -62666,13 +62867,13 @@ function resolveReplacementModuleFile(fromFile, specifier) {
|
|
|
62666
62867
|
}
|
|
62667
62868
|
return found;
|
|
62668
62869
|
}
|
|
62669
|
-
var
|
|
62870
|
+
var import_node_fs109, import_node_path108;
|
|
62670
62871
|
var init_replacement_module_handler = __esm({
|
|
62671
62872
|
"src/host/replacement-module-handler.ts"() {
|
|
62672
62873
|
"use strict";
|
|
62673
62874
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
62674
|
-
|
|
62675
|
-
|
|
62875
|
+
import_node_fs109 = require("node:fs");
|
|
62876
|
+
import_node_path108 = __toESM(require("node:path"), 1);
|
|
62676
62877
|
init_replacementModule();
|
|
62677
62878
|
init_backend_origin();
|
|
62678
62879
|
}
|
|
@@ -62702,14 +62903,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
62702
62903
|
const neededPackages = /* @__PURE__ */ new Set();
|
|
62703
62904
|
const factories = [];
|
|
62704
62905
|
const visit3 = (filePath) => {
|
|
62705
|
-
const real =
|
|
62906
|
+
const real = import_node_fs110.default.realpathSync(filePath);
|
|
62706
62907
|
const previous = files2.get(real);
|
|
62707
62908
|
if (previous !== void 0) return previous;
|
|
62708
62909
|
const id = "peach-config-file:" + files2.size;
|
|
62709
62910
|
files2.set(real, id);
|
|
62710
62911
|
const compiled = compileReplacementModule({
|
|
62711
62912
|
filePath: real,
|
|
62712
|
-
source:
|
|
62913
|
+
source: import_node_fs110.default.readFileSync(real, "utf8"),
|
|
62713
62914
|
runtimePackages,
|
|
62714
62915
|
localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
|
|
62715
62916
|
});
|
|
@@ -62733,7 +62934,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
62733
62934
|
if (!entries || typeof entries !== "object") continue;
|
|
62734
62935
|
for (const resolution of Object.values(entries)) {
|
|
62735
62936
|
if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
|
|
62736
|
-
resolution.file = visit3(
|
|
62937
|
+
resolution.file = visit3(import_node_path109.default.resolve(resolution.file));
|
|
62737
62938
|
}
|
|
62738
62939
|
}
|
|
62739
62940
|
}
|
|
@@ -62757,13 +62958,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
62757
62958
|
const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
|
|
62758
62959
|
return prefix + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
|
|
62759
62960
|
}
|
|
62760
|
-
var
|
|
62961
|
+
var import_node_fs110, import_node_path109, import_sucrase3, import_terser, PREFIX_START, PREFIX_END;
|
|
62761
62962
|
var init_configured_bundle_producer = __esm({
|
|
62762
62963
|
"src/configured-bundle-producer.ts"() {
|
|
62763
62964
|
"use strict";
|
|
62764
62965
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
62765
|
-
|
|
62766
|
-
|
|
62966
|
+
import_node_fs110 = __toESM(require("node:fs"), 1);
|
|
62967
|
+
import_node_path109 = __toESM(require("node:path"), 1);
|
|
62767
62968
|
init_bundle_global_footer();
|
|
62768
62969
|
import_sucrase3 = require("sucrase");
|
|
62769
62970
|
import_terser = require("terser");
|
|
@@ -62788,8 +62989,8 @@ __export(bundle_channel_exports, {
|
|
|
62788
62989
|
module.exports = __toCommonJS(bundle_channel_exports);
|
|
62789
62990
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
62790
62991
|
var import_node_crypto58 = require("node:crypto");
|
|
62791
|
-
var
|
|
62792
|
-
var
|
|
62992
|
+
var import_node_fs111 = require("node:fs");
|
|
62993
|
+
var import_node_path110 = require("node:path");
|
|
62793
62994
|
var import_node_vm = require("node:vm");
|
|
62794
62995
|
var import_node_zlib4 = require("node:zlib");
|
|
62795
62996
|
init_backend_origin();
|
|
@@ -62900,8 +63101,8 @@ function getDefaultPortForProtocol(protocol) {
|
|
|
62900
63101
|
return protocol === "https:" ? 443 : 80;
|
|
62901
63102
|
}
|
|
62902
63103
|
function isBaseServerUrl(url) {
|
|
62903
|
-
const
|
|
62904
|
-
return (
|
|
63104
|
+
const path98 = url.pathname || "/";
|
|
63105
|
+
return (path98 === "/" || path98 === "") && !url.search && !url.hash;
|
|
62905
63106
|
}
|
|
62906
63107
|
async function resolvePortViaServerScan(port) {
|
|
62907
63108
|
try {
|
|
@@ -66530,8 +66731,8 @@ init_process_group();
|
|
|
66530
66731
|
|
|
66531
66732
|
// cli/app-catalog.ts
|
|
66532
66733
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
66533
|
-
var
|
|
66534
|
-
var
|
|
66734
|
+
var import_node_fs108 = __toESM(require("node:fs"), 1);
|
|
66735
|
+
var import_node_path107 = __toESM(require("node:path"), 1);
|
|
66535
66736
|
init_bundleAssets();
|
|
66536
66737
|
init_expo_native_workspace();
|
|
66537
66738
|
|
|
@@ -66539,8 +66740,8 @@ init_expo_native_workspace();
|
|
|
66539
66740
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
66540
66741
|
var import_node_async_hooks3 = require("node:async_hooks");
|
|
66541
66742
|
var import_node_crypto57 = require("node:crypto");
|
|
66542
|
-
var
|
|
66543
|
-
var
|
|
66743
|
+
var import_node_fs107 = __toESM(require("node:fs"), 1);
|
|
66744
|
+
var import_node_path106 = __toESM(require("node:path"), 1);
|
|
66544
66745
|
|
|
66545
66746
|
// ../peach-kit/src/uttype-mime.ts
|
|
66546
66747
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -66618,17 +66819,17 @@ async function captureStagedHostFiles(prepare2) {
|
|
|
66618
66819
|
const value = await stagedCapture.run(names, prepare2);
|
|
66619
66820
|
return {
|
|
66620
66821
|
value,
|
|
66621
|
-
files: new Map([...names].map((name3) => [name3,
|
|
66822
|
+
files: new Map([...names].map((name3) => [name3, import_node_path106.default.join(stagedDir(), name3)]))
|
|
66622
66823
|
};
|
|
66623
66824
|
}
|
|
66624
66825
|
var STAGED_PREFIX = "/__peach/staged/";
|
|
66625
66826
|
var STAGED_NAME = /^([a-f0-9]{64})(\.[a-z0-9]{1,10})?$/;
|
|
66626
66827
|
var STAGED_RETENTION_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
66627
66828
|
function stagedDir() {
|
|
66628
|
-
return
|
|
66829
|
+
return import_node_path106.default.join(cacheDir(), "staged");
|
|
66629
66830
|
}
|
|
66630
66831
|
function stageHostFile(filePath, origin) {
|
|
66631
|
-
return stageHostBytes(
|
|
66832
|
+
return stageHostBytes(import_node_fs107.default.readFileSync(filePath), origin, import_node_path106.default.extname(filePath));
|
|
66632
66833
|
}
|
|
66633
66834
|
function stageHostBytes(bytes, origin, extension = "") {
|
|
66634
66835
|
const directory2 = prepareStagedDirectory();
|
|
@@ -66636,12 +66837,12 @@ function stageHostBytes(bytes, origin, extension = "") {
|
|
|
66636
66837
|
}
|
|
66637
66838
|
function prepareStagedDirectory() {
|
|
66638
66839
|
const directory2 = stagedDir();
|
|
66639
|
-
|
|
66840
|
+
import_node_fs107.default.mkdirSync(directory2, { recursive: true });
|
|
66640
66841
|
const now = Date.now();
|
|
66641
|
-
for (const entry of
|
|
66642
|
-
const stale =
|
|
66643
|
-
if (entry.isFile() && now -
|
|
66644
|
-
|
|
66842
|
+
for (const entry of import_node_fs107.default.readdirSync(directory2, { withFileTypes: true })) {
|
|
66843
|
+
const stale = import_node_path106.default.join(directory2, entry.name);
|
|
66844
|
+
if (entry.isFile() && now - import_node_fs107.default.statSync(stale).mtimeMs > STAGED_RETENTION_MS)
|
|
66845
|
+
import_node_fs107.default.rmSync(stale, { force: true });
|
|
66645
66846
|
}
|
|
66646
66847
|
return directory2;
|
|
66647
66848
|
}
|
|
@@ -66650,17 +66851,17 @@ function writeStagedBytes(bytes, origin, extension, directory2) {
|
|
|
66650
66851
|
extension = extension.toLowerCase();
|
|
66651
66852
|
const name3 = STAGED_NAME.test(digest4 + extension) ? digest4 + extension : digest4;
|
|
66652
66853
|
stagedCapture.getStore()?.add(name3);
|
|
66653
|
-
const destination =
|
|
66854
|
+
const destination = import_node_path106.default.join(directory2, name3);
|
|
66654
66855
|
const now = Date.now();
|
|
66655
|
-
if (
|
|
66656
|
-
|
|
66856
|
+
if (import_node_fs107.default.existsSync(destination)) {
|
|
66857
|
+
import_node_fs107.default.utimesSync(destination, new Date(now), new Date(now));
|
|
66657
66858
|
} else {
|
|
66658
|
-
const temporary =
|
|
66859
|
+
const temporary = import_node_path106.default.join(directory2, (0, import_node_crypto57.randomUUID)());
|
|
66659
66860
|
try {
|
|
66660
|
-
|
|
66661
|
-
|
|
66861
|
+
import_node_fs107.default.writeFileSync(temporary, bytes, { flag: "wx" });
|
|
66862
|
+
import_node_fs107.default.renameSync(temporary, destination);
|
|
66662
66863
|
} finally {
|
|
66663
|
-
|
|
66864
|
+
import_node_fs107.default.rmSync(temporary, { force: true });
|
|
66664
66865
|
}
|
|
66665
66866
|
}
|
|
66666
66867
|
return new URL(STAGED_PREFIX + name3, origin).toString();
|
|
@@ -66676,21 +66877,21 @@ var ACCENT_BUILD_SETTING = /ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "?(
|
|
|
66676
66877
|
var PLIST_ACCENT = /<key>NSAccentColorName<\/key>\s*<string>([^<]+)<\/string>/;
|
|
66677
66878
|
function listDir2(dir) {
|
|
66678
66879
|
try {
|
|
66679
|
-
return
|
|
66880
|
+
return import_node_fs108.default.readdirSync(dir, { withFileTypes: true });
|
|
66680
66881
|
} catch {
|
|
66681
66882
|
return [];
|
|
66682
66883
|
}
|
|
66683
66884
|
}
|
|
66684
66885
|
function readText(file) {
|
|
66685
66886
|
try {
|
|
66686
|
-
return
|
|
66887
|
+
return import_node_fs108.default.readFileSync(file, "utf8");
|
|
66687
66888
|
} catch {
|
|
66688
66889
|
return null;
|
|
66689
66890
|
}
|
|
66690
66891
|
}
|
|
66691
66892
|
function catalogFiles(dir, found) {
|
|
66692
66893
|
for (const entry of listDir2(dir)) {
|
|
66693
|
-
const full =
|
|
66894
|
+
const full = import_node_path107.default.join(dir, entry.name);
|
|
66694
66895
|
if (entry.isDirectory()) catalogFiles(full, found);
|
|
66695
66896
|
else if (entry.name === "Contents.json") found.push(full);
|
|
66696
66897
|
}
|
|
@@ -66716,33 +66917,33 @@ function readAssetCatalog(files2, readContents2, imageUri, accentName) {
|
|
|
66716
66917
|
return { colors, images, symbols, accentName };
|
|
66717
66918
|
}
|
|
66718
66919
|
async function discoverAppCatalog(appDir, assetOrigin) {
|
|
66719
|
-
if (!
|
|
66720
|
-
const packageJson = readText(
|
|
66920
|
+
if (!import_node_fs108.default.existsSync(import_node_path107.default.join(appDir, "ios")) && findExpoAppConfig(appDir)) {
|
|
66921
|
+
const packageJson = readText(import_node_path107.default.join(appDir, "package.json"));
|
|
66721
66922
|
if (packageJson) {
|
|
66722
66923
|
const manifest = JSON.parse(packageJson);
|
|
66723
66924
|
if (declaresNativeDependency(manifest, "expo") || declaresNativeDependency(manifest, "one"))
|
|
66724
66925
|
appDir = (await prepareExpoNativeProject(appDir)).app;
|
|
66725
66926
|
}
|
|
66726
66927
|
}
|
|
66727
|
-
const iosDir =
|
|
66928
|
+
const iosDir = import_node_path107.default.join(appDir, "ios");
|
|
66728
66929
|
const target = listDir2(iosDir).find(
|
|
66729
|
-
(entry) => entry.isDirectory() && entry.name !== "Pods" && listDir2(
|
|
66930
|
+
(entry) => entry.isDirectory() && entry.name !== "Pods" && listDir2(import_node_path107.default.join(iosDir, entry.name)).some(
|
|
66730
66931
|
(file) => /^AppDelegate\.(swift|mm|m)$/.test(file.name)
|
|
66731
66932
|
)
|
|
66732
66933
|
);
|
|
66733
66934
|
if (!target) return null;
|
|
66734
|
-
const targetDir =
|
|
66935
|
+
const targetDir = import_node_path107.default.join(iosDir, target.name);
|
|
66735
66936
|
const files2 = [];
|
|
66736
66937
|
for (const entry of listDir2(targetDir)) {
|
|
66737
66938
|
if (entry.isDirectory() && entry.name.endsWith(".xcassets"))
|
|
66738
|
-
catalogFiles(
|
|
66939
|
+
catalogFiles(import_node_path107.default.join(targetDir, entry.name), files2);
|
|
66739
66940
|
}
|
|
66740
66941
|
const relative4 = files2.map(
|
|
66741
|
-
(file) =>
|
|
66942
|
+
(file) => import_node_path107.default.relative(targetDir, file).split(import_node_path107.default.sep).join(import_node_path107.default.posix.sep)
|
|
66742
66943
|
);
|
|
66743
|
-
const readContents2 = (candidate) => readText(
|
|
66944
|
+
const readContents2 = (candidate) => readText(import_node_path107.default.join(targetDir, candidate));
|
|
66744
66945
|
const pbxproj = listDir2(iosDir).find((entry) => entry.name.endsWith(".xcodeproj"));
|
|
66745
|
-
const accentName = readText(
|
|
66946
|
+
const accentName = readText(import_node_path107.default.join(targetDir, "Info.plist"))?.match(PLIST_ACCENT)?.[1] ?? (pbxproj ? readText(import_node_path107.default.join(iosDir, pbxproj.name, "project.pbxproj"))?.match(
|
|
66746
66947
|
ACCENT_BUILD_SETTING
|
|
66747
66948
|
)?.[1] : void 0) ?? null;
|
|
66748
66949
|
return readAssetCatalog(
|
|
@@ -66755,7 +66956,7 @@ async function discoverAppCatalog(appDir, assetOrigin) {
|
|
|
66755
66956
|
);
|
|
66756
66957
|
return null;
|
|
66757
66958
|
}
|
|
66758
|
-
return stageHostFile(
|
|
66959
|
+
return stageHostFile(import_node_path107.default.join(targetDir, file), assetOrigin);
|
|
66759
66960
|
},
|
|
66760
66961
|
accentName
|
|
66761
66962
|
);
|
|
@@ -66869,10 +67070,10 @@ async function prepareChannel({
|
|
|
66869
67070
|
}
|
|
66870
67071
|
}
|
|
66871
67072
|
const identity2 = (0, import_node_crypto58.createHash)("sha256").update(bundle).update(icon);
|
|
66872
|
-
for (const [
|
|
67073
|
+
for (const [path98, bytes] of [...files2].sort(
|
|
66873
67074
|
([a], [b]) => a < b ? -1 : a > b ? 1 : 0
|
|
66874
67075
|
)) {
|
|
66875
|
-
identity2.update(JSON.stringify([
|
|
67076
|
+
identity2.update(JSON.stringify([path98, digest3(bytes)]));
|
|
66876
67077
|
}
|
|
66877
67078
|
if (native) identity2.update(JSON.stringify(native.metadata));
|
|
66878
67079
|
if (oneSDK) identity2.update(JSON.stringify(oneSDK.metadata));
|
|
@@ -66882,7 +67083,7 @@ async function prepareChannel({
|
|
|
66882
67083
|
const releaseKey = `${prefix}/peach/releases/${identity2.digest("hex")}`;
|
|
66883
67084
|
const assetBaseUrl = `${origin.origin}/${releaseKey}/`;
|
|
66884
67085
|
const directories = new Set(
|
|
66885
|
-
[...files2.keys()].map((
|
|
67086
|
+
[...files2.keys()].map((path98) => path98.slice(0, path98.lastIndexOf("/")))
|
|
66886
67087
|
);
|
|
66887
67088
|
let locations = 0;
|
|
66888
67089
|
const { stripRolldownBundleInventoryFooter, attachRolldownBundleInventory } = getCliRuntime().rolldown_bundle_inventory;
|
|
@@ -66896,12 +67097,12 @@ async function prepareChannel({
|
|
|
66896
67097
|
/("?httpServerLocation"?\s*:\s*)(?:"((?:[^"\\]|\\.)*)"|`([^`\\$]*)`)/g,
|
|
66897
67098
|
(match, property, quoted, template) => {
|
|
66898
67099
|
const location = quoted === void 0 ? template : JSON.parse(`"${quoted}"`);
|
|
66899
|
-
const
|
|
66900
|
-
if (!directories.has(
|
|
67100
|
+
const path98 = packagedAssetDirectory(location);
|
|
67101
|
+
if (!directories.has(path98)) {
|
|
66901
67102
|
throw new Error(`bundle asset location has no packaged files: ${location}`);
|
|
66902
67103
|
}
|
|
66903
67104
|
locations++;
|
|
66904
|
-
return `${property}${JSON.stringify(new URL(
|
|
67105
|
+
return `${property}${JSON.stringify(new URL(path98, assetBaseUrl).href)}`;
|
|
66905
67106
|
}
|
|
66906
67107
|
);
|
|
66907
67108
|
if (assets2.some((asset) => !asset.path.startsWith("assets/native-catalog/")) && !locations)
|
|
@@ -66909,7 +67110,7 @@ async function prepareChannel({
|
|
|
66909
67110
|
const attached = insertNativeBundleFooters(
|
|
66910
67111
|
source,
|
|
66911
67112
|
{ oneSDK, expoSwift, expoKotlin, nitro, turbo },
|
|
66912
|
-
(
|
|
67113
|
+
(path98) => new URL(path98, assetBaseUrl).href
|
|
66913
67114
|
);
|
|
66914
67115
|
source = attached.source;
|
|
66915
67116
|
if (appCatalog) {
|
|
@@ -66947,10 +67148,10 @@ async function prepareChannel({
|
|
|
66947
67148
|
contentType: "application/javascript"
|
|
66948
67149
|
},
|
|
66949
67150
|
{ key: `${releaseKey}/icon.png`, bytes: icon, contentType: "image/png" },
|
|
66950
|
-
...[...files2].map(([
|
|
66951
|
-
key: `${releaseKey}/${
|
|
67151
|
+
...[...files2].map(([path98, bytes]) => ({
|
|
67152
|
+
key: `${releaseKey}/${path98}`,
|
|
66952
67153
|
bytes,
|
|
66953
|
-
contentType: nativeAssets.get(
|
|
67154
|
+
contentType: nativeAssets.get(path98)?.contentType ?? {
|
|
66954
67155
|
png: "image/png",
|
|
66955
67156
|
jpg: "image/jpeg",
|
|
66956
67157
|
jpeg: "image/jpeg",
|
|
@@ -66959,23 +67160,23 @@ async function prepareChannel({
|
|
|
66959
67160
|
ttf: "font/ttf",
|
|
66960
67161
|
otf: "font/otf",
|
|
66961
67162
|
wav: "audio/wav"
|
|
66962
|
-
}[
|
|
67163
|
+
}[path98.split(".").pop()] ?? "application/octet-stream"
|
|
66963
67164
|
}))
|
|
66964
67165
|
];
|
|
66965
67166
|
return { platform: platform2, key: `${prefix}/${channelKey(platform2)}`, metadata, objects };
|
|
66966
67167
|
}
|
|
66967
67168
|
function brotliCompressCached(bytes) {
|
|
66968
|
-
const file = (0,
|
|
66969
|
-
if ((0,
|
|
67169
|
+
const file = (0, import_node_path110.join)(cacheDir(), "bundle-channel-brotli", `${digest3(bytes)}-q11-w24.br`);
|
|
67170
|
+
if ((0, import_node_fs111.existsSync)(file)) return (0, import_node_fs111.readFileSync)(file);
|
|
66970
67171
|
const compressed = (0, import_node_zlib4.brotliCompressSync)(bytes, {
|
|
66971
67172
|
params: {
|
|
66972
67173
|
[import_node_zlib4.constants.BROTLI_PARAM_QUALITY]: 11,
|
|
66973
67174
|
[import_node_zlib4.constants.BROTLI_PARAM_LGWIN]: 24
|
|
66974
67175
|
}
|
|
66975
67176
|
});
|
|
66976
|
-
(0,
|
|
66977
|
-
(0,
|
|
66978
|
-
(0,
|
|
67177
|
+
(0, import_node_fs111.mkdirSync)((0, import_node_path110.dirname)(file), { recursive: true });
|
|
67178
|
+
(0, import_node_fs111.writeFileSync)(`${file}.${process.pid}`, compressed);
|
|
67179
|
+
(0, import_node_fs111.renameSync)(`${file}.${process.pid}`, file);
|
|
66979
67180
|
return compressed;
|
|
66980
67181
|
}
|
|
66981
67182
|
async function publishBundleChannel(release, { put, fetchObject = fetch }) {
|
|
@@ -67026,15 +67227,15 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
|
|
|
67026
67227
|
const directory2 = packagedAssetDirectory(asset.httpServerLocation);
|
|
67027
67228
|
if (asset.files) {
|
|
67028
67229
|
for (const file of asset.files) {
|
|
67029
|
-
const
|
|
67030
|
-
if (!assets2.has(
|
|
67230
|
+
const path98 = `${directory2}/${(0, import_node_path110.basename)(file)}`;
|
|
67231
|
+
if (!assets2.has(path98)) assets2.set(path98, (0, import_node_fs111.readFileSync)(file));
|
|
67031
67232
|
}
|
|
67032
67233
|
continue;
|
|
67033
67234
|
}
|
|
67034
67235
|
for (const scale of asset.scales) {
|
|
67035
67236
|
const file = `${asset.name}${scale === 1 ? "" : `@${scale}x`}.${asset.type}`;
|
|
67036
|
-
const
|
|
67037
|
-
if (!assets2.has(
|
|
67237
|
+
const path98 = `${directory2}/${file}`;
|
|
67238
|
+
if (!assets2.has(path98)) assets2.set(path98, await readAssetFile(asset, file));
|
|
67038
67239
|
}
|
|
67039
67240
|
}
|
|
67040
67241
|
let appCatalog = null;
|
|
@@ -67046,11 +67247,11 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
|
|
|
67046
67247
|
images: Object.fromEntries(Object.entries(captured.value.images).map(([name3, variants]) => [
|
|
67047
67248
|
name3,
|
|
67048
67249
|
variants.map((image) => {
|
|
67049
|
-
const file = (0,
|
|
67250
|
+
const file = (0, import_node_path110.basename)(new URL(image.uri).pathname);
|
|
67050
67251
|
const staged = captured.files.get(file);
|
|
67051
67252
|
if (!staged) throw new Error("app catalog image was not staged");
|
|
67052
67253
|
const resource = `assets/native-catalog/${file}`;
|
|
67053
|
-
assets2.set(resource, (0,
|
|
67254
|
+
assets2.set(resource, (0, import_node_fs111.readFileSync)(staged));
|
|
67054
67255
|
return { ...image, uri: resource };
|
|
67055
67256
|
})
|
|
67056
67257
|
]))
|
|
@@ -67071,7 +67272,7 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
|
|
|
67071
67272
|
versions
|
|
67072
67273
|
)
|
|
67073
67274
|
),
|
|
67074
|
-
assets: [...assets2].map(([
|
|
67275
|
+
assets: [...assets2].map(([path98, bytes]) => ({ path: path98, bytes })),
|
|
67075
67276
|
...await buildNativeBundles(projectRoot, platform2, configuration)
|
|
67076
67277
|
};
|
|
67077
67278
|
}
|
|
@@ -67151,12 +67352,12 @@ async function snapshotOneProductionBundle(projectRoot, entryFile, env = {}, { r
|
|
|
67151
67352
|
const inputs = await readPackagingInputs(projectRoot);
|
|
67152
67353
|
const snapshots = [];
|
|
67153
67354
|
for (const platform2 of platforms2) {
|
|
67154
|
-
const out = await mkdtemp((0,
|
|
67355
|
+
const out = await mkdtemp((0, import_node_path110.join)(tmpdir3(), "peach-production-bundle-"));
|
|
67155
67356
|
try {
|
|
67156
67357
|
await promisify20(execFile20)(
|
|
67157
67358
|
runtimeExecutable,
|
|
67158
67359
|
[
|
|
67159
|
-
(0,
|
|
67360
|
+
(0, import_node_path110.join)(projectRoot, "node_modules/.bin/react-native"),
|
|
67160
67361
|
"bundle",
|
|
67161
67362
|
"--platform",
|
|
67162
67363
|
platform2,
|
|
@@ -67167,19 +67368,19 @@ async function snapshotOneProductionBundle(projectRoot, entryFile, env = {}, { r
|
|
|
67167
67368
|
"--entry-file",
|
|
67168
67369
|
entryFile,
|
|
67169
67370
|
"--bundle-output",
|
|
67170
|
-
(0,
|
|
67371
|
+
(0, import_node_path110.join)(out, "bundle.js"),
|
|
67171
67372
|
"--assets-dest",
|
|
67172
|
-
(0,
|
|
67373
|
+
(0, import_node_path110.join)(out, "assets"),
|
|
67173
67374
|
"--sourcemap-output",
|
|
67174
|
-
(0,
|
|
67375
|
+
(0, import_node_path110.join)(out, "bundle.js.map")
|
|
67175
67376
|
],
|
|
67176
67377
|
{ cwd: projectRoot, env: { ...process.env, ...env, NODE_ENV: "production" } }
|
|
67177
67378
|
);
|
|
67178
67379
|
snapshots.push(
|
|
67179
|
-
await packagePlatformBundle(projectRoot, platform2, await readFile3((0,
|
|
67380
|
+
await packagePlatformBundle(projectRoot, platform2, await readFile3((0, import_node_path110.join)(out, "bundle.js")), {
|
|
67180
67381
|
...inputs,
|
|
67181
67382
|
configuration: "Release",
|
|
67182
|
-
readAssetFile: (asset, file) => readFile3((0,
|
|
67383
|
+
readAssetFile: (asset, file) => readFile3((0, import_node_path110.join)(out, asset.httpServerLocation, file))
|
|
67183
67384
|
})
|
|
67184
67385
|
);
|
|
67185
67386
|
} finally {
|
|
@@ -67192,12 +67393,12 @@ async function snapshotOneDevBundle(projectRoot, env = {}, { runtimeExecutable =
|
|
|
67192
67393
|
const { spawn: spawn9 } = await import("node:child_process");
|
|
67193
67394
|
const { createServer } = await import("node:net");
|
|
67194
67395
|
const { createRequire: createRequire19 } = await import("node:module");
|
|
67195
|
-
const onePackage = createRequire19((0,
|
|
67396
|
+
const onePackage = createRequire19((0, import_node_path110.join)(projectRoot, "package.json")).resolve(
|
|
67196
67397
|
"one/package.json"
|
|
67197
67398
|
);
|
|
67198
|
-
const oneBin = (0,
|
|
67199
|
-
(0,
|
|
67200
|
-
JSON.parse((0,
|
|
67399
|
+
const oneBin = (0, import_node_path110.join)(
|
|
67400
|
+
(0, import_node_path110.dirname)(onePackage),
|
|
67401
|
+
JSON.parse((0, import_node_fs111.readFileSync)(onePackage, "utf8")).bin.one
|
|
67201
67402
|
);
|
|
67202
67403
|
const port = await new Promise((resolve4, reject) => {
|
|
67203
67404
|
const server = createServer().listen(0, "127.0.0.1", () => {
|