peachsim 0.1.2243 → 0.1.2244
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/cli/binary-sidecar.ts +89 -0
- package/cli/bridge-flow-runner.ts +2 -2
- package/cli/cloud-client.ts +2 -0
- package/cli/commands/control.ts +16 -0
- package/cli/commands/device.ts +1 -1
- package/cli/commands/flow.ts +2 -2
- package/cli/commands/inspect/core.ts +0 -20
- package/cli/commands/inspect/settling.ts +8 -0
- package/cli/commands/inspect.ts +5 -5
- package/cli/commands/preview.ts +12 -5
- package/cli/commands/shell-boolean-mode.ts +1 -1
- package/cli/commands/slides.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 +7 -7
- 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 +9 -3
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +6 -6
- 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 +27 -8
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- 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 +9 -3
- 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 +1 -1
- package/dist-lib/menu.cjs +11 -2
- package/dist-lib/menu.mjs +11 -2
- 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 +1 -1
- 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 +55 -53
- 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 +9 -22
- package/dist-lib/sdk.mjs +9 -20
- package/dist-lib/skills.cjs +872 -733
- 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 +5 -5
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -0
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -1
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/src/binarySidecarContract.ts +45 -0
- package/src/menu.ts +14 -0
- package/src/swift-host.ts +6 -7
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2244 | (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;
|
|
@@ -45,12 +45,12 @@ var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
|
|
|
45
45
|
|
|
46
46
|
// src/chromium-admission.ts
|
|
47
47
|
function readChromiumQueue(deps, verified2, own) {
|
|
48
|
-
const { fs:
|
|
49
|
-
const dir =
|
|
48
|
+
const { fs: fs117, os: os24, path: path142, childProcess: childProcess3 } = deps;
|
|
49
|
+
const dir = path142.join(
|
|
50
50
|
process.platform === "win32" ? os24.tmpdir() : "/tmp",
|
|
51
51
|
"chromium-admission"
|
|
52
52
|
);
|
|
53
|
-
|
|
53
|
+
fs117.mkdirSync(dir, { recursive: true });
|
|
54
54
|
const limit = Math.max(2, Math.floor(os24.cpus().length / 2));
|
|
55
55
|
const live = (entry) => {
|
|
56
56
|
const match = /^(\d+)-(\d+)-/.exec(entry);
|
|
@@ -78,10 +78,10 @@ function readChromiumQueue(deps, verified2, own) {
|
|
|
78
78
|
return same;
|
|
79
79
|
};
|
|
80
80
|
const tickets = [];
|
|
81
|
-
for (const entry of
|
|
81
|
+
for (const entry of fs117.readdirSync(dir)) {
|
|
82
82
|
if (entry !== own && !live(entry)) {
|
|
83
83
|
try {
|
|
84
|
-
|
|
84
|
+
fs117.unlinkSync(path142.join(dir, entry));
|
|
85
85
|
} catch {
|
|
86
86
|
}
|
|
87
87
|
continue;
|
|
@@ -89,7 +89,7 @@ function readChromiumQueue(deps, verified2, own) {
|
|
|
89
89
|
try {
|
|
90
90
|
tickets.push({
|
|
91
91
|
entry,
|
|
92
|
-
created:
|
|
92
|
+
created: fs117.statSync(path142.join(dir, entry), { bigint: true }).ctimeNs
|
|
93
93
|
});
|
|
94
94
|
} catch {
|
|
95
95
|
}
|
|
@@ -100,21 +100,21 @@ function readChromiumQueue(deps, verified2, own) {
|
|
|
100
100
|
return { dir, limit, tickets: tickets.map((t) => t.entry) };
|
|
101
101
|
}
|
|
102
102
|
async function acquireChromiumAdmission(deps) {
|
|
103
|
-
const { fs:
|
|
103
|
+
const { fs: fs117, path: path142, label, readQueue, signal } = deps;
|
|
104
104
|
signal?.throwIfAborted();
|
|
105
105
|
const queuedAt = Date.now();
|
|
106
106
|
const verified2 = /* @__PURE__ */ new Map();
|
|
107
107
|
const startedAt = Math.round(Date.now() / 1e3 - process.uptime());
|
|
108
108
|
const name3 = `${process.pid}-${startedAt}-${Math.random().toString(36).slice(2, 10)}`;
|
|
109
|
-
const ticket =
|
|
110
|
-
|
|
109
|
+
const ticket = path142.join(readQueue(deps, verified2, name3).dir, name3);
|
|
110
|
+
fs117.closeSync(fs117.openSync(ticket, "wx"));
|
|
111
111
|
let released = false;
|
|
112
112
|
const release = () => {
|
|
113
113
|
if (released) return;
|
|
114
114
|
released = true;
|
|
115
115
|
process.removeListener("exit", release);
|
|
116
116
|
try {
|
|
117
|
-
|
|
117
|
+
fs117.unlinkSync(ticket);
|
|
118
118
|
} catch {
|
|
119
119
|
}
|
|
120
120
|
};
|
|
@@ -20958,17 +20958,17 @@ function visit(node, visitor) {
|
|
|
20958
20958
|
} else
|
|
20959
20959
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
20960
20960
|
}
|
|
20961
|
-
function visit_(key2, node, visitor,
|
|
20962
|
-
const ctrl = callVisitor(key2, node, visitor,
|
|
20961
|
+
function visit_(key2, node, visitor, path142) {
|
|
20962
|
+
const ctrl = callVisitor(key2, node, visitor, path142);
|
|
20963
20963
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
20964
|
-
replaceNode(key2,
|
|
20965
|
-
return visit_(key2, ctrl, visitor,
|
|
20964
|
+
replaceNode(key2, path142, ctrl);
|
|
20965
|
+
return visit_(key2, ctrl, visitor, path142);
|
|
20966
20966
|
}
|
|
20967
20967
|
if (typeof ctrl !== "symbol") {
|
|
20968
20968
|
if (isCollection(node)) {
|
|
20969
|
-
|
|
20969
|
+
path142 = Object.freeze(path142.concat(node));
|
|
20970
20970
|
for (let i = 0; i < node.items.length; ++i) {
|
|
20971
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
20971
|
+
const ci = visit_(i, node.items[i], visitor, path142);
|
|
20972
20972
|
if (typeof ci === "number")
|
|
20973
20973
|
i = ci - 1;
|
|
20974
20974
|
else if (ci === BREAK)
|
|
@@ -20979,13 +20979,13 @@ function visit_(key2, node, visitor, path141) {
|
|
|
20979
20979
|
}
|
|
20980
20980
|
}
|
|
20981
20981
|
} else if (isPair(node)) {
|
|
20982
|
-
|
|
20983
|
-
const ck = visit_("key", node.key, visitor,
|
|
20982
|
+
path142 = Object.freeze(path142.concat(node));
|
|
20983
|
+
const ck = visit_("key", node.key, visitor, path142);
|
|
20984
20984
|
if (ck === BREAK)
|
|
20985
20985
|
return BREAK;
|
|
20986
20986
|
else if (ck === REMOVE)
|
|
20987
20987
|
node.key = null;
|
|
20988
|
-
const cv = visit_("value", node.value, visitor,
|
|
20988
|
+
const cv = visit_("value", node.value, visitor, path142);
|
|
20989
20989
|
if (cv === BREAK)
|
|
20990
20990
|
return BREAK;
|
|
20991
20991
|
else if (cv === REMOVE)
|
|
@@ -21003,17 +21003,17 @@ async function visitAsync(node, visitor) {
|
|
|
21003
21003
|
} else
|
|
21004
21004
|
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
21005
21005
|
}
|
|
21006
|
-
async function visitAsync_(key2, node, visitor,
|
|
21007
|
-
const ctrl = await callVisitor(key2, node, visitor,
|
|
21006
|
+
async function visitAsync_(key2, node, visitor, path142) {
|
|
21007
|
+
const ctrl = await callVisitor(key2, node, visitor, path142);
|
|
21008
21008
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
21009
|
-
replaceNode(key2,
|
|
21010
|
-
return visitAsync_(key2, ctrl, visitor,
|
|
21009
|
+
replaceNode(key2, path142, ctrl);
|
|
21010
|
+
return visitAsync_(key2, ctrl, visitor, path142);
|
|
21011
21011
|
}
|
|
21012
21012
|
if (typeof ctrl !== "symbol") {
|
|
21013
21013
|
if (isCollection(node)) {
|
|
21014
|
-
|
|
21014
|
+
path142 = Object.freeze(path142.concat(node));
|
|
21015
21015
|
for (let i = 0; i < node.items.length; ++i) {
|
|
21016
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
21016
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path142);
|
|
21017
21017
|
if (typeof ci === "number")
|
|
21018
21018
|
i = ci - 1;
|
|
21019
21019
|
else if (ci === BREAK)
|
|
@@ -21024,13 +21024,13 @@ async function visitAsync_(key2, node, visitor, path141) {
|
|
|
21024
21024
|
}
|
|
21025
21025
|
}
|
|
21026
21026
|
} else if (isPair(node)) {
|
|
21027
|
-
|
|
21028
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
21027
|
+
path142 = Object.freeze(path142.concat(node));
|
|
21028
|
+
const ck = await visitAsync_("key", node.key, visitor, path142);
|
|
21029
21029
|
if (ck === BREAK)
|
|
21030
21030
|
return BREAK;
|
|
21031
21031
|
else if (ck === REMOVE)
|
|
21032
21032
|
node.key = null;
|
|
21033
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
21033
|
+
const cv = await visitAsync_("value", node.value, visitor, path142);
|
|
21034
21034
|
if (cv === BREAK)
|
|
21035
21035
|
return BREAK;
|
|
21036
21036
|
else if (cv === REMOVE)
|
|
@@ -21057,23 +21057,23 @@ function initVisitor(visitor) {
|
|
|
21057
21057
|
}
|
|
21058
21058
|
return visitor;
|
|
21059
21059
|
}
|
|
21060
|
-
function callVisitor(key2, node, visitor,
|
|
21060
|
+
function callVisitor(key2, node, visitor, path142) {
|
|
21061
21061
|
if (typeof visitor === "function")
|
|
21062
|
-
return visitor(key2, node,
|
|
21062
|
+
return visitor(key2, node, path142);
|
|
21063
21063
|
if (isMap(node))
|
|
21064
|
-
return visitor.Map?.(key2, node,
|
|
21064
|
+
return visitor.Map?.(key2, node, path142);
|
|
21065
21065
|
if (isSeq(node))
|
|
21066
|
-
return visitor.Seq?.(key2, node,
|
|
21066
|
+
return visitor.Seq?.(key2, node, path142);
|
|
21067
21067
|
if (isPair(node))
|
|
21068
|
-
return visitor.Pair?.(key2, node,
|
|
21068
|
+
return visitor.Pair?.(key2, node, path142);
|
|
21069
21069
|
if (isScalar(node))
|
|
21070
|
-
return visitor.Scalar?.(key2, node,
|
|
21070
|
+
return visitor.Scalar?.(key2, node, path142);
|
|
21071
21071
|
if (isAlias(node))
|
|
21072
|
-
return visitor.Alias?.(key2, node,
|
|
21072
|
+
return visitor.Alias?.(key2, node, path142);
|
|
21073
21073
|
return void 0;
|
|
21074
21074
|
}
|
|
21075
|
-
function replaceNode(key2,
|
|
21076
|
-
const parent =
|
|
21075
|
+
function replaceNode(key2, path142, node) {
|
|
21076
|
+
const parent = path142[path142.length - 1];
|
|
21077
21077
|
if (isCollection(parent)) {
|
|
21078
21078
|
parent.items[key2] = node;
|
|
21079
21079
|
} else if (isPair(parent)) {
|
|
@@ -21682,10 +21682,10 @@ var init_createNode = __esm({
|
|
|
21682
21682
|
});
|
|
21683
21683
|
|
|
21684
21684
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
21685
|
-
function collectionFromPath(schema4,
|
|
21685
|
+
function collectionFromPath(schema4, path142, value) {
|
|
21686
21686
|
let v6 = value;
|
|
21687
|
-
for (let i =
|
|
21688
|
-
const k =
|
|
21687
|
+
for (let i = path142.length - 1; i >= 0; --i) {
|
|
21688
|
+
const k = path142[i];
|
|
21689
21689
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
21690
21690
|
const a = [];
|
|
21691
21691
|
a[k] = v6;
|
|
@@ -21711,7 +21711,7 @@ var init_Collection = __esm({
|
|
|
21711
21711
|
init_createNode();
|
|
21712
21712
|
init_identity();
|
|
21713
21713
|
init_Node();
|
|
21714
|
-
isEmptyPath = (
|
|
21714
|
+
isEmptyPath = (path142) => path142 == null || typeof path142 === "object" && !!path142[Symbol.iterator]().next().done;
|
|
21715
21715
|
Collection = class extends NodeBase {
|
|
21716
21716
|
constructor(type, schema4) {
|
|
21717
21717
|
super(type);
|
|
@@ -21741,11 +21741,11 @@ var init_Collection = __esm({
|
|
|
21741
21741
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
21742
21742
|
* that already exists in the map.
|
|
21743
21743
|
*/
|
|
21744
|
-
addIn(
|
|
21745
|
-
if (isEmptyPath(
|
|
21744
|
+
addIn(path142, value) {
|
|
21745
|
+
if (isEmptyPath(path142))
|
|
21746
21746
|
this.add(value);
|
|
21747
21747
|
else {
|
|
21748
|
-
const [key2, ...rest] =
|
|
21748
|
+
const [key2, ...rest] = path142;
|
|
21749
21749
|
const node = this.get(key2, true);
|
|
21750
21750
|
if (isCollection(node))
|
|
21751
21751
|
node.addIn(rest, value);
|
|
@@ -21759,8 +21759,8 @@ var init_Collection = __esm({
|
|
|
21759
21759
|
* Removes a value from the collection.
|
|
21760
21760
|
* @returns `true` if the item was found and removed.
|
|
21761
21761
|
*/
|
|
21762
|
-
deleteIn(
|
|
21763
|
-
const [key2, ...rest] =
|
|
21762
|
+
deleteIn(path142) {
|
|
21763
|
+
const [key2, ...rest] = path142;
|
|
21764
21764
|
if (rest.length === 0)
|
|
21765
21765
|
return this.delete(key2);
|
|
21766
21766
|
const node = this.get(key2, true);
|
|
@@ -21774,8 +21774,8 @@ var init_Collection = __esm({
|
|
|
21774
21774
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
21775
21775
|
* `true` (collections are always returned intact).
|
|
21776
21776
|
*/
|
|
21777
|
-
getIn(
|
|
21778
|
-
const [key2, ...rest] =
|
|
21777
|
+
getIn(path142, keepScalar) {
|
|
21778
|
+
const [key2, ...rest] = path142;
|
|
21779
21779
|
const node = this.get(key2, true);
|
|
21780
21780
|
if (rest.length === 0)
|
|
21781
21781
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -21793,8 +21793,8 @@ var init_Collection = __esm({
|
|
|
21793
21793
|
/**
|
|
21794
21794
|
* Checks if the collection includes a value with the key `key`.
|
|
21795
21795
|
*/
|
|
21796
|
-
hasIn(
|
|
21797
|
-
const [key2, ...rest] =
|
|
21796
|
+
hasIn(path142) {
|
|
21797
|
+
const [key2, ...rest] = path142;
|
|
21798
21798
|
if (rest.length === 0)
|
|
21799
21799
|
return this.has(key2);
|
|
21800
21800
|
const node = this.get(key2, true);
|
|
@@ -21804,8 +21804,8 @@ var init_Collection = __esm({
|
|
|
21804
21804
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
21805
21805
|
* boolean to add/remove the item from the set.
|
|
21806
21806
|
*/
|
|
21807
|
-
setIn(
|
|
21808
|
-
const [key2, ...rest] =
|
|
21807
|
+
setIn(path142, value) {
|
|
21808
|
+
const [key2, ...rest] = path142;
|
|
21809
21809
|
if (rest.length === 0) {
|
|
21810
21810
|
this.set(key2, value);
|
|
21811
21811
|
} else {
|
|
@@ -24274,9 +24274,9 @@ var init_Document = __esm({
|
|
|
24274
24274
|
this.contents.add(value);
|
|
24275
24275
|
}
|
|
24276
24276
|
/** Adds a value to the document. */
|
|
24277
|
-
addIn(
|
|
24277
|
+
addIn(path142, value) {
|
|
24278
24278
|
if (assertCollection(this.contents))
|
|
24279
|
-
this.contents.addIn(
|
|
24279
|
+
this.contents.addIn(path142, value);
|
|
24280
24280
|
}
|
|
24281
24281
|
/**
|
|
24282
24282
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -24351,14 +24351,14 @@ var init_Document = __esm({
|
|
|
24351
24351
|
* Removes a value from the document.
|
|
24352
24352
|
* @returns `true` if the item was found and removed.
|
|
24353
24353
|
*/
|
|
24354
|
-
deleteIn(
|
|
24355
|
-
if (isEmptyPath(
|
|
24354
|
+
deleteIn(path142) {
|
|
24355
|
+
if (isEmptyPath(path142)) {
|
|
24356
24356
|
if (this.contents == null)
|
|
24357
24357
|
return false;
|
|
24358
24358
|
this.contents = null;
|
|
24359
24359
|
return true;
|
|
24360
24360
|
}
|
|
24361
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
24361
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path142) : false;
|
|
24362
24362
|
}
|
|
24363
24363
|
/**
|
|
24364
24364
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -24373,10 +24373,10 @@ var init_Document = __esm({
|
|
|
24373
24373
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
24374
24374
|
* `true` (collections are always returned intact).
|
|
24375
24375
|
*/
|
|
24376
|
-
getIn(
|
|
24377
|
-
if (isEmptyPath(
|
|
24376
|
+
getIn(path142, keepScalar) {
|
|
24377
|
+
if (isEmptyPath(path142))
|
|
24378
24378
|
return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
|
|
24379
|
-
return isCollection(this.contents) ? this.contents.getIn(
|
|
24379
|
+
return isCollection(this.contents) ? this.contents.getIn(path142, keepScalar) : void 0;
|
|
24380
24380
|
}
|
|
24381
24381
|
/**
|
|
24382
24382
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -24387,10 +24387,10 @@ var init_Document = __esm({
|
|
|
24387
24387
|
/**
|
|
24388
24388
|
* Checks if the document includes a value at `path`.
|
|
24389
24389
|
*/
|
|
24390
|
-
hasIn(
|
|
24391
|
-
if (isEmptyPath(
|
|
24390
|
+
hasIn(path142) {
|
|
24391
|
+
if (isEmptyPath(path142))
|
|
24392
24392
|
return this.contents !== void 0;
|
|
24393
|
-
return isCollection(this.contents) ? this.contents.hasIn(
|
|
24393
|
+
return isCollection(this.contents) ? this.contents.hasIn(path142) : false;
|
|
24394
24394
|
}
|
|
24395
24395
|
/**
|
|
24396
24396
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -24407,13 +24407,13 @@ var init_Document = __esm({
|
|
|
24407
24407
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
24408
24408
|
* boolean to add/remove the item from the set.
|
|
24409
24409
|
*/
|
|
24410
|
-
setIn(
|
|
24411
|
-
if (isEmptyPath(
|
|
24410
|
+
setIn(path142, value) {
|
|
24411
|
+
if (isEmptyPath(path142)) {
|
|
24412
24412
|
this.contents = value;
|
|
24413
24413
|
} else if (this.contents == null) {
|
|
24414
|
-
this.contents = collectionFromPath(this.schema, Array.from(
|
|
24414
|
+
this.contents = collectionFromPath(this.schema, Array.from(path142), value);
|
|
24415
24415
|
} else if (assertCollection(this.contents)) {
|
|
24416
|
-
this.contents.setIn(
|
|
24416
|
+
this.contents.setIn(path142, value);
|
|
24417
24417
|
}
|
|
24418
24418
|
}
|
|
24419
24419
|
/**
|
|
@@ -26337,15 +26337,15 @@ function visit2(cst, visitor) {
|
|
|
26337
26337
|
cst = { start: cst.start, value: cst.value };
|
|
26338
26338
|
_visit(Object.freeze([]), cst, visitor);
|
|
26339
26339
|
}
|
|
26340
|
-
function _visit(
|
|
26341
|
-
let ctrl = visitor(item,
|
|
26340
|
+
function _visit(path142, item, visitor) {
|
|
26341
|
+
let ctrl = visitor(item, path142);
|
|
26342
26342
|
if (typeof ctrl === "symbol")
|
|
26343
26343
|
return ctrl;
|
|
26344
26344
|
for (const field2 of ["key", "value"]) {
|
|
26345
26345
|
const token = item[field2];
|
|
26346
26346
|
if (token && "items" in token) {
|
|
26347
26347
|
for (let i = 0; i < token.items.length; ++i) {
|
|
26348
|
-
const ci = _visit(Object.freeze(
|
|
26348
|
+
const ci = _visit(Object.freeze(path142.concat([[field2, i]])), token.items[i], visitor);
|
|
26349
26349
|
if (typeof ci === "number")
|
|
26350
26350
|
i = ci - 1;
|
|
26351
26351
|
else if (ci === BREAK2)
|
|
@@ -26356,10 +26356,10 @@ function _visit(path141, item, visitor) {
|
|
|
26356
26356
|
}
|
|
26357
26357
|
}
|
|
26358
26358
|
if (typeof ctrl === "function" && field2 === "key")
|
|
26359
|
-
ctrl = ctrl(item,
|
|
26359
|
+
ctrl = ctrl(item, path142);
|
|
26360
26360
|
}
|
|
26361
26361
|
}
|
|
26362
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
26362
|
+
return typeof ctrl === "function" ? ctrl(item, path142) : ctrl;
|
|
26363
26363
|
}
|
|
26364
26364
|
var BREAK2, SKIP2, REMOVE2;
|
|
26365
26365
|
var init_cst_visit = __esm({
|
|
@@ -26371,9 +26371,9 @@ var init_cst_visit = __esm({
|
|
|
26371
26371
|
visit2.BREAK = BREAK2;
|
|
26372
26372
|
visit2.SKIP = SKIP2;
|
|
26373
26373
|
visit2.REMOVE = REMOVE2;
|
|
26374
|
-
visit2.itemAtPath = (cst,
|
|
26374
|
+
visit2.itemAtPath = (cst, path142) => {
|
|
26375
26375
|
let item = cst;
|
|
26376
|
-
for (const [field2, index] of
|
|
26376
|
+
for (const [field2, index] of path142) {
|
|
26377
26377
|
const tok = item?.[field2];
|
|
26378
26378
|
if (tok && "items" in tok) {
|
|
26379
26379
|
item = tok.items[index];
|
|
@@ -26382,9 +26382,9 @@ var init_cst_visit = __esm({
|
|
|
26382
26382
|
}
|
|
26383
26383
|
return item;
|
|
26384
26384
|
};
|
|
26385
|
-
visit2.parentCollection = (cst,
|
|
26386
|
-
const parent = visit2.itemAtPath(cst,
|
|
26387
|
-
const field2 =
|
|
26385
|
+
visit2.parentCollection = (cst, path142) => {
|
|
26386
|
+
const parent = visit2.itemAtPath(cst, path142.slice(0, -1));
|
|
26387
|
+
const field2 = path142[path142.length - 1][0];
|
|
26388
26388
|
const coll = parent?.[field2];
|
|
26389
26389
|
if (coll && "items" in coll)
|
|
26390
26390
|
return coll;
|
|
@@ -27691,14 +27691,14 @@ var init_parser = __esm({
|
|
|
27691
27691
|
case "scalar":
|
|
27692
27692
|
case "single-quoted-scalar":
|
|
27693
27693
|
case "double-quoted-scalar": {
|
|
27694
|
-
const
|
|
27694
|
+
const fs117 = this.flowScalar(this.type);
|
|
27695
27695
|
if (atNextItem || it.value) {
|
|
27696
|
-
map2.items.push({ start, key:
|
|
27696
|
+
map2.items.push({ start, key: fs117, sep: [] });
|
|
27697
27697
|
this.onKeyLine = true;
|
|
27698
27698
|
} else if (it.sep) {
|
|
27699
|
-
this.stack.push(
|
|
27699
|
+
this.stack.push(fs117);
|
|
27700
27700
|
} else {
|
|
27701
|
-
Object.assign(it, { key:
|
|
27701
|
+
Object.assign(it, { key: fs117, sep: [] });
|
|
27702
27702
|
this.onKeyLine = true;
|
|
27703
27703
|
}
|
|
27704
27704
|
return;
|
|
@@ -27826,13 +27826,13 @@ var init_parser = __esm({
|
|
|
27826
27826
|
case "scalar":
|
|
27827
27827
|
case "single-quoted-scalar":
|
|
27828
27828
|
case "double-quoted-scalar": {
|
|
27829
|
-
const
|
|
27829
|
+
const fs117 = this.flowScalar(this.type);
|
|
27830
27830
|
if (!it || it.value)
|
|
27831
|
-
fc.items.push({ start: [], key:
|
|
27831
|
+
fc.items.push({ start: [], key: fs117, sep: [] });
|
|
27832
27832
|
else if (it.sep)
|
|
27833
|
-
this.stack.push(
|
|
27833
|
+
this.stack.push(fs117);
|
|
27834
27834
|
else
|
|
27835
|
-
Object.assign(it, { key:
|
|
27835
|
+
Object.assign(it, { key: fs117, sep: [] });
|
|
27836
27836
|
return;
|
|
27837
27837
|
}
|
|
27838
27838
|
case "flow-map-end":
|
|
@@ -33589,8 +33589,8 @@ function metadataValue(value, key2) {
|
|
|
33589
33589
|
if (!value || typeof value !== "object") return void 0;
|
|
33590
33590
|
return Object.getOwnPropertyDescriptor(value, key2)?.value;
|
|
33591
33591
|
}
|
|
33592
|
-
function readProjectJson(
|
|
33593
|
-
const text6 = readProjectMetadata(
|
|
33592
|
+
function readProjectJson(path142, files2 = nodeRepoFileReader) {
|
|
33593
|
+
const text6 = readProjectMetadata(path142, files2);
|
|
33594
33594
|
if (text6 === null) return null;
|
|
33595
33595
|
try {
|
|
33596
33596
|
const value = JSON.parse(text6);
|
|
@@ -33680,17 +33680,17 @@ function readNativeProjectRenderer(dir, platform2, files2 = nodeRepoFileReader,
|
|
|
33680
33680
|
declarations.push({ source, enabled: value === "true" });
|
|
33681
33681
|
else throw new Error(`${source}: new architecture setting must be true or false`);
|
|
33682
33682
|
};
|
|
33683
|
-
const json = (
|
|
33684
|
-
const text6 = readProjectMetadata((0, import_node_path13.join)(dir,
|
|
33683
|
+
const json = (path142) => {
|
|
33684
|
+
const text6 = readProjectMetadata((0, import_node_path13.join)(dir, path142), files2);
|
|
33685
33685
|
if (text6 === null) {
|
|
33686
|
-
if (files2.exists((0, import_node_path13.join)(dir,
|
|
33687
|
-
throw new Error(`${
|
|
33686
|
+
if (files2.exists((0, import_node_path13.join)(dir, path142)))
|
|
33687
|
+
throw new Error(`${path142}: unreadable native metadata`);
|
|
33688
33688
|
return void 0;
|
|
33689
33689
|
}
|
|
33690
33690
|
try {
|
|
33691
33691
|
return JSON.parse(text6);
|
|
33692
33692
|
} catch {
|
|
33693
|
-
throw new Error(`${
|
|
33693
|
+
throw new Error(`${path142}: malformed native metadata`);
|
|
33694
33694
|
}
|
|
33695
33695
|
};
|
|
33696
33696
|
if (appJson) {
|
|
@@ -34296,7 +34296,7 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
|
|
|
34296
34296
|
expoModule: moduleDir ? (0, import_node_path14.relative)(appDir, moduleDir) || "." : null,
|
|
34297
34297
|
optional: optional3,
|
|
34298
34298
|
swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
|
|
34299
|
-
(
|
|
34299
|
+
(path142) => path142.endsWith(".swift") && [...(readSmallFile(path142) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
|
|
34300
34300
|
(match) => match[1] === name3
|
|
34301
34301
|
)
|
|
34302
34302
|
) : false,
|
|
@@ -36334,10 +36334,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
|
|
|
36334
36334
|
}
|
|
36335
36335
|
function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri) {
|
|
36336
36336
|
const pbxprojPath = Object.keys(files2).find(
|
|
36337
|
-
(
|
|
36337
|
+
(path142) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path142)
|
|
36338
36338
|
) ?? Object.keys(files2).find(
|
|
36339
|
-
(
|
|
36340
|
-
) ?? Object.keys(files2).find((
|
|
36339
|
+
(path142) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path142)
|
|
36340
|
+
) ?? Object.keys(files2).find((path142) => /(?:^|\/)project\.pbxproj$/.test(path142));
|
|
36341
36341
|
if (!pbxprojPath) return null;
|
|
36342
36342
|
const pbxproj = files2[pbxprojPath];
|
|
36343
36343
|
let objects = {};
|
|
@@ -36379,7 +36379,7 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
|
|
|
36379
36379
|
} else if (applicationTargetNames.size === 1) {
|
|
36380
36380
|
targetName = [...applicationTargetNames][0];
|
|
36381
36381
|
} else if (applicationTargetNames.size > 1) {
|
|
36382
|
-
const delegateTargets = Object.keys(files2).filter((
|
|
36382
|
+
const delegateTargets = Object.keys(files2).filter((path142) => !path142.includes("/Pods/")).map((path142) => path142.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
|
|
36383
36383
|
(name3) => typeof name3 === "string" && applicationTargetNames.has(name3)
|
|
36384
36384
|
);
|
|
36385
36385
|
if (delegateTargets.length === 1) {
|
|
@@ -36620,7 +36620,7 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
|
|
|
36620
36620
|
if (Object.hasOwn(files2, file)) return [file];
|
|
36621
36621
|
const prefix = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
|
|
36622
36622
|
return paths.filter(
|
|
36623
|
-
(
|
|
36623
|
+
(path142) => path142.startsWith(prefix) && !/(?:^|\/)\./.test(path142.slice(prefix.length))
|
|
36624
36624
|
);
|
|
36625
36625
|
},
|
|
36626
36626
|
join33,
|
|
@@ -36631,7 +36631,7 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
|
|
|
36631
36631
|
}
|
|
36632
36632
|
const rootModuleName = readRootModuleName(
|
|
36633
36633
|
Object.entries(files2).filter(
|
|
36634
|
-
([
|
|
36634
|
+
([path142]) => !path142.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path142) || path142.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
|
|
36635
36635
|
).map(([, source]) => source)
|
|
36636
36636
|
);
|
|
36637
36637
|
return {
|
|
@@ -37022,8 +37022,8 @@ export *
|
|
|
37022
37022
|
}`;
|
|
37023
37023
|
}
|
|
37024
37024
|
function swiftPackageIdentity(url) {
|
|
37025
|
-
const
|
|
37026
|
-
return (
|
|
37025
|
+
const path142 = url.endsWith("/") ? url.slice(0, -1) : url;
|
|
37026
|
+
return (path142.split("/").pop() ?? path142).replace(/\.git$/, "").toLowerCase();
|
|
37027
37027
|
}
|
|
37028
37028
|
function clangSettingEntries(settings, tool) {
|
|
37029
37029
|
return (settings ?? []).flatMap(
|
|
@@ -37724,14 +37724,14 @@ function addAsset(into, asset) {
|
|
|
37724
37724
|
function checkStack(dir, type, devices2) {
|
|
37725
37725
|
const sets = (parent, allowed) => (0, import_node_fs29.readdirSync)(parent, { withFileTypes: true }).flatMap((entry) => {
|
|
37726
37726
|
if (entry.name.startsWith(".") || entry.isFile()) return [];
|
|
37727
|
-
const
|
|
37727
|
+
const path142 = (0, import_node_path25.join)(parent, entry.name);
|
|
37728
37728
|
const extension = (0, import_node_path25.extname)(entry.name);
|
|
37729
37729
|
if (!entry.isDirectory() || !allowed.includes(extension))
|
|
37730
37730
|
return refuse(
|
|
37731
|
-
|
|
37731
|
+
path142,
|
|
37732
37732
|
`image stack content other than ${allowed.join(", ")} is unproven`
|
|
37733
37733
|
);
|
|
37734
|
-
return [{ path:
|
|
37734
|
+
return [{ path: path142, extension }];
|
|
37735
37735
|
});
|
|
37736
37736
|
for (const layer of sets(dir, [`.${type}layer`, ".imageset", ".colorset"])) {
|
|
37737
37737
|
if (layer.extension !== `.${type}layer`) continue;
|
|
@@ -37743,37 +37743,37 @@ function checkStack(dir, type, devices2) {
|
|
|
37743
37743
|
function walk(dir, into, devices2, extensions) {
|
|
37744
37744
|
for (const entry of (0, import_node_fs29.readdirSync)(dir, { withFileTypes: true })) {
|
|
37745
37745
|
if (entry.name.startsWith(".") || entry.isFile()) continue;
|
|
37746
|
-
const
|
|
37747
|
-
if (!entry.isDirectory()) return refuse(
|
|
37746
|
+
const path142 = (0, import_node_path25.join)(dir, entry.name);
|
|
37747
|
+
if (!entry.isDirectory()) return refuse(path142, "it is neither a file nor a directory");
|
|
37748
37748
|
const extension = (0, import_node_path25.extname)(entry.name).slice(1);
|
|
37749
37749
|
const type = extension.toLowerCase();
|
|
37750
37750
|
const base = entry.name.slice(0, entry.name.length - extension.length - 1);
|
|
37751
37751
|
if (type !== extension && knownTypes.has(type))
|
|
37752
|
-
return refuse(
|
|
37752
|
+
return refuse(path142, "its type extension is not lowercase");
|
|
37753
37753
|
if (type === "colorset" || type === "imageset" || type === "symbolset") {
|
|
37754
37754
|
addAsset(into, {
|
|
37755
37755
|
kind: type === "colorset" ? "color" : "image",
|
|
37756
37756
|
name: base,
|
|
37757
|
-
...assetState(
|
|
37757
|
+
...assetState(path142, type, devices2),
|
|
37758
37758
|
extensions,
|
|
37759
|
-
source:
|
|
37759
|
+
source: path142
|
|
37760
37760
|
});
|
|
37761
37761
|
continue;
|
|
37762
37762
|
}
|
|
37763
37763
|
if (silentTypes.has(type)) continue;
|
|
37764
37764
|
if (stackTypes.has(type)) {
|
|
37765
|
-
checkStack(
|
|
37765
|
+
checkStack(path142, type, devices2);
|
|
37766
37766
|
continue;
|
|
37767
37767
|
}
|
|
37768
|
-
if (unprovenTypes.has(type)) return refuse(
|
|
37768
|
+
if (unprovenTypes.has(type)) return refuse(path142, `${type} assets are unproven`);
|
|
37769
37769
|
const name3 = type === "spriteatlas" ? base : entry.name;
|
|
37770
|
-
if (!folderProperties((0, import_node_path25.join)(
|
|
37771
|
-
walk(
|
|
37770
|
+
if (!folderProperties((0, import_node_path25.join)(path142, "Contents.json")).namespace) {
|
|
37771
|
+
walk(path142, into, devices2, extensions);
|
|
37772
37772
|
continue;
|
|
37773
37773
|
}
|
|
37774
|
-
const child = into.namespaces.get(name3) ?? scope(
|
|
37774
|
+
const child = into.namespaces.get(name3) ?? scope(path142);
|
|
37775
37775
|
into.namespaces.set(name3, child);
|
|
37776
|
-
walk(
|
|
37776
|
+
walk(path142, child, devices2, extensions);
|
|
37777
37777
|
}
|
|
37778
37778
|
}
|
|
37779
37779
|
function words(name3) {
|
|
@@ -37820,11 +37820,11 @@ function members(into, kind, prefix, extensions) {
|
|
|
37820
37820
|
const assets2 = /* @__PURE__ */ new Set();
|
|
37821
37821
|
const out = [];
|
|
37822
37822
|
for (const entry of entries) {
|
|
37823
|
-
const
|
|
37823
|
+
const path142 = `${prefix}${entry.name}`;
|
|
37824
37824
|
const source = entry.child ? entry.child.source : entry.asset.source;
|
|
37825
37825
|
if (Array.from(entry.name).some((char) => char.charCodeAt(0) > 127))
|
|
37826
37826
|
refuse(source, "its name is not ASCII");
|
|
37827
|
-
const named = (text7) => `The \\"${escape(
|
|
37827
|
+
const named = (text7) => `The \\"${escape(path142)}\\" ${text7}`;
|
|
37828
37828
|
if (entry.child) {
|
|
37829
37829
|
const text7 = symbol(entry.name, true);
|
|
37830
37830
|
if (!text7)
|
|
@@ -37847,9 +37847,9 @@ function members(into, kind, prefix, extensions) {
|
|
|
37847
37847
|
namespaces.add(text7);
|
|
37848
37848
|
out.push({
|
|
37849
37849
|
type: "namespace",
|
|
37850
|
-
path:
|
|
37850
|
+
path: path142,
|
|
37851
37851
|
symbol: spelled(text7),
|
|
37852
|
-
members: members(entry.child, kind, `${
|
|
37852
|
+
members: members(entry.child, kind, `${path142}/`, extensions)
|
|
37853
37853
|
});
|
|
37854
37854
|
}
|
|
37855
37855
|
continue;
|
|
@@ -37876,7 +37876,7 @@ function members(into, kind, prefix, extensions) {
|
|
|
37876
37876
|
else if (!omitted)
|
|
37877
37877
|
out.push({
|
|
37878
37878
|
type: "asset",
|
|
37879
|
-
path:
|
|
37879
|
+
path: path142,
|
|
37880
37880
|
name: entry.name,
|
|
37881
37881
|
symbol: spelled(text6),
|
|
37882
37882
|
thinnable: asset.thinnable,
|
|
@@ -38158,8 +38158,8 @@ var init_xcode_asset_symbols = __esm({
|
|
|
38158
38158
|
import_node_path25 = require("node:path");
|
|
38159
38159
|
Refusal = class extends Error {
|
|
38160
38160
|
};
|
|
38161
|
-
refuse = (
|
|
38162
|
-
throw new Refusal(`Generated asset symbols are unproven for ${
|
|
38161
|
+
refuse = (path142, reason) => {
|
|
38162
|
+
throw new Refusal(`Generated asset symbols are unproven for ${path142}: ${reason}`);
|
|
38163
38163
|
};
|
|
38164
38164
|
isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
38165
38165
|
scope = (source) => ({
|
|
@@ -38605,11 +38605,11 @@ function catalogDigest(directory2) {
|
|
|
38605
38605
|
for (const entry of (0, import_node_fs30.readdirSync)(dir, { withFileTypes: true }).sort(
|
|
38606
38606
|
(a, b) => a.name.localeCompare(b.name)
|
|
38607
38607
|
)) {
|
|
38608
|
-
const
|
|
38609
|
-
if (entry.isDirectory()) walk3(
|
|
38610
|
-
else if (entry.isFile() && (0, import_node_fs30.statSync)(
|
|
38611
|
-
hashes.push([(0, import_node_path26.relative)(directory2,
|
|
38612
|
-
else throw new Error(`Unsupported asset catalog entry: ${
|
|
38608
|
+
const path142 = (0, import_node_path26.join)(dir, entry.name);
|
|
38609
|
+
if (entry.isDirectory()) walk3(path142);
|
|
38610
|
+
else if (entry.isFile() && (0, import_node_fs30.statSync)(path142).size <= 64 * 1024 * 1024)
|
|
38611
|
+
hashes.push([(0, import_node_path26.relative)(directory2, path142), sha2562((0, import_node_fs30.readFileSync)(path142))]);
|
|
38612
|
+
else throw new Error(`Unsupported asset catalog entry: ${path142}`);
|
|
38613
38613
|
}
|
|
38614
38614
|
};
|
|
38615
38615
|
walk3(directory2);
|
|
@@ -38620,7 +38620,7 @@ function symbolSource(plan, root) {
|
|
|
38620
38620
|
const known = symbolTexts.get(key2);
|
|
38621
38621
|
if (known !== void 0) return { status: "source", text: known };
|
|
38622
38622
|
const source = assetSymbolSource(
|
|
38623
|
-
plan.catalogs.map(({ path:
|
|
38623
|
+
plan.catalogs.map(({ path: path142 }) => (0, import_node_path26.join)(root, path142)),
|
|
38624
38624
|
plan.settings
|
|
38625
38625
|
);
|
|
38626
38626
|
if (source.status === "source") symbolTexts.set(key2, source.text);
|
|
@@ -38679,9 +38679,9 @@ function planAssetSymbols(resources, root, settings) {
|
|
|
38679
38679
|
`Generated asset symbols are proven only for TARGETED_DEVICE_FAMILY 1, 2, 1,2, 1,7, 1,3,7, 1,2,6 or 1,2,7; this target resolves to "${families}".`
|
|
38680
38680
|
);
|
|
38681
38681
|
const plan = {
|
|
38682
|
-
catalogs: catalogs.map((
|
|
38683
|
-
path:
|
|
38684
|
-
sha256: catalogDigest((0, import_node_path26.join)(root,
|
|
38682
|
+
catalogs: catalogs.map((path142) => ({
|
|
38683
|
+
path: path142,
|
|
38684
|
+
sha256: catalogDigest((0, import_node_path26.join)(root, path142))
|
|
38685
38685
|
})),
|
|
38686
38686
|
settings: { deployment: target, devices: devices2, extensions: extensions === "YES" }
|
|
38687
38687
|
};
|
|
@@ -43801,10 +43801,10 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
43801
43801
|
const enclosing = scopes.length > 0 ? scopes[scopes.length - 1].prefix : [];
|
|
43802
43802
|
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] !== "<") {
|
|
43803
43803
|
const name3 = scope2[4];
|
|
43804
|
-
const
|
|
43805
|
-
if (!byPath.has(
|
|
43804
|
+
const path142 = scopeOf(name3, enclosing, false);
|
|
43805
|
+
if (!byPath.has(path142.join(".")) && (path142.length === 1 || byPath.has(path142.slice(0, -1).join(".")))) {
|
|
43806
43806
|
const keptAttrs = [...(scope2[1] ?? "").matchAll(/@\w+(?:\([^)]*\))?/g)].map((attr) => attr[0]).filter((attr) => !attr.startsWith("@objc"));
|
|
43807
|
-
const id = `s:peach-synthesized-${module2}-${
|
|
43807
|
+
const id = `s:peach-synthesized-${module2}-${path142.join(".")}`;
|
|
43808
43808
|
const body = [];
|
|
43809
43809
|
let inner = 1;
|
|
43810
43810
|
let closed = false;
|
|
@@ -43859,15 +43859,15 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
43859
43859
|
symbols.push({
|
|
43860
43860
|
kind: { identifier: "swift.enum" },
|
|
43861
43861
|
identifier: { precise: id },
|
|
43862
|
-
pathComponents:
|
|
43862
|
+
pathComponents: path142,
|
|
43863
43863
|
declarationFragments: fragments,
|
|
43864
43864
|
accessLevel: "public"
|
|
43865
43865
|
});
|
|
43866
|
-
if (
|
|
43866
|
+
if (path142.length > 1)
|
|
43867
43867
|
relationships.push({
|
|
43868
43868
|
kind: "memberOf",
|
|
43869
43869
|
source: id,
|
|
43870
|
-
target: byPath.get(
|
|
43870
|
+
target: byPath.get(path142.slice(0, -1).join("."))
|
|
43871
43871
|
});
|
|
43872
43872
|
for (const kase of cases) {
|
|
43873
43873
|
const memberId = `${id}-${kase.leaf}`;
|
|
@@ -43876,7 +43876,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
43876
43876
|
symbols.push({
|
|
43877
43877
|
kind: { identifier: "swift.enum.case" },
|
|
43878
43878
|
identifier: { precise: memberId },
|
|
43879
|
-
pathComponents: [...
|
|
43879
|
+
pathComponents: [...path142, kase.leaf],
|
|
43880
43880
|
declarationFragments: [
|
|
43881
43881
|
{ kind: "keyword", spelling: "case" },
|
|
43882
43882
|
{ kind: "text", spelling: " " },
|
|
@@ -43892,7 +43892,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs) {
|
|
|
43892
43892
|
symbols.push({
|
|
43893
43893
|
kind: { identifier: "swift.init" },
|
|
43894
43894
|
identifier: { precise: initId },
|
|
43895
|
-
pathComponents: [...
|
|
43895
|
+
pathComponents: [...path142, "init(rawValue:)"],
|
|
43896
43896
|
declarationFragments: [
|
|
43897
43897
|
{ kind: "keyword", spelling: "init" },
|
|
43898
43898
|
{ kind: "text", spelling: "?(" },
|
|
@@ -43961,7 +43961,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
43961
43961
|
})
|
|
43962
43962
|
)
|
|
43963
43963
|
);
|
|
43964
|
-
const trap = (
|
|
43964
|
+
const trap = (path142) => `fatalError("${path142} is ${options.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
|
|
43965
43965
|
const skipped = [];
|
|
43966
43966
|
const behavior = options.behavior ?? /* @__PURE__ */ new Map();
|
|
43967
43967
|
const used = /* @__PURE__ */ new Set();
|
|
@@ -44311,34 +44311,34 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44311
44311
|
lines.push(...physical);
|
|
44312
44312
|
owners.push(...physical.map(() => current2));
|
|
44313
44313
|
};
|
|
44314
|
-
const emitAt = (
|
|
44315
|
-
if (omit.has(
|
|
44314
|
+
const emitAt = (path142, line) => {
|
|
44315
|
+
if (omit.has(path142)) return;
|
|
44316
44316
|
const previous = current2;
|
|
44317
|
-
current2 =
|
|
44317
|
+
current2 = path142;
|
|
44318
44318
|
emit(line);
|
|
44319
44319
|
current2 = previous;
|
|
44320
44320
|
};
|
|
44321
44321
|
const emitInertState = (id, indent2, build2) => {
|
|
44322
|
-
const
|
|
44322
|
+
const path142 = pathOf(byId.get(id));
|
|
44323
44323
|
emitAt(hiddenInit(id), `${indent2}init(_peachInert: Void) { ${build2} }`);
|
|
44324
44324
|
const list2 = conforms.get(id) ?? [];
|
|
44325
44325
|
const has = (name3) => (children.get(id) ?? []).some((member) => leaf(member) === name3);
|
|
44326
44326
|
if (list2.includes("Encodable") && !has("encode(to:)"))
|
|
44327
44327
|
emitAt(
|
|
44328
|
-
`${
|
|
44328
|
+
`${path142}.encode(to:)`,
|
|
44329
44329
|
`${indent2}public func encode(to encoder: Encoder) throws {}`
|
|
44330
44330
|
);
|
|
44331
44331
|
if (list2.includes("Decodable") && !has("init(from:)"))
|
|
44332
44332
|
emitAt(
|
|
44333
|
-
`${
|
|
44333
|
+
`${path142}.init(from:)`,
|
|
44334
44334
|
`${indent2}public init(from decoder: Decoder) throws { self.init(_peachInert: ()) }`
|
|
44335
44335
|
);
|
|
44336
44336
|
};
|
|
44337
44337
|
const scoped = (body) => (symbol2, ...rest) => {
|
|
44338
|
-
const
|
|
44339
|
-
if (omit.has(
|
|
44338
|
+
const path142 = pathOf(symbol2);
|
|
44339
|
+
if (omit.has(path142)) return void skipped.push({ path: path142, reason: omit.get(path142) });
|
|
44340
44340
|
const previous = current2;
|
|
44341
|
-
current2 =
|
|
44341
|
+
current2 = path142;
|
|
44342
44342
|
try {
|
|
44343
44343
|
body(symbol2, ...rest);
|
|
44344
44344
|
} finally {
|
|
@@ -44370,7 +44370,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44370
44370
|
};
|
|
44371
44371
|
const emitMember = scoped(
|
|
44372
44372
|
(member, indent2, context) => {
|
|
44373
|
-
const
|
|
44373
|
+
const path142 = pathOf(member);
|
|
44374
44374
|
if (TYPE_KINDS.has(member.kind.identifier)) {
|
|
44375
44375
|
const origin = origins.get(member.identifier.precise)?.split(".")[0];
|
|
44376
44376
|
const parent = owner.get(member.identifier.precise);
|
|
@@ -44387,7 +44387,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44387
44387
|
))
|
|
44388
44388
|
return;
|
|
44389
44389
|
if (!MEMBER_KINDS.has(member.kind.identifier)) {
|
|
44390
|
-
skipped.push({ path:
|
|
44390
|
+
skipped.push({ path: path142, reason: `unhandled ${member.kind.identifier}` });
|
|
44391
44391
|
return;
|
|
44392
44392
|
}
|
|
44393
44393
|
const { 1: spelledAttrs, 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
@@ -44395,15 +44395,15 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44395
44395
|
/@(\w+)(?:\([^)]*\))?\s*/g,
|
|
44396
44396
|
(attr, name3) => typeByPath.has(name3) ? "" : attr
|
|
44397
44397
|
) : spelledAttrs;
|
|
44398
|
-
const attrs = options.unobjc?.has(
|
|
44398
|
+
const attrs = options.unobjc?.has(path142) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : wrapped;
|
|
44399
44399
|
const modifiers = /^((?:(?:required|final|override|convenience|unowned(?:\(\w+\))?|weak|lazy|nonisolated|mutating|nonmutating) )*)(.*)$/s.exec(
|
|
44400
44400
|
rest
|
|
44401
44401
|
);
|
|
44402
44402
|
const flags = new Set(
|
|
44403
44403
|
modifiers[1].trim().split(/\s+/).filter(Boolean).map((flag) => flag.replace(/\(.*/, ""))
|
|
44404
44404
|
);
|
|
44405
|
-
const requiredInit = context.inClass && !!options.requiredInits?.has(
|
|
44406
|
-
const restatesRequired = context.inClass &&
|
|
44405
|
+
const requiredInit = context.inClass && !!options.requiredInits?.has(path142);
|
|
44406
|
+
const restatesRequired = context.inClass && path142.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
|
|
44407
44407
|
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
44408
44408
|
);
|
|
44409
44409
|
const protocolInit = member.kind.identifier === "swift.init" && /^c:objc\(pl\)\w+\(im\).*::SYNTHESIZED::c:objc\(cs\)/.test(
|
|
@@ -44413,12 +44413,12 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44413
44413
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
44414
44414
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
44415
44415
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
44416
|
-
const override = context.inClass && !options.plain?.has(
|
|
44416
|
+
const override = context.inClass && !options.plain?.has(path142) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path142) || isObjC(member) && path142.endsWith(".init()")) ? "override " : "";
|
|
44417
44417
|
const head = `${indent2}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
44418
|
-
const measured = behavior.get(
|
|
44419
|
-
if (measured) used.add(
|
|
44418
|
+
const measured = behavior.get(path142);
|
|
44419
|
+
if (measured) used.add(path142);
|
|
44420
44420
|
const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
|
|
44421
|
-
const body = overloadBody ?? measured?.body ?? (options.inert ? inertBody(member) : trap(
|
|
44421
|
+
const body = overloadBody ?? measured?.body ?? (options.inert ? inertBody(member) : trap(path142));
|
|
44422
44422
|
switch (member.kind.identifier) {
|
|
44423
44423
|
case "swift.property":
|
|
44424
44424
|
case "swift.type.property":
|
|
@@ -44431,13 +44431,13 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44431
44431
|
const parameter = !measured && !options.inert && !settable && /:\s*some\s/.test(decl) ? opaqueParameter(member) : void 0;
|
|
44432
44432
|
const getter = parameter ? `return ({ () -> ${parameter} in ${body} })()` : body;
|
|
44433
44433
|
const computed = decl.replace(/^((?:static |class )*)let /, "$1var ");
|
|
44434
|
-
const wrapper = options.projections?.get(
|
|
44434
|
+
const wrapper = options.projections?.get(path142);
|
|
44435
44435
|
if (wrapper) {
|
|
44436
44436
|
const type = /^var\s+`?\w+`?\s*:\s*(.+)$/s.exec(computed)?.[1];
|
|
44437
|
-
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [
|
|
44437
|
+
const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path142]);
|
|
44438
44438
|
if (!initial)
|
|
44439
44439
|
return void skipped.push({
|
|
44440
|
-
path:
|
|
44440
|
+
path: path142,
|
|
44441
44441
|
reason: `wrapped by ${wrapper} with no inert initial value`
|
|
44442
44442
|
});
|
|
44443
44443
|
const own = new RegExp(
|
|
@@ -44458,7 +44458,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44458
44458
|
return;
|
|
44459
44459
|
}
|
|
44460
44460
|
emit(
|
|
44461
|
-
`${head}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options.inert ? "" : trap(
|
|
44461
|
+
`${head}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options.inert ? "" : trap(path142))} }` : ""} }`
|
|
44462
44462
|
);
|
|
44463
44463
|
return;
|
|
44464
44464
|
}
|
|
@@ -44517,7 +44517,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44517
44517
|
};
|
|
44518
44518
|
const emitType = scoped(
|
|
44519
44519
|
(symbol2, indent2) => {
|
|
44520
|
-
const
|
|
44520
|
+
const path142 = pathOf(symbol2);
|
|
44521
44521
|
const id = symbol2.identifier.precise;
|
|
44522
44522
|
const inner = `${indent2} `;
|
|
44523
44523
|
switch (symbol2.kind.identifier) {
|
|
@@ -44534,10 +44534,10 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44534
44534
|
case "swift.class": {
|
|
44535
44535
|
const shape = header(symbol2, "class", indent2);
|
|
44536
44536
|
if (!shape)
|
|
44537
|
-
return void skipped.push({ path:
|
|
44538
|
-
const parent = options.superclasses?.get(
|
|
44537
|
+
return void skipped.push({ path: path142, reason: `unparsed class ${text(symbol2)}` });
|
|
44538
|
+
const parent = options.superclasses?.get(path142) ?? superclass.get(id);
|
|
44539
44539
|
const blocked = classBlocked(id);
|
|
44540
|
-
if (blocked) return void skipped.push({ path:
|
|
44540
|
+
if (blocked) return void skipped.push({ path: path142, reason: blocked });
|
|
44541
44541
|
const ancestors = /* @__PURE__ */ new Set();
|
|
44542
44542
|
const inherited = /* @__PURE__ */ new Set();
|
|
44543
44543
|
for (let at = superId.get(id); at; at = superId.get(at)) {
|
|
@@ -44553,7 +44553,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44553
44553
|
"Equatable",
|
|
44554
44554
|
"CustomStringConvertible",
|
|
44555
44555
|
"CustomDebugStringConvertible"
|
|
44556
|
-
].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(
|
|
44556
|
+
].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(path142)?.has(name3.split(/::|\./).pop()) && !options.unconformed?.get(path142)?.has(name3)
|
|
44557
44557
|
)
|
|
44558
44558
|
].filter((name3, at, all2) => all2.indexOf(name3) === at);
|
|
44559
44559
|
const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
|
|
@@ -44565,9 +44565,9 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44565
44565
|
`${indent2}${shape.attrs}${objcName ? `@objc(${objcName}) ` : ""}${shape.final}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
|
|
44566
44566
|
);
|
|
44567
44567
|
const members2 = membersOf(id);
|
|
44568
|
-
const extra = options.behavior?.get(
|
|
44568
|
+
const extra = options.behavior?.get(path142)?.members;
|
|
44569
44569
|
if (extra) {
|
|
44570
|
-
used.add(
|
|
44570
|
+
used.add(path142);
|
|
44571
44571
|
emit(`${inner}${extra}`);
|
|
44572
44572
|
}
|
|
44573
44573
|
for (const member of members2)
|
|
@@ -44623,11 +44623,11 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44623
44623
|
if (protocol && member.kind.identifier === "swift.method" && leaf(member).endsWith("()") && have.has(`instance|leaf|${leaf(member).slice(0, -2)}`))
|
|
44624
44624
|
propertyWitnesses.push({
|
|
44625
44625
|
owner: current2,
|
|
44626
|
-
head: `extension ${pathOf(protocol)} where Self: ${
|
|
44626
|
+
head: `extension ${pathOf(protocol)} where Self: ${path142} {`,
|
|
44627
44627
|
member,
|
|
44628
|
-
path:
|
|
44628
|
+
path: path142
|
|
44629
44629
|
});
|
|
44630
|
-
else emitWitness(member, inner,
|
|
44630
|
+
else emitWitness(member, inner, path142, open && isObjC(member));
|
|
44631
44631
|
}
|
|
44632
44632
|
}
|
|
44633
44633
|
if (options.inert && designated2 && classBuild(id) === "hidden")
|
|
@@ -44635,13 +44635,13 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44635
44635
|
const coder = members2.some((member) => leaf(member) === "init(coder:)");
|
|
44636
44636
|
if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
44637
44637
|
emit(
|
|
44638
|
-
`${inner}public required init${options.coderNonfailable?.has(
|
|
44638
|
+
`${inner}public required init${options.coderNonfailable?.has(path142) ? "" : "?"}(coder: NSCoder) { ${options.inert && !options.coderNonfailable?.has(path142) ? "return nil" : trap(`${path142}.init(coder:)`)} }`
|
|
44639
44639
|
);
|
|
44640
44640
|
if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
|
|
44641
44641
|
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
44642
44642
|
))
|
|
44643
44643
|
emit(
|
|
44644
|
-
`${inner}public required init() { ${options.inert ? superInit(id) : trap(`${
|
|
44644
|
+
`${inner}public required init() { ${options.inert ? superInit(id) : trap(`${path142}.init()`)} }`
|
|
44645
44645
|
);
|
|
44646
44646
|
emit(`${indent2}}`);
|
|
44647
44647
|
return;
|
|
@@ -44649,7 +44649,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44649
44649
|
case "swift.struct": {
|
|
44650
44650
|
const shape = header(symbol2, "struct", indent2);
|
|
44651
44651
|
if (!shape)
|
|
44652
|
-
return void skipped.push({ path:
|
|
44652
|
+
return void skipped.push({ path: path142, reason: `unparsed struct ${text(symbol2)}` });
|
|
44653
44653
|
const members2 = membersOf(id);
|
|
44654
44654
|
const raw2 = rawType(members2);
|
|
44655
44655
|
const list2 = inheritance(id);
|
|
@@ -44689,7 +44689,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44689
44689
|
emitInertState(
|
|
44690
44690
|
id,
|
|
44691
44691
|
inner,
|
|
44692
|
-
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [
|
|
44692
|
+
raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path142]) ?? "0"}` : ""
|
|
44693
44693
|
);
|
|
44694
44694
|
emit(`${indent2}}`);
|
|
44695
44695
|
return;
|
|
@@ -44697,7 +44697,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44697
44697
|
case "swift.enum": {
|
|
44698
44698
|
const shape = header(symbol2, "enum", indent2);
|
|
44699
44699
|
if (!shape)
|
|
44700
|
-
return void skipped.push({ path:
|
|
44700
|
+
return void skipped.push({ path: path142, reason: `unparsed enum ${text(symbol2)}` });
|
|
44701
44701
|
const members2 = membersOf(id);
|
|
44702
44702
|
const cases = members2.filter(
|
|
44703
44703
|
(member) => member.kind.identifier === "swift.enum.case"
|
|
@@ -44707,7 +44707,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44707
44707
|
const missing2 = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
|
|
44708
44708
|
if (raw2 && (isObjC(symbol2) || /^c:@C?M@[^@]+@E@/.test(id)) && missing2.length > 0)
|
|
44709
44709
|
return void skipped.push({
|
|
44710
|
-
path:
|
|
44710
|
+
path: path142,
|
|
44711
44711
|
reason: `no header value for ${missing2.map(leaf).join(", ")}`
|
|
44712
44712
|
});
|
|
44713
44713
|
const list2 = inheritance(id, raw2 ?? void 0).filter(
|
|
@@ -44746,8 +44746,8 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44746
44746
|
});
|
|
44747
44747
|
}
|
|
44748
44748
|
if (options.inert) {
|
|
44749
|
-
const value = options.trapped?.has(hiddenInit(id)) ? null : inertValue(
|
|
44750
|
-
emitInertState(id, inner, value === null ? trap(
|
|
44749
|
+
const value = options.trapped?.has(hiddenInit(id)) ? null : inertValue(path142, /* @__PURE__ */ new Set(), []);
|
|
44750
|
+
emitInertState(id, inner, value === null ? trap(path142) : `self = ${value}`);
|
|
44751
44751
|
}
|
|
44752
44752
|
emit(`${indent2}}`);
|
|
44753
44753
|
return;
|
|
@@ -44756,14 +44756,14 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44756
44756
|
const shape = header(symbol2, "protocol", indent2);
|
|
44757
44757
|
if (!shape)
|
|
44758
44758
|
return void skipped.push({
|
|
44759
|
-
path:
|
|
44759
|
+
path: path142,
|
|
44760
44760
|
reason: `unparsed protocol ${text(symbol2)}`
|
|
44761
44761
|
});
|
|
44762
44762
|
const native = nativeObjcProtocols.has(id);
|
|
44763
44763
|
const objcName = native ? /^c:objc\(pl\)(\w+)$/.exec(id)?.[1] : void 0;
|
|
44764
44764
|
if (native && !objcName)
|
|
44765
44765
|
return void skipped.push({
|
|
44766
|
-
path:
|
|
44766
|
+
path: path142,
|
|
44767
44767
|
reason: `unknown Objective-C protocol identity ${id}`
|
|
44768
44768
|
});
|
|
44769
44769
|
const list2 = [
|
|
@@ -44791,7 +44791,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44791
44791
|
}
|
|
44792
44792
|
emit(`${indent2}}`);
|
|
44793
44793
|
if (defaults.length > 0) {
|
|
44794
|
-
emit(`${indent2}extension ${
|
|
44794
|
+
emit(`${indent2}extension ${path142} {`);
|
|
44795
44795
|
for (const member of defaults) {
|
|
44796
44796
|
const decl = text(member);
|
|
44797
44797
|
if (optional3.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
|
|
@@ -44885,7 +44885,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44885
44885
|
return null;
|
|
44886
44886
|
};
|
|
44887
44887
|
const emitGlobal = scoped((symbol2) => {
|
|
44888
|
-
const
|
|
44888
|
+
const path142 = pathOf(symbol2);
|
|
44889
44889
|
const kind = symbol2.kind.identifier;
|
|
44890
44890
|
if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
|
|
44891
44891
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol2));
|
|
@@ -44894,20 +44894,20 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44894
44894
|
if (leaf(symbol2).endsWith("(_:)") && !/^(?:prefix|infix|postfix)\b/.test(spelled2))
|
|
44895
44895
|
spelled2 = `prefix ${spelled2}`;
|
|
44896
44896
|
}
|
|
44897
|
-
const measured = behavior.get(
|
|
44898
|
-
if (measured) used.add(
|
|
44897
|
+
const measured = behavior.get(path142);
|
|
44898
|
+
if (measured) used.add(path142);
|
|
44899
44899
|
const overloadBody = /\basync\b/.test(spelled2) ? measured?.asyncBody : /\bResult</.test(spelled2) ? measured?.resultBody : void 0;
|
|
44900
44900
|
emit(
|
|
44901
|
-
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options.inert ? inertBody(symbol2) : trap(
|
|
44901
|
+
`${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path142))} }`
|
|
44902
44902
|
);
|
|
44903
44903
|
} else if (kind === "swift.var") {
|
|
44904
44904
|
const parsed = splitAccessors(text(symbol2).replace(/^let /, "var "));
|
|
44905
|
-
const measured = behavior.get(
|
|
44906
|
-
if (measured) used.add(
|
|
44905
|
+
const measured = behavior.get(path142);
|
|
44906
|
+
if (measured) used.add(path142);
|
|
44907
44907
|
emit(
|
|
44908
|
-
`public ${parsed.decl} { ${measured?.body ?? (options.inert ? inertBody(symbol2) : trap(
|
|
44908
|
+
`public ${parsed.decl} { ${measured?.body ?? (options.inert ? inertBody(symbol2) : trap(path142))} }`
|
|
44909
44909
|
);
|
|
44910
|
-
} else skipped.push({ path:
|
|
44910
|
+
} else skipped.push({ path: path142, reason: `unhandled top-level ${kind}` });
|
|
44911
44911
|
});
|
|
44912
44912
|
const cExports = new Set(
|
|
44913
44913
|
[...byId.values()].flatMap((symbol2) => {
|
|
@@ -44924,7 +44924,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44924
44924
|
return !name3 || !cExports.has(`${name3}|${text(symbol2)}`);
|
|
44925
44925
|
}).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
|
|
44926
44926
|
for (const symbol2 of roots) {
|
|
44927
|
-
const
|
|
44927
|
+
const path142 = pathOf(symbol2);
|
|
44928
44928
|
if (TYPE_KINDS.has(symbol2.kind.identifier)) emitType(symbol2, "");
|
|
44929
44929
|
else emitGlobal(symbol2);
|
|
44930
44930
|
}
|
|
@@ -44985,9 +44985,9 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
44985
44985
|
"#endif",
|
|
44986
44986
|
""
|
|
44987
44987
|
];
|
|
44988
|
-
for (const
|
|
44989
|
-
if (!used.has(
|
|
44990
|
-
skipped.push({ path:
|
|
44988
|
+
for (const path142 of behavior.keys())
|
|
44989
|
+
if (!used.has(path142))
|
|
44990
|
+
skipped.push({ path: path142, reason: "behavior names no emitted declaration" });
|
|
44991
44991
|
return {
|
|
44992
44992
|
source: `${[...banner, ...lines].join("\n")}
|
|
44993
44993
|
`,
|
|
@@ -47191,9 +47191,9 @@ function originalColumn(line, column) {
|
|
|
47191
47191
|
}
|
|
47192
47192
|
function designTimeDiagnostic(output2, files2) {
|
|
47193
47193
|
const rewritten = /* @__PURE__ */ new Map();
|
|
47194
|
-
const linesOf = (
|
|
47194
|
+
const linesOf = (path142) => {
|
|
47195
47195
|
const file = Object.keys(files2).find(
|
|
47196
|
-
(name3) => name3.endsWith(".swift") && (
|
|
47196
|
+
(name3) => name3.endsWith(".swift") && (path142 === name3 || path142.endsWith(`/${name3}`))
|
|
47197
47197
|
);
|
|
47198
47198
|
if (file === void 0) return null;
|
|
47199
47199
|
let lines = rewritten.get(file);
|
|
@@ -66276,9 +66276,9 @@ async function packageTreeDigest(root) {
|
|
|
66276
66276
|
(a, b) => a.name.localeCompare(b.name)
|
|
66277
66277
|
)) {
|
|
66278
66278
|
if (entry.name === "node_modules") continue;
|
|
66279
|
-
const
|
|
66280
|
-
if (entry.isDirectory()) walk3((0, import_node_path66.join)(directory2, entry.name), `${
|
|
66281
|
-
else if (entry.isFile()) files2.push(
|
|
66279
|
+
const path142 = `${relative6}${entry.name}`;
|
|
66280
|
+
if (entry.isDirectory()) walk3((0, import_node_path66.join)(directory2, entry.name), `${path142}/`);
|
|
66281
|
+
else if (entry.isFile()) files2.push(path142);
|
|
66282
66282
|
}
|
|
66283
66283
|
};
|
|
66284
66284
|
walk3(root, "");
|
|
@@ -66305,7 +66305,7 @@ var init_package_tree_digest = __esm({
|
|
|
66305
66305
|
|
|
66306
66306
|
// src/expo-native-prebuilt.ts
|
|
66307
66307
|
function expoNativeCompilerDigestValue() {
|
|
66308
|
-
return true ? "
|
|
66308
|
+
return true ? "cf0557e09d89c8c6883a1e9ce3f3f57b9f43040a8f4e81e39c612c37d34d8430" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
66309
66309
|
}
|
|
66310
66310
|
function readSources(value) {
|
|
66311
66311
|
const sources = isRecord(value) ? value.sources : null;
|
|
@@ -67668,7 +67668,7 @@ function resolveSwiftPackages(options) {
|
|
|
67668
67668
|
headers.set(name3, import_node_path71.default.relative(binary2.dir, dir));
|
|
67669
67669
|
};
|
|
67670
67670
|
visit3(pkg, binary2.target);
|
|
67671
|
-
binary2.headerDependencies = [...headers].map(([module2,
|
|
67671
|
+
binary2.headerDependencies = [...headers].map(([module2, path142]) => ({ module: module2, path: path142 }));
|
|
67672
67672
|
}
|
|
67673
67673
|
for (const owner of options.owners ?? []) {
|
|
67674
67674
|
const found = productClosure(owner.products);
|
|
@@ -68404,8 +68404,8 @@ function withBuiltinStandinBehavior(behavior) {
|
|
|
68404
68404
|
for (const [module2, members2] of Object.entries(BUILTIN_STANDIN_BEHAVIOR))
|
|
68405
68405
|
merged[module2] = {
|
|
68406
68406
|
...Object.fromEntries(
|
|
68407
|
-
Object.entries(members2).map(([
|
|
68408
|
-
|
|
68407
|
+
Object.entries(members2).map(([path142, entry]) => [
|
|
68408
|
+
path142,
|
|
68409
68409
|
{ ...entry, builtin: true }
|
|
68410
68410
|
])
|
|
68411
68411
|
),
|
|
@@ -73115,8 +73115,8 @@ function imagesetFiles(images) {
|
|
|
73115
73115
|
];
|
|
73116
73116
|
}).sort((a, b) => a.scale - b.scale);
|
|
73117
73117
|
}
|
|
73118
|
-
function flatScale(
|
|
73119
|
-
const match = /@([23])x\.[^./]+$/.exec(
|
|
73118
|
+
function flatScale(path142) {
|
|
73119
|
+
const match = /@([23])x\.[^./]+$/.exec(path142);
|
|
73120
73120
|
return match ? Number(match[1]) : 1;
|
|
73121
73121
|
}
|
|
73122
73122
|
function providesNamespace(text6) {
|
|
@@ -73143,8 +73143,8 @@ function catalogEntryName(contentsPath, kind, readText2) {
|
|
|
73143
73143
|
}
|
|
73144
73144
|
return segments.join("/");
|
|
73145
73145
|
}
|
|
73146
|
-
function isFlatResourceImage(
|
|
73147
|
-
return
|
|
73146
|
+
function isFlatResourceImage(path142) {
|
|
73147
|
+
return path142.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path142));
|
|
73148
73148
|
}
|
|
73149
73149
|
function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
73150
73150
|
const table = [];
|
|
@@ -73157,7 +73157,7 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
|
73157
73157
|
seen.set(bundlePath, names);
|
|
73158
73158
|
return { bundlePath, names };
|
|
73159
73159
|
};
|
|
73160
|
-
const catalogs = paths.filter((
|
|
73160
|
+
const catalogs = paths.filter((path142) => baseOf(path142) === "Contents.json");
|
|
73161
73161
|
for (const contentsPath of catalogs) {
|
|
73162
73162
|
const name3 = catalogEntryName(contentsPath, ".imageset", readText2);
|
|
73163
73163
|
if (name3 === null) continue;
|
|
@@ -73189,13 +73189,13 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
|
73189
73189
|
...intent === "template" || intent === "original" ? { renderingMode: intent } : {}
|
|
73190
73190
|
});
|
|
73191
73191
|
}
|
|
73192
|
-
for (const
|
|
73193
|
-
if (!isFlatResourceImage(
|
|
73194
|
-
const name3 = baseOf(
|
|
73195
|
-
const { bundlePath, names } = namesFor(
|
|
73192
|
+
for (const path142 of paths) {
|
|
73193
|
+
if (!isFlatResourceImage(path142)) continue;
|
|
73194
|
+
const name3 = baseOf(path142).slice(0, -extOf(path142).length);
|
|
73195
|
+
const { bundlePath, names } = namesFor(path142);
|
|
73196
73196
|
if (name3 === "" || names.has(name3)) continue;
|
|
73197
73197
|
names.add(name3);
|
|
73198
|
-
table.push({ name: name3, file:
|
|
73198
|
+
table.push({ name: name3, file: path142, scale: flatScale(path142), bundlePath });
|
|
73199
73199
|
}
|
|
73200
73200
|
return table;
|
|
73201
73201
|
}
|
|
@@ -73230,7 +73230,7 @@ function colorsetValue(color2) {
|
|
|
73230
73230
|
}
|
|
73231
73231
|
function enumerateBundleColors(paths, readText2) {
|
|
73232
73232
|
const table = {};
|
|
73233
|
-
for (const contentsPath of paths.filter((
|
|
73233
|
+
for (const contentsPath of paths.filter((path142) => baseOf(path142) === "Contents.json")) {
|
|
73234
73234
|
const name3 = catalogEntryName(contentsPath, ".colorset", readText2);
|
|
73235
73235
|
if (name3 === null || name3 in table) continue;
|
|
73236
73236
|
let colors;
|
|
@@ -73294,8 +73294,8 @@ function axisExtremes(points) {
|
|
|
73294
73294
|
function pathBounds(d) {
|
|
73295
73295
|
const xs = [];
|
|
73296
73296
|
const ys = [];
|
|
73297
|
-
for (const
|
|
73298
|
-
(0, import_svgpath.default)(
|
|
73297
|
+
for (const path142 of d)
|
|
73298
|
+
(0, import_svgpath.default)(path142).abs().unshort().unarc().iterate((segment, _index, x, y) => {
|
|
73299
73299
|
const [command, ...args] = segment;
|
|
73300
73300
|
if (command === "M" || command === "L") {
|
|
73301
73301
|
xs.push(Number(args[0]));
|
|
@@ -73322,7 +73322,7 @@ function guide(svg, id, axis) {
|
|
|
73322
73322
|
}
|
|
73323
73323
|
function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
73324
73324
|
const table = {};
|
|
73325
|
-
for (const contentsPath of paths.filter((
|
|
73325
|
+
for (const contentsPath of paths.filter((path142) => baseOf(path142) === "Contents.json")) {
|
|
73326
73326
|
const name3 = catalogEntryName(contentsPath, ".symbolset", readText2);
|
|
73327
73327
|
if (name3 === null) continue;
|
|
73328
73328
|
const bundle = bundleForFile(contentsPath);
|
|
@@ -73381,8 +73381,8 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
|
73381
73381
|
advance,
|
|
73382
73382
|
box: [12 - wide2 / 2, 12 - tall / 2, wide2, tall],
|
|
73383
73383
|
...customLayout ? { customLayout } : {},
|
|
73384
|
-
layers: d.map((
|
|
73385
|
-
d: (0, import_svgpath.default)(
|
|
73384
|
+
layers: d.map((path142) => ({
|
|
73385
|
+
d: (0, import_svgpath.default)(path142).abs().scale(em).translate(translateX, translateY).round(3).toString()
|
|
73386
73386
|
}))
|
|
73387
73387
|
};
|
|
73388
73388
|
table[vectorKey] = vector;
|
|
@@ -73393,18 +73393,18 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
|
73393
73393
|
}
|
|
73394
73394
|
return table;
|
|
73395
73395
|
}
|
|
73396
|
-
function isCopiedResource(
|
|
73397
|
-
if (copiedBundle ||
|
|
73396
|
+
function isCopiedResource(path142, copiedBundle) {
|
|
73397
|
+
if (copiedBundle || path142.split("/").some((segment) => /\.(atlasc|bundle|storyboardc|nib)$/.test(segment)))
|
|
73398
73398
|
return true;
|
|
73399
|
-
const ext = extOf(
|
|
73399
|
+
const ext = extOf(path142);
|
|
73400
73400
|
if (ext === ".json" || ext === ".xcstrings") return true;
|
|
73401
|
-
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !
|
|
73401
|
+
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !path142.split("/").some((segment) => segment.endsWith(".xcassets"));
|
|
73402
73402
|
}
|
|
73403
73403
|
function enumerateBundleResources(paths, copiedBundle = false) {
|
|
73404
73404
|
const found = [];
|
|
73405
73405
|
const seen = /* @__PURE__ */ new Set();
|
|
73406
73406
|
const ordered = [...paths].filter(
|
|
73407
|
-
(
|
|
73407
|
+
(path142) => path142.split("/").includes("Resources") && path142.split("/").every((segment) => segment !== "" && segment !== "..") && isCopiedResource(path142, copiedBundle)
|
|
73408
73408
|
).sort((a, b) => {
|
|
73409
73409
|
const aDepth = a.split("/").length;
|
|
73410
73410
|
const bDepth = b.split("/").length;
|
|
@@ -73567,31 +73567,31 @@ function tokens(text6) {
|
|
|
73567
73567
|
}
|
|
73568
73568
|
return result;
|
|
73569
73569
|
}
|
|
73570
|
-
function qualified(language, key2,
|
|
73571
|
-
return `(${language}: ${key2}${
|
|
73570
|
+
function qualified(language, key2, path142) {
|
|
73571
|
+
return `(${language}: ${key2}${path142 === "" ? "" : "|==|" + path142})`;
|
|
73572
73572
|
}
|
|
73573
|
-
function requiresNumber(language, key2,
|
|
73573
|
+
function requiresNumber(language, key2, path142) {
|
|
73574
73574
|
return Error(
|
|
73575
|
-
"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,
|
|
73575
|
+
"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, path142)
|
|
73576
73576
|
);
|
|
73577
73577
|
}
|
|
73578
|
-
function moreThanOne(language, key2,
|
|
73578
|
+
function moreThanOne(language, key2, path142) {
|
|
73579
73579
|
return Error(
|
|
73580
|
-
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2,
|
|
73580
|
+
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path142)
|
|
73581
73581
|
);
|
|
73582
73582
|
}
|
|
73583
73583
|
function schemaPath(segments) {
|
|
73584
73584
|
return segments.map((segment) => `'${segment}'`).join(" -> ");
|
|
73585
73585
|
}
|
|
73586
|
-
function checkUnitShape(node,
|
|
73586
|
+
function checkUnitShape(node, path142) {
|
|
73587
73587
|
const raw2 = node.stringUnit;
|
|
73588
73588
|
if (raw2 === void 0)
|
|
73589
|
-
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(
|
|
73589
|
+
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path142)}`);
|
|
73590
73590
|
if (raw2 === null)
|
|
73591
|
-
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(
|
|
73591
|
+
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path142)}`);
|
|
73592
73592
|
if (!isRecord3(raw2))
|
|
73593
|
-
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(
|
|
73594
|
-
const unitPath = [...
|
|
73593
|
+
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path142)}`);
|
|
73594
|
+
const unitPath = [...path142, "stringUnit"];
|
|
73595
73595
|
if (!Object.hasOwn(raw2, "state"))
|
|
73596
73596
|
throw Error(`Missing required key 'state' inside ${schemaPath(unitPath)}`);
|
|
73597
73597
|
const state = raw2.state;
|
|
@@ -73608,38 +73608,38 @@ function checkUnitShape(node, path141) {
|
|
|
73608
73608
|
throw Error(`Expected string for key 'value' inside ${schemaPath(unitPath)}`);
|
|
73609
73609
|
return value;
|
|
73610
73610
|
}
|
|
73611
|
-
function checkPluralShape(node,
|
|
73611
|
+
function checkPluralShape(node, path142) {
|
|
73612
73612
|
for (const [category, raw2] of Object.entries(node)) {
|
|
73613
|
-
const categoryPath = [...
|
|
73613
|
+
const categoryPath = [...path142, category];
|
|
73614
73614
|
if (raw2 === null)
|
|
73615
73615
|
throw Error(
|
|
73616
|
-
`Missing required value for key '${category}' inside ${schemaPath(
|
|
73616
|
+
`Missing required value for key '${category}' inside ${schemaPath(path142)}`
|
|
73617
73617
|
);
|
|
73618
73618
|
if (!isRecord3(raw2))
|
|
73619
|
-
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(
|
|
73619
|
+
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path142)}`);
|
|
73620
73620
|
checkUnitShape(raw2, categoryPath);
|
|
73621
73621
|
}
|
|
73622
73622
|
}
|
|
73623
|
-
function checkLocalizationShape(node,
|
|
73623
|
+
function checkLocalizationShape(node, path142, deviceValue = false) {
|
|
73624
73624
|
if (node === null)
|
|
73625
73625
|
throw Error(
|
|
73626
|
-
`Missing required value for key '${
|
|
73626
|
+
`Missing required value for key '${path142[path142.length - 1]}' inside ${schemaPath(path142.slice(0, -1))}`
|
|
73627
73627
|
);
|
|
73628
73628
|
if (!isRecord3(node))
|
|
73629
73629
|
throw Error(
|
|
73630
|
-
`Expected dictionary for key '${
|
|
73630
|
+
`Expected dictionary for key '${path142[path142.length - 1]}' inside ${schemaPath(path142.slice(0, -1))}`
|
|
73631
73631
|
);
|
|
73632
|
-
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations,
|
|
73632
|
+
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path142);
|
|
73633
73633
|
if (!deviceValue && Object.hasOwn(node, "substitutions"))
|
|
73634
|
-
checkSubstitutionsShape(node.substitutions,
|
|
73635
|
-
if (!Object.hasOwn(node, "variations")) checkUnitShape(node,
|
|
73634
|
+
checkSubstitutionsShape(node.substitutions, path142);
|
|
73635
|
+
if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path142);
|
|
73636
73636
|
}
|
|
73637
|
-
function checkVariationsShape(variations,
|
|
73637
|
+
function checkVariationsShape(variations, path142) {
|
|
73638
73638
|
if (variations === null)
|
|
73639
|
-
throw Error(`Missing required value for key 'variations' inside ${schemaPath(
|
|
73639
|
+
throw Error(`Missing required value for key 'variations' inside ${schemaPath(path142)}`);
|
|
73640
73640
|
if (!isRecord3(variations))
|
|
73641
|
-
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(
|
|
73642
|
-
const variationsPath = [...
|
|
73641
|
+
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path142)}`);
|
|
73642
|
+
const variationsPath = [...path142, "variations"];
|
|
73643
73643
|
for (const [type, raw2] of Object.entries(variations)) {
|
|
73644
73644
|
if (raw2 === null)
|
|
73645
73645
|
throw Error(
|
|
@@ -73665,11 +73665,11 @@ function checkVariationsShape(variations, path141) {
|
|
|
73665
73665
|
}
|
|
73666
73666
|
}
|
|
73667
73667
|
}
|
|
73668
|
-
function checkSubstitutionsShape(substitutions,
|
|
73668
|
+
function checkSubstitutionsShape(substitutions, path142) {
|
|
73669
73669
|
if (substitutions === null) return;
|
|
73670
73670
|
if (!isRecord3(substitutions))
|
|
73671
|
-
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(
|
|
73672
|
-
const substitutionsPath = [...
|
|
73671
|
+
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path142)}`);
|
|
73672
|
+
const substitutionsPath = [...path142, "substitutions"];
|
|
73673
73673
|
for (const [name3, raw2] of Object.entries(substitutions)) {
|
|
73674
73674
|
const subPath = [...substitutionsPath, name3];
|
|
73675
73675
|
if (raw2 === null)
|
|
@@ -73711,10 +73711,10 @@ function scanSpecs(forms) {
|
|
|
73711
73711
|
}
|
|
73712
73712
|
return specs;
|
|
73713
73713
|
}
|
|
73714
|
-
function inferPlural(forms, language, key2,
|
|
73714
|
+
function inferPlural(forms, language, key2, path142) {
|
|
73715
73715
|
const specs = scanSpecs(forms);
|
|
73716
|
-
if (specs.size === 0) throw requiresNumber(language, key2,
|
|
73717
|
-
if (specs.size > 1) throw moreThanOne(language, key2,
|
|
73716
|
+
if (specs.size === 0) throw requiresNumber(language, key2, path142);
|
|
73717
|
+
if (specs.size > 1) throw moreThanOne(language, key2, path142);
|
|
73718
73718
|
return [...specs.values()][0] ?? { specifier: "", argument: 0 };
|
|
73719
73719
|
}
|
|
73720
73720
|
function unit(value) {
|
|
@@ -74183,8 +74183,8 @@ function plist4(value, depth) {
|
|
|
74183
74183
|
}
|
|
74184
74184
|
function compileStringCatalog(source, name3) {
|
|
74185
74185
|
return Object.fromEntries(
|
|
74186
|
-
Object.entries(compileCatalogTables(source, name3)).map(([
|
|
74187
|
-
|
|
74186
|
+
Object.entries(compileCatalogTables(source, name3)).map(([path142, table]) => [
|
|
74187
|
+
path142,
|
|
74188
74188
|
'<?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' + plist4(table, 0) + "</plist>\n"
|
|
74189
74189
|
])
|
|
74190
74190
|
);
|
|
@@ -75112,8 +75112,8 @@ function sourceEntryPath() {
|
|
|
75112
75112
|
return null;
|
|
75113
75113
|
}
|
|
75114
75114
|
}
|
|
75115
|
-
function isCliEntry(
|
|
75116
|
-
const name3 = (0, import_node_path81.basename)(
|
|
75115
|
+
function isCliEntry(path142) {
|
|
75116
|
+
const name3 = (0, import_node_path81.basename)(path142);
|
|
75117
75117
|
return name3 === "bin.ts" || name3 === "bin.js";
|
|
75118
75118
|
}
|
|
75119
75119
|
function rnxSelfInvocation() {
|
|
@@ -77051,6 +77051,9 @@ function packageSources(packagePath, hosted = false, linked = /* @__PURE__ */ ne
|
|
|
77051
77051
|
return files2;
|
|
77052
77052
|
}
|
|
77053
77053
|
function packageSnapshot(project2, entry, moduleRoot) {
|
|
77054
|
+
moduleRoot ??= xcodeProjects().get(project2.packagePath)?.moduleRoot ?? linkedModuleRoots(project2.packagePath).find(
|
|
77055
|
+
(root) => import_node_fs86.default.existsSync(import_node_path83.default.join(root, "toolchain.json"))
|
|
77056
|
+
);
|
|
77054
77057
|
const layout2 = xcodeLayout(project2.packagePath);
|
|
77055
77058
|
const pin2 = moduleRoot ? swiftDistributionAt(moduleRoot) ?? JSON.parse(import_node_fs86.default.readFileSync(import_node_path83.default.join(moduleRoot, "toolchain.json"), "utf8")) : null;
|
|
77056
77059
|
const linked = layout2 ? standinLibraries(
|
|
@@ -77521,10 +77524,7 @@ function scopedArtifact(project2, entry, moduleRoot, signal) {
|
|
|
77521
77524
|
queued.then(resolve14, reject).finally(() => signal.removeEventListener("abort", stop));
|
|
77522
77525
|
});
|
|
77523
77526
|
}
|
|
77524
|
-
const
|
|
77525
|
-
(root) => import_node_fs86.default.existsSync(import_node_path83.default.join(root, "toolchain.json"))
|
|
77526
|
-
);
|
|
77527
|
-
const snapshot = packageSnapshot(project2, entry, snapshotRoot);
|
|
77527
|
+
const snapshot = packageSnapshot(project2, entry, moduleRoot);
|
|
77528
77528
|
const compiled = project2.artifact?.compiled;
|
|
77529
77529
|
if (project2.artifact && compiled && compiled.module === moduleStamp(project2.packagePath, moduleRoot, false)) {
|
|
77530
77530
|
const input = snapshotCompileInput(snapshot);
|
|
@@ -80421,11 +80421,11 @@ function stringList(value) {
|
|
|
80421
80421
|
function externalSpecMembers(root, requested) {
|
|
80422
80422
|
const children = (spec) => Array.isArray(spec.subspecs) ? spec.subspecs.filter(object5) : [];
|
|
80423
80423
|
const chains = /* @__PURE__ */ new Map();
|
|
80424
|
-
const select = (
|
|
80425
|
-
const key2 =
|
|
80424
|
+
const select = (path142) => {
|
|
80425
|
+
const key2 = path142.join("/");
|
|
80426
80426
|
if (chains.has(key2)) return;
|
|
80427
80427
|
const chain = [root];
|
|
80428
|
-
for (const part of
|
|
80428
|
+
for (const part of path142) {
|
|
80429
80429
|
const child = children(chain.at(-1)).find((sub) => sub.name === part);
|
|
80430
80430
|
if (!child) throw new Error(`${String(root.name)} has no subspec ${key2}`);
|
|
80431
80431
|
chain.push(child);
|
|
@@ -80434,7 +80434,7 @@ function externalSpecMembers(root, requested) {
|
|
|
80434
80434
|
const spec = chain.at(-1);
|
|
80435
80435
|
const defaults = stringList(spec.default_subspecs ?? spec.default_subspec);
|
|
80436
80436
|
const activated2 = defaults[0] === "none" ? [] : defaults.length > 0 ? defaults : children(spec).map((sub) => String(sub.name));
|
|
80437
|
-
for (const name3 of activated2) select([...
|
|
80437
|
+
for (const name3 of activated2) select([...path142, ...name3.split("/")]);
|
|
80438
80438
|
for (const member of chain)
|
|
80439
80439
|
for (const dependencies of [member.dependencies, iosOf(member)?.dependencies])
|
|
80440
80440
|
for (const dependency of object5(dependencies) ? Object.keys(dependencies) : []) {
|
|
@@ -85727,8 +85727,8 @@ var init_expo_swift_host = __esm({
|
|
|
85727
85727
|
});
|
|
85728
85728
|
|
|
85729
85729
|
// ../peach-kit/src/uttype-mime.ts
|
|
85730
|
-
function preferredMimeType(
|
|
85731
|
-
const name3 =
|
|
85730
|
+
function preferredMimeType(path142) {
|
|
85731
|
+
const name3 = path142.split(/[?#]/, 1)[0].replace(/\/+$/, "").split("/").pop() ?? "";
|
|
85732
85732
|
const dot = name3.lastIndexOf(".");
|
|
85733
85733
|
if (dot <= 0) return null;
|
|
85734
85734
|
return preferredMimeTypeForExtension(name3.slice(dot + 1));
|
|
@@ -87107,7 +87107,7 @@ var init_nitro_superset = __esm({
|
|
|
87107
87107
|
init_nitroContract();
|
|
87108
87108
|
init_swift_standin_digest();
|
|
87109
87109
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
87110
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
87110
|
+
NITRO_COMPILER_DIGEST = true ? "6a6f80ad2d874ad53a058d4aa8764ae971a237caf160c09603cebe64e1b6bbf6" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
87111
87111
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
87112
87112
|
nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
|
|
87113
87113
|
published2 = /* @__PURE__ */ new Map();
|
|
@@ -88444,8 +88444,8 @@ function getDefaultPortForProtocol(protocol) {
|
|
|
88444
88444
|
return protocol === "https:" ? 443 : 80;
|
|
88445
88445
|
}
|
|
88446
88446
|
function isBaseServerUrl(url) {
|
|
88447
|
-
const
|
|
88448
|
-
return (
|
|
88447
|
+
const path142 = url.pathname || "/";
|
|
88448
|
+
return (path142 === "/" || path142 === "") && !url.search && !url.hash;
|
|
88449
88449
|
}
|
|
88450
88450
|
async function resolvePortViaServerScan(port) {
|
|
88451
88451
|
try {
|
|
@@ -88867,9 +88867,9 @@ function safeChildPlistName(value) {
|
|
|
88867
88867
|
name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
|
|
88868
88868
|
};
|
|
88869
88869
|
}
|
|
88870
|
-
async function readableSettingsBundle(
|
|
88870
|
+
async function readableSettingsBundle(path142) {
|
|
88871
88871
|
try {
|
|
88872
|
-
const root = await (0, import_promises10.stat)((0, import_node_path106.join)(
|
|
88872
|
+
const root = await (0, import_promises10.stat)((0, import_node_path106.join)(path142, "Root.plist"));
|
|
88873
88873
|
return root.isFile() && root.size <= MAX_PLIST_BYTES;
|
|
88874
88874
|
} catch {
|
|
88875
88875
|
return false;
|
|
@@ -88914,11 +88914,11 @@ async function settingsBundleFingerprint(bundlePath) {
|
|
|
88914
88914
|
return null;
|
|
88915
88915
|
}
|
|
88916
88916
|
}
|
|
88917
|
-
async function parsePlistRecord(
|
|
88917
|
+
async function parsePlistRecord(path142) {
|
|
88918
88918
|
try {
|
|
88919
|
-
const metadata = await (0, import_promises10.stat)(
|
|
88919
|
+
const metadata = await (0, import_promises10.stat)(path142);
|
|
88920
88920
|
if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
|
|
88921
|
-
const source = await (0, import_promises10.readFile)(
|
|
88921
|
+
const source = await (0, import_promises10.readFile)(path142, "utf8");
|
|
88922
88922
|
const parsed = parsePlistSource(source);
|
|
88923
88923
|
return isRecord(parsed) ? parsed : null;
|
|
88924
88924
|
} catch {
|
|
@@ -89423,7 +89423,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
|
89423
89423
|
return null;
|
|
89424
89424
|
}
|
|
89425
89425
|
}
|
|
89426
|
-
function httpGet(hostname, port,
|
|
89426
|
+
function httpGet(hostname, port, path142, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
89427
89427
|
return new Promise((resolve14) => {
|
|
89428
89428
|
let settled = false;
|
|
89429
89429
|
let killing = false;
|
|
@@ -89432,7 +89432,7 @@ function httpGet(hostname, port, path141, method = "GET", timeout = TIMEOUT_MS,
|
|
|
89432
89432
|
settled = true;
|
|
89433
89433
|
resolve14(value);
|
|
89434
89434
|
};
|
|
89435
|
-
const req = import_http.default.request({ hostname, port, path:
|
|
89435
|
+
const req = import_http.default.request({ hostname, port, path: path142, method, headers }, (res) => {
|
|
89436
89436
|
let body = "";
|
|
89437
89437
|
res.on("data", (c) => body += c.toString());
|
|
89438
89438
|
const contentType2 = (() => {
|
|
@@ -101788,8 +101788,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
|
|
|
101788
101788
|
}
|
|
101789
101789
|
const out = [];
|
|
101790
101790
|
for (const dir of dirs) {
|
|
101791
|
-
const
|
|
101792
|
-
if (!out.includes(
|
|
101791
|
+
const path142 = `${dir}/${filename}`;
|
|
101792
|
+
if (!out.includes(path142)) out.push(path142);
|
|
101793
101793
|
}
|
|
101794
101794
|
if (!out.includes(filename)) out.push(filename);
|
|
101795
101795
|
return out;
|
|
@@ -101831,6 +101831,15 @@ function resolveMetroIosAssetDestFiles(destFiles, descriptor, scale) {
|
|
|
101831
101831
|
(file) => destFileMatchesLocation(file, descriptor.httpServerLocation, filename)
|
|
101832
101832
|
).sort();
|
|
101833
101833
|
}
|
|
101834
|
+
function resolveMetroAndroidAssetDestFiles(destFiles, descriptor, scale) {
|
|
101835
|
+
const location = descriptor.httpServerLocation.replace(/^\//, "");
|
|
101836
|
+
const identifier2 = `${location}/${descriptor.name}`.toLowerCase().replace(/\//g, "_").replace(/[^a-z0-9_]/g, "").replace(/^(?:assets|assetsunstable_path)_/, "");
|
|
101837
|
+
const density = androidDensities.get(scale);
|
|
101838
|
+
const folder = !androidDrawableTypes.has(descriptor.type) ? "raw" : density && `drawable-${density}`;
|
|
101839
|
+
if (!folder) return [];
|
|
101840
|
+
const relative6 = `${folder}/${identifier2}.${descriptor.type}`;
|
|
101841
|
+
return destFiles.some((file) => file.replaceAll("\\", "/") === relative6) ? [relative6] : [];
|
|
101842
|
+
}
|
|
101834
101843
|
async function embedMetroAssetFiles(bundle, read) {
|
|
101835
101844
|
const sites = scanAssetDescriptorSites(bundle);
|
|
101836
101845
|
const embedded = /* @__PURE__ */ new Map();
|
|
@@ -101951,7 +101960,7 @@ function rewriteDescriptorObject(bundle, site, entry) {
|
|
|
101951
101960
|
const missing2 = countNewlines(bundle.slice(site.start, site.end)) - countNewlines(rewritten);
|
|
101952
101961
|
return missing2 > 0 ? `${rewritten.slice(0, -1)}${"\n".repeat(missing2)}}` : rewritten;
|
|
101953
101962
|
}
|
|
101954
|
-
var EXPRESSION_KEYWORDS, PLACEHOLDER_JPEG, METRO_ASSET_PLACEHOLDERS;
|
|
101963
|
+
var EXPRESSION_KEYWORDS, PLACEHOLDER_JPEG, METRO_ASSET_PLACEHOLDERS, androidDrawableTypes, androidDensities;
|
|
101955
101964
|
var init_metroAssetArtifact = __esm({
|
|
101956
101965
|
"../contrast-bundler/src/metroAssetArtifact.ts"() {
|
|
101957
101966
|
"use strict";
|
|
@@ -101982,6 +101991,15 @@ var init_metroAssetArtifact = __esm({
|
|
|
101982
101991
|
["gif", "R0lGODlhCAAIAPAAACYmK/8A/yH5BAAAAAAALAAAAAAIAAgAAAINjAMJh8q6DoTPSWvoKQA7"],
|
|
101983
101992
|
["webp", "UklGRiQAAABXRUJQVlA4TBcAAAAvB8ABAA8wJj/5P8v//IcH/gAf0f94AAA="]
|
|
101984
101993
|
]);
|
|
101994
|
+
androidDrawableTypes = /* @__PURE__ */ new Set(["gif", "jpeg", "jpg", "ktx", "png", "webp", "xml"]);
|
|
101995
|
+
androidDensities = /* @__PURE__ */ new Map([
|
|
101996
|
+
[0.75, "ldpi"],
|
|
101997
|
+
[1, "mdpi"],
|
|
101998
|
+
[1.5, "hdpi"],
|
|
101999
|
+
[2, "xhdpi"],
|
|
102000
|
+
[3, "xxhdpi"],
|
|
102001
|
+
[4, "xxxhdpi"]
|
|
102002
|
+
]);
|
|
101985
102003
|
}
|
|
101986
102004
|
});
|
|
101987
102005
|
|
|
@@ -102835,6 +102853,7 @@ function placeMetroDescriptor(listing, descriptor) {
|
|
|
102835
102853
|
(scale) => distinctByContent(listing.directory, [
|
|
102836
102854
|
.../* @__PURE__ */ new Set([
|
|
102837
102855
|
...resolveMetroIosAssetDestFiles(listing.files, descriptor, scale),
|
|
102856
|
+
...resolveMetroAndroidAssetDestFiles(listing.files, descriptor, scale),
|
|
102838
102857
|
...resolveExpoHashedAssetFiles(listing.files, descriptor, scale)
|
|
102839
102858
|
])
|
|
102840
102859
|
])
|
|
@@ -107458,11 +107477,11 @@ function explainMissingCallTarget(error) {
|
|
|
107458
107477
|
}
|
|
107459
107478
|
throw error;
|
|
107460
107479
|
}
|
|
107461
|
-
async function callInBridge(bridge,
|
|
107462
|
-
return bridge.send({ type: "call", path:
|
|
107480
|
+
async function callInBridge(bridge, path142, ...args) {
|
|
107481
|
+
return bridge.send({ type: "call", path: path142, args }).catch(explainMissingCallTarget);
|
|
107463
107482
|
}
|
|
107464
|
-
async function callInBridgeWrite(bridge,
|
|
107465
|
-
return bridge.send({ type: "call", path:
|
|
107483
|
+
async function callInBridgeWrite(bridge, path142, ...args) {
|
|
107484
|
+
return bridge.send({ type: "call", path: path142, args, acquireLock: true }).catch(explainMissingCallTarget);
|
|
107466
107485
|
}
|
|
107467
107486
|
var import_node_fs132, import_node_path134, import_ws3, PEACH_PLACEMENT_ENV, resolvedWorld, refusedBridges, BridgeSimLockedError, BridgeHandshakeTimeoutError, noticedTargets, DisconnectedSimError, TIMEOUT_UNIT_MS, BRIDGE_VALUE_FLAGS_TABLE, BRIDGE_VALUE_FLAGS;
|
|
107468
107487
|
var init_ws_bridge = __esm({
|
|
@@ -108124,6 +108143,105 @@ var init_app_splash = __esm({
|
|
|
108124
108143
|
}
|
|
108125
108144
|
});
|
|
108126
108145
|
|
|
108146
|
+
// src/binarySidecarContract.ts
|
|
108147
|
+
function readPeachSidecarManifest(value) {
|
|
108148
|
+
if (typeof value !== "object" || value === null || !("format" in value) || value.format !== 1 || !("platform" in value) || value.platform !== "ios" && value.platform !== "android" || !("bundleSha256" in value) || typeof value.bundleSha256 !== "string" || !/^[a-f0-9]{64}$/.test(value.bundleSha256) || !("nativePackages" in value))
|
|
108149
|
+
throw new Error("invalid peach sidecar manifest");
|
|
108150
|
+
return {
|
|
108151
|
+
format: 1,
|
|
108152
|
+
platform: value.platform,
|
|
108153
|
+
bundleSha256: value.bundleSha256,
|
|
108154
|
+
nativePackages: readPackageVersions(value.nativePackages)
|
|
108155
|
+
};
|
|
108156
|
+
}
|
|
108157
|
+
var PEACH_SIDECAR_DIR, PEACH_SIDECAR_BUNDLE, PEACH_SIDECAR_MANIFEST, PEACH_SIDECAR_ASSETS;
|
|
108158
|
+
var init_binarySidecarContract = __esm({
|
|
108159
|
+
"src/binarySidecarContract.ts"() {
|
|
108160
|
+
"use strict";
|
|
108161
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
108162
|
+
init_package_versions();
|
|
108163
|
+
PEACH_SIDECAR_DIR = "peach";
|
|
108164
|
+
PEACH_SIDECAR_BUNDLE = "main.js.br";
|
|
108165
|
+
PEACH_SIDECAR_MANIFEST = "app.json";
|
|
108166
|
+
PEACH_SIDECAR_ASSETS = "assets";
|
|
108167
|
+
}
|
|
108168
|
+
});
|
|
108169
|
+
|
|
108170
|
+
// cli/binary-sidecar.ts
|
|
108171
|
+
function isAppBinaryPath(target) {
|
|
108172
|
+
return /\.(ipa|apk)$/i.test(target) && import_node_fs135.default.statSync(target, { throwIfNoEntry: false })?.isFile() === true;
|
|
108173
|
+
}
|
|
108174
|
+
function extractAppBinaryBundle(binary2) {
|
|
108175
|
+
const file = import_node_path137.default.resolve(binary2);
|
|
108176
|
+
const entries = (0, import_node_child_process61.execFileSync)("unzip", ["-Z1", file], {
|
|
108177
|
+
encoding: "utf8",
|
|
108178
|
+
maxBuffer: 256 * 1024 * 1024
|
|
108179
|
+
}).split("\n");
|
|
108180
|
+
const manifestEntry = entries.find(
|
|
108181
|
+
(entry) => new RegExp(
|
|
108182
|
+
`^(Payload/[^/]+\\.app|assets)/${PEACH_SIDECAR_DIR}/${PEACH_SIDECAR_MANIFEST.replace(".", "\\.")}$`
|
|
108183
|
+
).test(entry)
|
|
108184
|
+
);
|
|
108185
|
+
if (!manifestEntry)
|
|
108186
|
+
throw new Error(
|
|
108187
|
+
`${binary2} carries no peach sidecar; only apps built by Contrast include the plain javascript peach runs`
|
|
108188
|
+
);
|
|
108189
|
+
const sidecar = import_node_path137.default.posix.dirname(manifestEntry);
|
|
108190
|
+
const appRoot = import_node_path137.default.posix.dirname(sidecar);
|
|
108191
|
+
const digest3 = (0, import_node_crypto69.createHash)("sha256").update(import_node_fs135.default.readFileSync(file)).digest("hex");
|
|
108192
|
+
const out = import_node_path137.default.join(cacheDir(), "app-binaries", digest3);
|
|
108193
|
+
const bundlePath = import_node_path137.default.join(out, "main.js");
|
|
108194
|
+
const extracted = import_node_path137.default.join(out, "extracted");
|
|
108195
|
+
if (!import_node_fs135.default.existsSync(bundlePath)) {
|
|
108196
|
+
import_node_fs135.default.rmSync(out, { recursive: true, force: true });
|
|
108197
|
+
import_node_fs135.default.mkdirSync(extracted, { recursive: true });
|
|
108198
|
+
const patterns = [`${sidecar}/*`];
|
|
108199
|
+
const iosAssets = `${appRoot}/assets/`;
|
|
108200
|
+
if (appRoot.startsWith("Payload/") && entries.some((entry) => entry.startsWith(iosAssets)))
|
|
108201
|
+
patterns.push(`${iosAssets}*`);
|
|
108202
|
+
(0, import_node_child_process61.execFileSync)("unzip", ["-q", "-o", file, ...patterns, "-d", extracted]);
|
|
108203
|
+
const manifest = readPeachSidecarManifest(
|
|
108204
|
+
JSON.parse(import_node_fs135.default.readFileSync(import_node_path137.default.join(extracted, manifestEntry), "utf8"))
|
|
108205
|
+
);
|
|
108206
|
+
const bundle = (0, import_node_zlib4.brotliDecompressSync)(
|
|
108207
|
+
import_node_fs135.default.readFileSync(import_node_path137.default.join(extracted, sidecar, PEACH_SIDECAR_BUNDLE))
|
|
108208
|
+
);
|
|
108209
|
+
if ((0, import_node_crypto69.createHash)("sha256").update(bundle).digest("hex") !== manifest.bundleSha256)
|
|
108210
|
+
throw new Error(`${binary2}: the peach sidecar bundle does not match its manifest`);
|
|
108211
|
+
const assets2 = manifest.platform === "ios" ? import_node_path137.default.join(extracted, appRoot, "assets") : import_node_path137.default.join(extracted, sidecar, PEACH_SIDECAR_ASSETS);
|
|
108212
|
+
if (import_node_fs135.default.existsSync(assets2)) import_node_fs135.default.renameSync(assets2, import_node_path137.default.join(out, "assets"));
|
|
108213
|
+
import_node_fs135.default.copyFileSync(
|
|
108214
|
+
import_node_path137.default.join(extracted, manifestEntry),
|
|
108215
|
+
import_node_path137.default.join(out, PEACH_SIDECAR_MANIFEST)
|
|
108216
|
+
);
|
|
108217
|
+
import_node_fs135.default.writeFileSync(
|
|
108218
|
+
`${bundlePath}.partial`,
|
|
108219
|
+
insertPackageVersionsFooter(bundle.toString("utf8"), manifest.nativePackages)
|
|
108220
|
+
);
|
|
108221
|
+
import_node_fs135.default.renameSync(`${bundlePath}.partial`, bundlePath);
|
|
108222
|
+
import_node_fs135.default.rmSync(extracted, { recursive: true, force: true });
|
|
108223
|
+
}
|
|
108224
|
+
const { platform: platform2 } = readPeachSidecarManifest(
|
|
108225
|
+
JSON.parse(import_node_fs135.default.readFileSync(import_node_path137.default.join(out, PEACH_SIDECAR_MANIFEST), "utf8"))
|
|
108226
|
+
);
|
|
108227
|
+
return { bundlePath, platform: platform2 };
|
|
108228
|
+
}
|
|
108229
|
+
var import_node_child_process61, import_node_crypto69, import_node_fs135, import_node_path137, import_node_zlib4;
|
|
108230
|
+
var init_binary_sidecar = __esm({
|
|
108231
|
+
"cli/binary-sidecar.ts"() {
|
|
108232
|
+
"use strict";
|
|
108233
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
108234
|
+
import_node_child_process61 = require("node:child_process");
|
|
108235
|
+
import_node_crypto69 = require("node:crypto");
|
|
108236
|
+
import_node_fs135 = __toESM(require("node:fs"), 1);
|
|
108237
|
+
import_node_path137 = __toESM(require("node:path"), 1);
|
|
108238
|
+
import_node_zlib4 = require("node:zlib");
|
|
108239
|
+
init_package_versions();
|
|
108240
|
+
init_binarySidecarContract();
|
|
108241
|
+
init_home_paths();
|
|
108242
|
+
}
|
|
108243
|
+
});
|
|
108244
|
+
|
|
108127
108245
|
// src/bridge-contract-input.ts
|
|
108128
108246
|
var SEMANTIC_WAIT_MAX_TIMEOUT_MS;
|
|
108129
108247
|
var init_bridge_contract_input = __esm({
|
|
@@ -108938,7 +109056,7 @@ var init_core = __esm({
|
|
|
108938
109056
|
// cli/output-redaction.ts
|
|
108939
109057
|
function mask(value) {
|
|
108940
109058
|
if (MASKED.test(value)) return value;
|
|
108941
|
-
return `<redacted:${(0,
|
|
109059
|
+
return `<redacted:${(0, import_node_crypto70.createHash)("sha256").update(value).digest("hex").slice(0, 4)}>`;
|
|
108942
109060
|
}
|
|
108943
109061
|
function maskQuoted(quoted2) {
|
|
108944
109062
|
return `${quoted2[0]}${mask(quoted2.slice(1, -1))}${quoted2[0]}`;
|
|
@@ -109060,12 +109178,12 @@ function redactText(text6, configurationOnly, decodedString = false) {
|
|
|
109060
109178
|
(line, prefix, name3, value) => SECRET_NAME.test(name3) ? `${prefix}${mask(value)}` : line
|
|
109061
109179
|
).replace(EMAIL, mask).replace(OPAQUE_ID, mask);
|
|
109062
109180
|
}
|
|
109063
|
-
var
|
|
109181
|
+
var import_node_crypto70, SECRET_NAME, JWT, GOOGLE_API_KEY, BEARER, EMAIL, OPAQUE_ID, STRING, NUMBER, PAIR2, STRING_TOKEN, QUERY_PAIR, HEADER_LINE, MASKED, CONFIG_CONTAINER, utf8;
|
|
109064
109182
|
var init_output_redaction = __esm({
|
|
109065
109183
|
"cli/output-redaction.ts"() {
|
|
109066
109184
|
"use strict";
|
|
109067
109185
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
109068
|
-
|
|
109186
|
+
import_node_crypto70 = require("node:crypto");
|
|
109069
109187
|
init_config();
|
|
109070
109188
|
SECRET_NAME = /^(?:[\w-]*(?:api[-_]?key|token|secret|password|passwd|authorization|cookie|signature|credential)s?|auth|sig|email|uid|[\w-]*(?:user|account|local|device|installation|client|app|project|sender|measurement|tenant)[-_]?id)$/i;
|
|
109071
109189
|
JWT = /\beyJ[\w-]{6,}\.[\w-]{6,}\.[\w-]{6,}/g;
|
|
@@ -109566,7 +109684,7 @@ function macDesktopLaunchHome(bridgePort) {
|
|
|
109566
109684
|
const dev = readDevBridgeLockfiles().find(
|
|
109567
109685
|
(lock) => lock.bridgePort === bridgePort && isDevBridgeLockfileFresh(lock)
|
|
109568
109686
|
);
|
|
109569
|
-
const homeKey = (0,
|
|
109687
|
+
const homeKey = (0, import_node_crypto71.createHash)("sha256").update(home).digest("hex");
|
|
109570
109688
|
const dir = (0, import_path7.join)((0, import_os3.tmpdir)(), "peach-desktop-launch", homeKey, String(bridgePort));
|
|
109571
109689
|
(0, import_fs8.mkdirSync)(dir, { recursive: true });
|
|
109572
109690
|
if ((0, import_fs8.existsSync)(home)) {
|
|
@@ -109672,14 +109790,14 @@ function buildMacLaunchUrl(url, opts, nativeApp = false) {
|
|
|
109672
109790
|
}
|
|
109673
109791
|
return deepLink.toString();
|
|
109674
109792
|
}
|
|
109675
|
-
var import_child_process5, import_fs8,
|
|
109793
|
+
var import_child_process5, import_fs8, import_node_crypto71, import_os3, import_path7, import_url2, import_meta2, _sootsimRoot;
|
|
109676
109794
|
var init_desktop_companion = __esm({
|
|
109677
109795
|
"cli/desktop-companion.ts"() {
|
|
109678
109796
|
"use strict";
|
|
109679
109797
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
109680
109798
|
import_child_process5 = require("child_process");
|
|
109681
109799
|
import_fs8 = require("fs");
|
|
109682
|
-
|
|
109800
|
+
import_node_crypto71 = require("node:crypto");
|
|
109683
109801
|
import_os3 = require("os");
|
|
109684
109802
|
import_path7 = require("path");
|
|
109685
109803
|
import_url2 = require("url");
|
|
@@ -109827,13 +109945,13 @@ function resolvePlaywright() {
|
|
|
109827
109945
|
try {
|
|
109828
109946
|
const modulePath = requireFromRoot.resolve(spec);
|
|
109829
109947
|
const packageJsonPath = requireFromRoot.resolve(`${spec}/package.json`);
|
|
109830
|
-
const parsed = JSON.parse((0,
|
|
109948
|
+
const parsed = JSON.parse((0, import_node_fs136.readFileSync)(packageJsonPath, "utf8"));
|
|
109831
109949
|
if (!isRecord(parsed) || typeof parsed.version !== "string") continue;
|
|
109832
109950
|
const corePackagePath = (0, import_node_module23.createRequire)(modulePath).resolve(
|
|
109833
109951
|
"playwright-core/package.json"
|
|
109834
109952
|
);
|
|
109835
|
-
const cliPath = (0,
|
|
109836
|
-
if (!(0,
|
|
109953
|
+
const cliPath = (0, import_node_path138.join)((0, import_node_path138.dirname)(corePackagePath), "cli.js");
|
|
109954
|
+
if (!(0, import_node_fs136.existsSync)(cliPath)) continue;
|
|
109837
109955
|
return {
|
|
109838
109956
|
spec,
|
|
109839
109957
|
modulePath,
|
|
@@ -109861,7 +109979,7 @@ async function provisionPlaywright() {
|
|
|
109861
109979
|
await installVerifiedTarball({
|
|
109862
109980
|
url: `https://registry.npmjs.org/playwright-core/-/playwright-core-${version2}.tgz`,
|
|
109863
109981
|
digest: { algorithm, encoding: "base64", value: digest3 },
|
|
109864
|
-
destDir: (0,
|
|
109982
|
+
destDir: (0, import_node_path138.join)(playwrightCoreDir(version2), "node_modules", "playwright-core"),
|
|
109865
109983
|
installedMarker: "package.json",
|
|
109866
109984
|
// npm tarballs hold the package under a leading `package/`
|
|
109867
109985
|
stripComponents: 1,
|
|
@@ -109876,12 +109994,12 @@ async function provisionPlaywright() {
|
|
|
109876
109994
|
return installed2;
|
|
109877
109995
|
}
|
|
109878
109996
|
function chromiumPathsFile() {
|
|
109879
|
-
return (0,
|
|
109997
|
+
return (0, import_node_path138.join)(cacheDir(), "playwright-chromium-paths.json");
|
|
109880
109998
|
}
|
|
109881
109999
|
function readChromiumPaths() {
|
|
109882
110000
|
let parsed;
|
|
109883
110001
|
try {
|
|
109884
|
-
parsed = JSON.parse((0,
|
|
110002
|
+
parsed = JSON.parse((0, import_node_fs136.readFileSync)(chromiumPathsFile(), "utf8"));
|
|
109885
110003
|
} catch {
|
|
109886
110004
|
return {};
|
|
109887
110005
|
}
|
|
@@ -109905,7 +110023,7 @@ function packageChromiumPath(resolved, env) {
|
|
|
109905
110023
|
const cached4 = known[key2];
|
|
109906
110024
|
if (cached4) return { ok: true, path: cached4 };
|
|
109907
110025
|
const self = rnxSelfInvocation();
|
|
109908
|
-
const probe2 = (0,
|
|
110026
|
+
const probe2 = (0, import_node_child_process62.spawnSync)(
|
|
109909
110027
|
self.executable,
|
|
109910
110028
|
[...self.prefixArgs, RNX_INTERNAL_COMMAND, RNX_INTERNAL_CHILDREN.playwrightProbe],
|
|
109911
110029
|
{
|
|
@@ -109933,15 +110051,15 @@ function packageChromiumPath(resolved, env) {
|
|
|
109933
110051
|
const keys = Object.keys(known);
|
|
109934
110052
|
for (const old of keys.slice(0, Math.max(0, keys.length - CHROMIUM_PATHS_KEPT)))
|
|
109935
110053
|
delete known[old];
|
|
109936
|
-
(0,
|
|
110054
|
+
(0, import_node_fs136.mkdirSync)(cacheDir(), { recursive: true });
|
|
109937
110055
|
const staged = `${chromiumPathsFile()}.${process.pid}`;
|
|
109938
|
-
(0,
|
|
109939
|
-
(0,
|
|
110056
|
+
(0, import_node_fs136.writeFileSync)(staged, JSON.stringify(known));
|
|
110057
|
+
(0, import_node_fs136.renameSync)(staged, chromiumPathsFile());
|
|
109940
110058
|
return { ok: true, path: parsed.expectedPath };
|
|
109941
110059
|
}
|
|
109942
|
-
function isExecutable(
|
|
110060
|
+
function isExecutable(path142) {
|
|
109943
110061
|
try {
|
|
109944
|
-
(0,
|
|
110062
|
+
(0, import_node_fs136.accessSync)(path142, import_node_fs136.constants.X_OK);
|
|
109945
110063
|
return true;
|
|
109946
110064
|
} catch {
|
|
109947
110065
|
return false;
|
|
@@ -109950,7 +110068,7 @@ function isExecutable(path141) {
|
|
|
109950
110068
|
function probeBrowser(resolved, env, shell) {
|
|
109951
110069
|
const override = env.PEACH_CHROMIUM_EXECUTABLE;
|
|
109952
110070
|
if (override) {
|
|
109953
|
-
const executablePath2 = (0,
|
|
110071
|
+
const executablePath2 = (0, import_node_path138.resolve)(override);
|
|
109954
110072
|
if (!isExecutable(executablePath2))
|
|
109955
110073
|
return {
|
|
109956
110074
|
ok: false,
|
|
@@ -109961,9 +110079,9 @@ function probeBrowser(resolved, env, shell) {
|
|
|
109961
110079
|
const expected = packageChromiumPath(resolved, env);
|
|
109962
110080
|
if (!expected.ok) return expected;
|
|
109963
110081
|
const expectedPath = expected.path;
|
|
109964
|
-
let browserDir = (0,
|
|
109965
|
-
while (!/^chromium-\d+$/.test((0,
|
|
109966
|
-
const parent = (0,
|
|
110082
|
+
let browserDir = (0, import_node_path138.dirname)(expectedPath);
|
|
110083
|
+
while (!/^chromium-\d+$/.test((0, import_node_path138.basename)(browserDir))) {
|
|
110084
|
+
const parent = (0, import_node_path138.dirname)(browserDir);
|
|
109967
110085
|
if (parent === browserDir)
|
|
109968
110086
|
return {
|
|
109969
110087
|
ok: false,
|
|
@@ -109971,28 +110089,28 @@ function probeBrowser(resolved, env, shell) {
|
|
|
109971
110089
|
};
|
|
109972
110090
|
browserDir = parent;
|
|
109973
110091
|
}
|
|
109974
|
-
const browsersDir = (0,
|
|
110092
|
+
const browsersDir = (0, import_node_path138.dirname)(browserDir);
|
|
109975
110093
|
const prefix = shell ? "chromium_headless_shell-" : "chromium-";
|
|
109976
110094
|
const paths = shell ? process.platform === "win32" ? ["chrome-headless-shell-win64/chrome-headless-shell.exe"] : [
|
|
109977
110095
|
process.arch === "arm64" ? "chrome-headless-shell-linux-arm64/chrome-headless-shell" : "chrome-headless-shell-linux64/chrome-headless-shell",
|
|
109978
110096
|
"chrome-linux/headless_shell"
|
|
109979
|
-
] : process.platform === "linux" ? [(0,
|
|
109980
|
-
let executablePath = shell ? (0,
|
|
110097
|
+
] : process.platform === "linux" ? [(0, import_node_path138.relative)(browserDir, expectedPath), "chrome-linux/chrome"] : [(0, import_node_path138.relative)(browserDir, expectedPath)];
|
|
110098
|
+
let executablePath = shell ? (0, import_node_path138.join)(
|
|
109981
110099
|
browsersDir,
|
|
109982
|
-
`${prefix}${(0,
|
|
110100
|
+
`${prefix}${(0, import_node_path138.basename)(browserDir).slice("chromium-".length)}`,
|
|
109983
110101
|
paths[0]
|
|
109984
110102
|
) : expectedPath;
|
|
109985
|
-
const revisions = (0,
|
|
110103
|
+
const revisions = (0, import_node_fs136.existsSync)(browsersDir) ? (0, import_node_fs136.readdirSync)(browsersDir).filter(
|
|
109986
110104
|
(name3) => name3.startsWith(prefix) && /^\d+$/.test(name3.slice(prefix.length))
|
|
109987
110105
|
).sort((a, b) => Number(b.slice(prefix.length)) - Number(a.slice(prefix.length))) : [];
|
|
109988
110106
|
for (const revision of revisions) {
|
|
109989
|
-
const installed2 = paths.map((
|
|
110107
|
+
const installed2 = paths.map((path142) => (0, import_node_path138.join)(browsersDir, revision, path142)).find(isExecutable);
|
|
109990
110108
|
if (installed2) {
|
|
109991
110109
|
executablePath = installed2;
|
|
109992
110110
|
break;
|
|
109993
110111
|
}
|
|
109994
110112
|
}
|
|
109995
|
-
return { ok: true, executablePath, exists: (0,
|
|
110113
|
+
return { ok: true, executablePath, exists: (0, import_node_fs136.existsSync)(executablePath) };
|
|
109996
110114
|
}
|
|
109997
110115
|
async function ensurePlaywrightBrowser(resolved, headless, env = process.env) {
|
|
109998
110116
|
const headlessShell = headless && process.platform !== "darwin";
|
|
@@ -110010,7 +110128,7 @@ async function ensurePlaywrightBrowser(resolved, headless, env = process.env) {
|
|
|
110010
110128
|
};
|
|
110011
110129
|
}
|
|
110012
110130
|
const installer = rnxSelfInvocation();
|
|
110013
|
-
const install = (0,
|
|
110131
|
+
const install = (0, import_node_child_process62.spawnSync)(
|
|
110014
110132
|
installer.executable,
|
|
110015
110133
|
[
|
|
110016
110134
|
...installer.prefixArgs,
|
|
@@ -110069,15 +110187,15 @@ async function launchProvisionedPlaywright() {
|
|
|
110069
110187
|
{ headless: true }
|
|
110070
110188
|
);
|
|
110071
110189
|
}
|
|
110072
|
-
var
|
|
110190
|
+
var import_node_child_process62, import_node_fs136, import_node_module23, import_node_path138, CHROMIUM_PATHS_KEPT;
|
|
110073
110191
|
var init_playwright_provisioning = __esm({
|
|
110074
110192
|
"cli/drivers/playwright-provisioning.ts"() {
|
|
110075
110193
|
"use strict";
|
|
110076
110194
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
110077
|
-
|
|
110078
|
-
|
|
110195
|
+
import_node_child_process62 = require("node:child_process");
|
|
110196
|
+
import_node_fs136 = require("node:fs");
|
|
110079
110197
|
import_node_module23 = require("node:module");
|
|
110080
|
-
|
|
110198
|
+
import_node_path138 = require("node:path");
|
|
110081
110199
|
init_src();
|
|
110082
110200
|
init_home_paths();
|
|
110083
110201
|
init_is_record();
|
|
@@ -114506,12 +114624,12 @@ function linuxUnitPath() {
|
|
|
114506
114624
|
function getDaemonServiceStatus() {
|
|
114507
114625
|
if (shouldSkipPersistentDaemon()) return { supported: false, installed: false };
|
|
114508
114626
|
if (process.platform === "darwin") {
|
|
114509
|
-
const
|
|
114510
|
-
return { supported: true, installed: (0, import_fs10.existsSync)(
|
|
114627
|
+
const path142 = macPlistPath();
|
|
114628
|
+
return { supported: true, installed: (0, import_fs10.existsSync)(path142), path: path142 };
|
|
114511
114629
|
}
|
|
114512
114630
|
if (process.platform === "linux") {
|
|
114513
|
-
const
|
|
114514
|
-
return { supported: linuxUserManagerReachable(), installed: (0, import_fs10.existsSync)(
|
|
114631
|
+
const path142 = linuxUnitPath();
|
|
114632
|
+
return { supported: linuxUserManagerReachable(), installed: (0, import_fs10.existsSync)(path142), path: path142 };
|
|
114515
114633
|
}
|
|
114516
114634
|
return { supported: false, installed: false };
|
|
114517
114635
|
}
|
|
@@ -114556,9 +114674,9 @@ function macBridgeHasListener(pid, port) {
|
|
|
114556
114674
|
}
|
|
114557
114675
|
return result.stdout.trim() === String(pid);
|
|
114558
114676
|
}
|
|
114559
|
-
function sameFile(
|
|
114677
|
+
function sameFile(path142, device, inode) {
|
|
114560
114678
|
try {
|
|
114561
|
-
const stats = (0, import_fs10.statSync)(
|
|
114679
|
+
const stats = (0, import_fs10.statSync)(path142, { bigint: true });
|
|
114562
114680
|
return stats.dev === device && stats.ino === inode;
|
|
114563
114681
|
} catch {
|
|
114564
114682
|
return false;
|
|
@@ -114640,13 +114758,13 @@ async function stopMacDaemonBridge(invocation, target = macServiceTarget()) {
|
|
|
114640
114758
|
}
|
|
114641
114759
|
throw new Error(`bridge pid ${lock.pid} did not release port ${lock.bridgePort}`);
|
|
114642
114760
|
}
|
|
114643
|
-
async function startMacDaemon(
|
|
114761
|
+
async function startMacDaemon(path142, invocation = resolveDaemonInvocation(), target = macServiceTarget()) {
|
|
114644
114762
|
const service = readMacDaemonState(target);
|
|
114645
114763
|
const lock = readDaemonLockfile();
|
|
114646
114764
|
if (service?.state === "running" && service.pid !== null && isDaemonLockfileFresh(lock) && lock.pid === service.pid && macBridgeHasListener(lock.pid, lock.bridgePort))
|
|
114647
114765
|
return service.pid;
|
|
114648
114766
|
await stopMacDaemonBridge(invocation, target);
|
|
114649
|
-
runLaunchctl(["bootstrap", target.slice(0, target.lastIndexOf("/")),
|
|
114767
|
+
runLaunchctl(["bootstrap", target.slice(0, target.lastIndexOf("/")), path142]);
|
|
114650
114768
|
const deadline = Date.now() + 4e3;
|
|
114651
114769
|
while (Date.now() < deadline) {
|
|
114652
114770
|
const service2 = readMacDaemonState(target);
|
|
@@ -114724,19 +114842,19 @@ async function waitForBridgeRelease(hasListener, lock) {
|
|
|
114724
114842
|
}
|
|
114725
114843
|
async function daemonRestart() {
|
|
114726
114844
|
if (process.platform === "darwin") {
|
|
114727
|
-
const
|
|
114728
|
-
if (!(0, import_fs10.existsSync)(
|
|
114845
|
+
const path142 = macPlistPath();
|
|
114846
|
+
if (!(0, import_fs10.existsSync)(path142)) {
|
|
114729
114847
|
console.error(" daemon not registered. run `peach daemon install`");
|
|
114730
114848
|
peachExit(1);
|
|
114731
114849
|
}
|
|
114732
114850
|
await stopMacDaemonBridge(resolveDaemonInvocation());
|
|
114733
|
-
await startMacDaemon(
|
|
114851
|
+
await startMacDaemon(path142);
|
|
114734
114852
|
console.log(" restarted");
|
|
114735
114853
|
return;
|
|
114736
114854
|
}
|
|
114737
114855
|
if (process.platform === "linux") {
|
|
114738
|
-
const
|
|
114739
|
-
if (!(0, import_fs10.existsSync)(
|
|
114856
|
+
const path142 = linuxUnitPath();
|
|
114857
|
+
if (!(0, import_fs10.existsSync)(path142)) {
|
|
114740
114858
|
console.error(" daemon not registered. run `peach daemon install`");
|
|
114741
114859
|
peachExit(1);
|
|
114742
114860
|
}
|
|
@@ -115349,9 +115467,9 @@ function property(object6, key2) {
|
|
|
115349
115467
|
function oneNativeAppIdentity(source, platform2 = "ios") {
|
|
115350
115468
|
if (source === void 0) return null;
|
|
115351
115469
|
const app = property(property(readSource(source).oneOptions(), "native"), "app");
|
|
115352
|
-
const text6 = (...
|
|
115470
|
+
const text6 = (...path142) => {
|
|
115353
115471
|
let at = app;
|
|
115354
|
-
for (const key2 of
|
|
115472
|
+
for (const key2 of path142) at = property(at, key2);
|
|
115355
115473
|
return at?.kind === "string" ? at.value : void 0;
|
|
115356
115474
|
};
|
|
115357
115475
|
const name3 = text6("displayName") ?? text6("name");
|
|
@@ -115397,8 +115515,8 @@ function oneNativeAppIdentity(source, platform2 = "ios") {
|
|
|
115397
115515
|
if (key2 !== null && value.kind === "boolean") infoPlistBooleans[key2] = value.value;
|
|
115398
115516
|
}
|
|
115399
115517
|
}
|
|
115400
|
-
for (const [key2, ...
|
|
115401
|
-
const purpose = text6(...
|
|
115518
|
+
for (const [key2, ...path142] of IOS_PURPOSE_STRINGS) {
|
|
115519
|
+
const purpose = text6(...path142);
|
|
115402
115520
|
if (purpose !== void 0) infoPlistStrings[key2] = purpose;
|
|
115403
115521
|
}
|
|
115404
115522
|
const permissionUsageDescriptions = Object.fromEntries(
|
|
@@ -115507,29 +115625,29 @@ function launcherActivities(application) {
|
|
|
115507
115625
|
function readModuleNamespace(moduleRoot, manifest) {
|
|
115508
115626
|
if (manifest.attributes.package) return manifest.attributes.package;
|
|
115509
115627
|
for (const name3 of ["build.gradle", "build.gradle.kts"]) {
|
|
115510
|
-
const file =
|
|
115511
|
-
if (!
|
|
115628
|
+
const file = import_node_path139.default.join(moduleRoot, name3);
|
|
115629
|
+
if (!import_node_fs137.default.existsSync(file)) continue;
|
|
115512
115630
|
const match = /\bnamespace\s*=?\s*["']([\w.]+)["']/.exec(
|
|
115513
|
-
|
|
115631
|
+
import_node_fs137.default.readFileSync(file, "utf8")
|
|
115514
115632
|
);
|
|
115515
115633
|
if (match) return match[1];
|
|
115516
115634
|
}
|
|
115517
115635
|
return void 0;
|
|
115518
115636
|
}
|
|
115519
115637
|
function readModuleRootModuleName(moduleRoot) {
|
|
115520
|
-
const sourceSets =
|
|
115521
|
-
const manifestFile =
|
|
115522
|
-
if (!
|
|
115523
|
-
const document = parseXml(
|
|
115638
|
+
const sourceSets = import_node_path139.default.join(moduleRoot, "src");
|
|
115639
|
+
const manifestFile = import_node_path139.default.join(sourceSets, "main/AndroidManifest.xml");
|
|
115640
|
+
if (!import_node_fs137.default.existsSync(manifestFile)) return null;
|
|
115641
|
+
const document = parseXml(import_node_fs137.default.readFileSync(manifestFile, "utf8"), manifestFile);
|
|
115524
115642
|
const manifest = document.children[0];
|
|
115525
115643
|
const application = manifest?.children.find((child) => child.name === "application");
|
|
115526
115644
|
if (manifest?.name !== "manifest" || !application) return null;
|
|
115527
115645
|
const launchers = launcherActivities(application);
|
|
115528
115646
|
if (launchers.length === 0) return null;
|
|
115529
|
-
for (const set2 of
|
|
115530
|
-
const file =
|
|
115531
|
-
if (!set2.isDirectory() || set2.name === "main" || !
|
|
115532
|
-
if (
|
|
115647
|
+
for (const set2 of import_node_fs137.default.readdirSync(sourceSets, { withFileTypes: true })) {
|
|
115648
|
+
const file = import_node_path139.default.join(sourceSets, set2.name, "AndroidManifest.xml");
|
|
115649
|
+
if (!set2.isDirectory() || set2.name === "main" || !import_node_fs137.default.existsSync(file)) continue;
|
|
115650
|
+
if (import_node_fs137.default.readFileSync(file, "utf8").includes("<activity")) return void 0;
|
|
115533
115651
|
}
|
|
115534
115652
|
const launcher = launchers[0];
|
|
115535
115653
|
const enabled2 = launcher.attributes["android:enabled"];
|
|
@@ -115541,32 +115659,32 @@ function readModuleRootModuleName(moduleRoot) {
|
|
|
115541
115659
|
const qualified3 = declared.startsWith(".") ? namespace && `${namespace}${declared}` : declared.includes(".") ? declared : namespace && `${namespace}.${declared}`;
|
|
115542
115660
|
if (!qualified3 || qualified3.includes("$")) return void 0;
|
|
115543
115661
|
const relative6 = qualified3.split(".").join("/");
|
|
115544
|
-
const files2 =
|
|
115662
|
+
const files2 = import_node_fs137.default.readdirSync(sourceSets, { withFileTypes: true }).filter((set2) => set2.isDirectory()).flatMap(
|
|
115545
115663
|
(set2) => ["java", "kotlin"].flatMap(
|
|
115546
115664
|
(language) => ["kt", "java"].map(
|
|
115547
|
-
(extension) =>
|
|
115665
|
+
(extension) => import_node_path139.default.join(sourceSets, set2.name, language, `${relative6}.${extension}`)
|
|
115548
115666
|
)
|
|
115549
115667
|
)
|
|
115550
|
-
).filter((file) =>
|
|
115668
|
+
).filter((file) => import_node_fs137.default.existsSync(file));
|
|
115551
115669
|
if (files2.length !== 1) return void 0;
|
|
115552
115670
|
return readAndroidRootModuleFromActivitySource(
|
|
115553
|
-
|
|
115671
|
+
import_node_fs137.default.readFileSync(files2[0], "utf8"),
|
|
115554
115672
|
qualified3.slice(qualified3.lastIndexOf(".") + 1)
|
|
115555
115673
|
);
|
|
115556
115674
|
}
|
|
115557
115675
|
function readAndroidLauncherRootModuleName(projectRoot) {
|
|
115558
|
-
const androidRoot =
|
|
115559
|
-
if (!
|
|
115560
|
-
const names =
|
|
115676
|
+
const androidRoot = import_node_path139.default.join(projectRoot, "android");
|
|
115677
|
+
if (!import_node_fs137.default.existsSync(androidRoot)) return void 0;
|
|
115678
|
+
const names = import_node_fs137.default.readdirSync(androidRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => readModuleRootModuleName(import_node_path139.default.join(androidRoot, entry.name))).filter((name3) => name3 !== null);
|
|
115561
115679
|
return names.length === 1 ? names[0] : void 0;
|
|
115562
115680
|
}
|
|
115563
|
-
var
|
|
115681
|
+
var import_node_fs137, import_node_path139, STRINGS_AND_COMMENTS, DECLARATION, KOTLIN_LITERAL, JAVA_LITERAL;
|
|
115564
115682
|
var init_android_root_module = __esm({
|
|
115565
115683
|
"src/android-root-module.ts"() {
|
|
115566
115684
|
"use strict";
|
|
115567
115685
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
115568
|
-
|
|
115569
|
-
|
|
115686
|
+
import_node_fs137 = __toESM(require("node:fs"), 1);
|
|
115687
|
+
import_node_path139 = __toESM(require("node:path"), 1);
|
|
115570
115688
|
init_android_xml();
|
|
115571
115689
|
STRINGS_AND_COMMENTS = /"(?:\\.|[^"\\])*"|\/\/[^\n]*|\/\*[\s\S]*?\*\//g;
|
|
115572
115690
|
DECLARATION = /\b(?:fun|String)\s+getMainComponentName\s*\(/g;
|
|
@@ -115576,8 +115694,8 @@ var init_android_root_module = __esm({
|
|
|
115576
115694
|
});
|
|
115577
115695
|
|
|
115578
115696
|
// src/appBundleResourcesContract.ts
|
|
115579
|
-
function isAppBundleResourcePath(
|
|
115580
|
-
return
|
|
115697
|
+
function isAppBundleResourcePath(path142) {
|
|
115698
|
+
return path142.length > 0 && !path142.includes("\0") && !/[\\?#]/.test(path142) && path142.split("/").every((part) => part !== "" && part !== "." && part !== "..");
|
|
115581
115699
|
}
|
|
115582
115700
|
var init_appBundleResourcesContract = __esm({
|
|
115583
115701
|
"src/appBundleResourcesContract.ts"() {
|
|
@@ -115590,27 +115708,27 @@ var init_appBundleResourcesContract = __esm({
|
|
|
115590
115708
|
function stageAppBundleResources(appDir, origin, iosTarget, environment) {
|
|
115591
115709
|
const app = readIosAppTarget(appDir, iosTarget, environment);
|
|
115592
115710
|
if (!app) return {};
|
|
115593
|
-
let root =
|
|
115711
|
+
let root = import_node_fs138.default.realpathSync(findWorkspaceRoot(appDir));
|
|
115594
115712
|
for (; ; ) {
|
|
115595
115713
|
const escaped = app.resources.some((file) => {
|
|
115596
|
-
const relative6 =
|
|
115597
|
-
return relative6.startsWith(`..${
|
|
115714
|
+
const relative6 = import_node_path140.default.relative(root, import_node_fs138.default.realpathSync(file));
|
|
115715
|
+
return relative6.startsWith(`..${import_node_path140.default.sep}`) || import_node_path140.default.isAbsolute(relative6);
|
|
115598
115716
|
});
|
|
115599
115717
|
if (!escaped) break;
|
|
115600
|
-
const wider =
|
|
115718
|
+
const wider = import_node_fs138.default.realpathSync(findWorkspaceRoot(import_node_path140.default.dirname(root)));
|
|
115601
115719
|
if (wider === root) break;
|
|
115602
115720
|
root = wider;
|
|
115603
115721
|
}
|
|
115604
115722
|
const members2 = /* @__PURE__ */ new Map();
|
|
115605
115723
|
for (const file of app.resources) {
|
|
115606
|
-
const real =
|
|
115607
|
-
const relative6 =
|
|
115608
|
-
if (relative6.startsWith(`..${
|
|
115724
|
+
const real = import_node_fs138.default.realpathSync(file);
|
|
115725
|
+
const relative6 = import_node_path140.default.relative(root, real);
|
|
115726
|
+
if (relative6.startsWith(`..${import_node_path140.default.sep}`) || import_node_path140.default.isAbsolute(relative6))
|
|
115609
115727
|
throw new Error("native app resource escapes the Xcode input root");
|
|
115610
|
-
const lexical =
|
|
115611
|
-
if (lexical === ".." || lexical.startsWith(`..${
|
|
115728
|
+
const lexical = import_node_path140.default.relative(root, file);
|
|
115729
|
+
if (lexical === ".." || lexical.startsWith(`..${import_node_path140.default.sep}`) || import_node_path140.default.isAbsolute(lexical))
|
|
115612
115730
|
throw new Error("native app resource escapes the selected project");
|
|
115613
|
-
const name3 = `Resources/${lexical.split(
|
|
115731
|
+
const name3 = `Resources/${lexical.split(import_node_path140.default.sep).join("/")}`;
|
|
115614
115732
|
members2.set(name3, file);
|
|
115615
115733
|
}
|
|
115616
115734
|
const resources = enumerateBundleResources([...members2.keys()]);
|
|
@@ -115626,21 +115744,21 @@ function stageAppBundleResources(appDir, origin, iosTarget, environment) {
|
|
|
115626
115744
|
const content = bytes[index];
|
|
115627
115745
|
result[base] = {
|
|
115628
115746
|
uri: urls[index],
|
|
115629
|
-
sha256: (0,
|
|
115747
|
+
sha256: (0, import_node_crypto72.createHash)("sha256").update(content).digest("hex"),
|
|
115630
115748
|
contentType: preferredMimeType(base) ?? "application/octet-stream",
|
|
115631
115749
|
byteLength: content.byteLength
|
|
115632
115750
|
};
|
|
115633
115751
|
});
|
|
115634
115752
|
return result;
|
|
115635
115753
|
}
|
|
115636
|
-
var
|
|
115754
|
+
var import_node_crypto72, import_node_fs138, import_node_path140;
|
|
115637
115755
|
var init_app_bundle_resources = __esm({
|
|
115638
115756
|
"cli/app-bundle-resources.ts"() {
|
|
115639
115757
|
"use strict";
|
|
115640
115758
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
115641
|
-
|
|
115642
|
-
|
|
115643
|
-
|
|
115759
|
+
import_node_crypto72 = require("node:crypto");
|
|
115760
|
+
import_node_fs138 = __toESM(require("node:fs"), 1);
|
|
115761
|
+
import_node_path140 = __toESM(require("node:path"), 1);
|
|
115644
115762
|
init_uttype_mime();
|
|
115645
115763
|
init_bundleAssets();
|
|
115646
115764
|
init_appBundleResourcesContract();
|
|
@@ -115743,45 +115861,45 @@ var init_material_symbol_fonts = __esm({
|
|
|
115743
115861
|
|
|
115744
115862
|
// cli/material-symbol-fonts.ts
|
|
115745
115863
|
function materialSymbolFontPaths(appDir) {
|
|
115746
|
-
const appRequire = (0, import_node_module24.createRequire)(
|
|
115864
|
+
const appRequire = (0, import_node_module24.createRequire)(import_node_path141.default.join(appDir, "package.json"));
|
|
115747
115865
|
let nativeManifest;
|
|
115748
115866
|
try {
|
|
115749
115867
|
nativeManifest = appRequire.resolve("@react-navigation/native/package.json");
|
|
115750
115868
|
} catch {
|
|
115751
115869
|
return [];
|
|
115752
115870
|
}
|
|
115753
|
-
const nativePackage = JSON.parse(
|
|
115871
|
+
const nativePackage = JSON.parse(import_node_fs139.default.readFileSync(nativeManifest, "utf8"));
|
|
115754
115872
|
const dependencies = nativePackage && typeof nativePackage === "object" ? Reflect.get(nativePackage, "dependencies") : null;
|
|
115755
115873
|
if (!dependencies || typeof dependencies !== "object" || !Reflect.has(dependencies, "@react-navigation/material-symbols"))
|
|
115756
115874
|
return [];
|
|
115757
115875
|
const nativeRequire = (0, import_node_module24.createRequire)(nativeManifest);
|
|
115758
|
-
const symbolsDir =
|
|
115876
|
+
const symbolsDir = import_node_path141.default.dirname(
|
|
115759
115877
|
nativeRequire.resolve("@react-navigation/material-symbols/package.json")
|
|
115760
115878
|
);
|
|
115761
|
-
const fontsDir =
|
|
115762
|
-
const available =
|
|
115879
|
+
const fontsDir = import_node_path141.default.join(symbolsDir, "assets/fonts");
|
|
115880
|
+
const available = import_node_fs139.default.existsSync(fontsDir) ? import_node_fs139.default.readdirSync(fontsDir).filter((name3) => name3.startsWith("MaterialSymbols") && name3.endsWith(".ttf")) : [];
|
|
115763
115881
|
const manifest = JSON.parse(
|
|
115764
|
-
|
|
115882
|
+
import_node_fs139.default.readFileSync(import_node_path141.default.join(appDir, "package.json"), "utf8")
|
|
115765
115883
|
);
|
|
115766
115884
|
return materialSymbolFontNames(manifest, available, symbolsDir).map(
|
|
115767
|
-
(name3) =>
|
|
115885
|
+
(name3) => import_node_path141.default.join(fontsDir, name3)
|
|
115768
115886
|
);
|
|
115769
115887
|
}
|
|
115770
115888
|
function materialSymbolFontAssets(fontPaths) {
|
|
115771
115889
|
const selected = fontPaths.filter(
|
|
115772
115890
|
(fontPath) => /^MaterialSymbols(?:Outlined|Rounded|Sharp)_\d+(?:_Filled)?\.ttf$/.test(
|
|
115773
|
-
|
|
115891
|
+
import_node_path141.default.basename(fontPath)
|
|
115774
115892
|
)
|
|
115775
115893
|
);
|
|
115776
115894
|
if (!selected.length) return void 0;
|
|
115777
|
-
const directory2 =
|
|
115778
|
-
const codepointsFile =
|
|
115779
|
-
const mirroredFile =
|
|
115780
|
-
const digest3 = (0,
|
|
115895
|
+
const directory2 = import_node_path141.default.dirname(selected[0]);
|
|
115896
|
+
const codepointsFile = import_node_path141.default.join(directory2, "MaterialSymbols.codepoints");
|
|
115897
|
+
const mirroredFile = import_node_path141.default.join(directory2, "MaterialSymbols.mirrored");
|
|
115898
|
+
const digest3 = (0, import_node_crypto73.createHash)("md5");
|
|
115781
115899
|
for (const asset of [...selected, codepointsFile, mirroredFile].sort(
|
|
115782
|
-
(a, b) =>
|
|
115900
|
+
(a, b) => import_node_path141.default.basename(a) < import_node_path141.default.basename(b) ? -1 : import_node_path141.default.basename(a) > import_node_path141.default.basename(b) ? 1 : 0
|
|
115783
115901
|
)) {
|
|
115784
|
-
digest3.update(
|
|
115902
|
+
digest3.update(import_node_fs139.default.readFileSync(asset));
|
|
115785
115903
|
}
|
|
115786
115904
|
return {
|
|
115787
115905
|
hash: digest3.digest("hex").slice(0, 8),
|
|
@@ -115789,15 +115907,15 @@ function materialSymbolFontAssets(fontPaths) {
|
|
|
115789
115907
|
mirroredPath: mirroredFile
|
|
115790
115908
|
};
|
|
115791
115909
|
}
|
|
115792
|
-
var
|
|
115910
|
+
var import_node_crypto73, import_node_fs139, import_node_module24, import_node_path141;
|
|
115793
115911
|
var init_material_symbol_fonts2 = __esm({
|
|
115794
115912
|
"cli/material-symbol-fonts.ts"() {
|
|
115795
115913
|
"use strict";
|
|
115796
115914
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
115797
|
-
|
|
115798
|
-
|
|
115915
|
+
import_node_crypto73 = require("node:crypto");
|
|
115916
|
+
import_node_fs139 = __toESM(require("node:fs"), 1);
|
|
115799
115917
|
import_node_module24 = require("node:module");
|
|
115800
|
-
|
|
115918
|
+
import_node_path141 = __toESM(require("node:path"), 1);
|
|
115801
115919
|
init_material_symbol_fonts();
|
|
115802
115920
|
}
|
|
115803
115921
|
});
|
|
@@ -115805,11 +115923,11 @@ var init_material_symbol_fonts2 = __esm({
|
|
|
115805
115923
|
// cli/app-fonts.ts
|
|
115806
115924
|
function discoverNativeLinkedAppFonts(opts) {
|
|
115807
115925
|
const { paths, materialSymbols } = discoverNativeLinkedAppFontAssets(opts);
|
|
115808
|
-
const realProjectRoot =
|
|
115926
|
+
const realProjectRoot = import_node_fs140.default.realpathSync(opts.projectDir);
|
|
115809
115927
|
const specs = getCliRuntime().engine_config_plugin_fonts.nativeLinkedFontSpecsFromPaths(
|
|
115810
115928
|
projectRelativeFontPaths(opts.projectDir, paths),
|
|
115811
115929
|
nativeFontPlatform(opts.platform),
|
|
115812
|
-
(fontPath) => stageHostFile(
|
|
115930
|
+
(fontPath) => stageHostFile(import_node_path142.default.resolve(realProjectRoot, fontPath), opts.nativeAssetOrigin)
|
|
115813
115931
|
);
|
|
115814
115932
|
attachMaterialSymbolMetadata(
|
|
115815
115933
|
specs,
|
|
@@ -115833,28 +115951,28 @@ function attachMaterialSymbolMetadata(specs, files2, assetUrl) {
|
|
|
115833
115951
|
};
|
|
115834
115952
|
}
|
|
115835
115953
|
function projectRelativeFontPaths(projectDir, fontPaths) {
|
|
115836
|
-
const projectRoot =
|
|
115837
|
-
const realProjectRoot =
|
|
115954
|
+
const projectRoot = import_node_path142.default.resolve(projectDir);
|
|
115955
|
+
const realProjectRoot = import_node_fs140.default.realpathSync(projectDir);
|
|
115838
115956
|
return fontPaths.map((fontPath) => {
|
|
115839
|
-
const lexical =
|
|
115840
|
-
const relative6 = lexical.startsWith("..") ||
|
|
115841
|
-
return relative6.split(
|
|
115957
|
+
const lexical = import_node_path142.default.relative(projectRoot, fontPath);
|
|
115958
|
+
const relative6 = lexical.startsWith("..") || import_node_path142.default.isAbsolute(lexical) ? import_node_path142.default.relative(realProjectRoot, import_node_fs140.default.realpathSync(fontPath)) : lexical;
|
|
115959
|
+
return relative6.split(import_node_path142.default.sep).join("/");
|
|
115842
115960
|
});
|
|
115843
115961
|
}
|
|
115844
115962
|
function resolveDeclaredFontPath(appDir, declared) {
|
|
115845
|
-
let resolved =
|
|
115846
|
-
if (!
|
|
115963
|
+
let resolved = import_node_path142.default.resolve(appDir, declared);
|
|
115964
|
+
if (!import_node_fs140.default.existsSync(resolved)) {
|
|
115847
115965
|
try {
|
|
115848
|
-
resolved = (0, import_node_module25.createRequire)(
|
|
115966
|
+
resolved = (0, import_node_module25.createRequire)(import_node_path142.default.join(appDir, "package.json")).resolve(declared);
|
|
115849
115967
|
} catch {
|
|
115850
115968
|
return [];
|
|
115851
115969
|
}
|
|
115852
115970
|
}
|
|
115853
|
-
return
|
|
115971
|
+
return import_node_fs140.default.statSync(resolved).isDirectory() ? import_node_fs140.default.readdirSync(resolved).map((file) => import_node_path142.default.join(resolved, file)) : [resolved];
|
|
115854
115972
|
}
|
|
115855
115973
|
function isFile(filePath) {
|
|
115856
115974
|
try {
|
|
115857
|
-
return
|
|
115975
|
+
return import_node_fs140.default.statSync(filePath).isFile();
|
|
115858
115976
|
} catch {
|
|
115859
115977
|
return false;
|
|
115860
115978
|
}
|
|
@@ -115900,13 +116018,13 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
115900
116018
|
scannedFontDirectories++;
|
|
115901
116019
|
let entries;
|
|
115902
116020
|
try {
|
|
115903
|
-
entries =
|
|
116021
|
+
entries = import_node_fs140.default.readdirSync(current2.dir, { withFileTypes: true });
|
|
115904
116022
|
} catch {
|
|
115905
116023
|
continue;
|
|
115906
116024
|
}
|
|
115907
116025
|
for (const entry of entries) {
|
|
115908
116026
|
if (entry.isSymbolicLink()) continue;
|
|
115909
|
-
const fullPath =
|
|
116027
|
+
const fullPath = import_node_path142.default.join(current2.dir, entry.name);
|
|
115910
116028
|
if (entry.isDirectory()) {
|
|
115911
116029
|
if (current2.depth < 4 && pending2.length < 64 && !entry.name.startsWith(".")) {
|
|
115912
116030
|
pending2.push({ dir: fullPath, depth: current2.depth + 1 });
|
|
@@ -115921,7 +116039,7 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
115921
116039
|
};
|
|
115922
116040
|
try {
|
|
115923
116041
|
const packageJson = JSON.parse(
|
|
115924
|
-
|
|
116042
|
+
import_node_fs140.default.readFileSync(import_node_path142.default.join(selectedAppDir, "package.json"), "utf8")
|
|
115925
116043
|
);
|
|
115926
116044
|
const dependencyNames = /* @__PURE__ */ new Set();
|
|
115927
116045
|
for (const field2 of ["dependencies", "devDependencies", "optionalDependencies"]) {
|
|
@@ -115936,22 +116054,22 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
115936
116054
|
const config = Reflect.get(packageJson, "reactNativeVectorIcons");
|
|
115937
116055
|
const configuredFontDir = config && typeof config === "object" ? Reflect.get(config, "fontDir") : null;
|
|
115938
116056
|
const configuredDir = typeof configuredFontDir === "string" ? configuredFontDir : "rnvi-fonts";
|
|
115939
|
-
const root =
|
|
115940
|
-
const relativeRoot =
|
|
115941
|
-
if (!relativeRoot.startsWith("..") && !
|
|
116057
|
+
const root = import_node_path142.default.resolve(selectedAppDir, configuredDir);
|
|
116058
|
+
const relativeRoot = import_node_path142.default.relative(selectedAppDir, root);
|
|
116059
|
+
if (!relativeRoot.startsWith("..") && !import_node_path142.default.isAbsolute(relativeRoot)) {
|
|
115942
116060
|
collectFontFiles(root);
|
|
115943
116061
|
}
|
|
115944
|
-
const vectorIconRequire = (0, import_node_module25.createRequire)(
|
|
116062
|
+
const vectorIconRequire = (0, import_node_module25.createRequire)(import_node_path142.default.join(selectedAppDir, "package.json"));
|
|
115945
116063
|
for (const dependencyName of vectorIconDependencies) {
|
|
115946
116064
|
try {
|
|
115947
116065
|
const entryPath = vectorIconRequire.resolve(dependencyName);
|
|
115948
|
-
const dependencyPath = dependencyName.split("/").join(
|
|
115949
|
-
const marker = `${
|
|
116066
|
+
const dependencyPath = dependencyName.split("/").join(import_node_path142.default.sep);
|
|
116067
|
+
const marker = `${import_node_path142.default.sep}node_modules${import_node_path142.default.sep}${dependencyPath}${import_node_path142.default.sep}`;
|
|
115950
116068
|
const markerIndex = entryPath.lastIndexOf(marker);
|
|
115951
116069
|
if (markerIndex === -1) continue;
|
|
115952
116070
|
const packageRoot = entryPath.slice(0, markerIndex + marker.length - 1);
|
|
115953
116071
|
const fontsDir = dependencyName === "react-native-vector-icons" ? "Fonts" : "fonts";
|
|
115954
|
-
collectFontFiles(
|
|
116072
|
+
collectFontFiles(import_node_path142.default.join(packageRoot, fontsDir));
|
|
115955
116073
|
} catch {
|
|
115956
116074
|
}
|
|
115957
116075
|
}
|
|
@@ -115959,17 +116077,17 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
115959
116077
|
} catch {
|
|
115960
116078
|
}
|
|
115961
116079
|
try {
|
|
115962
|
-
const configPath =
|
|
115963
|
-
if (
|
|
115964
|
-
const appConfigRequire = (0, import_node_module25.createRequire)(
|
|
116080
|
+
const configPath = import_node_path142.default.join(selectedAppDir, "react-native.config.js");
|
|
116081
|
+
if (import_node_fs140.default.statSync(configPath).isFile()) {
|
|
116082
|
+
const appConfigRequire = (0, import_node_module25.createRequire)(import_node_path142.default.join(selectedAppDir, "package.json"));
|
|
115965
116083
|
const rnConfig = appConfigRequire(configPath);
|
|
115966
116084
|
const assets2 = rnConfig && typeof rnConfig === "object" ? Reflect.get(rnConfig, "assets") : null;
|
|
115967
116085
|
if (Array.isArray(assets2)) {
|
|
115968
116086
|
for (const assetDir of assets2) {
|
|
115969
116087
|
if (typeof assetDir !== "string") continue;
|
|
115970
|
-
const root =
|
|
115971
|
-
const relativeRoot =
|
|
115972
|
-
if (relativeRoot.startsWith("..") ||
|
|
116088
|
+
const root = import_node_path142.default.resolve(selectedAppDir, assetDir);
|
|
116089
|
+
const relativeRoot = import_node_path142.default.relative(selectedAppDir, root);
|
|
116090
|
+
if (relativeRoot.startsWith("..") || import_node_path142.default.isAbsolute(relativeRoot)) continue;
|
|
115973
116091
|
collectFontFiles(root);
|
|
115974
116092
|
}
|
|
115975
116093
|
}
|
|
@@ -115977,33 +116095,33 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
115977
116095
|
} catch {
|
|
115978
116096
|
}
|
|
115979
116097
|
if (platform2 === "ios") {
|
|
115980
|
-
const iosDir =
|
|
116098
|
+
const iosDir = import_node_path142.default.join(selectedAppDir, "ios");
|
|
115981
116099
|
try {
|
|
115982
|
-
const targetDirs =
|
|
116100
|
+
const targetDirs = import_node_fs140.default.readdirSync(iosDir, { withFileTypes: true }).filter(
|
|
115983
116101
|
(entry) => entry.isDirectory() && !entry.isSymbolicLink() && entry.name !== "Pods" && entry.name !== "build" && !entry.name.startsWith(".")
|
|
115984
116102
|
).slice(0, 64);
|
|
115985
116103
|
const bundledByName = /* @__PURE__ */ new Map();
|
|
115986
|
-
for (const entry of
|
|
116104
|
+
for (const entry of import_node_fs140.default.readdirSync(iosDir, { withFileTypes: true })) {
|
|
115987
116105
|
if (!entry.isDirectory() || !entry.name.endsWith(".xcodeproj")) continue;
|
|
115988
|
-
const xcodeproj =
|
|
116106
|
+
const xcodeproj = import_node_path142.default.join(iosDir, entry.name);
|
|
115989
116107
|
for (const target of listXcodeAppTargets(xcodeproj, { requireSources: false })) {
|
|
115990
116108
|
const members2 = readXcodeAppTarget(xcodeproj, target, void 0, {
|
|
115991
116109
|
requireSources: false
|
|
115992
116110
|
});
|
|
115993
116111
|
for (const file of members2.resources) {
|
|
115994
|
-
if (!bundledByName.has(
|
|
115995
|
-
bundledByName.set(
|
|
116112
|
+
if (!bundledByName.has(import_node_path142.default.basename(file)))
|
|
116113
|
+
bundledByName.set(import_node_path142.default.basename(file), file);
|
|
115996
116114
|
}
|
|
115997
116115
|
}
|
|
115998
116116
|
}
|
|
115999
|
-
const plistPaths = [
|
|
116117
|
+
const plistPaths = [import_node_path142.default.join(iosDir, "Info.plist")];
|
|
116000
116118
|
for (const entry of targetDirs) {
|
|
116001
|
-
plistPaths.push(
|
|
116119
|
+
plistPaths.push(import_node_path142.default.join(iosDir, entry.name, "Info.plist"));
|
|
116002
116120
|
}
|
|
116003
116121
|
for (const plistPath of plistPaths) {
|
|
116004
116122
|
let parsed;
|
|
116005
116123
|
try {
|
|
116006
|
-
parsed = parsePlistSource(
|
|
116124
|
+
parsed = parsePlistSource(import_node_fs140.default.readFileSync(plistPath, "utf8"));
|
|
116007
116125
|
} catch {
|
|
116008
116126
|
continue;
|
|
116009
116127
|
}
|
|
@@ -116014,12 +116132,12 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
116014
116132
|
if (typeof declaredFont !== "string") continue;
|
|
116015
116133
|
const bundled = bundledByName.get(declaredFont);
|
|
116016
116134
|
const candidates = [
|
|
116017
|
-
|
|
116018
|
-
|
|
116135
|
+
import_node_path142.default.resolve(import_node_path142.default.dirname(plistPath), declaredFont),
|
|
116136
|
+
import_node_path142.default.resolve(iosDir, declaredFont)
|
|
116019
116137
|
];
|
|
116020
116138
|
const fontPath = candidates.find((candidate) => {
|
|
116021
|
-
const relative6 =
|
|
116022
|
-
if (relative6.startsWith("..") ||
|
|
116139
|
+
const relative6 = import_node_path142.default.relative(selectedAppDir, candidate);
|
|
116140
|
+
if (relative6.startsWith("..") || import_node_path142.default.isAbsolute(relative6)) return false;
|
|
116023
116141
|
return isFile(candidate);
|
|
116024
116142
|
}) ?? (bundled && isFile(bundled) ? bundled : void 0);
|
|
116025
116143
|
if (fontPath) fontPaths.push(fontPath);
|
|
@@ -116033,14 +116151,14 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
116033
116151
|
materialSymbols: materialSymbolFontAssets(materialFonts)
|
|
116034
116152
|
};
|
|
116035
116153
|
}
|
|
116036
|
-
var
|
|
116154
|
+
var import_node_fs140, import_node_module25, import_node_path142, require3;
|
|
116037
116155
|
var init_app_fonts = __esm({
|
|
116038
116156
|
"cli/app-fonts.ts"() {
|
|
116039
116157
|
"use strict";
|
|
116040
116158
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
116041
|
-
|
|
116159
|
+
import_node_fs140 = __toESM(require("node:fs"), 1);
|
|
116042
116160
|
import_node_module25 = require("node:module");
|
|
116043
|
-
|
|
116161
|
+
import_node_path142 = __toESM(require("node:path"), 1);
|
|
116044
116162
|
init_cli_runtime();
|
|
116045
116163
|
init_staged_host_files();
|
|
116046
116164
|
init_native_firebase_config();
|
|
@@ -116313,7 +116431,7 @@ function splashImageOnDisk(imageUrl, appDir) {
|
|
|
116313
116431
|
const { pathname } = new URL(imageUrl);
|
|
116314
116432
|
if (!pathname.startsWith("/assets/")) return false;
|
|
116315
116433
|
try {
|
|
116316
|
-
return
|
|
116434
|
+
return import_node_fs141.default.statSync(import_node_path143.default.join(appDir, decodeURIComponent(pathname.slice("/assets/".length)))).isFile();
|
|
116317
116435
|
} catch {
|
|
116318
116436
|
return false;
|
|
116319
116437
|
}
|
|
@@ -116359,18 +116477,18 @@ function stageBuiltBundleManifest(bundleUrl, config) {
|
|
|
116359
116477
|
const bundle = new URL(bundleUrl);
|
|
116360
116478
|
if (!isStagedHostFileRequest(bundle.pathname) || Object.keys(config).length === 0)
|
|
116361
116479
|
return null;
|
|
116362
|
-
const directory2 =
|
|
116480
|
+
const directory2 = import_node_fs141.default.mkdtempSync(import_node_path143.default.join(import_node_os24.default.tmpdir(), "peach-app-manifest-"));
|
|
116363
116481
|
try {
|
|
116364
|
-
const file =
|
|
116365
|
-
|
|
116482
|
+
const file = import_node_path143.default.join(directory2, "manifest.json");
|
|
116483
|
+
import_node_fs141.default.writeFileSync(file, JSON.stringify({ extra: { expoClient: config } }));
|
|
116366
116484
|
return stageHostFile(file, bundle.origin);
|
|
116367
116485
|
} finally {
|
|
116368
|
-
|
|
116486
|
+
import_node_fs141.default.rmSync(directory2, { recursive: true, force: true });
|
|
116369
116487
|
}
|
|
116370
116488
|
}
|
|
116371
116489
|
function readOneConfigNativeAppIdentity(appDir, platform2) {
|
|
116372
|
-
const config =
|
|
116373
|
-
return
|
|
116490
|
+
const config = import_node_path143.default.join(appDir, "vite.config.ts");
|
|
116491
|
+
return import_node_fs141.default.existsSync(config) ? oneNativeAppIdentity(import_node_fs141.default.readFileSync(config, "utf8"), platform2) : null;
|
|
116374
116492
|
}
|
|
116375
116493
|
function readProjectNativeAppIdentityWire(project2, platform2, iosTarget, environment) {
|
|
116376
116494
|
if (!canExtractNativeAppIdentity(platform2)) return null;
|
|
@@ -116583,14 +116701,14 @@ function applyShellLaunchOptions(url, opts) {
|
|
|
116583
116701
|
for (const entry of opts.args ?? []) url.searchParams.append("arg", entry);
|
|
116584
116702
|
return url;
|
|
116585
116703
|
}
|
|
116586
|
-
var
|
|
116704
|
+
var import_node_fs141, import_node_os24, import_node_path143, SHELL_APPS, DEV_BUNDLE_RESOLVE_ATTEMPTS, DEV_BUNDLE_RESOLVE_INTERVAL_MS, startedExpoConfigReads;
|
|
116587
116705
|
var init_shell_url = __esm({
|
|
116588
116706
|
"cli/commands/shell-url.ts"() {
|
|
116589
116707
|
"use strict";
|
|
116590
116708
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
116591
|
-
|
|
116709
|
+
import_node_fs141 = __toESM(require("node:fs"), 1);
|
|
116592
116710
|
import_node_os24 = __toESM(require("node:os"), 1);
|
|
116593
|
-
|
|
116711
|
+
import_node_path143 = __toESM(require("node:path"), 1);
|
|
116594
116712
|
init_oneViteAliases();
|
|
116595
116713
|
init_dev_server_scanner();
|
|
116596
116714
|
init_android_root_module();
|
|
@@ -116640,12 +116758,12 @@ var init_shell_url = __esm({
|
|
|
116640
116758
|
// cli/commands/skills.ts
|
|
116641
116759
|
function getSkillsDir() {
|
|
116642
116760
|
if (typeof __PEACH_BUNDLED_SKILLS__ !== "undefined") {
|
|
116643
|
-
const dir =
|
|
116761
|
+
const dir = path127.join(rnxHomeDir(), "skills", getCliVersion());
|
|
116644
116762
|
for (const [file, body] of Object.entries(__PEACH_BUNDLED_SKILLS__)) {
|
|
116645
|
-
const target =
|
|
116646
|
-
if (
|
|
116647
|
-
|
|
116648
|
-
|
|
116763
|
+
const target = path127.join(dir, file);
|
|
116764
|
+
if (fs101.existsSync(target)) continue;
|
|
116765
|
+
fs101.mkdirSync(path127.dirname(target), { recursive: true });
|
|
116766
|
+
fs101.writeFileSync(target, body);
|
|
116649
116767
|
}
|
|
116650
116768
|
return dir;
|
|
116651
116769
|
}
|
|
@@ -116653,10 +116771,10 @@ function getSkillsDir() {
|
|
|
116653
116771
|
const pkgPath = (0, import_url3.fileURLToPath)(
|
|
116654
116772
|
import_meta4.resolve(`${rnxPublicBrand.packageName}/package.json`)
|
|
116655
116773
|
);
|
|
116656
|
-
return primaryCheckoutPath(
|
|
116774
|
+
return primaryCheckoutPath(path127.join(path127.dirname(pkgPath), "skills"));
|
|
116657
116775
|
} catch {
|
|
116658
|
-
const __dirname =
|
|
116659
|
-
return primaryCheckoutPath(
|
|
116776
|
+
const __dirname = path127.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
|
|
116777
|
+
return primaryCheckoutPath(path127.resolve(__dirname, "../../skills"));
|
|
116660
116778
|
}
|
|
116661
116779
|
}
|
|
116662
116780
|
function primaryCheckoutPath(dir) {
|
|
@@ -116679,39 +116797,39 @@ function primaryCheckoutPath(dir) {
|
|
|
116679
116797
|
} catch {
|
|
116680
116798
|
return dir;
|
|
116681
116799
|
}
|
|
116682
|
-
if (
|
|
116683
|
-
const primary =
|
|
116684
|
-
return
|
|
116800
|
+
if (path127.basename(common) !== ".git") return dir;
|
|
116801
|
+
const primary = path127.join(path127.dirname(common), path127.relative(top, dir));
|
|
116802
|
+
return fs101.existsSync(primary) ? primary : dir;
|
|
116685
116803
|
}
|
|
116686
116804
|
function skillsDir() {
|
|
116687
116805
|
skillsDirPath ??= getSkillsDir();
|
|
116688
116806
|
return skillsDirPath;
|
|
116689
116807
|
}
|
|
116690
116808
|
function targetFromHome(envName, fallbackDir) {
|
|
116691
|
-
const home = process.env[envName] ||
|
|
116692
|
-
return
|
|
116809
|
+
const home = process.env[envName] || path127.join(os21.homedir(), fallbackDir);
|
|
116810
|
+
return path127.join(home, "skills");
|
|
116693
116811
|
}
|
|
116694
116812
|
function codexTargets() {
|
|
116695
116813
|
const homes = /* @__PURE__ */ new Map();
|
|
116696
116814
|
const userHome = process.env.HOME || os21.homedir();
|
|
116697
|
-
const primaryCodexHome = process.env.CODEX_HOME ||
|
|
116698
|
-
homes.set(
|
|
116815
|
+
const primaryCodexHome = process.env.CODEX_HOME || path127.join(userHome, ".codex");
|
|
116816
|
+
homes.set(path127.resolve(primaryCodexHome), "codex");
|
|
116699
116817
|
const tmCodexHomes = process.env.TM_CODEX_HOMES;
|
|
116700
116818
|
if (tmCodexHomes) {
|
|
116701
|
-
for (const h of tmCodexHomes.split(
|
|
116819
|
+
for (const h of tmCodexHomes.split(path127.delimiter)) {
|
|
116702
116820
|
if (h.trim()) {
|
|
116703
|
-
const resolved =
|
|
116821
|
+
const resolved = path127.resolve(h.trim());
|
|
116704
116822
|
if (!homes.has(resolved)) {
|
|
116705
|
-
homes.set(resolved,
|
|
116823
|
+
homes.set(resolved, path127.basename(resolved).replace(/^\./, ""));
|
|
116706
116824
|
}
|
|
116707
116825
|
}
|
|
116708
116826
|
}
|
|
116709
116827
|
}
|
|
116710
|
-
const tmHome = process.env.TM_HOME ||
|
|
116711
|
-
const enginePath =
|
|
116712
|
-
if (
|
|
116828
|
+
const tmHome = process.env.TM_HOME || path127.join(userHome, ".team-machine");
|
|
116829
|
+
const enginePath = path127.join(tmHome, "engine.yaml");
|
|
116830
|
+
if (fs101.existsSync(enginePath)) {
|
|
116713
116831
|
try {
|
|
116714
|
-
const engine = parse(
|
|
116832
|
+
const engine = parse(fs101.readFileSync(enginePath, "utf8"));
|
|
116715
116833
|
let accounts = engine;
|
|
116716
116834
|
for (const key2 of ["accounts", "providers", "codex", "accounts"]) {
|
|
116717
116835
|
accounts = isRecord(accounts) ? accounts[key2] : void 0;
|
|
@@ -116719,8 +116837,8 @@ function codexTargets() {
|
|
|
116719
116837
|
for (const [name3, account] of Object.entries(isRecord(accounts) ? accounts : {})) {
|
|
116720
116838
|
const configured = isRecord(account) ? account.home : void 0;
|
|
116721
116839
|
if (typeof configured !== "string") continue;
|
|
116722
|
-
const homeDir = configured.startsWith("~") ?
|
|
116723
|
-
const resolved =
|
|
116840
|
+
const homeDir = configured.startsWith("~") ? path127.join(userHome, configured.slice(1)) : configured;
|
|
116841
|
+
const resolved = path127.resolve(homeDir);
|
|
116724
116842
|
if (!homes.has(resolved)) {
|
|
116725
116843
|
homes.set(resolved, `codex-${name3}`);
|
|
116726
116844
|
}
|
|
@@ -116729,13 +116847,13 @@ function codexTargets() {
|
|
|
116729
116847
|
}
|
|
116730
116848
|
}
|
|
116731
116849
|
try {
|
|
116732
|
-
for (const entry of
|
|
116850
|
+
for (const entry of fs101.readdirSync(userHome)) {
|
|
116733
116851
|
if (entry.startsWith(".codex-")) {
|
|
116734
|
-
const fullPath =
|
|
116852
|
+
const fullPath = path127.join(userHome, entry);
|
|
116735
116853
|
try {
|
|
116736
|
-
const stat2 =
|
|
116854
|
+
const stat2 = fs101.statSync(fullPath);
|
|
116737
116855
|
if (stat2.isDirectory()) {
|
|
116738
|
-
const resolved =
|
|
116856
|
+
const resolved = path127.resolve(fullPath);
|
|
116739
116857
|
if (!homes.has(resolved)) {
|
|
116740
116858
|
homes.set(resolved, entry.replace(/^\./, ""));
|
|
116741
116859
|
}
|
|
@@ -116750,7 +116868,7 @@ function codexTargets() {
|
|
|
116750
116868
|
for (const [homePath, label] of homes) {
|
|
116751
116869
|
targets.push({
|
|
116752
116870
|
label,
|
|
116753
|
-
dir:
|
|
116871
|
+
dir: path127.join(homePath, "skills")
|
|
116754
116872
|
});
|
|
116755
116873
|
}
|
|
116756
116874
|
return targets;
|
|
@@ -116766,7 +116884,7 @@ function hasInstalledPeachSkills() {
|
|
|
116766
116884
|
(file) => /^([^/]+)\/SKILL\.md$/.exec(file)?.[1] ?? []
|
|
116767
116885
|
) : listSkills().map((skill7) => skill7.name);
|
|
116768
116886
|
return defaultAgentTargets().some(
|
|
116769
|
-
({ dir }) => names.some((name3) =>
|
|
116887
|
+
({ dir }) => names.some((name3) => fs101.existsSync(path127.join(dir, name3, "SKILL.md")))
|
|
116770
116888
|
);
|
|
116771
116889
|
}
|
|
116772
116890
|
function parseSkillFrontmatter(content) {
|
|
@@ -116809,27 +116927,27 @@ function readFrontmatterField(frontmatter, field2) {
|
|
|
116809
116927
|
return null;
|
|
116810
116928
|
}
|
|
116811
116929
|
function listSkills() {
|
|
116812
|
-
if (!
|
|
116930
|
+
if (!fs101.existsSync(skillsDir())) return [];
|
|
116813
116931
|
const skills = [];
|
|
116814
|
-
for (const entry of
|
|
116815
|
-
const skillMd =
|
|
116816
|
-
if (!
|
|
116817
|
-
const meta = parseSkillFrontmatter(
|
|
116932
|
+
for (const entry of fs101.readdirSync(skillsDir())) {
|
|
116933
|
+
const skillMd = path127.join(skillsDir(), entry, "SKILL.md");
|
|
116934
|
+
if (!fs101.existsSync(skillMd)) continue;
|
|
116935
|
+
const meta = parseSkillFrontmatter(fs101.readFileSync(skillMd, "utf8"));
|
|
116818
116936
|
if (meta) {
|
|
116819
116937
|
skills.push({ name: entry, description: meta.description });
|
|
116820
116938
|
}
|
|
116821
116939
|
}
|
|
116822
116940
|
return skills.sort((a, b) => a.name.localeCompare(b.name));
|
|
116823
116941
|
}
|
|
116824
|
-
var import_child_process9,
|
|
116942
|
+
var import_child_process9, fs101, os21, path127, import_url3, import_meta4, skillsDirPath;
|
|
116825
116943
|
var init_skills = __esm({
|
|
116826
116944
|
"cli/commands/skills.ts"() {
|
|
116827
116945
|
"use strict";
|
|
116828
116946
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
116829
116947
|
import_child_process9 = require("child_process");
|
|
116830
|
-
|
|
116948
|
+
fs101 = __toESM(require("fs"), 1);
|
|
116831
116949
|
os21 = __toESM(require("os"), 1);
|
|
116832
|
-
|
|
116950
|
+
path127 = __toESM(require("path"), 1);
|
|
116833
116951
|
import_url3 = require("url");
|
|
116834
116952
|
init_browser();
|
|
116835
116953
|
init_cli_version();
|
|
@@ -117181,8 +117299,8 @@ __export(metro_bundle_assets_exports, {
|
|
|
117181
117299
|
stageMetroBundleAssets: () => stageMetroBundleAssets
|
|
117182
117300
|
});
|
|
117183
117301
|
async function stageMetroBundleAssets(bundleFile, source, origin) {
|
|
117184
|
-
const directory2 =
|
|
117185
|
-
if (!
|
|
117302
|
+
const directory2 = import_node_path144.default.join(import_node_path144.default.dirname(bundleFile), "assets");
|
|
117303
|
+
if (!import_node_fs142.default.existsSync(directory2)) return;
|
|
117186
117304
|
const descriptors = extractAssetDescriptors(source).filter(
|
|
117187
117305
|
(descriptor) => !isEmbeddedAssetDescriptor(descriptor)
|
|
117188
117306
|
);
|
|
@@ -117206,14 +117324,14 @@ async function stageMetroBundleAssets(bundleFile, source, origin) {
|
|
|
117206
117324
|
const bytes = scales.map((scale) => {
|
|
117207
117325
|
const relative6 = placement.files.get(scale);
|
|
117208
117326
|
if (!relative6 || !search.dest) throw new Error("Metro asset scale is missing");
|
|
117209
|
-
return
|
|
117327
|
+
return import_node_fs142.default.readFileSync(import_node_path144.default.join(search.dest.directory, relative6));
|
|
117210
117328
|
});
|
|
117211
117329
|
const verified2 = perFile && hashes ? bytes.every((content, i) => {
|
|
117212
|
-
const hash = (0,
|
|
117330
|
+
const hash = (0, import_node_crypto74.createHash)("md5").update(content).digest("hex");
|
|
117213
117331
|
return descriptor.scales.some(
|
|
117214
117332
|
(scale, j) => scale === scales[i] && hashes[j] === hash
|
|
117215
117333
|
);
|
|
117216
|
-
}) : scales.length === descriptor.scales.length && (0,
|
|
117334
|
+
}) : scales.length === descriptor.scales.length && (0, import_node_crypto74.createHash)("md5").update(Buffer.concat(bytes)).digest("hex") === descriptor.hash;
|
|
117217
117335
|
if (!verified2)
|
|
117218
117336
|
throw new Error(`Metro asset changed while staging: ${descriptor.name}`);
|
|
117219
117337
|
scales.forEach((scale, i) => {
|
|
@@ -117240,14 +117358,14 @@ async function stageMetroBundleAssets(bundleFile, source, origin) {
|
|
|
117240
117358
|
});
|
|
117241
117359
|
stageHostMetroAssets(staged, origin);
|
|
117242
117360
|
}
|
|
117243
|
-
var
|
|
117361
|
+
var import_node_crypto74, import_node_fs142, import_node_path144;
|
|
117244
117362
|
var init_metro_bundle_assets = __esm({
|
|
117245
117363
|
"cli/metro-bundle-assets.ts"() {
|
|
117246
117364
|
"use strict";
|
|
117247
117365
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
117248
|
-
|
|
117249
|
-
|
|
117250
|
-
|
|
117366
|
+
import_node_crypto74 = require("node:crypto");
|
|
117367
|
+
import_node_fs142 = __toESM(require("node:fs"), 1);
|
|
117368
|
+
import_node_path144 = __toESM(require("node:path"), 1);
|
|
117251
117369
|
init_metroAssetArtifact();
|
|
117252
117370
|
init_staged_host_files();
|
|
117253
117371
|
}
|
|
@@ -117274,9 +117392,9 @@ async function runStreamCommand(args, opts = {}) {
|
|
|
117274
117392
|
});
|
|
117275
117393
|
if (typeof simId !== "string" || !simId)
|
|
117276
117394
|
throw new Error("Could not identify the local simulator.");
|
|
117277
|
-
const directory2 = (0,
|
|
117278
|
-
(0,
|
|
117279
|
-
const file = (0,
|
|
117395
|
+
const directory2 = (0, import_node_path145.join)(rnxHomeDir(), "streams");
|
|
117396
|
+
(0, import_node_fs143.mkdirSync)(directory2, { recursive: true });
|
|
117397
|
+
const file = (0, import_node_path145.join)(directory2, `${encodeURIComponent(simId)}.json`);
|
|
117280
117398
|
const state = await callInBridge(bridge, "SootSim.bridges.videoStream.state");
|
|
117281
117399
|
if (action === "status") {
|
|
117282
117400
|
console.log(` stream: ${state}`);
|
|
@@ -117301,13 +117419,13 @@ async function runStreamCommand(args, opts = {}) {
|
|
|
117301
117419
|
await callInBridge(bridge, "SootSim.bridges.videoStream.stop");
|
|
117302
117420
|
let record4 = null;
|
|
117303
117421
|
try {
|
|
117304
|
-
record4 = recordSchema.parse(JSON.parse((0,
|
|
117422
|
+
record4 = recordSchema.parse(JSON.parse((0, import_node_fs143.readFileSync)(file, "utf8")));
|
|
117305
117423
|
} catch (error) {
|
|
117306
117424
|
if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
|
|
117307
117425
|
throw error;
|
|
117308
117426
|
}
|
|
117309
117427
|
if (record4) await stopSession(record4);
|
|
117310
|
-
(0,
|
|
117428
|
+
(0, import_node_fs143.rmSync)(file, { force: true });
|
|
117311
117429
|
console.log(" stream: off");
|
|
117312
117430
|
return;
|
|
117313
117431
|
}
|
|
@@ -117343,7 +117461,7 @@ async function runStreamCommand(args, opts = {}) {
|
|
|
117343
117461
|
token: registration.token
|
|
117344
117462
|
});
|
|
117345
117463
|
writeSecureJsonAtomic(file, record3);
|
|
117346
|
-
removeRecord = () => (0,
|
|
117464
|
+
removeRecord = () => (0, import_node_fs143.rmSync)(file, { force: true });
|
|
117347
117465
|
console.log(` ${record3.watchUrl}`);
|
|
117348
117466
|
console.log(" Press Ctrl+C to stop streaming.");
|
|
117349
117467
|
await new Promise((resolve14) => {
|
|
@@ -117353,10 +117471,10 @@ async function runStreamCommand(args, opts = {}) {
|
|
|
117353
117471
|
process.off("SIGTERM", finish);
|
|
117354
117472
|
resolve14();
|
|
117355
117473
|
};
|
|
117356
|
-
const watcher = (0,
|
|
117474
|
+
const watcher = (0, import_node_fs143.watch)(directory2, (_event, filename) => {
|
|
117357
117475
|
if (filename !== `${encodeURIComponent(simId)}.json`) return;
|
|
117358
117476
|
try {
|
|
117359
|
-
(0,
|
|
117477
|
+
(0, import_node_fs143.readFileSync)(file);
|
|
117360
117478
|
} catch (error) {
|
|
117361
117479
|
if (error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
117362
117480
|
finish();
|
|
@@ -117380,13 +117498,13 @@ async function runStreamCommand(args, opts = {}) {
|
|
|
117380
117498
|
}
|
|
117381
117499
|
}
|
|
117382
117500
|
}
|
|
117383
|
-
var
|
|
117501
|
+
var import_node_fs143, import_node_path145, import_zod2, STREAM_FLAG, registrationSchema, recordSchema;
|
|
117384
117502
|
var init_stream = __esm({
|
|
117385
117503
|
"cli/commands/stream.ts"() {
|
|
117386
117504
|
"use strict";
|
|
117387
117505
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
117388
|
-
|
|
117389
|
-
|
|
117506
|
+
import_node_fs143 = require("node:fs");
|
|
117507
|
+
import_node_path145 = require("node:path");
|
|
117390
117508
|
import_zod2 = require("zod");
|
|
117391
117509
|
init_home_paths();
|
|
117392
117510
|
init_public_brand();
|
|
@@ -117428,14 +117546,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
117428
117546
|
const neededPackages = /* @__PURE__ */ new Set();
|
|
117429
117547
|
const factories = [];
|
|
117430
117548
|
const visit3 = (filePath) => {
|
|
117431
|
-
const real =
|
|
117549
|
+
const real = import_node_fs144.default.realpathSync(filePath);
|
|
117432
117550
|
const previous = files2.get(real);
|
|
117433
117551
|
if (previous !== void 0) return previous;
|
|
117434
117552
|
const id = "peach-config-file:" + files2.size;
|
|
117435
117553
|
files2.set(real, id);
|
|
117436
117554
|
const compiled = compileReplacementModule({
|
|
117437
117555
|
filePath: real,
|
|
117438
|
-
source:
|
|
117556
|
+
source: import_node_fs144.default.readFileSync(real, "utf8"),
|
|
117439
117557
|
runtimePackages,
|
|
117440
117558
|
localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
|
|
117441
117559
|
});
|
|
@@ -117459,7 +117577,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
117459
117577
|
if (!entries || typeof entries !== "object") continue;
|
|
117460
117578
|
for (const resolution of Object.values(entries)) {
|
|
117461
117579
|
if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
|
|
117462
|
-
resolution.file = visit3(
|
|
117580
|
+
resolution.file = visit3(import_node_path146.default.resolve(resolution.file));
|
|
117463
117581
|
}
|
|
117464
117582
|
}
|
|
117465
117583
|
}
|
|
@@ -117483,13 +117601,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
117483
117601
|
const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
|
|
117484
117602
|
return prefix + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
|
|
117485
117603
|
}
|
|
117486
|
-
var
|
|
117604
|
+
var import_node_fs144, import_node_path146, import_sucrase3, import_terser2, PREFIX_START, PREFIX_END;
|
|
117487
117605
|
var init_configured_bundle_producer = __esm({
|
|
117488
117606
|
"src/configured-bundle-producer.ts"() {
|
|
117489
117607
|
"use strict";
|
|
117490
117608
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
117491
|
-
|
|
117492
|
-
|
|
117609
|
+
import_node_fs144 = __toESM(require("node:fs"), 1);
|
|
117610
|
+
import_node_path146 = __toESM(require("node:path"), 1);
|
|
117493
117611
|
init_bundle_global_footer();
|
|
117494
117612
|
import_sucrase3 = require("sucrase");
|
|
117495
117613
|
import_terser2 = require("terser");
|
|
@@ -117799,9 +117917,9 @@ var init_android_theme = __esm({
|
|
|
117799
117917
|
|
|
117800
117918
|
// src/android-drawables.ts
|
|
117801
117919
|
function readAndroidDrawables(moduleDir, sources) {
|
|
117802
|
-
const res =
|
|
117920
|
+
const res = import_node_path147.default.join(moduleDir, "src/main/res");
|
|
117803
117921
|
const byName = /* @__PURE__ */ new Map();
|
|
117804
|
-
for (const dir of
|
|
117922
|
+
for (const dir of import_node_fs145.default.existsSync(res) ? import_node_fs145.default.readdirSync(res).sort() : []) {
|
|
117805
117923
|
if (!dir.startsWith("drawable")) continue;
|
|
117806
117924
|
const match = DRAWABLE_DIR.exec(dir);
|
|
117807
117925
|
const qualifier = match?.[1];
|
|
@@ -117811,10 +117929,10 @@ function readAndroidDrawables(moduleDir, sources) {
|
|
|
117811
117929
|
`${res}/${dir}: drawables under this qualifier are not resolved by Peach yet`
|
|
117812
117930
|
);
|
|
117813
117931
|
const version2 = Number(match[2] ?? 0);
|
|
117814
|
-
for (const entry of
|
|
117932
|
+
for (const entry of import_node_fs145.default.readdirSync(import_node_path147.default.join(res, dir)).sort()) {
|
|
117815
117933
|
if (!entry.endsWith(".xml") && !BITMAP.test(entry)) continue;
|
|
117816
117934
|
const name3 = entry.replace(BITMAP, "").replace(/\.xml$/, "");
|
|
117817
|
-
const file =
|
|
117935
|
+
const file = import_node_path147.default.join(res, dir, entry);
|
|
117818
117936
|
const files2 = byName.get(name3) ?? [];
|
|
117819
117937
|
byName.set(name3, files2);
|
|
117820
117938
|
if (version2 > DEVICE_API) continue;
|
|
@@ -117827,7 +117945,7 @@ function readAndroidDrawables(moduleDir, sources) {
|
|
|
117827
117945
|
ninePatch: entry.endsWith(".9.png")
|
|
117828
117946
|
});
|
|
117829
117947
|
else {
|
|
117830
|
-
const root = parseXml(
|
|
117948
|
+
const root = parseXml(import_node_fs145.default.readFileSync(file, "utf8"), file).children[0];
|
|
117831
117949
|
files2.push(
|
|
117832
117950
|
root?.name === "vector" ? {
|
|
117833
117951
|
file,
|
|
@@ -117994,13 +118112,13 @@ function readVector(root, file, sources) {
|
|
|
117994
118112
|
calls
|
|
117995
118113
|
};
|
|
117996
118114
|
}
|
|
117997
|
-
var
|
|
118115
|
+
var import_node_fs145, import_node_path147, DEVICE_API, BUCKETS, DRAWABLE_DIR, BITMAP;
|
|
117998
118116
|
var init_android_drawables = __esm({
|
|
117999
118117
|
"src/android-drawables.ts"() {
|
|
118000
118118
|
"use strict";
|
|
118001
118119
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
118002
|
-
|
|
118003
|
-
|
|
118120
|
+
import_node_fs145 = __toESM(require("node:fs"), 1);
|
|
118121
|
+
import_node_path147 = __toESM(require("node:path"), 1);
|
|
118004
118122
|
init_android_theme();
|
|
118005
118123
|
init_android_xml();
|
|
118006
118124
|
DEVICE_API = 37;
|
|
@@ -118022,12 +118140,12 @@ var init_android_drawables = __esm({
|
|
|
118022
118140
|
|
|
118023
118141
|
// src/android-layout-ids.ts
|
|
118024
118142
|
function readAndroidLayoutIds(moduleDir) {
|
|
118025
|
-
const res =
|
|
118143
|
+
const res = import_node_path148.default.join(moduleDir, "src/main/res");
|
|
118026
118144
|
const layouts = /* @__PURE__ */ new Set();
|
|
118027
118145
|
const ids = /* @__PURE__ */ new Set();
|
|
118028
118146
|
const elements = /* @__PURE__ */ new Map();
|
|
118029
|
-
for (const dir of
|
|
118030
|
-
const directory2 =
|
|
118147
|
+
for (const dir of import_node_fs146.default.existsSync(res) ? import_node_fs146.default.readdirSync(res).sort() : []) {
|
|
118148
|
+
const directory2 = import_node_path148.default.join(res, dir);
|
|
118031
118149
|
if (dir === "layout" || dir.startsWith("layout-")) {
|
|
118032
118150
|
const match = LAYOUT_DIR.exec(dir);
|
|
118033
118151
|
if (!match)
|
|
@@ -118037,13 +118155,13 @@ function readAndroidLayoutIds(moduleDir) {
|
|
|
118037
118155
|
const orientation = match[1] === "port" ? 1 : match[1] === "land" ? 2 : 0;
|
|
118038
118156
|
const night = match[2] === "notnight" ? 1 : match[2] === "night" ? 2 : 0;
|
|
118039
118157
|
const version2 = Number(match[3] ?? 0);
|
|
118040
|
-
for (const entry of
|
|
118158
|
+
for (const entry of import_node_fs146.default.readdirSync(directory2).sort()) {
|
|
118041
118159
|
if (!entry.endsWith(".xml")) continue;
|
|
118042
118160
|
const name3 = entry.slice(0, -".xml".length);
|
|
118043
118161
|
layouts.add(name3);
|
|
118044
|
-
const xml =
|
|
118162
|
+
const xml = import_node_fs146.default.readFileSync(import_node_path148.default.join(directory2, entry), "utf8");
|
|
118045
118163
|
for (const reference of xml.matchAll(ID_REFERENCE)) ids.add(reference[1]);
|
|
118046
|
-
const element = parseXml(xml,
|
|
118164
|
+
const element = parseXml(xml, import_node_path148.default.join(directory2, entry)).children[0];
|
|
118047
118165
|
if (!element || version2 > DEVICE_API) continue;
|
|
118048
118166
|
elements.set(name3, [
|
|
118049
118167
|
...elements.get(name3) ?? [],
|
|
@@ -118051,9 +118169,9 @@ function readAndroidLayoutIds(moduleDir) {
|
|
|
118051
118169
|
]);
|
|
118052
118170
|
}
|
|
118053
118171
|
} else if (dir.startsWith("values")) {
|
|
118054
|
-
for (const entry of
|
|
118172
|
+
for (const entry of import_node_fs146.default.readdirSync(directory2).sort()) {
|
|
118055
118173
|
if (!entry.endsWith(".xml")) continue;
|
|
118056
|
-
const xml =
|
|
118174
|
+
const xml = import_node_fs146.default.readFileSync(import_node_path148.default.join(directory2, entry), "utf8");
|
|
118057
118175
|
for (const item of xml.matchAll(ID_ITEM)) {
|
|
118058
118176
|
const name3 = ITEM_NAME.exec(item[0])?.[1];
|
|
118059
118177
|
if (name3) ids.add(name3);
|
|
@@ -118063,13 +118181,13 @@ function readAndroidLayoutIds(moduleDir) {
|
|
|
118063
118181
|
}
|
|
118064
118182
|
return { layouts: [...layouts].sort(), ids: [...ids].sort(), elements };
|
|
118065
118183
|
}
|
|
118066
|
-
var
|
|
118184
|
+
var import_node_fs146, import_node_path148, LAYOUT_DIR, ID_REFERENCE, ID_ITEM, ITEM_NAME;
|
|
118067
118185
|
var init_android_layout_ids = __esm({
|
|
118068
118186
|
"src/android-layout-ids.ts"() {
|
|
118069
118187
|
"use strict";
|
|
118070
118188
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
118071
|
-
|
|
118072
|
-
|
|
118189
|
+
import_node_fs146 = __toESM(require("node:fs"), 1);
|
|
118190
|
+
import_node_path148 = __toESM(require("node:path"), 1);
|
|
118073
118191
|
init_android_drawables();
|
|
118074
118192
|
init_android_xml();
|
|
118075
118193
|
LAYOUT_DIR = /^layout(?:-(port|land))?(?:-(notnight|night))?(?:-v(\d+))?$/;
|
|
@@ -118084,15 +118202,15 @@ function readAndroidStrings(moduleDir) {
|
|
|
118084
118202
|
const strings7 = /* @__PURE__ */ new Map();
|
|
118085
118203
|
const plurals = /* @__PURE__ */ new Map();
|
|
118086
118204
|
const arrays = /* @__PURE__ */ new Map();
|
|
118087
|
-
const res =
|
|
118088
|
-
const dirs =
|
|
118205
|
+
const res = import_node_path149.default.join(moduleDir, "src/main/res");
|
|
118206
|
+
const dirs = import_node_fs147.default.existsSync(res) ? import_node_fs147.default.readdirSync(res).sort() : [];
|
|
118089
118207
|
for (const dir of dirs) {
|
|
118090
118208
|
if (!dir.startsWith("values")) continue;
|
|
118091
118209
|
const qualifier = VALUES_DIR.exec(dir);
|
|
118092
|
-
for (const entry of
|
|
118210
|
+
for (const entry of import_node_fs147.default.readdirSync(import_node_path149.default.join(res, dir)).sort()) {
|
|
118093
118211
|
if (!entry.endsWith(".xml")) continue;
|
|
118094
|
-
const file =
|
|
118095
|
-
const text6 =
|
|
118212
|
+
const file = import_node_path149.default.join(res, dir, entry);
|
|
118213
|
+
const text6 = import_node_fs147.default.readFileSync(file, "utf8").replace(/<!--[\s\S]*?-->/g, "");
|
|
118096
118214
|
for (const match of text6.matchAll(ELEMENT)) {
|
|
118097
118215
|
const kind = match[1] ?? "";
|
|
118098
118216
|
const name3 = NAME.exec(match[2] ?? "")?.[1];
|
|
@@ -118143,13 +118261,13 @@ function compileString(raw2, where) {
|
|
|
118143
118261
|
where
|
|
118144
118262
|
);
|
|
118145
118263
|
}
|
|
118146
|
-
var
|
|
118264
|
+
var import_node_fs147, import_node_path149, VALUES_DIR, ELEMENT, ITEM, NAME, QUANTITY, QUANTITIES, isQuantity, sorted;
|
|
118147
118265
|
var init_android_strings = __esm({
|
|
118148
118266
|
"src/android-strings.ts"() {
|
|
118149
118267
|
"use strict";
|
|
118150
118268
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
118151
|
-
|
|
118152
|
-
|
|
118269
|
+
import_node_fs147 = __toESM(require("node:fs"), 1);
|
|
118270
|
+
import_node_path149 = __toESM(require("node:path"), 1);
|
|
118153
118271
|
init_android_string_value();
|
|
118154
118272
|
init_android_xml();
|
|
118155
118273
|
VALUES_DIR = /^values(?:-([a-z]{2,3})(?:-r([A-Z]{2}))?)?$/;
|
|
@@ -129533,7 +129651,7 @@ function repositories(body, where) {
|
|
|
129533
129651
|
if (name3 === "google") roots.push("https://dl.google.com/dl/android/maven2");
|
|
129534
129652
|
else if (name3 === "mavenCentral") roots.push("https://repo1.maven.org/maven2");
|
|
129535
129653
|
else if (name3 === "mavenLocal")
|
|
129536
|
-
roots.push(
|
|
129654
|
+
roots.push(import_node_path150.default.join(import_node_os25.default.homedir(), ".m2", "repository"));
|
|
129537
129655
|
else {
|
|
129538
129656
|
const declared = direct ?? /["']([^"']+)["']/.exec(block2 ?? "")?.[1];
|
|
129539
129657
|
if (!declared)
|
|
@@ -129548,9 +129666,9 @@ function repositories(body, where) {
|
|
|
129548
129666
|
return roots;
|
|
129549
129667
|
}
|
|
129550
129668
|
function mavenRepositories(projectDir, where) {
|
|
129551
|
-
const file = ["settings.gradle.kts", "settings.gradle"].map((name3) =>
|
|
129669
|
+
const file = ["settings.gradle.kts", "settings.gradle"].map((name3) => import_node_path150.default.join(projectDir, name3)).find((candidate) => import_node_fs148.default.existsSync(candidate));
|
|
129552
129670
|
if (!file) throw new Error(`${where}: ${projectDir} has no settings.gradle`);
|
|
129553
|
-
const text6 =
|
|
129671
|
+
const text6 = import_node_fs148.default.readFileSync(file, "utf8");
|
|
129554
129672
|
const management = text6.search(/\bdependencyResolutionManagement\b/);
|
|
129555
129673
|
if (management < 0)
|
|
129556
129674
|
throw new Error(`${where}: ${file} declares no dependency repositories`);
|
|
@@ -129605,43 +129723,43 @@ function zipSources(bytes, where) {
|
|
|
129605
129723
|
const localExtra = bytes.readUInt16LE(localOffset + 28);
|
|
129606
129724
|
const start = localOffset + 30 + localName + localExtra;
|
|
129607
129725
|
const payload = bytes.subarray(start, start + compressed);
|
|
129608
|
-
const data = method === 0 ? Buffer.from(payload) : method === 8 ? (0,
|
|
129726
|
+
const data = method === 0 ? Buffer.from(payload) : method === 8 ? (0, import_node_zlib5.inflateRawSync)(payload) : null;
|
|
129609
129727
|
if (!data) throw new Error(`${where}: ${name3} uses zip method ${method}`);
|
|
129610
129728
|
entries.push({ name: name3, data });
|
|
129611
129729
|
}
|
|
129612
129730
|
return entries;
|
|
129613
129731
|
}
|
|
129614
129732
|
function extract(bytes, where) {
|
|
129615
|
-
const key2 = (0,
|
|
129733
|
+
const key2 = (0, import_node_crypto75.createHash)("sha256").update(bytes).digest("hex");
|
|
129616
129734
|
const cached4 = pending.get(key2);
|
|
129617
129735
|
if (cached4) return cached4;
|
|
129618
129736
|
const request = (async () => {
|
|
129619
|
-
const dest =
|
|
129620
|
-
const marker =
|
|
129621
|
-
if (!
|
|
129737
|
+
const dest = import_node_path150.default.join(import_node_os25.default.tmpdir(), "peach-maven-sources", key2);
|
|
129738
|
+
const marker = import_node_path150.default.join(dest, ".complete");
|
|
129739
|
+
if (!import_node_fs148.default.existsSync(marker)) {
|
|
129622
129740
|
const entries = zipSources(bytes, where);
|
|
129623
129741
|
const java = entries.find((entry) => entry.name.endsWith(".java"));
|
|
129624
129742
|
if (java) throw new Error(`${where}: ${java.name} is a Java source`);
|
|
129625
129743
|
const kotlin = entries.filter((entry) => entry.name.endsWith(".kt"));
|
|
129626
129744
|
if (kotlin.length === 0) throw new Error(`${where}: sources jar has no Kotlin`);
|
|
129627
129745
|
const staging = `${dest}.partial-${process.pid}`;
|
|
129628
|
-
|
|
129746
|
+
import_node_fs148.default.rmSync(staging, { recursive: true, force: true });
|
|
129629
129747
|
for (const entry of kotlin) {
|
|
129630
|
-
const file =
|
|
129631
|
-
|
|
129632
|
-
|
|
129748
|
+
const file = import_node_path150.default.join(staging, entry.name);
|
|
129749
|
+
import_node_fs148.default.mkdirSync(import_node_path150.default.dirname(file), { recursive: true });
|
|
129750
|
+
import_node_fs148.default.writeFileSync(file, entry.data);
|
|
129633
129751
|
}
|
|
129634
|
-
|
|
129752
|
+
import_node_fs148.default.writeFileSync(import_node_path150.default.join(staging, ".complete"), "");
|
|
129635
129753
|
try {
|
|
129636
|
-
|
|
129754
|
+
import_node_fs148.default.renameSync(staging, dest);
|
|
129637
129755
|
} catch (error) {
|
|
129638
|
-
|
|
129639
|
-
if (!
|
|
129756
|
+
import_node_fs148.default.rmSync(staging, { recursive: true, force: true });
|
|
129757
|
+
if (!import_node_fs148.default.existsSync(marker)) throw error;
|
|
129640
129758
|
}
|
|
129641
129759
|
}
|
|
129642
|
-
return
|
|
129760
|
+
return import_node_fs148.default.readdirSync(dest, { recursive: true }).flatMap((entry) => {
|
|
129643
129761
|
const name3 = String(entry);
|
|
129644
|
-
return name3.endsWith(".kt") ? [
|
|
129762
|
+
return name3.endsWith(".kt") ? [import_node_path150.default.join(dest, name3)] : [];
|
|
129645
129763
|
}).sort();
|
|
129646
129764
|
})().catch((error) => {
|
|
129647
129765
|
pending.delete(key2);
|
|
@@ -129664,8 +129782,8 @@ async function sourcesJar(root, group, artifact, version2) {
|
|
|
129664
129782
|
if (!response.ok) throw new Error(`${url} answered ${response.status}`);
|
|
129665
129783
|
return Buffer.from(await response.arrayBuffer());
|
|
129666
129784
|
}
|
|
129667
|
-
const file =
|
|
129668
|
-
return
|
|
129785
|
+
const file = import_node_path150.default.join(root, ...parts);
|
|
129786
|
+
return import_node_fs148.default.existsSync(file) ? import_node_fs148.default.readFileSync(file) : null;
|
|
129669
129787
|
}
|
|
129670
129788
|
async function mavenKotlinSources(projectDir, coordinate, where) {
|
|
129671
129789
|
const { group, artifact, version: version2 } = coordinate;
|
|
@@ -129675,28 +129793,28 @@ async function mavenKotlinSources(projectDir, coordinate, where) {
|
|
|
129675
129793
|
}
|
|
129676
129794
|
return null;
|
|
129677
129795
|
}
|
|
129678
|
-
var
|
|
129796
|
+
var import_node_crypto75, import_node_fs148, import_node_os25, import_node_path150, import_node_zlib5, pending;
|
|
129679
129797
|
var init_kotlin_maven_sources = __esm({
|
|
129680
129798
|
"src/kotlin-maven-sources.ts"() {
|
|
129681
129799
|
"use strict";
|
|
129682
129800
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
129683
|
-
|
|
129684
|
-
|
|
129801
|
+
import_node_crypto75 = require("node:crypto");
|
|
129802
|
+
import_node_fs148 = __toESM(require("node:fs"), 1);
|
|
129685
129803
|
import_node_os25 = __toESM(require("node:os"), 1);
|
|
129686
|
-
|
|
129687
|
-
|
|
129804
|
+
import_node_path150 = __toESM(require("node:path"), 1);
|
|
129805
|
+
import_node_zlib5 = require("node:zlib");
|
|
129688
129806
|
pending = /* @__PURE__ */ new Map();
|
|
129689
129807
|
}
|
|
129690
129808
|
});
|
|
129691
129809
|
|
|
129692
129810
|
// src/kotlin-version-catalog.ts
|
|
129693
|
-
var
|
|
129811
|
+
var import_node_fs149, import_node_path151, import_smol_toml, accessorName, KotlinVersionCatalog;
|
|
129694
129812
|
var init_kotlin_version_catalog = __esm({
|
|
129695
129813
|
"src/kotlin-version-catalog.ts"() {
|
|
129696
129814
|
"use strict";
|
|
129697
129815
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
129698
|
-
|
|
129699
|
-
|
|
129816
|
+
import_node_fs149 = __toESM(require("node:fs"), 1);
|
|
129817
|
+
import_node_path151 = __toESM(require("node:path"), 1);
|
|
129700
129818
|
import_smol_toml = require("smol-toml");
|
|
129701
129819
|
init_is_record();
|
|
129702
129820
|
accessorName = (name3) => name3.replace(/[-_.]/g, ".");
|
|
@@ -129704,8 +129822,8 @@ var init_kotlin_version_catalog = __esm({
|
|
|
129704
129822
|
file;
|
|
129705
129823
|
tables;
|
|
129706
129824
|
constructor(projectDir) {
|
|
129707
|
-
this.file =
|
|
129708
|
-
this.tables =
|
|
129825
|
+
this.file = import_node_path151.default.join(projectDir, "gradle/libs.versions.toml");
|
|
129826
|
+
this.tables = import_node_fs149.default.existsSync(this.file) ? (0, import_smol_toml.parse)(import_node_fs149.default.readFileSync(this.file, "utf8")) : {};
|
|
129709
129827
|
}
|
|
129710
129828
|
entry(section, accessor, where) {
|
|
129711
129829
|
const table = this.tables[section];
|
|
@@ -129763,7 +129881,7 @@ __export(kotlin_app_exports, {
|
|
|
129763
129881
|
});
|
|
129764
129882
|
function readAndroidPins(moduleRoot) {
|
|
129765
129883
|
const toolchain = JSON.parse(
|
|
129766
|
-
|
|
129884
|
+
import_node_fs150.default.readFileSync(import_node_path152.default.join(moduleRoot, "toolchain.json"), "utf8")
|
|
129767
129885
|
);
|
|
129768
129886
|
if (!isRecord(toolchain))
|
|
129769
129887
|
throw new Error("peachsim kotlin/toolchain.json is not an object");
|
|
@@ -129804,8 +129922,8 @@ function readAndroidPins(moduleRoot) {
|
|
|
129804
129922
|
}
|
|
129805
129923
|
function readGradle(dir) {
|
|
129806
129924
|
for (const name3 of ["build.gradle.kts", "build.gradle"]) {
|
|
129807
|
-
const file =
|
|
129808
|
-
if (
|
|
129925
|
+
const file = import_node_path152.default.join(dir, name3);
|
|
129926
|
+
if (import_node_fs150.default.existsSync(file)) return { file, text: import_node_fs150.default.readFileSync(file, "utf8") };
|
|
129809
129927
|
}
|
|
129810
129928
|
return null;
|
|
129811
129929
|
}
|
|
@@ -130002,15 +130120,15 @@ function themeSources(moduleDir, night) {
|
|
|
130002
130120
|
} : { android, app: read("values") };
|
|
130003
130121
|
}
|
|
130004
130122
|
function valuesFiles(moduleDir, qualifier) {
|
|
130005
|
-
const values =
|
|
130006
|
-
return
|
|
130007
|
-
const file =
|
|
130008
|
-
return { file, text:
|
|
130123
|
+
const values = import_node_path152.default.join(moduleDir, "src/main/res", qualifier);
|
|
130124
|
+
return import_node_fs150.default.existsSync(values) ? import_node_fs150.default.readdirSync(values).filter((entry) => entry.endsWith(".xml")).map((entry) => {
|
|
130125
|
+
const file = import_node_path152.default.join(values, entry);
|
|
130126
|
+
return { file, text: import_node_fs150.default.readFileSync(file, "utf8") };
|
|
130009
130127
|
}) : [];
|
|
130010
130128
|
}
|
|
130011
130129
|
function readAppColors(moduleDir, theme) {
|
|
130012
|
-
const res =
|
|
130013
|
-
for (const dir of
|
|
130130
|
+
const res = import_node_path152.default.join(moduleDir, "src/main/res");
|
|
130131
|
+
for (const dir of import_node_fs150.default.existsSync(res) ? import_node_fs150.default.readdirSync(res).sort() : []) {
|
|
130014
130132
|
if (!dir.startsWith("values") || dir === "values" || dir === "values-night") continue;
|
|
130015
130133
|
const colors = Object.keys(readResourceValues(valuesFiles(moduleDir, dir)).colors);
|
|
130016
130134
|
if (colors.length > 0)
|
|
@@ -130082,17 +130200,17 @@ function isLauncher(element) {
|
|
|
130082
130200
|
);
|
|
130083
130201
|
}
|
|
130084
130202
|
async function readKotlinApp(moduleArg, options) {
|
|
130085
|
-
const moduleDir =
|
|
130086
|
-
const manifestFile =
|
|
130087
|
-
if (!
|
|
130203
|
+
const moduleDir = import_node_fs150.default.realpathSync(import_node_path152.default.resolve(moduleArg));
|
|
130204
|
+
const manifestFile = import_node_path152.default.join(moduleDir, "src/main/AndroidManifest.xml");
|
|
130205
|
+
if (!import_node_fs150.default.existsSync(manifestFile))
|
|
130088
130206
|
throw new Error(
|
|
130089
130207
|
`${moduleDir} is not an Android app module: no src/main/AndroidManifest.xml`
|
|
130090
130208
|
);
|
|
130091
130209
|
let projectDir = moduleDir;
|
|
130092
130210
|
while (!["settings.gradle.kts", "settings.gradle"].some(
|
|
130093
|
-
(name3) =>
|
|
130211
|
+
(name3) => import_node_fs150.default.existsSync(import_node_path152.default.join(projectDir, name3))
|
|
130094
130212
|
)) {
|
|
130095
|
-
const parent =
|
|
130213
|
+
const parent = import_node_path152.default.dirname(projectDir);
|
|
130096
130214
|
if (parent === projectDir)
|
|
130097
130215
|
throw new Error(`${moduleDir} has no settings.gradle above it`);
|
|
130098
130216
|
projectDir = parent;
|
|
@@ -130134,7 +130252,7 @@ async function readKotlinApp(moduleArg, options) {
|
|
|
130134
130252
|
const language = /^(\d+)\.(\d+)/.exec(kotlin)?.slice(1, 3).join(".");
|
|
130135
130253
|
if (!language)
|
|
130136
130254
|
throw new Error(`Kotlin plugin version ${kotlin} names no language version`);
|
|
130137
|
-
const manifest = parseXml(
|
|
130255
|
+
const manifest = parseXml(import_node_fs150.default.readFileSync(manifestFile, "utf8"), manifestFile);
|
|
130138
130256
|
const root = manifest.children.find((element) => element.name === "manifest");
|
|
130139
130257
|
const application = root?.children.find((element) => element.name === "application");
|
|
130140
130258
|
if (!root || !application) throw new Error(`${manifestFile} has no <application>`);
|
|
@@ -130228,11 +130346,11 @@ async function readKotlinApp(moduleArg, options) {
|
|
|
130228
130346
|
const sources = selected ? selected.kotlin : [];
|
|
130229
130347
|
if (!selected)
|
|
130230
130348
|
for (const set2 of ["java", "kotlin"]) {
|
|
130231
|
-
const dir =
|
|
130232
|
-
if (!
|
|
130349
|
+
const dir = import_node_path152.default.join(moduleDir, "src/main", set2);
|
|
130350
|
+
if (!import_node_fs150.default.existsSync(dir)) continue;
|
|
130233
130351
|
const walk3 = (current2) => {
|
|
130234
|
-
for (const entry of
|
|
130235
|
-
const full =
|
|
130352
|
+
for (const entry of import_node_fs150.default.readdirSync(current2, { withFileTypes: true })) {
|
|
130353
|
+
const full = import_node_path152.default.join(current2, entry.name);
|
|
130236
130354
|
if (entry.isDirectory()) walk3(full);
|
|
130237
130355
|
else if (entry.name.endsWith(".java"))
|
|
130238
130356
|
throw new Error(`${full}: Java sources are not supported by peach open`);
|
|
@@ -130277,13 +130395,13 @@ async function readKotlinApp(moduleArg, options) {
|
|
|
130277
130395
|
layoutIds: readAndroidLayoutIds(moduleDir)
|
|
130278
130396
|
};
|
|
130279
130397
|
}
|
|
130280
|
-
var
|
|
130398
|
+
var import_node_fs150, import_node_path152, ANDROID_NS, MAIN, LAUNCHER, PLUGINS, PLATFORM_GROUPS, PLATFORM_ARTIFACTS, ANDROID_PIN;
|
|
130281
130399
|
var init_kotlin_app = __esm({
|
|
130282
130400
|
"src/kotlin-app.ts"() {
|
|
130283
130401
|
"use strict";
|
|
130284
130402
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
130285
|
-
|
|
130286
|
-
|
|
130403
|
+
import_node_fs150 = __toESM(require("node:fs"), 1);
|
|
130404
|
+
import_node_path152 = __toESM(require("node:path"), 1);
|
|
130287
130405
|
init_android_drawables();
|
|
130288
130406
|
init_android_layout_ids();
|
|
130289
130407
|
init_android_strings();
|
|
@@ -130335,24 +130453,24 @@ __export(native_input_exports, {
|
|
|
130335
130453
|
});
|
|
130336
130454
|
function resolveNativeInput(target) {
|
|
130337
130455
|
if (!target || /^\w+:\/\//.test(target) || /^\d+$/.test(target)) return null;
|
|
130338
|
-
const resolved =
|
|
130339
|
-
const stat2 =
|
|
130456
|
+
const resolved = import_node_path153.default.resolve(target);
|
|
130457
|
+
const stat2 = import_node_fs151.default.statSync(resolved, { throwIfNoEntry: false });
|
|
130340
130458
|
if (!stat2) return null;
|
|
130341
130459
|
if (stat2.isFile()) {
|
|
130342
|
-
if (resolved.endsWith(".swift") &&
|
|
130343
|
-
return { kind: "swift-file", path:
|
|
130344
|
-
if (
|
|
130345
|
-
return { kind: "swift-package", path:
|
|
130460
|
+
if (resolved.endsWith(".swift") && import_node_path153.default.basename(resolved) !== "Package.swift")
|
|
130461
|
+
return { kind: "swift-file", path: import_node_fs151.default.realpathSync(resolved) };
|
|
130462
|
+
if (import_node_path153.default.basename(resolved) === "Package.swift")
|
|
130463
|
+
return { kind: "swift-package", path: import_node_fs151.default.realpathSync(import_node_path153.default.dirname(resolved)) };
|
|
130346
130464
|
return null;
|
|
130347
130465
|
}
|
|
130348
130466
|
if (!stat2.isDirectory()) return null;
|
|
130349
|
-
if (
|
|
130350
|
-
return { kind: "swift-package", path:
|
|
130467
|
+
if (import_node_fs151.default.existsSync(import_node_path153.default.join(resolved, "Package.swift")))
|
|
130468
|
+
return { kind: "swift-package", path: import_node_fs151.default.realpathSync(resolved) };
|
|
130351
130469
|
const xcode = findXcodeProject(resolved);
|
|
130352
|
-
if (xcode) return { kind: "xcode", path:
|
|
130353
|
-
if (
|
|
130354
|
-
return { kind: "kotlin", path:
|
|
130355
|
-
if (!
|
|
130470
|
+
if (xcode) return { kind: "xcode", path: import_node_fs151.default.realpathSync(xcode) };
|
|
130471
|
+
if (import_node_fs151.default.existsSync(import_node_path153.default.join(resolved, "src/main/AndroidManifest.xml")))
|
|
130472
|
+
return { kind: "kotlin", path: import_node_fs151.default.realpathSync(resolved) };
|
|
130473
|
+
if (!import_node_fs151.default.existsSync(import_node_path153.default.join(resolved, "package.json")) && import_node_fs151.default.readdirSync(resolved).some((name3) => name3.endsWith(".swift")))
|
|
130356
130474
|
throw new Error(
|
|
130357
130475
|
`${target} holds Swift files but no Package.swift or Xcode project; open one .swift file, a Swift package, or an Xcode project`
|
|
130358
130476
|
);
|
|
@@ -130381,7 +130499,7 @@ async function prepareSwiftInput(input, opts = {}) {
|
|
|
130381
130499
|
module2?.root,
|
|
130382
130500
|
run14?.configuration
|
|
130383
130501
|
) : input.path;
|
|
130384
|
-
const name3 = input.kind === "swift-file" ?
|
|
130502
|
+
const name3 = input.kind === "swift-file" ? import_node_path153.default.basename(input.path, ".swift") : import_node_path153.default.basename(packagePath);
|
|
130385
130503
|
const appProject = resolveAppProject(packagePath);
|
|
130386
130504
|
let appInfo;
|
|
130387
130505
|
try {
|
|
@@ -130436,7 +130554,7 @@ async function prepareNativeInput(input, opts) {
|
|
|
130436
130554
|
const metadata = await host2.kotlinAppArtifact(project2, moduleRoot, opts.origin);
|
|
130437
130555
|
const prefix = new URL(metadata.url).pathname.slice(0, -"app.mjs".length);
|
|
130438
130556
|
return {
|
|
130439
|
-
name:
|
|
130557
|
+
name: import_node_path153.default.basename(project2.projectDir),
|
|
130440
130558
|
guestSource: kotlinGuestBundle(),
|
|
130441
130559
|
guestPath: KOTLIN_GUEST_PATH,
|
|
130442
130560
|
metadataPath: host2.KOTLIN_PACKAGE_PATH,
|
|
@@ -130471,13 +130589,13 @@ async function prepareNativeInput(input, opts) {
|
|
|
130471
130589
|
throw error;
|
|
130472
130590
|
}
|
|
130473
130591
|
}
|
|
130474
|
-
var
|
|
130592
|
+
var import_node_fs151, import_node_path153;
|
|
130475
130593
|
var init_native_input = __esm({
|
|
130476
130594
|
"cli/native-input.ts"() {
|
|
130477
130595
|
"use strict";
|
|
130478
130596
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
130479
|
-
|
|
130480
|
-
|
|
130597
|
+
import_node_fs151 = __toESM(require("node:fs"), 1);
|
|
130598
|
+
import_node_path153 = __toESM(require("node:path"), 1);
|
|
130481
130599
|
init_configured_bundle_producer();
|
|
130482
130600
|
init_guest_bundle();
|
|
130483
130601
|
init_kotlinDiscoveryContract();
|
|
@@ -130615,7 +130733,7 @@ async function runKotlin(args, opts = {}) {
|
|
|
130615
130733
|
throw new Error(`unknown peach open flag for an Android app: ${arg}`);
|
|
130616
130734
|
else if (modulePath)
|
|
130617
130735
|
throw new Error("peach open expects one Android app module directory");
|
|
130618
|
-
else modulePath =
|
|
130736
|
+
else modulePath = import_node_path154.default.resolve(arg);
|
|
130619
130737
|
}
|
|
130620
130738
|
if (!modulePath) throw new Error("usage: peach open <android-app-module>");
|
|
130621
130739
|
const device = opts.device ?? opts.openArgs?.find((_, index) => opts.openArgs?.[index - 1] === "--device") ?? DEFAULT_DEVICE_BY_PLATFORM.android;
|
|
@@ -130638,7 +130756,7 @@ async function runKotlin(args, opts = {}) {
|
|
|
130638
130756
|
let origin = "";
|
|
130639
130757
|
let artifact;
|
|
130640
130758
|
let compileError = "Kotlin compilation is starting";
|
|
130641
|
-
const projectName =
|
|
130759
|
+
const projectName = import_node_path154.default.basename(project2.projectDir);
|
|
130642
130760
|
const routes2 = () => ({
|
|
130643
130761
|
root: project2.projectDir,
|
|
130644
130762
|
moduleRoot,
|
|
@@ -130763,7 +130881,7 @@ async function runKotlin(args, opts = {}) {
|
|
|
130763
130881
|
});
|
|
130764
130882
|
console.log(` Kotlin app: ${project2.launcher.name} in ${project2.moduleDir}`);
|
|
130765
130883
|
console.log(` Kotlin preview host: ${origin}`);
|
|
130766
|
-
watcher =
|
|
130884
|
+
watcher = import_node_fs152.default.watch(project2.projectDir, { recursive: true }, (_event, file) => {
|
|
130767
130885
|
if (file && file.split(/[\\/]/).some((segment) => segment === "build" || segment.startsWith(".")))
|
|
130768
130886
|
return;
|
|
130769
130887
|
void rebuild();
|
|
@@ -130818,14 +130936,14 @@ async function runKotlin(args, opts = {}) {
|
|
|
130818
130936
|
}
|
|
130819
130937
|
return code;
|
|
130820
130938
|
}
|
|
130821
|
-
var
|
|
130939
|
+
var import_node_fs152, import_node_http3, import_node_path154, import_ws5, HMR_PATH;
|
|
130822
130940
|
var init_kotlin = __esm({
|
|
130823
130941
|
"cli/commands/kotlin.ts"() {
|
|
130824
130942
|
"use strict";
|
|
130825
130943
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
130826
|
-
|
|
130944
|
+
import_node_fs152 = __toESM(require("node:fs"), 1);
|
|
130827
130945
|
import_node_http3 = __toESM(require("node:http"), 1);
|
|
130828
|
-
|
|
130946
|
+
import_node_path154 = __toESM(require("node:path"), 1);
|
|
130829
130947
|
import_ws5 = require("ws");
|
|
130830
130948
|
init_device_catalog();
|
|
130831
130949
|
init_guest_bundle();
|
|
@@ -130882,7 +131000,7 @@ async function runSwift(args, opts = {}) {
|
|
|
130882
131000
|
const value = input[++index];
|
|
130883
131001
|
if (!value || value.startsWith("-"))
|
|
130884
131002
|
throw new Error("--swift-sdks-path requires a value");
|
|
130885
|
-
process.env.PEACH_SWIFT_SDKS_PATH =
|
|
131003
|
+
process.env.PEACH_SWIFT_SDKS_PATH = import_node_path155.default.resolve(value);
|
|
130886
131004
|
} else if (arg === "--host-port" || valueFlags.has(arg)) {
|
|
130887
131005
|
const value = input[++index];
|
|
130888
131006
|
if (!value || value.startsWith("-")) throw new Error(`${arg} requires a value`);
|
|
@@ -130896,7 +131014,7 @@ async function runSwift(args, opts = {}) {
|
|
|
130896
131014
|
else if (arg.startsWith("-"))
|
|
130897
131015
|
throw new Error(`unknown peach open flag for a Swift app: ${arg}`);
|
|
130898
131016
|
else if (packagePath) throw new Error("peach open expects one project");
|
|
130899
|
-
else packagePath =
|
|
131017
|
+
else packagePath = import_node_path155.default.resolve(arg);
|
|
130900
131018
|
}
|
|
130901
131019
|
if (!packagePath) {
|
|
130902
131020
|
throw new Error(
|
|
@@ -131071,7 +131189,7 @@ async function runSwift(args, opts = {}) {
|
|
|
131071
131189
|
code = 1;
|
|
131072
131190
|
stop();
|
|
131073
131191
|
});
|
|
131074
|
-
watcher =
|
|
131192
|
+
watcher = import_node_fs153.default.watch(
|
|
131075
131193
|
nativeInput.kind === "swift-file" ? nativeInput.path : packagePath,
|
|
131076
131194
|
{ recursive: nativeInput.kind !== "swift-file" },
|
|
131077
131195
|
(_event, file) => {
|
|
@@ -131139,14 +131257,14 @@ async function runSwift(args, opts = {}) {
|
|
|
131139
131257
|
}
|
|
131140
131258
|
return code;
|
|
131141
131259
|
}
|
|
131142
|
-
var
|
|
131260
|
+
var import_node_fs153, import_node_http4, import_node_path155, import_ws6;
|
|
131143
131261
|
var init_swift = __esm({
|
|
131144
131262
|
"cli/commands/swift.ts"() {
|
|
131145
131263
|
"use strict";
|
|
131146
131264
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
131147
|
-
|
|
131265
|
+
import_node_fs153 = __toESM(require("node:fs"), 1);
|
|
131148
131266
|
import_node_http4 = __toESM(require("node:http"), 1);
|
|
131149
|
-
|
|
131267
|
+
import_node_path155 = __toESM(require("node:path"), 1);
|
|
131150
131268
|
import_ws6 = require("ws");
|
|
131151
131269
|
init_backend_origin();
|
|
131152
131270
|
init_swift_submit();
|
|
@@ -131356,14 +131474,14 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
131356
131474
|
);
|
|
131357
131475
|
}
|
|
131358
131476
|
const { executable, prefixArgs } = rnxSelfInvocation();
|
|
131359
|
-
const bridgeLogPath =
|
|
131477
|
+
const bridgeLogPath = import_node_path156.default.join(
|
|
131360
131478
|
import_node_os26.default.tmpdir(),
|
|
131361
131479
|
`peach-bridge-${Date.now()}-${process.pid}.log`
|
|
131362
131480
|
);
|
|
131363
|
-
const bridgeLogFd =
|
|
131481
|
+
const bridgeLogFd = import_node_fs154.default.openSync(bridgeLogPath, "a");
|
|
131364
131482
|
let child;
|
|
131365
131483
|
try {
|
|
131366
|
-
child = (0,
|
|
131484
|
+
child = (0, import_node_child_process63.spawn)(
|
|
131367
131485
|
executable,
|
|
131368
131486
|
[...prefixArgs, "serve", "--quiet", "--port", String(preferredPort)],
|
|
131369
131487
|
{
|
|
@@ -131374,7 +131492,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
131374
131492
|
}
|
|
131375
131493
|
);
|
|
131376
131494
|
} finally {
|
|
131377
|
-
|
|
131495
|
+
import_node_fs154.default.closeSync(bridgeLogFd);
|
|
131378
131496
|
}
|
|
131379
131497
|
if (resources) {
|
|
131380
131498
|
resources.bridge = child;
|
|
@@ -131416,7 +131534,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
131416
131534
|
await sleep2(Math.max(0, Math.min(150, deadline - Date.now())));
|
|
131417
131535
|
}
|
|
131418
131536
|
const reason = childExit ? `peach bridge exited before becoming ready (exit ${childExit})` : `peach bridge did not start within ${Math.round(OPEN_BRIDGE_SPAWN_TIMEOUT_MS / 1e3)}s`;
|
|
131419
|
-
const bridgeLog =
|
|
131537
|
+
const bridgeLog = import_node_fs154.default.readFileSync(bridgeLogPath, "utf8").trim().slice(-2e3);
|
|
131420
131538
|
throw new Error(
|
|
131421
131539
|
`${reason}${bridgeLog ? `
|
|
131422
131540
|
${bridgeLog}` : ""}
|
|
@@ -131428,8 +131546,8 @@ async function retireOutdatedIdleBridge(lock) {
|
|
|
131428
131546
|
const current2 = getCliVersion();
|
|
131429
131547
|
if (isSootsimDevCheckout() || lock.cliVersion === current2) return;
|
|
131430
131548
|
if (lock.cliVersion && compareSemver(current2, lock.cliVersion) <= 0) return;
|
|
131431
|
-
const appRecord =
|
|
131432
|
-
if (
|
|
131549
|
+
const appRecord = import_node_path156.default.join(rnxHomeDir(), "app-runtime.json");
|
|
131550
|
+
if (import_node_fs154.default.existsSync(appRecord)) return;
|
|
131433
131551
|
const bridge = createBridge(lock.bridgePort, { commandTimeoutMs: 2e3 });
|
|
131434
131552
|
const simCount = await bridge.listSims({ includeRetained: true }).then(
|
|
131435
131553
|
(sims) => sims.length,
|
|
@@ -131455,31 +131573,31 @@ function isolateHomeForExplicitPort(preferredPort, explicitPort, lock) {
|
|
|
131455
131573
|
return;
|
|
131456
131574
|
}
|
|
131457
131575
|
const sharedRuntimes = runtimesDir();
|
|
131458
|
-
const home =
|
|
131576
|
+
const home = import_node_path156.default.join(rnxHomeDir(), "port-homes", String(preferredPort));
|
|
131459
131577
|
activatePeachHome(home);
|
|
131460
|
-
const runtimes =
|
|
131578
|
+
const runtimes = import_node_path156.default.join(home, "runtimes");
|
|
131461
131579
|
if (resolveDevCheckoutRuntimeRoot()) {
|
|
131462
131580
|
removePortHomeSharedRuntimesLink(runtimes, sharedRuntimes);
|
|
131463
|
-
} else if (
|
|
131464
|
-
|
|
131581
|
+
} else if (import_node_fs154.default.existsSync(sharedRuntimes) && !import_node_fs154.default.existsSync(runtimes)) {
|
|
131582
|
+
import_node_fs154.default.symlinkSync(sharedRuntimes, runtimes);
|
|
131465
131583
|
}
|
|
131466
131584
|
process.env[PEACH_HOME_ENV] = home;
|
|
131467
131585
|
}
|
|
131468
131586
|
function removePortHomeSharedRuntimesLink(runtimes, sharedRuntimes) {
|
|
131469
131587
|
let stat2;
|
|
131470
131588
|
try {
|
|
131471
|
-
stat2 =
|
|
131589
|
+
stat2 = import_node_fs154.default.lstatSync(runtimes);
|
|
131472
131590
|
} catch {
|
|
131473
131591
|
return;
|
|
131474
131592
|
}
|
|
131475
131593
|
if (!stat2.isSymbolicLink()) return;
|
|
131476
131594
|
let target;
|
|
131477
131595
|
try {
|
|
131478
|
-
target =
|
|
131596
|
+
target = import_node_path156.default.resolve(import_node_path156.default.dirname(runtimes), import_node_fs154.default.readlinkSync(runtimes));
|
|
131479
131597
|
} catch {
|
|
131480
131598
|
return;
|
|
131481
131599
|
}
|
|
131482
|
-
if (target === sharedRuntimes)
|
|
131600
|
+
if (target === sharedRuntimes) import_node_fs154.default.unlinkSync(runtimes);
|
|
131483
131601
|
}
|
|
131484
131602
|
async function ensureRuntimeForOpen() {
|
|
131485
131603
|
if (resolveDevCheckoutRuntimeRoot()) return;
|
|
@@ -131489,12 +131607,12 @@ async function ensureRuntimeForOpen() {
|
|
|
131489
131607
|
);
|
|
131490
131608
|
}
|
|
131491
131609
|
const active = readActiveRuntime();
|
|
131492
|
-
if (active &&
|
|
131610
|
+
if (active && import_node_fs154.default.existsSync(import_node_path156.default.join(runtimeDir(active), "index.html"))) {
|
|
131493
131611
|
await ensureCliCompanion(runtimeDir(active));
|
|
131494
131612
|
return;
|
|
131495
131613
|
}
|
|
131496
131614
|
const directory2 = runtimesDir();
|
|
131497
|
-
if (
|
|
131615
|
+
if (import_node_fs154.default.existsSync(directory2) && import_node_fs154.default.readdirSync(directory2).length > 0) {
|
|
131498
131616
|
throw new Error(
|
|
131499
131617
|
"peach open: runtime staging or selection is incomplete. finish staging and select the runtime with peach runtime use <version> before opening."
|
|
131500
131618
|
);
|
|
@@ -131580,11 +131698,11 @@ async function readSimDevice(bridge, simId) {
|
|
|
131580
131698
|
}
|
|
131581
131699
|
function prebuiltBundleFile(target) {
|
|
131582
131700
|
if (!/\.(js|bundle|jsbundle)$/i.test(target)) return null;
|
|
131583
|
-
const file =
|
|
131584
|
-
return
|
|
131701
|
+
const file = import_node_path156.default.resolve(process.cwd(), target);
|
|
131702
|
+
return import_node_fs154.default.statSync(file, { throwIfNoEntry: false })?.isFile() ? file : null;
|
|
131585
131703
|
}
|
|
131586
131704
|
async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
|
|
131587
|
-
const bytes =
|
|
131705
|
+
const bytes = import_node_fs154.default.readFileSync(file);
|
|
131588
131706
|
const source = bytes.toString("utf8");
|
|
131589
131707
|
const mode = await detectBundleModeFromText(source);
|
|
131590
131708
|
if (!mode) {
|
|
@@ -131602,7 +131720,7 @@ async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
|
|
|
131602
131720
|
stageHostBytes(
|
|
131603
131721
|
prepared === source ? bytes : Buffer.from(prepared, "utf8"),
|
|
131604
131722
|
`http://127.0.0.1:${bridgePort}`,
|
|
131605
|
-
|
|
131723
|
+
import_node_path156.default.extname(file)
|
|
131606
131724
|
)
|
|
131607
131725
|
);
|
|
131608
131726
|
url.searchParams.set("dev", String(mode === "development"));
|
|
@@ -131610,10 +131728,10 @@ async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
|
|
|
131610
131728
|
}
|
|
131611
131729
|
function normalizeReplacementPath(filePath) {
|
|
131612
131730
|
if (filePath.startsWith("~/")) {
|
|
131613
|
-
return
|
|
131731
|
+
return import_node_path156.default.join(import_node_os26.default.homedir(), filePath.slice(2));
|
|
131614
131732
|
}
|
|
131615
|
-
if (
|
|
131616
|
-
return
|
|
131733
|
+
if (import_node_path156.default.isAbsolute(filePath)) return filePath;
|
|
131734
|
+
return import_node_path156.default.resolve(process.cwd(), filePath);
|
|
131617
131735
|
}
|
|
131618
131736
|
function parseOpenRuntimeConfig(args) {
|
|
131619
131737
|
const modules = {};
|
|
@@ -131632,7 +131750,7 @@ function parseOpenRuntimeConfig(args) {
|
|
|
131632
131750
|
}
|
|
131633
131751
|
const moduleName2 = raw2.slice(0, eqIndex).trim();
|
|
131634
131752
|
const filePath = normalizeReplacementPath(raw2.slice(eqIndex + 1).trim());
|
|
131635
|
-
if (!
|
|
131753
|
+
if (!import_node_fs154.default.existsSync(filePath)) {
|
|
131636
131754
|
console.error(` peach open: replacement file not found: ${filePath}`);
|
|
131637
131755
|
peachExit(1);
|
|
131638
131756
|
}
|
|
@@ -131658,7 +131776,7 @@ function parseOpenRuntimeConfig(args) {
|
|
|
131658
131776
|
return config.modules || config.network ? config : void 0;
|
|
131659
131777
|
}
|
|
131660
131778
|
async function ensureConfiguredRuntime(version2) {
|
|
131661
|
-
if (
|
|
131779
|
+
if (import_node_fs154.default.existsSync(import_node_path156.default.join(runtimeDir(version2), "index.html"))) return;
|
|
131662
131780
|
console.error(` installing configured engine runtime ${version2}...`);
|
|
131663
131781
|
const result = await rnxRuntime.install({
|
|
131664
131782
|
version: version2,
|
|
@@ -131738,7 +131856,7 @@ async function waitForSimMatchOrHostExit(wsPort, commandTimeoutMs, predicate, ho
|
|
|
131738
131856
|
const watchHost = !!hostPid && Number.isInteger(hostPid) && hostPid > 1;
|
|
131739
131857
|
const hostExited = () => watchHost && hostPid !== void 0 && !isProcessRunning(hostPid);
|
|
131740
131858
|
if (opts.admittedFile && watchHost) {
|
|
131741
|
-
while (!
|
|
131859
|
+
while (!import_node_fs154.default.existsSync(opts.admittedFile)) {
|
|
131742
131860
|
opts.signal?.throwIfAborted();
|
|
131743
131861
|
if (hostExited()) return { kind: "host-exit" };
|
|
131744
131862
|
await sleep2(intervalMs);
|
|
@@ -131798,7 +131916,7 @@ function playwrightHostPidForSim(sim) {
|
|
|
131798
131916
|
function signalDriverLaunchConnected(result) {
|
|
131799
131917
|
if (!result.connectAckFile) return false;
|
|
131800
131918
|
try {
|
|
131801
|
-
|
|
131919
|
+
import_node_fs154.default.writeFileSync(
|
|
131802
131920
|
result.connectAckFile,
|
|
131803
131921
|
`${JSON.stringify({ connectedAt: Date.now(), pid: result.pid ?? null })}
|
|
131804
131922
|
`,
|
|
@@ -131812,7 +131930,7 @@ function signalDriverLaunchConnected(result) {
|
|
|
131812
131930
|
function readUnservedUrl(result) {
|
|
131813
131931
|
if (!result.diagnosticLogPath) return null;
|
|
131814
131932
|
try {
|
|
131815
|
-
const detail =
|
|
131933
|
+
const detail = import_node_fs154.default.readFileSync(result.diagnosticLogPath, "utf8");
|
|
131816
131934
|
const match = detail.match(/\[unserved\] nothing serves (\S+)/);
|
|
131817
131935
|
return match ? match[1] : null;
|
|
131818
131936
|
} catch {
|
|
@@ -131822,14 +131940,14 @@ function readUnservedUrl(result) {
|
|
|
131822
131940
|
function printDriverDiagnosticLogTail(result) {
|
|
131823
131941
|
if (!result.diagnosticLogPath) return;
|
|
131824
131942
|
try {
|
|
131825
|
-
const detail =
|
|
131943
|
+
const detail = import_node_fs154.default.readFileSync(result.diagnosticLogPath, "utf8").trim();
|
|
131826
131944
|
if (!detail) {
|
|
131827
|
-
console.error(` ${
|
|
131945
|
+
console.error(` ${import_node_path156.default.basename(result.diagnosticLogPath)} was empty`);
|
|
131828
131946
|
return;
|
|
131829
131947
|
}
|
|
131830
131948
|
const shown = detail.length > 4e3 ? `\u2026
|
|
131831
131949
|
${detail.slice(-4e3)}` : detail;
|
|
131832
|
-
console.error(` ${
|
|
131950
|
+
console.error(` ${import_node_path156.default.basename(result.diagnosticLogPath)}:`);
|
|
131833
131951
|
console.error(shown);
|
|
131834
131952
|
if (/No usable sandbox/i.test(detail)) {
|
|
131835
131953
|
console.error(
|
|
@@ -131839,7 +131957,7 @@ ${detail.slice(-4e3)}` : detail;
|
|
|
131839
131957
|
} catch (err) {
|
|
131840
131958
|
const message = err instanceof Error ? err.message : String(err);
|
|
131841
131959
|
console.error(
|
|
131842
|
-
` failed to read ${
|
|
131960
|
+
` failed to read ${import_node_path156.default.basename(result.diagnosticLogPath)}: ${message}`
|
|
131843
131961
|
);
|
|
131844
131962
|
}
|
|
131845
131963
|
}
|
|
@@ -131854,16 +131972,16 @@ async function waitForProcessExit(pid, timeoutMs = 2500) {
|
|
|
131854
131972
|
function isPlaywrightHostProcess(pid) {
|
|
131855
131973
|
if (process.platform === "linux") {
|
|
131856
131974
|
try {
|
|
131857
|
-
return
|
|
131975
|
+
return import_node_fs154.default.readFileSync(`/proc/${pid}/environ`, "utf8").split("\0").some((entry) => entry.startsWith("SOOTSIM_PW_URL="));
|
|
131858
131976
|
} catch {
|
|
131859
131977
|
return false;
|
|
131860
131978
|
}
|
|
131861
131979
|
}
|
|
131862
|
-
const plain = (0,
|
|
131980
|
+
const plain = (0, import_node_child_process63.spawnSync)("ps", ["-o", "command=", "-p", String(pid)], {
|
|
131863
131981
|
encoding: "utf8",
|
|
131864
131982
|
stdio: ["ignore", "pipe", "pipe"]
|
|
131865
131983
|
});
|
|
131866
|
-
const withEnv = (0,
|
|
131984
|
+
const withEnv = (0, import_node_child_process63.spawnSync)("ps", ["eww", "-o", "command=", "-p", String(pid)], {
|
|
131867
131985
|
encoding: "utf8",
|
|
131868
131986
|
stdio: ["ignore", "pipe", "pipe"]
|
|
131869
131987
|
});
|
|
@@ -132091,6 +132209,20 @@ async function runOpenCommand(args, opts = {}) {
|
|
|
132091
132209
|
}
|
|
132092
132210
|
}
|
|
132093
132211
|
async function openSim(args, opts) {
|
|
132212
|
+
const binary2 = args.find((arg) => !arg.startsWith("-") && isAppBinaryPath(arg));
|
|
132213
|
+
if (binary2) {
|
|
132214
|
+
try {
|
|
132215
|
+
const { bundlePath, platform: platform2 } = extractAppBinaryBundle(binary2);
|
|
132216
|
+
args = args.map((arg) => arg === binary2 ? bundlePath : arg);
|
|
132217
|
+
if (platform2 === "android" && !args.includes("--device") && !args.includes("-d"))
|
|
132218
|
+
args = [...args, "--device", "pixel-8"];
|
|
132219
|
+
} catch (error) {
|
|
132220
|
+
console.error(
|
|
132221
|
+
` peach open: ${error instanceof Error ? error.message : String(error)}`
|
|
132222
|
+
);
|
|
132223
|
+
peachExit(1);
|
|
132224
|
+
}
|
|
132225
|
+
}
|
|
132094
132226
|
const openArgOptions = {
|
|
132095
132227
|
stripBooleanFlags: [
|
|
132096
132228
|
"--new",
|
|
@@ -133167,18 +133299,18 @@ async function runCloseCommand(args, opts = {}) {
|
|
|
133167
133299
|
bridge.close();
|
|
133168
133300
|
}
|
|
133169
133301
|
}
|
|
133170
|
-
var
|
|
133302
|
+
var import_node_child_process63, import_node_fs154, import_node_http5, import_node_https2, import_node_net, import_node_os26, import_node_path156, import_ws7, DEFAULT_DRIVER_CONNECT_TIMEOUT_MS, DRIVER_CONNECT_INTERVAL_MS, DRIVER_CONNECT_HOST_GRACE_MS, OPEN_BRIDGE_SPAWN_TIMEOUT_MS, OPEN_BRIDGE_RUNTIME_TIMEOUT_MS, OPEN_BRIDGE_HEALTH_TIMEOUT_MS, OPEN_BRIDGE_SILENCE_MS, LIVE_BRIDGE_HANDSHAKE_TIMEOUT_MS;
|
|
133171
133303
|
var init_control = __esm({
|
|
133172
133304
|
"cli/commands/control.ts"() {
|
|
133173
133305
|
"use strict";
|
|
133174
133306
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
133175
|
-
|
|
133176
|
-
|
|
133307
|
+
import_node_child_process63 = require("node:child_process");
|
|
133308
|
+
import_node_fs154 = __toESM(require("node:fs"), 1);
|
|
133177
133309
|
import_node_http5 = __toESM(require("node:http"), 1);
|
|
133178
133310
|
import_node_https2 = __toESM(require("node:https"), 1);
|
|
133179
133311
|
import_node_net = __toESM(require("node:net"), 1);
|
|
133180
133312
|
import_node_os26 = __toESM(require("node:os"), 1);
|
|
133181
|
-
|
|
133313
|
+
import_node_path156 = __toESM(require("node:path"), 1);
|
|
133182
133314
|
init_src();
|
|
133183
133315
|
import_ws7 = require("ws");
|
|
133184
133316
|
init_agent_identity();
|
|
@@ -133208,6 +133340,7 @@ var init_control = __esm({
|
|
|
133208
133340
|
init_app_config();
|
|
133209
133341
|
init_app_project();
|
|
133210
133342
|
init_app_splash();
|
|
133343
|
+
init_binary_sidecar();
|
|
133211
133344
|
init_bridge_diagnostics();
|
|
133212
133345
|
init_current_sim();
|
|
133213
133346
|
init_desktop_companion();
|
|
@@ -133677,10 +133810,14 @@ function renderActivityIdleScript({
|
|
|
133677
133810
|
maxMs,
|
|
133678
133811
|
requiredStillMs,
|
|
133679
133812
|
transitionStartWindowMs,
|
|
133680
|
-
transitionTimeoutMs
|
|
133813
|
+
transitionTimeoutMs,
|
|
133814
|
+
skipIfInspectActive
|
|
133681
133815
|
}) {
|
|
133682
133816
|
return `(async () => {
|
|
133683
133817
|
const start = Date.now()
|
|
133818
|
+
if (${skipIfInspectActive} && globalThis.__sootsimEngineState?.inspectActive === true) {
|
|
133819
|
+
return { settled: true, elapsed: 0, blockedBy: '' }
|
|
133820
|
+
}
|
|
133684
133821
|
const budgetMs = ${Math.max(0, Math.round(maxMs))}
|
|
133685
133822
|
const requiredStillMs = ${Math.max(1, Math.round(requiredStillMs))}
|
|
133686
133823
|
let deadline = start + budgetMs
|
|
@@ -133784,6 +133921,7 @@ async function waitForSootsimIdle({
|
|
|
133784
133921
|
screenStill = false,
|
|
133785
133922
|
maestro = false,
|
|
133786
133923
|
motionOnly = false,
|
|
133924
|
+
skipIfInspectActive = false,
|
|
133787
133925
|
readyPlayback = false,
|
|
133788
133926
|
transitionStartWindowMs = 80,
|
|
133789
133927
|
transitionTimeoutMs = 4e3
|
|
@@ -133799,7 +133937,8 @@ async function waitForSootsimIdle({
|
|
|
133799
133937
|
maxMs,
|
|
133800
133938
|
requiredStillMs: Math.max(1, Math.round(stablePolls)) * Math.max(1, Math.round(pollMs)),
|
|
133801
133939
|
transitionStartWindowMs,
|
|
133802
|
-
transitionTimeoutMs
|
|
133940
|
+
transitionTimeoutMs,
|
|
133941
|
+
skipIfInspectActive
|
|
133803
133942
|
}) : `(async () => {
|
|
133804
133943
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
|
133805
133944
|
// tests inject a virtual clock as globalThis.__sootsimIdleClock ({ now, sleep })
|
|
@@ -135162,16 +135301,16 @@ function readRecentShellAppId(state) {
|
|
|
135162
135301
|
}
|
|
135163
135302
|
function resolveProjectRelativeFlowBase(flowDir) {
|
|
135164
135303
|
if (!flowDir) return process.cwd();
|
|
135165
|
-
return
|
|
135304
|
+
return path140.basename(flowDir) === ".maestro" ? path140.dirname(flowDir) : flowDir;
|
|
135166
135305
|
}
|
|
135167
135306
|
function resolveFlowScreenshotPathWithMode(screenshotDir, name3, opts) {
|
|
135168
135307
|
const normalizedName = name3.endsWith(".png") ? name3 : `${name3}.png`;
|
|
135169
|
-
if (
|
|
135308
|
+
if (path140.isAbsolute(normalizedName)) return normalizedName;
|
|
135170
135309
|
if (opts.mode === "flow" && /[\\/]/.test(normalizedName)) {
|
|
135171
135310
|
const baseDir = normalizedName.startsWith("./") || normalizedName.startsWith("../") ? opts.flowDir ?? process.cwd() : resolveProjectRelativeFlowBase(opts.flowDir);
|
|
135172
|
-
return
|
|
135311
|
+
return path140.resolve(baseDir, normalizedName);
|
|
135173
135312
|
}
|
|
135174
|
-
return
|
|
135313
|
+
return path140.join(screenshotDir, normalizedName);
|
|
135175
135314
|
}
|
|
135176
135315
|
function normalizeFlowScreenshotSpec(step) {
|
|
135177
135316
|
if (typeof step === "string") {
|
|
@@ -135273,13 +135412,13 @@ function normalizeBareStringStep(verb2) {
|
|
|
135273
135412
|
function parseFlowSteps(content) {
|
|
135274
135413
|
return parseFlowFile(content).steps;
|
|
135275
135414
|
}
|
|
135276
|
-
var
|
|
135415
|
+
var fs115, path140, import_frame_identity, DEFAULT_TIMEOUT, ASSERTION_LOOKUP_MS, NON_MUTATING_STEPS, FLOW_TIMEOUT_SCALE, scaledTimeout, MAESTRO_SELECTOR_KEYS, UNSUPPORTED_SELECTOR_KEYS, ACCESSIBILITY_SELECTOR_KEYS, ACCESSIBILITY_TRAIT_FILTERS, MAESTRO_PERMISSION_KINDS, MAESTRO_PERMISSION_STATUS, MAESTRO_LOCATION_STATUS, RANDOM_INPUT_KEYS, pick, CaptureSetupError, SootSimBridgeFlowRunner;
|
|
135277
135416
|
var init_bridge_flow_runner = __esm({
|
|
135278
135417
|
"cli/bridge-flow-runner.ts"() {
|
|
135279
135418
|
"use strict";
|
|
135280
135419
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
135281
|
-
|
|
135282
|
-
|
|
135420
|
+
fs115 = __toESM(require("fs"), 1);
|
|
135421
|
+
path140 = __toESM(require("path"), 1);
|
|
135283
135422
|
init_src2();
|
|
135284
135423
|
import_frame_identity = __toESM(require_frame_identity(), 1);
|
|
135285
135424
|
init_device_catalog();
|
|
@@ -135693,14 +135832,14 @@ var init_bridge_flow_runner = __esm({
|
|
|
135693
135832
|
if (chunks.length === 0) {
|
|
135694
135833
|
throw new Error("recording requested but no video buffer was produced");
|
|
135695
135834
|
}
|
|
135696
|
-
|
|
135835
|
+
fs115.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
|
|
135697
135836
|
const videoMime = stopped.mime || this.opts.recordingFormat || "video/webm";
|
|
135698
135837
|
const extension = videoMime.includes("mp4") ? "mp4" : "webm";
|
|
135699
|
-
const outputPath2 =
|
|
135838
|
+
const outputPath2 = path140.join(
|
|
135700
135839
|
this.opts.recordingOutputDir,
|
|
135701
135840
|
`peach-${Date.now()}.${extension}`
|
|
135702
135841
|
);
|
|
135703
|
-
|
|
135842
|
+
fs115.writeFileSync(outputPath2, Buffer.concat(chunks));
|
|
135704
135843
|
return outputPath2;
|
|
135705
135844
|
}
|
|
135706
135845
|
async waitForRecordingTail(opts) {
|
|
@@ -136000,7 +136139,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
136000
136139
|
}
|
|
136001
136140
|
const direct = await test.activatePressAt(point.x, point.y, ${nodeId})
|
|
136002
136141
|
if (direct?.ok) {
|
|
136003
|
-
|
|
136142
|
+
globalThis.dispatchEvent(
|
|
136004
136143
|
new CustomEvent('sootsim:agentAction', {
|
|
136005
136144
|
detail: { type: 'tap', x: point.x, y: point.y, target: ${JSON.stringify(
|
|
136006
136145
|
replayTarget
|
|
@@ -136017,7 +136156,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
136017
136156
|
if (!test?.activatePressAt) return null
|
|
136018
136157
|
const direct = await test.activatePressAt(${x}, ${y})
|
|
136019
136158
|
if (direct?.ok) {
|
|
136020
|
-
|
|
136159
|
+
globalThis.dispatchEvent(
|
|
136021
136160
|
new CustomEvent('sootsim:agentAction', {
|
|
136022
136161
|
detail: { type: 'tap', x: ${x}, y: ${y} },
|
|
136023
136162
|
}),
|
|
@@ -136416,7 +136555,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
136416
136555
|
flowDir: this.opts.flowDir
|
|
136417
136556
|
}
|
|
136418
136557
|
);
|
|
136419
|
-
|
|
136558
|
+
fs115.mkdirSync(path140.dirname(outputPath2), { recursive: true });
|
|
136420
136559
|
const layers = spec.layers ?? this.opts.screenshotLayers;
|
|
136421
136560
|
const screenshotRequest = {
|
|
136422
136561
|
type: "screenshot",
|
|
@@ -136451,11 +136590,11 @@ var init_bridge_flow_runner = __esm({
|
|
|
136451
136590
|
throw new Error("could not read current device model for framed screenshot");
|
|
136452
136591
|
}
|
|
136453
136592
|
const framed = await composeFramedScreenshot(rawBuffer, model);
|
|
136454
|
-
|
|
136593
|
+
fs115.writeFileSync(outputPath2, framed);
|
|
136455
136594
|
console.log(`[flow] screenshot: ${outputPath2} (frame: ${model})`);
|
|
136456
136595
|
return outputPath2;
|
|
136457
136596
|
}
|
|
136458
|
-
|
|
136597
|
+
fs115.writeFileSync(outputPath2, rawBuffer);
|
|
136459
136598
|
console.log(`[flow] screenshot: ${outputPath2}`);
|
|
136460
136599
|
return outputPath2;
|
|
136461
136600
|
}
|
|
@@ -136494,11 +136633,11 @@ var init_bridge_flow_runner = __esm({
|
|
|
136494
136633
|
// + a11y tree + console errors/warnings + failed network requests +
|
|
136495
136634
|
// shell state, all under one directory so post-mortem is one grep away.
|
|
136496
136635
|
async captureFailureBundle(outputDir, context) {
|
|
136497
|
-
|
|
136636
|
+
fs115.mkdirSync(outputDir, { recursive: true });
|
|
136498
136637
|
const write = (name3, content) => {
|
|
136499
136638
|
try {
|
|
136500
|
-
|
|
136501
|
-
|
|
136639
|
+
fs115.writeFileSync(
|
|
136640
|
+
path140.join(outputDir, name3),
|
|
136502
136641
|
typeof content === "string" ? redactForSharing(content) : content
|
|
136503
136642
|
);
|
|
136504
136643
|
} catch {
|
|
@@ -137213,8 +137352,8 @@ var init_bridge_flow_runner = __esm({
|
|
|
137213
137352
|
runScript(target) {
|
|
137214
137353
|
const spec = typeof target === "string" ? { file: target } : target;
|
|
137215
137354
|
if (!spec.file) throw new Error("runScript requires a file");
|
|
137216
|
-
const scriptPath =
|
|
137217
|
-
const source =
|
|
137355
|
+
const scriptPath = path140.resolve(this.opts.flowDir, spec.file);
|
|
137356
|
+
const source = fs115.readFileSync(scriptPath, "utf8");
|
|
137218
137357
|
this.js.evaluate(source, { env: spec.env });
|
|
137219
137358
|
console.log(`[flow] runScript: ${spec.file} done`);
|
|
137220
137359
|
}
|
|
@@ -137246,10 +137385,10 @@ var init_bridge_flow_runner = __esm({
|
|
|
137246
137385
|
throw new Error("addMedia requires at least one file path");
|
|
137247
137386
|
}
|
|
137248
137387
|
for (const fileSpec of rawFiles) {
|
|
137249
|
-
const filePath =
|
|
137250
|
-
const stat2 =
|
|
137251
|
-
const bytes =
|
|
137252
|
-
const ext =
|
|
137388
|
+
const filePath = path140.resolve(this.opts.flowDir, fileSpec);
|
|
137389
|
+
const stat2 = fs115.statSync(filePath);
|
|
137390
|
+
const bytes = fs115.readFileSync(filePath);
|
|
137391
|
+
const ext = path140.extname(filePath).slice(1).toLowerCase();
|
|
137253
137392
|
const mimeType = ext === "png" ? "image/png" : ext === "webp" ? "image/webp" : ext === "gif" ? "image/gif" : ext === "svg" ? "image/svg+xml" : ext === "avif" ? "image/avif" : ext === "bmp" ? "image/bmp" : ext === "ico" ? "image/x-icon" : "image/jpeg";
|
|
137254
137393
|
const dataUrl = `data:${mimeType};base64,${bytes.toString("base64")}`;
|
|
137255
137394
|
const added = await this.evaluate(
|
|
@@ -137638,14 +137777,14 @@ var init_bridge_flow_runner = __esm({
|
|
|
137638
137777
|
for (const [k, v6] of Object.entries(env)) this.js.putEnv(k, v6);
|
|
137639
137778
|
}
|
|
137640
137779
|
if (file) {
|
|
137641
|
-
const flowPath =
|
|
137642
|
-
const flowContent =
|
|
137780
|
+
const flowPath = path140.resolve(this.opts.flowDir, file);
|
|
137781
|
+
const flowContent = fs115.readFileSync(flowPath, "utf8");
|
|
137643
137782
|
const { frontmatter } = parseFlowFile(flowContent);
|
|
137644
137783
|
if (frontmatter.env && typeof frontmatter.env === "object") {
|
|
137645
137784
|
this.js.defineVariables(frontmatter.env);
|
|
137646
137785
|
}
|
|
137647
137786
|
const previousDir = this.opts.flowDir;
|
|
137648
|
-
this.opts.flowDir =
|
|
137787
|
+
this.opts.flowDir = path140.dirname(flowPath);
|
|
137649
137788
|
try {
|
|
137650
137789
|
await this.runFlow(parseFlowSteps(flowContent));
|
|
137651
137790
|
} finally {
|
|
@@ -137803,8 +137942,8 @@ __export(registry_exports, {
|
|
|
137803
137942
|
});
|
|
137804
137943
|
module.exports = __toCommonJS(registry_exports);
|
|
137805
137944
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
137806
|
-
var
|
|
137807
|
-
var
|
|
137945
|
+
var fs116 = __toESM(require("fs"), 1);
|
|
137946
|
+
var path141 = __toESM(require("path"), 1);
|
|
137808
137947
|
|
|
137809
137948
|
// src/skills/builtin/a11y-review.ts
|
|
137810
137949
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -137824,8 +137963,8 @@ var skill = {
|
|
|
137824
137963
|
},
|
|
137825
137964
|
async execute(params, context) {
|
|
137826
137965
|
const { chromium } = await import("playwright");
|
|
137827
|
-
const
|
|
137828
|
-
const
|
|
137966
|
+
const path142 = await import("path");
|
|
137967
|
+
const fs117 = await import("fs");
|
|
137829
137968
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
137830
137969
|
headless: true
|
|
137831
137970
|
});
|
|
@@ -137882,9 +138021,9 @@ var skill = {
|
|
|
137882
138021
|
warnings: issues.filter((i) => i.severity === "warning").length,
|
|
137883
138022
|
tree: typeof tree3 === "string" ? tree3 : JSON.stringify(tree3)
|
|
137884
138023
|
};
|
|
137885
|
-
const reportPath =
|
|
137886
|
-
|
|
137887
|
-
|
|
138024
|
+
const reportPath = path142.join(context.outputDir, "a11y-report.json");
|
|
138025
|
+
fs117.mkdirSync(path142.dirname(reportPath), { recursive: true });
|
|
138026
|
+
fs117.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
137888
138027
|
return {
|
|
137889
138028
|
success: issues.filter((i) => i.severity === "error").length === 0,
|
|
137890
138029
|
message: `${report.errors} errors, ${report.warnings} warnings across ${report.nodeCount} nodes`,
|
|
@@ -137918,14 +138057,14 @@ var skill2 = {
|
|
|
137918
138057
|
}
|
|
137919
138058
|
},
|
|
137920
138059
|
async execute(params, context) {
|
|
137921
|
-
const
|
|
137922
|
-
const
|
|
138060
|
+
const fs117 = await import("node:fs");
|
|
138061
|
+
const path142 = await import("node:path");
|
|
137923
138062
|
const { COMPAT_RESULT_CAVEAT: COMPAT_RESULT_CAVEAT2, formatPackageStatus: formatPackageStatus2, formatScanCounts: formatScanCounts2, scanDeps: scanDeps2 } = await Promise.resolve().then(() => (init_web(), web_exports));
|
|
137924
|
-
const packagePath =
|
|
137925
|
-
if (!
|
|
138063
|
+
const packagePath = path142.join(context.projectDir, "package.json");
|
|
138064
|
+
if (!fs117.existsSync(packagePath)) {
|
|
137926
138065
|
return { success: false, message: "No package.json found" };
|
|
137927
138066
|
}
|
|
137928
|
-
const parsed = JSON.parse(
|
|
138067
|
+
const parsed = JSON.parse(fs117.readFileSync(packagePath, "utf8"));
|
|
137929
138068
|
if (!parsed || typeof parsed !== "object") {
|
|
137930
138069
|
return { success: false, message: "package.json is not an object" };
|
|
137931
138070
|
}
|
|
@@ -137937,9 +138076,9 @@ var skill2 = {
|
|
|
137937
138076
|
}) : scanDeps2(parsed);
|
|
137938
138077
|
const packageResult = params.packageName ? scan2.packages[0] : void 0;
|
|
137939
138078
|
const message = packageResult ? `${params.packageName}: ${formatPackageStatus2(packageResult)}. ${COMPAT_RESULT_CAVEAT2}` : `${formatScanCounts2(scan2)}. ${COMPAT_RESULT_CAVEAT2}`;
|
|
137940
|
-
const reportPath =
|
|
137941
|
-
|
|
137942
|
-
|
|
138079
|
+
const reportPath = path142.join(context.outputDir, "compat-report.json");
|
|
138080
|
+
fs117.mkdirSync(path142.dirname(reportPath), { recursive: true });
|
|
138081
|
+
fs117.writeFileSync(reportPath, `${JSON.stringify(scan2, null, 2)}
|
|
137943
138082
|
`);
|
|
137944
138083
|
return {
|
|
137945
138084
|
success: true,
|
|
@@ -137982,8 +138121,8 @@ var skill3 = {
|
|
|
137982
138121
|
record: { type: "boolean", description: "Record video of the flow" }
|
|
137983
138122
|
},
|
|
137984
138123
|
async execute(params, context) {
|
|
137985
|
-
const
|
|
137986
|
-
const
|
|
138124
|
+
const fs117 = await import("fs");
|
|
138125
|
+
const path142 = await import("path");
|
|
137987
138126
|
const { parseFlowFile: parseFlowFile2 } = await Promise.resolve().then(() => (init_flow_file(), flow_file_exports));
|
|
137988
138127
|
const { DEFAULT_SOOTSIM_BRIDGE_PORT: DEFAULT_SOOTSIM_BRIDGE_PORT2 } = await Promise.resolve().then(() => (init_bridge_constants(), bridge_constants_exports));
|
|
137989
138128
|
const { SootSimBridgeHost: SootSimBridgeHost2 } = await Promise.resolve().then(() => (init_bridge_host(), bridge_host_exports));
|
|
@@ -137993,7 +138132,7 @@ var skill3 = {
|
|
|
137993
138132
|
const host2 = new SootSimBridgeHost2({ port: DEFAULT_SOOTSIM_BRIDGE_PORT2 });
|
|
137994
138133
|
host2.start({ silent: true });
|
|
137995
138134
|
try {
|
|
137996
|
-
const flowContent =
|
|
138135
|
+
const flowContent = fs117.readFileSync(params.flowPath, "utf8");
|
|
137997
138136
|
const { steps } = parseFlowFile2(flowContent);
|
|
137998
138137
|
const beforeIds = new Set(host2.listSims().map((sim) => sim.id));
|
|
137999
138138
|
await runOpenCommand2([context.url, "--new", "--headless", "--no-describe"], {
|
|
@@ -138018,7 +138157,7 @@ var skill3 = {
|
|
|
138018
138157
|
});
|
|
138019
138158
|
const driver = new SootSimBridgeFlowRunner2(bridge, {
|
|
138020
138159
|
screenshotDir: context.outputDir,
|
|
138021
|
-
flowDir:
|
|
138160
|
+
flowDir: path142.dirname(path142.resolve(params.flowPath)),
|
|
138022
138161
|
simId,
|
|
138023
138162
|
recordingOutputDir: params.record ? context.outputDir : void 0
|
|
138024
138163
|
});
|
|
@@ -138040,7 +138179,7 @@ var skill3 = {
|
|
|
138040
138179
|
simId,
|
|
138041
138180
|
videoPath: videoPath || void 0
|
|
138042
138181
|
},
|
|
138043
|
-
artifacts: videoPath ? [{ type: "video", name:
|
|
138182
|
+
artifacts: videoPath ? [{ type: "video", name: path142.basename(videoPath), path: videoPath }] : void 0
|
|
138044
138183
|
};
|
|
138045
138184
|
} finally {
|
|
138046
138185
|
try {
|
|
@@ -138088,8 +138227,8 @@ var skill4 = {
|
|
|
138088
138227
|
},
|
|
138089
138228
|
async execute(params, context) {
|
|
138090
138229
|
const { chromium } = await import("playwright");
|
|
138091
|
-
const
|
|
138092
|
-
const
|
|
138230
|
+
const path142 = await import("path");
|
|
138231
|
+
const fs117 = await import("fs");
|
|
138093
138232
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
138094
138233
|
headless: true
|
|
138095
138234
|
});
|
|
@@ -138117,9 +138256,9 @@ var skill4 = {
|
|
|
138117
138256
|
...profile,
|
|
138118
138257
|
fps: syncCount > 0 ? (syncCount / (duration / 1e3)).toFixed(1) : "0"
|
|
138119
138258
|
};
|
|
138120
|
-
const reportPath =
|
|
138121
|
-
|
|
138122
|
-
|
|
138259
|
+
const reportPath = path142.join(context.outputDir, "perf-report.json");
|
|
138260
|
+
fs117.mkdirSync(path142.dirname(reportPath), { recursive: true });
|
|
138261
|
+
fs117.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
138123
138262
|
return {
|
|
138124
138263
|
success: true,
|
|
138125
138264
|
message: `${report.fps} fps, ${profile.avgSyncMs?.toFixed(1)}ms avg sync, ${nodeCount} nodes`,
|
|
@@ -138153,8 +138292,8 @@ var skill5 = {
|
|
|
138153
138292
|
},
|
|
138154
138293
|
async execute(params, context) {
|
|
138155
138294
|
const { chromium } = await import("playwright");
|
|
138156
|
-
const
|
|
138157
|
-
const
|
|
138295
|
+
const path142 = await import("path");
|
|
138296
|
+
const fs117 = await import("fs");
|
|
138158
138297
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
138159
138298
|
headless: true
|
|
138160
138299
|
});
|
|
@@ -138162,8 +138301,8 @@ var skill5 = {
|
|
|
138162
138301
|
try {
|
|
138163
138302
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
138164
138303
|
await page.waitForTimeout(2e3);
|
|
138165
|
-
const outputPath2 =
|
|
138166
|
-
|
|
138304
|
+
const outputPath2 = path142.join(context.outputDir, `${params.name}.png`);
|
|
138305
|
+
fs117.mkdirSync(path142.dirname(outputPath2), { recursive: true });
|
|
138167
138306
|
await page.screenshot({ path: outputPath2 });
|
|
138168
138307
|
return {
|
|
138169
138308
|
success: true,
|
|
@@ -138205,8 +138344,8 @@ var skill6 = {
|
|
|
138205
138344
|
},
|
|
138206
138345
|
async execute(params, context) {
|
|
138207
138346
|
const { chromium } = await import("playwright");
|
|
138208
|
-
const
|
|
138209
|
-
const
|
|
138347
|
+
const path142 = await import("path");
|
|
138348
|
+
const fs117 = await import("fs");
|
|
138210
138349
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
138211
138350
|
headless: true
|
|
138212
138351
|
});
|
|
@@ -138214,14 +138353,14 @@ var skill6 = {
|
|
|
138214
138353
|
try {
|
|
138215
138354
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
138216
138355
|
await page.waitForTimeout(2e3);
|
|
138217
|
-
const currentPath =
|
|
138218
|
-
|
|
138356
|
+
const currentPath = path142.join(context.outputDir, `${params.name}-current.png`);
|
|
138357
|
+
fs117.mkdirSync(path142.dirname(currentPath), { recursive: true });
|
|
138219
138358
|
await page.screenshot({ path: currentPath });
|
|
138220
138359
|
try {
|
|
138221
138360
|
const { PNG } = await import("pngjs");
|
|
138222
138361
|
const pixelmatch = (await import("pixelmatch")).default;
|
|
138223
|
-
const baseline = PNG.sync.read(
|
|
138224
|
-
const current2 = PNG.sync.read(
|
|
138362
|
+
const baseline = PNG.sync.read(fs117.readFileSync(params.baseline));
|
|
138363
|
+
const current2 = PNG.sync.read(fs117.readFileSync(currentPath));
|
|
138225
138364
|
const { width, height } = baseline;
|
|
138226
138365
|
const diff = new PNG({ width, height });
|
|
138227
138366
|
const numDiffPixels = pixelmatch(
|
|
@@ -138232,8 +138371,8 @@ var skill6 = {
|
|
|
138232
138371
|
height,
|
|
138233
138372
|
{ threshold: params.threshold || 0.1 }
|
|
138234
138373
|
);
|
|
138235
|
-
const diffPath =
|
|
138236
|
-
|
|
138374
|
+
const diffPath = path142.join(context.outputDir, `${params.name}-diff.png`);
|
|
138375
|
+
fs117.writeFileSync(diffPath, PNG.sync.write(diff));
|
|
138237
138376
|
const totalPixels = width * height;
|
|
138238
138377
|
const diffPercent = (numDiffPixels / totalPixels * 100).toFixed(2);
|
|
138239
138378
|
return {
|
|
@@ -138297,10 +138436,10 @@ var skillRegistry = {
|
|
|
138297
138436
|
},
|
|
138298
138437
|
// load skills from a project manifest (rnx-skills.json)
|
|
138299
138438
|
async loadFromManifest(projectDir) {
|
|
138300
|
-
const manifestPath =
|
|
138301
|
-
if (!
|
|
138439
|
+
const manifestPath = path141.join(projectDir, "rnx-skills.json");
|
|
138440
|
+
if (!fs116.existsSync(manifestPath)) return;
|
|
138302
138441
|
try {
|
|
138303
|
-
const manifest = JSON.parse(
|
|
138442
|
+
const manifest = JSON.parse(fs116.readFileSync(manifestPath, "utf8"));
|
|
138304
138443
|
if (Array.isArray(manifest.skills)) {
|
|
138305
138444
|
for (const entry of manifest.skills) {
|
|
138306
138445
|
if (typeof entry === "string") {
|
|
@@ -138311,7 +138450,7 @@ var skillRegistry = {
|
|
|
138311
138450
|
}
|
|
138312
138451
|
} else if (entry.file) {
|
|
138313
138452
|
try {
|
|
138314
|
-
const mod = await import(
|
|
138453
|
+
const mod = await import(path141.resolve(projectDir, entry.file));
|
|
138315
138454
|
if (mod.skill) this.register(mod.skill);
|
|
138316
138455
|
} catch {
|
|
138317
138456
|
}
|
|
@@ -138324,10 +138463,10 @@ var skillRegistry = {
|
|
|
138324
138463
|
// auto-discover skills based on project dependencies
|
|
138325
138464
|
suggestSkills(projectDir) {
|
|
138326
138465
|
const suggestions = [];
|
|
138327
|
-
const pkgPath =
|
|
138328
|
-
if (!
|
|
138466
|
+
const pkgPath = path141.join(projectDir, "package.json");
|
|
138467
|
+
if (!fs116.existsSync(pkgPath)) return suggestions;
|
|
138329
138468
|
try {
|
|
138330
|
-
const pkg = JSON.parse(
|
|
138469
|
+
const pkg = JSON.parse(fs116.readFileSync(pkgPath, "utf8"));
|
|
138331
138470
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
138332
138471
|
if (deps["detox"] || deps["maestro"]) {
|
|
138333
138472
|
suggestions.push("maestro-test");
|