peachsim 0.1.2243 → 0.1.2246
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 +9 -8
- 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 +10 -1
- 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 +72 -17
- 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 +11 -4
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +71 -16
- 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 +92 -18
- package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +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 +13 -6
- 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 +3 -3
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- 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 +11 -23
- package/dist-lib/sdk.mjs +11 -21
- package/dist-lib/skills.cjs +946 -750
- package/dist-lib/swift-compile.cjs +65 -10
- package/dist-lib/swift-compile.mjs +65 -10
- 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 +70 -15
- package/dist-lib/vite.cjs +3 -3
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +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/node.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +8 -1
- package/dist-types/packages/peach-engine/src/render-worker/image-pixel-contract.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/render-worker/resilient-frame-clock.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-guest-image-ledger.ts +74 -7
- package/src/swift-guest-link.ts +3 -1
- 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.2246 | (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);
|
|
@@ -49389,6 +49389,7 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
49389
49389
|
const types = [];
|
|
49390
49390
|
const functionTypes = [];
|
|
49391
49391
|
const definitions = [];
|
|
49392
|
+
const functionImports = /* @__PURE__ */ new Map();
|
|
49392
49393
|
let usesDlsym = false;
|
|
49393
49394
|
let usesDlerror = false;
|
|
49394
49395
|
const usedSymbols = /* @__PURE__ */ new Set();
|
|
@@ -49458,6 +49459,11 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
49458
49459
|
const isDlsym = instrumentDynamicLookups && module2 === "env" && name3 === "dlsym" && kind === 0;
|
|
49459
49460
|
const isDlerror = instrumentDynamicLookups && module2 === "env" && name3 === "dlerror" && kind === 0;
|
|
49460
49461
|
if (module2 === "env" && names.has(name3)) usedSymbols.add(name3);
|
|
49462
|
+
if (module2 === "env" && kind === 0 && names.has(name3)) {
|
|
49463
|
+
const type = types[functionType2];
|
|
49464
|
+
if (!type) throw new Error(`missing import type for ${name3}`);
|
|
49465
|
+
functionImports.set(name3, type);
|
|
49466
|
+
}
|
|
49461
49467
|
if (isDlsym || isDlerror) {
|
|
49462
49468
|
const type = types[functionType2];
|
|
49463
49469
|
const expected = isDlsym ? "126,126:126" : ":126";
|
|
@@ -49607,6 +49613,7 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
49607
49613
|
return {
|
|
49608
49614
|
bytes: Buffer.concat(sections2),
|
|
49609
49615
|
definitions,
|
|
49616
|
+
functionImports,
|
|
49610
49617
|
usesDlsym,
|
|
49611
49618
|
usedSymbols: [...usedSymbols]
|
|
49612
49619
|
};
|
|
@@ -49654,7 +49661,13 @@ function createGuestImageLedger(input) {
|
|
|
49654
49661
|
/* @__PURE__ */ new Set()
|
|
49655
49662
|
);
|
|
49656
49663
|
if (rewritten.usesDlsym) callersUsingDlsym.add(image.id);
|
|
49657
|
-
units.push({
|
|
49664
|
+
units.push({
|
|
49665
|
+
image: image.id,
|
|
49666
|
+
object: object6,
|
|
49667
|
+
aliases,
|
|
49668
|
+
usedSymbols: rewritten.usedSymbols,
|
|
49669
|
+
functionImports: rewritten.functionImports
|
|
49670
|
+
});
|
|
49658
49671
|
for (const symbol2 of rewritten.definitions) {
|
|
49659
49672
|
if (symbol2.type && symbol2.type.results.length > 1)
|
|
49660
49673
|
throw new Error(`multiple results for ${symbol2.name}`);
|
|
@@ -49739,9 +49752,33 @@ function createGuestImageLedger(input) {
|
|
|
49739
49752
|
bindings.set(binding.symbol, matches[0].alias);
|
|
49740
49753
|
startup.set(binding.object, bindings);
|
|
49741
49754
|
}
|
|
49742
|
-
const
|
|
49755
|
+
const resultWrappers = /* @__PURE__ */ new Map();
|
|
49756
|
+
const definitionsByAlias = /* @__PURE__ */ new Map();
|
|
49757
|
+
for (const definition2 of definitions) {
|
|
49758
|
+
const previous = definitionsByAlias.get(definition2.alias);
|
|
49759
|
+
if (!previous || previous.weak && !definition2.weak)
|
|
49760
|
+
definitionsByAlias.set(definition2.alias, definition2);
|
|
49761
|
+
}
|
|
49762
|
+
const objects = units.map(({ image, object: object6, aliases, functionImports }) => {
|
|
49743
49763
|
const bindings = new Map(bindingsByImage.get(image));
|
|
49744
49764
|
for (const [name3, alias] of startup.get(object6.path) ?? []) bindings.set(name3, alias);
|
|
49765
|
+
for (const [name3, type] of functionImports) {
|
|
49766
|
+
const alias = bindings.get(name3);
|
|
49767
|
+
const provider = alias === void 0 ? void 0 : definitionsByAlias.get(alias);
|
|
49768
|
+
if (!provider || provider.kind !== "function" || provider.result !== "i32" || type.results.length !== 1 || type.results[0] !== 126 || type.parameters.map(llvmType).join(",") !== provider.parameters.join(","))
|
|
49769
|
+
continue;
|
|
49770
|
+
const key2 = `${image}:${provider.alias}`;
|
|
49771
|
+
let wrapper = resultWrappers.get(key2);
|
|
49772
|
+
if (!wrapper) {
|
|
49773
|
+
wrapper = {
|
|
49774
|
+
symbol: `__peach_integer_result_${image}_${resultWrappers.size}`,
|
|
49775
|
+
image,
|
|
49776
|
+
provider
|
|
49777
|
+
};
|
|
49778
|
+
resultWrappers.set(key2, wrapper);
|
|
49779
|
+
}
|
|
49780
|
+
bindings.set(name3, wrapper.symbol);
|
|
49781
|
+
}
|
|
49745
49782
|
return {
|
|
49746
49783
|
path: object6.path,
|
|
49747
49784
|
instrumentDynamicLookups: object6.instrumentDynamicLookups,
|
|
@@ -49775,13 +49812,26 @@ function createGuestImageLedger(input) {
|
|
|
49775
49812
|
'target triple = "wasm64-unknown-wasip1"',
|
|
49776
49813
|
`@.names = private constant [${nameSize} x i8] c"${nameContents}"`
|
|
49777
49814
|
];
|
|
49778
|
-
|
|
49815
|
+
const declarations = new Map(exported2);
|
|
49816
|
+
for (const { provider } of resultWrappers.values())
|
|
49817
|
+
declarations.set(provider.alias, provider);
|
|
49818
|
+
for (const definition2 of declarations.values()) {
|
|
49779
49819
|
if (definition2.kind === "function")
|
|
49780
49820
|
ir.push(
|
|
49781
49821
|
`declare ${definition2.result} @${definition2.alias}(${definition2.parameters.join(", ")})`
|
|
49782
49822
|
);
|
|
49783
49823
|
else ir.push(`@${definition2.alias} = external global i8`);
|
|
49784
49824
|
}
|
|
49825
|
+
for (const { symbol: symbol2, provider } of resultWrappers.values()) {
|
|
49826
|
+
const parameters = provider.parameters.map((type, index) => `${type} %arg${index}`);
|
|
49827
|
+
ir.push(
|
|
49828
|
+
`define i64 @${symbol2}(${parameters.join(", ")}) {`,
|
|
49829
|
+
` %word = call i32 @${provider.alias}(${parameters.join(", ")})`,
|
|
49830
|
+
" %result = zext i32 %word to i64",
|
|
49831
|
+
" ret i64 %result",
|
|
49832
|
+
"}"
|
|
49833
|
+
);
|
|
49834
|
+
}
|
|
49785
49835
|
ir.push(`@__peach_dyld_symbols = constant [${exported2.size} x { ptr, i32, ptr }] [`);
|
|
49786
49836
|
ir.push(
|
|
49787
49837
|
[...exported2.values()].map(
|
|
@@ -49820,10 +49870,13 @@ function createGuestImageLedger(input) {
|
|
|
49820
49870
|
callers: input.callers,
|
|
49821
49871
|
definitions,
|
|
49822
49872
|
objects,
|
|
49823
|
-
callerWrappers: [
|
|
49824
|
-
|
|
49825
|
-
|
|
49826
|
-
|
|
49873
|
+
callerWrappers: [
|
|
49874
|
+
...[...callersUsingDlsym].map((image) => ({
|
|
49875
|
+
symbol: `__peach_dlsym_caller_${image}`,
|
|
49876
|
+
image
|
|
49877
|
+
})),
|
|
49878
|
+
...[...resultWrappers.values()].map(({ symbol: symbol2, image }) => ({ symbol: symbol2, image }))
|
|
49879
|
+
],
|
|
49827
49880
|
llvmIR: ir.join("\n") + "\n"
|
|
49828
49881
|
};
|
|
49829
49882
|
}
|
|
@@ -51698,7 +51751,9 @@ function linkGuestImages(options) {
|
|
|
51698
51751
|
return { selected: selected2, ledger: ledger2 };
|
|
51699
51752
|
};
|
|
51700
51753
|
let prepared = prepare2(false);
|
|
51701
|
-
const provider = prepared.ledger.callerWrappers.
|
|
51754
|
+
const provider = prepared.ledger.callerWrappers.some(
|
|
51755
|
+
({ symbol: symbol2 }) => symbol2.startsWith("__peach_dlsym_caller_")
|
|
51756
|
+
);
|
|
51702
51757
|
if (provider) prepared = prepare2(true);
|
|
51703
51758
|
const { selected, ledger } = prepared;
|
|
51704
51759
|
const replacements = /* @__PURE__ */ new Map();
|
|
@@ -59362,7 +59417,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
59362
59417
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
59363
59418
|
MULTI_MANIFEST_VERSION = 68;
|
|
59364
59419
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
59365
|
-
compilerSourceDigest = true ? "
|
|
59420
|
+
compilerSourceDigest = true ? "cd22143ba7a25fbe9f28d0187e37d40819453c2914c0808fbb77c738ef7e105d" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
59366
59421
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
59367
59422
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
59368
59423
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -65844,7 +65899,7 @@ var init_swift_standin_digest = __esm({
|
|
|
65844
65899
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
65845
65900
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
65846
65901
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
65847
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
65902
|
+
STANDIN_SOURCE_DIGEST = true ? "ce843ce67154212aa53c70a7c36567dc28c70b6d5f1a3222fe7527693c0eabf8" : standinSourceDigest();
|
|
65848
65903
|
}
|
|
65849
65904
|
});
|
|
65850
65905
|
|
|
@@ -66276,9 +66331,9 @@ async function packageTreeDigest(root) {
|
|
|
66276
66331
|
(a, b) => a.name.localeCompare(b.name)
|
|
66277
66332
|
)) {
|
|
66278
66333
|
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(
|
|
66334
|
+
const path142 = `${relative6}${entry.name}`;
|
|
66335
|
+
if (entry.isDirectory()) walk3((0, import_node_path66.join)(directory2, entry.name), `${path142}/`);
|
|
66336
|
+
else if (entry.isFile()) files2.push(path142);
|
|
66282
66337
|
}
|
|
66283
66338
|
};
|
|
66284
66339
|
walk3(root, "");
|
|
@@ -66305,7 +66360,7 @@ var init_package_tree_digest = __esm({
|
|
|
66305
66360
|
|
|
66306
66361
|
// src/expo-native-prebuilt.ts
|
|
66307
66362
|
function expoNativeCompilerDigestValue() {
|
|
66308
|
-
return true ? "
|
|
66363
|
+
return true ? "21a0f833c352239e91173327f31255a272988ee1af2cf4754932134df568d55e" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
66309
66364
|
}
|
|
66310
66365
|
function readSources(value) {
|
|
66311
66366
|
const sources = isRecord(value) ? value.sources : null;
|
|
@@ -67668,7 +67723,7 @@ function resolveSwiftPackages(options) {
|
|
|
67668
67723
|
headers.set(name3, import_node_path71.default.relative(binary2.dir, dir));
|
|
67669
67724
|
};
|
|
67670
67725
|
visit3(pkg, binary2.target);
|
|
67671
|
-
binary2.headerDependencies = [...headers].map(([module2,
|
|
67726
|
+
binary2.headerDependencies = [...headers].map(([module2, path142]) => ({ module: module2, path: path142 }));
|
|
67672
67727
|
}
|
|
67673
67728
|
for (const owner of options.owners ?? []) {
|
|
67674
67729
|
const found = productClosure(owner.products);
|
|
@@ -68404,8 +68459,8 @@ function withBuiltinStandinBehavior(behavior) {
|
|
|
68404
68459
|
for (const [module2, members2] of Object.entries(BUILTIN_STANDIN_BEHAVIOR))
|
|
68405
68460
|
merged[module2] = {
|
|
68406
68461
|
...Object.fromEntries(
|
|
68407
|
-
Object.entries(members2).map(([
|
|
68408
|
-
|
|
68462
|
+
Object.entries(members2).map(([path142, entry]) => [
|
|
68463
|
+
path142,
|
|
68409
68464
|
{ ...entry, builtin: true }
|
|
68410
68465
|
])
|
|
68411
68466
|
),
|
|
@@ -73115,8 +73170,8 @@ function imagesetFiles(images) {
|
|
|
73115
73170
|
];
|
|
73116
73171
|
}).sort((a, b) => a.scale - b.scale);
|
|
73117
73172
|
}
|
|
73118
|
-
function flatScale(
|
|
73119
|
-
const match = /@([23])x\.[^./]+$/.exec(
|
|
73173
|
+
function flatScale(path142) {
|
|
73174
|
+
const match = /@([23])x\.[^./]+$/.exec(path142);
|
|
73120
73175
|
return match ? Number(match[1]) : 1;
|
|
73121
73176
|
}
|
|
73122
73177
|
function providesNamespace(text6) {
|
|
@@ -73143,8 +73198,8 @@ function catalogEntryName(contentsPath, kind, readText2) {
|
|
|
73143
73198
|
}
|
|
73144
73199
|
return segments.join("/");
|
|
73145
73200
|
}
|
|
73146
|
-
function isFlatResourceImage(
|
|
73147
|
-
return
|
|
73201
|
+
function isFlatResourceImage(path142) {
|
|
73202
|
+
return path142.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path142));
|
|
73148
73203
|
}
|
|
73149
73204
|
function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
73150
73205
|
const table = [];
|
|
@@ -73157,7 +73212,7 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
|
73157
73212
|
seen.set(bundlePath, names);
|
|
73158
73213
|
return { bundlePath, names };
|
|
73159
73214
|
};
|
|
73160
|
-
const catalogs = paths.filter((
|
|
73215
|
+
const catalogs = paths.filter((path142) => baseOf(path142) === "Contents.json");
|
|
73161
73216
|
for (const contentsPath of catalogs) {
|
|
73162
73217
|
const name3 = catalogEntryName(contentsPath, ".imageset", readText2);
|
|
73163
73218
|
if (name3 === null) continue;
|
|
@@ -73189,13 +73244,13 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
|
73189
73244
|
...intent === "template" || intent === "original" ? { renderingMode: intent } : {}
|
|
73190
73245
|
});
|
|
73191
73246
|
}
|
|
73192
|
-
for (const
|
|
73193
|
-
if (!isFlatResourceImage(
|
|
73194
|
-
const name3 = baseOf(
|
|
73195
|
-
const { bundlePath, names } = namesFor(
|
|
73247
|
+
for (const path142 of paths) {
|
|
73248
|
+
if (!isFlatResourceImage(path142)) continue;
|
|
73249
|
+
const name3 = baseOf(path142).slice(0, -extOf(path142).length);
|
|
73250
|
+
const { bundlePath, names } = namesFor(path142);
|
|
73196
73251
|
if (name3 === "" || names.has(name3)) continue;
|
|
73197
73252
|
names.add(name3);
|
|
73198
|
-
table.push({ name: name3, file:
|
|
73253
|
+
table.push({ name: name3, file: path142, scale: flatScale(path142), bundlePath });
|
|
73199
73254
|
}
|
|
73200
73255
|
return table;
|
|
73201
73256
|
}
|
|
@@ -73230,7 +73285,7 @@ function colorsetValue(color2) {
|
|
|
73230
73285
|
}
|
|
73231
73286
|
function enumerateBundleColors(paths, readText2) {
|
|
73232
73287
|
const table = {};
|
|
73233
|
-
for (const contentsPath of paths.filter((
|
|
73288
|
+
for (const contentsPath of paths.filter((path142) => baseOf(path142) === "Contents.json")) {
|
|
73234
73289
|
const name3 = catalogEntryName(contentsPath, ".colorset", readText2);
|
|
73235
73290
|
if (name3 === null || name3 in table) continue;
|
|
73236
73291
|
let colors;
|
|
@@ -73294,8 +73349,8 @@ function axisExtremes(points) {
|
|
|
73294
73349
|
function pathBounds(d) {
|
|
73295
73350
|
const xs = [];
|
|
73296
73351
|
const ys = [];
|
|
73297
|
-
for (const
|
|
73298
|
-
(0, import_svgpath.default)(
|
|
73352
|
+
for (const path142 of d)
|
|
73353
|
+
(0, import_svgpath.default)(path142).abs().unshort().unarc().iterate((segment, _index, x, y) => {
|
|
73299
73354
|
const [command, ...args] = segment;
|
|
73300
73355
|
if (command === "M" || command === "L") {
|
|
73301
73356
|
xs.push(Number(args[0]));
|
|
@@ -73322,7 +73377,7 @@ function guide(svg, id, axis) {
|
|
|
73322
73377
|
}
|
|
73323
73378
|
function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
73324
73379
|
const table = {};
|
|
73325
|
-
for (const contentsPath of paths.filter((
|
|
73380
|
+
for (const contentsPath of paths.filter((path142) => baseOf(path142) === "Contents.json")) {
|
|
73326
73381
|
const name3 = catalogEntryName(contentsPath, ".symbolset", readText2);
|
|
73327
73382
|
if (name3 === null) continue;
|
|
73328
73383
|
const bundle = bundleForFile(contentsPath);
|
|
@@ -73381,8 +73436,8 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
|
73381
73436
|
advance,
|
|
73382
73437
|
box: [12 - wide2 / 2, 12 - tall / 2, wide2, tall],
|
|
73383
73438
|
...customLayout ? { customLayout } : {},
|
|
73384
|
-
layers: d.map((
|
|
73385
|
-
d: (0, import_svgpath.default)(
|
|
73439
|
+
layers: d.map((path142) => ({
|
|
73440
|
+
d: (0, import_svgpath.default)(path142).abs().scale(em).translate(translateX, translateY).round(3).toString()
|
|
73386
73441
|
}))
|
|
73387
73442
|
};
|
|
73388
73443
|
table[vectorKey] = vector;
|
|
@@ -73393,18 +73448,18 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
|
73393
73448
|
}
|
|
73394
73449
|
return table;
|
|
73395
73450
|
}
|
|
73396
|
-
function isCopiedResource(
|
|
73397
|
-
if (copiedBundle ||
|
|
73451
|
+
function isCopiedResource(path142, copiedBundle) {
|
|
73452
|
+
if (copiedBundle || path142.split("/").some((segment) => /\.(atlasc|bundle|storyboardc|nib)$/.test(segment)))
|
|
73398
73453
|
return true;
|
|
73399
|
-
const ext = extOf(
|
|
73454
|
+
const ext = extOf(path142);
|
|
73400
73455
|
if (ext === ".json" || ext === ".xcstrings") return true;
|
|
73401
|
-
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !
|
|
73456
|
+
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !path142.split("/").some((segment) => segment.endsWith(".xcassets"));
|
|
73402
73457
|
}
|
|
73403
73458
|
function enumerateBundleResources(paths, copiedBundle = false) {
|
|
73404
73459
|
const found = [];
|
|
73405
73460
|
const seen = /* @__PURE__ */ new Set();
|
|
73406
73461
|
const ordered = [...paths].filter(
|
|
73407
|
-
(
|
|
73462
|
+
(path142) => path142.split("/").includes("Resources") && path142.split("/").every((segment) => segment !== "" && segment !== "..") && isCopiedResource(path142, copiedBundle)
|
|
73408
73463
|
).sort((a, b) => {
|
|
73409
73464
|
const aDepth = a.split("/").length;
|
|
73410
73465
|
const bDepth = b.split("/").length;
|
|
@@ -73567,31 +73622,31 @@ function tokens(text6) {
|
|
|
73567
73622
|
}
|
|
73568
73623
|
return result;
|
|
73569
73624
|
}
|
|
73570
|
-
function qualified(language, key2,
|
|
73571
|
-
return `(${language}: ${key2}${
|
|
73625
|
+
function qualified(language, key2, path142) {
|
|
73626
|
+
return `(${language}: ${key2}${path142 === "" ? "" : "|==|" + path142})`;
|
|
73572
73627
|
}
|
|
73573
|
-
function requiresNumber(language, key2,
|
|
73628
|
+
function requiresNumber(language, key2, path142) {
|
|
73574
73629
|
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,
|
|
73630
|
+
"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
73631
|
);
|
|
73577
73632
|
}
|
|
73578
|
-
function moreThanOne(language, key2,
|
|
73633
|
+
function moreThanOne(language, key2, path142) {
|
|
73579
73634
|
return Error(
|
|
73580
|
-
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2,
|
|
73635
|
+
"Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path142)
|
|
73581
73636
|
);
|
|
73582
73637
|
}
|
|
73583
73638
|
function schemaPath(segments) {
|
|
73584
73639
|
return segments.map((segment) => `'${segment}'`).join(" -> ");
|
|
73585
73640
|
}
|
|
73586
|
-
function checkUnitShape(node,
|
|
73641
|
+
function checkUnitShape(node, path142) {
|
|
73587
73642
|
const raw2 = node.stringUnit;
|
|
73588
73643
|
if (raw2 === void 0)
|
|
73589
|
-
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(
|
|
73644
|
+
throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path142)}`);
|
|
73590
73645
|
if (raw2 === null)
|
|
73591
|
-
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(
|
|
73646
|
+
throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path142)}`);
|
|
73592
73647
|
if (!isRecord3(raw2))
|
|
73593
|
-
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(
|
|
73594
|
-
const unitPath = [...
|
|
73648
|
+
throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path142)}`);
|
|
73649
|
+
const unitPath = [...path142, "stringUnit"];
|
|
73595
73650
|
if (!Object.hasOwn(raw2, "state"))
|
|
73596
73651
|
throw Error(`Missing required key 'state' inside ${schemaPath(unitPath)}`);
|
|
73597
73652
|
const state = raw2.state;
|
|
@@ -73608,38 +73663,38 @@ function checkUnitShape(node, path141) {
|
|
|
73608
73663
|
throw Error(`Expected string for key 'value' inside ${schemaPath(unitPath)}`);
|
|
73609
73664
|
return value;
|
|
73610
73665
|
}
|
|
73611
|
-
function checkPluralShape(node,
|
|
73666
|
+
function checkPluralShape(node, path142) {
|
|
73612
73667
|
for (const [category, raw2] of Object.entries(node)) {
|
|
73613
|
-
const categoryPath = [...
|
|
73668
|
+
const categoryPath = [...path142, category];
|
|
73614
73669
|
if (raw2 === null)
|
|
73615
73670
|
throw Error(
|
|
73616
|
-
`Missing required value for key '${category}' inside ${schemaPath(
|
|
73671
|
+
`Missing required value for key '${category}' inside ${schemaPath(path142)}`
|
|
73617
73672
|
);
|
|
73618
73673
|
if (!isRecord3(raw2))
|
|
73619
|
-
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(
|
|
73674
|
+
throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path142)}`);
|
|
73620
73675
|
checkUnitShape(raw2, categoryPath);
|
|
73621
73676
|
}
|
|
73622
73677
|
}
|
|
73623
|
-
function checkLocalizationShape(node,
|
|
73678
|
+
function checkLocalizationShape(node, path142, deviceValue = false) {
|
|
73624
73679
|
if (node === null)
|
|
73625
73680
|
throw Error(
|
|
73626
|
-
`Missing required value for key '${
|
|
73681
|
+
`Missing required value for key '${path142[path142.length - 1]}' inside ${schemaPath(path142.slice(0, -1))}`
|
|
73627
73682
|
);
|
|
73628
73683
|
if (!isRecord3(node))
|
|
73629
73684
|
throw Error(
|
|
73630
|
-
`Expected dictionary for key '${
|
|
73685
|
+
`Expected dictionary for key '${path142[path142.length - 1]}' inside ${schemaPath(path142.slice(0, -1))}`
|
|
73631
73686
|
);
|
|
73632
|
-
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations,
|
|
73687
|
+
if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path142);
|
|
73633
73688
|
if (!deviceValue && Object.hasOwn(node, "substitutions"))
|
|
73634
|
-
checkSubstitutionsShape(node.substitutions,
|
|
73635
|
-
if (!Object.hasOwn(node, "variations")) checkUnitShape(node,
|
|
73689
|
+
checkSubstitutionsShape(node.substitutions, path142);
|
|
73690
|
+
if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path142);
|
|
73636
73691
|
}
|
|
73637
|
-
function checkVariationsShape(variations,
|
|
73692
|
+
function checkVariationsShape(variations, path142) {
|
|
73638
73693
|
if (variations === null)
|
|
73639
|
-
throw Error(`Missing required value for key 'variations' inside ${schemaPath(
|
|
73694
|
+
throw Error(`Missing required value for key 'variations' inside ${schemaPath(path142)}`);
|
|
73640
73695
|
if (!isRecord3(variations))
|
|
73641
|
-
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(
|
|
73642
|
-
const variationsPath = [...
|
|
73696
|
+
throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path142)}`);
|
|
73697
|
+
const variationsPath = [...path142, "variations"];
|
|
73643
73698
|
for (const [type, raw2] of Object.entries(variations)) {
|
|
73644
73699
|
if (raw2 === null)
|
|
73645
73700
|
throw Error(
|
|
@@ -73665,11 +73720,11 @@ function checkVariationsShape(variations, path141) {
|
|
|
73665
73720
|
}
|
|
73666
73721
|
}
|
|
73667
73722
|
}
|
|
73668
|
-
function checkSubstitutionsShape(substitutions,
|
|
73723
|
+
function checkSubstitutionsShape(substitutions, path142) {
|
|
73669
73724
|
if (substitutions === null) return;
|
|
73670
73725
|
if (!isRecord3(substitutions))
|
|
73671
|
-
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(
|
|
73672
|
-
const substitutionsPath = [...
|
|
73726
|
+
throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path142)}`);
|
|
73727
|
+
const substitutionsPath = [...path142, "substitutions"];
|
|
73673
73728
|
for (const [name3, raw2] of Object.entries(substitutions)) {
|
|
73674
73729
|
const subPath = [...substitutionsPath, name3];
|
|
73675
73730
|
if (raw2 === null)
|
|
@@ -73711,10 +73766,10 @@ function scanSpecs(forms) {
|
|
|
73711
73766
|
}
|
|
73712
73767
|
return specs;
|
|
73713
73768
|
}
|
|
73714
|
-
function inferPlural(forms, language, key2,
|
|
73769
|
+
function inferPlural(forms, language, key2, path142) {
|
|
73715
73770
|
const specs = scanSpecs(forms);
|
|
73716
|
-
if (specs.size === 0) throw requiresNumber(language, key2,
|
|
73717
|
-
if (specs.size > 1) throw moreThanOne(language, key2,
|
|
73771
|
+
if (specs.size === 0) throw requiresNumber(language, key2, path142);
|
|
73772
|
+
if (specs.size > 1) throw moreThanOne(language, key2, path142);
|
|
73718
73773
|
return [...specs.values()][0] ?? { specifier: "", argument: 0 };
|
|
73719
73774
|
}
|
|
73720
73775
|
function unit(value) {
|
|
@@ -74183,8 +74238,8 @@ function plist4(value, depth) {
|
|
|
74183
74238
|
}
|
|
74184
74239
|
function compileStringCatalog(source, name3) {
|
|
74185
74240
|
return Object.fromEntries(
|
|
74186
|
-
Object.entries(compileCatalogTables(source, name3)).map(([
|
|
74187
|
-
|
|
74241
|
+
Object.entries(compileCatalogTables(source, name3)).map(([path142, table]) => [
|
|
74242
|
+
path142,
|
|
74188
74243
|
'<?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
74244
|
])
|
|
74190
74245
|
);
|
|
@@ -75112,8 +75167,8 @@ function sourceEntryPath() {
|
|
|
75112
75167
|
return null;
|
|
75113
75168
|
}
|
|
75114
75169
|
}
|
|
75115
|
-
function isCliEntry(
|
|
75116
|
-
const name3 = (0, import_node_path81.basename)(
|
|
75170
|
+
function isCliEntry(path142) {
|
|
75171
|
+
const name3 = (0, import_node_path81.basename)(path142);
|
|
75117
75172
|
return name3 === "bin.ts" || name3 === "bin.js";
|
|
75118
75173
|
}
|
|
75119
75174
|
function rnxSelfInvocation() {
|
|
@@ -77051,6 +77106,9 @@ function packageSources(packagePath, hosted = false, linked = /* @__PURE__ */ ne
|
|
|
77051
77106
|
return files2;
|
|
77052
77107
|
}
|
|
77053
77108
|
function packageSnapshot(project2, entry, moduleRoot) {
|
|
77109
|
+
moduleRoot ??= xcodeProjects().get(project2.packagePath)?.moduleRoot ?? linkedModuleRoots(project2.packagePath).find(
|
|
77110
|
+
(root) => import_node_fs86.default.existsSync(import_node_path83.default.join(root, "toolchain.json"))
|
|
77111
|
+
);
|
|
77054
77112
|
const layout2 = xcodeLayout(project2.packagePath);
|
|
77055
77113
|
const pin2 = moduleRoot ? swiftDistributionAt(moduleRoot) ?? JSON.parse(import_node_fs86.default.readFileSync(import_node_path83.default.join(moduleRoot, "toolchain.json"), "utf8")) : null;
|
|
77056
77114
|
const linked = layout2 ? standinLibraries(
|
|
@@ -77521,10 +77579,7 @@ function scopedArtifact(project2, entry, moduleRoot, signal) {
|
|
|
77521
77579
|
queued.then(resolve14, reject).finally(() => signal.removeEventListener("abort", stop));
|
|
77522
77580
|
});
|
|
77523
77581
|
}
|
|
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);
|
|
77582
|
+
const snapshot = packageSnapshot(project2, entry, moduleRoot);
|
|
77528
77583
|
const compiled = project2.artifact?.compiled;
|
|
77529
77584
|
if (project2.artifact && compiled && compiled.module === moduleStamp(project2.packagePath, moduleRoot, false)) {
|
|
77530
77585
|
const input = snapshotCompileInput(snapshot);
|
|
@@ -80421,11 +80476,11 @@ function stringList(value) {
|
|
|
80421
80476
|
function externalSpecMembers(root, requested) {
|
|
80422
80477
|
const children = (spec) => Array.isArray(spec.subspecs) ? spec.subspecs.filter(object5) : [];
|
|
80423
80478
|
const chains = /* @__PURE__ */ new Map();
|
|
80424
|
-
const select = (
|
|
80425
|
-
const key2 =
|
|
80479
|
+
const select = (path142) => {
|
|
80480
|
+
const key2 = path142.join("/");
|
|
80426
80481
|
if (chains.has(key2)) return;
|
|
80427
80482
|
const chain = [root];
|
|
80428
|
-
for (const part of
|
|
80483
|
+
for (const part of path142) {
|
|
80429
80484
|
const child = children(chain.at(-1)).find((sub) => sub.name === part);
|
|
80430
80485
|
if (!child) throw new Error(`${String(root.name)} has no subspec ${key2}`);
|
|
80431
80486
|
chain.push(child);
|
|
@@ -80434,7 +80489,7 @@ function externalSpecMembers(root, requested) {
|
|
|
80434
80489
|
const spec = chain.at(-1);
|
|
80435
80490
|
const defaults = stringList(spec.default_subspecs ?? spec.default_subspec);
|
|
80436
80491
|
const activated2 = defaults[0] === "none" ? [] : defaults.length > 0 ? defaults : children(spec).map((sub) => String(sub.name));
|
|
80437
|
-
for (const name3 of activated2) select([...
|
|
80492
|
+
for (const name3 of activated2) select([...path142, ...name3.split("/")]);
|
|
80438
80493
|
for (const member of chain)
|
|
80439
80494
|
for (const dependencies of [member.dependencies, iosOf(member)?.dependencies])
|
|
80440
80495
|
for (const dependency of object5(dependencies) ? Object.keys(dependencies) : []) {
|
|
@@ -85727,8 +85782,8 @@ var init_expo_swift_host = __esm({
|
|
|
85727
85782
|
});
|
|
85728
85783
|
|
|
85729
85784
|
// ../peach-kit/src/uttype-mime.ts
|
|
85730
|
-
function preferredMimeType(
|
|
85731
|
-
const name3 =
|
|
85785
|
+
function preferredMimeType(path142) {
|
|
85786
|
+
const name3 = path142.split(/[?#]/, 1)[0].replace(/\/+$/, "").split("/").pop() ?? "";
|
|
85732
85787
|
const dot = name3.lastIndexOf(".");
|
|
85733
85788
|
if (dot <= 0) return null;
|
|
85734
85789
|
return preferredMimeTypeForExtension(name3.slice(dot + 1));
|
|
@@ -87107,7 +87162,7 @@ var init_nitro_superset = __esm({
|
|
|
87107
87162
|
init_nitroContract();
|
|
87108
87163
|
init_swift_standin_digest();
|
|
87109
87164
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
87110
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
87165
|
+
NITRO_COMPILER_DIGEST = true ? "e02b15db160c1ae1d6ce71b0b3c956ffd9adf8db358ab3b3e048483d2a6f3cde" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
87111
87166
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
87112
87167
|
nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
|
|
87113
87168
|
published2 = /* @__PURE__ */ new Map();
|
|
@@ -88444,8 +88499,8 @@ function getDefaultPortForProtocol(protocol) {
|
|
|
88444
88499
|
return protocol === "https:" ? 443 : 80;
|
|
88445
88500
|
}
|
|
88446
88501
|
function isBaseServerUrl(url) {
|
|
88447
|
-
const
|
|
88448
|
-
return (
|
|
88502
|
+
const path142 = url.pathname || "/";
|
|
88503
|
+
return (path142 === "/" || path142 === "") && !url.search && !url.hash;
|
|
88449
88504
|
}
|
|
88450
88505
|
async function resolvePortViaServerScan(port) {
|
|
88451
88506
|
try {
|
|
@@ -88867,9 +88922,9 @@ function safeChildPlistName(value) {
|
|
|
88867
88922
|
name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
|
|
88868
88923
|
};
|
|
88869
88924
|
}
|
|
88870
|
-
async function readableSettingsBundle(
|
|
88925
|
+
async function readableSettingsBundle(path142) {
|
|
88871
88926
|
try {
|
|
88872
|
-
const root = await (0, import_promises10.stat)((0, import_node_path106.join)(
|
|
88927
|
+
const root = await (0, import_promises10.stat)((0, import_node_path106.join)(path142, "Root.plist"));
|
|
88873
88928
|
return root.isFile() && root.size <= MAX_PLIST_BYTES;
|
|
88874
88929
|
} catch {
|
|
88875
88930
|
return false;
|
|
@@ -88914,11 +88969,11 @@ async function settingsBundleFingerprint(bundlePath) {
|
|
|
88914
88969
|
return null;
|
|
88915
88970
|
}
|
|
88916
88971
|
}
|
|
88917
|
-
async function parsePlistRecord(
|
|
88972
|
+
async function parsePlistRecord(path142) {
|
|
88918
88973
|
try {
|
|
88919
|
-
const metadata = await (0, import_promises10.stat)(
|
|
88974
|
+
const metadata = await (0, import_promises10.stat)(path142);
|
|
88920
88975
|
if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
|
|
88921
|
-
const source = await (0, import_promises10.readFile)(
|
|
88976
|
+
const source = await (0, import_promises10.readFile)(path142, "utf8");
|
|
88922
88977
|
const parsed = parsePlistSource(source);
|
|
88923
88978
|
return isRecord(parsed) ? parsed : null;
|
|
88924
88979
|
} catch {
|
|
@@ -89423,7 +89478,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
|
89423
89478
|
return null;
|
|
89424
89479
|
}
|
|
89425
89480
|
}
|
|
89426
|
-
function httpGet(hostname, port,
|
|
89481
|
+
function httpGet(hostname, port, path142, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
89427
89482
|
return new Promise((resolve14) => {
|
|
89428
89483
|
let settled = false;
|
|
89429
89484
|
let killing = false;
|
|
@@ -89432,7 +89487,7 @@ function httpGet(hostname, port, path141, method = "GET", timeout = TIMEOUT_MS,
|
|
|
89432
89487
|
settled = true;
|
|
89433
89488
|
resolve14(value);
|
|
89434
89489
|
};
|
|
89435
|
-
const req = import_http.default.request({ hostname, port, path:
|
|
89490
|
+
const req = import_http.default.request({ hostname, port, path: path142, method, headers }, (res) => {
|
|
89436
89491
|
let body = "";
|
|
89437
89492
|
res.on("data", (c) => body += c.toString());
|
|
89438
89493
|
const contentType2 = (() => {
|
|
@@ -101788,8 +101843,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
|
|
|
101788
101843
|
}
|
|
101789
101844
|
const out = [];
|
|
101790
101845
|
for (const dir of dirs) {
|
|
101791
|
-
const
|
|
101792
|
-
if (!out.includes(
|
|
101846
|
+
const path142 = `${dir}/${filename}`;
|
|
101847
|
+
if (!out.includes(path142)) out.push(path142);
|
|
101793
101848
|
}
|
|
101794
101849
|
if (!out.includes(filename)) out.push(filename);
|
|
101795
101850
|
return out;
|
|
@@ -101831,6 +101886,15 @@ function resolveMetroIosAssetDestFiles(destFiles, descriptor, scale) {
|
|
|
101831
101886
|
(file) => destFileMatchesLocation(file, descriptor.httpServerLocation, filename)
|
|
101832
101887
|
).sort();
|
|
101833
101888
|
}
|
|
101889
|
+
function resolveMetroAndroidAssetDestFiles(destFiles, descriptor, scale) {
|
|
101890
|
+
const location = descriptor.httpServerLocation.replace(/^\//, "");
|
|
101891
|
+
const identifier2 = `${location}/${descriptor.name}`.toLowerCase().replace(/\//g, "_").replace(/[^a-z0-9_]/g, "").replace(/^(?:assets|assetsunstable_path)_/, "");
|
|
101892
|
+
const density = androidDensities.get(scale);
|
|
101893
|
+
const folder = !androidDrawableTypes.has(descriptor.type) ? "raw" : density && `drawable-${density}`;
|
|
101894
|
+
if (!folder) return [];
|
|
101895
|
+
const relative6 = `${folder}/${identifier2}.${descriptor.type}`;
|
|
101896
|
+
return destFiles.some((file) => file.replaceAll("\\", "/") === relative6) ? [relative6] : [];
|
|
101897
|
+
}
|
|
101834
101898
|
async function embedMetroAssetFiles(bundle, read) {
|
|
101835
101899
|
const sites = scanAssetDescriptorSites(bundle);
|
|
101836
101900
|
const embedded = /* @__PURE__ */ new Map();
|
|
@@ -101951,7 +102015,7 @@ function rewriteDescriptorObject(bundle, site, entry) {
|
|
|
101951
102015
|
const missing2 = countNewlines(bundle.slice(site.start, site.end)) - countNewlines(rewritten);
|
|
101952
102016
|
return missing2 > 0 ? `${rewritten.slice(0, -1)}${"\n".repeat(missing2)}}` : rewritten;
|
|
101953
102017
|
}
|
|
101954
|
-
var EXPRESSION_KEYWORDS, PLACEHOLDER_JPEG, METRO_ASSET_PLACEHOLDERS;
|
|
102018
|
+
var EXPRESSION_KEYWORDS, PLACEHOLDER_JPEG, METRO_ASSET_PLACEHOLDERS, androidDrawableTypes, androidDensities;
|
|
101955
102019
|
var init_metroAssetArtifact = __esm({
|
|
101956
102020
|
"../contrast-bundler/src/metroAssetArtifact.ts"() {
|
|
101957
102021
|
"use strict";
|
|
@@ -101982,6 +102046,15 @@ var init_metroAssetArtifact = __esm({
|
|
|
101982
102046
|
["gif", "R0lGODlhCAAIAPAAACYmK/8A/yH5BAAAAAAALAAAAAAIAAgAAAINjAMJh8q6DoTPSWvoKQA7"],
|
|
101983
102047
|
["webp", "UklGRiQAAABXRUJQVlA4TBcAAAAvB8ABAA8wJj/5P8v//IcH/gAf0f94AAA="]
|
|
101984
102048
|
]);
|
|
102049
|
+
androidDrawableTypes = /* @__PURE__ */ new Set(["gif", "jpeg", "jpg", "ktx", "png", "webp", "xml"]);
|
|
102050
|
+
androidDensities = /* @__PURE__ */ new Map([
|
|
102051
|
+
[0.75, "ldpi"],
|
|
102052
|
+
[1, "mdpi"],
|
|
102053
|
+
[1.5, "hdpi"],
|
|
102054
|
+
[2, "xhdpi"],
|
|
102055
|
+
[3, "xxhdpi"],
|
|
102056
|
+
[4, "xxxhdpi"]
|
|
102057
|
+
]);
|
|
101985
102058
|
}
|
|
101986
102059
|
});
|
|
101987
102060
|
|
|
@@ -102835,6 +102908,7 @@ function placeMetroDescriptor(listing, descriptor) {
|
|
|
102835
102908
|
(scale) => distinctByContent(listing.directory, [
|
|
102836
102909
|
.../* @__PURE__ */ new Set([
|
|
102837
102910
|
...resolveMetroIosAssetDestFiles(listing.files, descriptor, scale),
|
|
102911
|
+
...resolveMetroAndroidAssetDestFiles(listing.files, descriptor, scale),
|
|
102838
102912
|
...resolveExpoHashedAssetFiles(listing.files, descriptor, scale)
|
|
102839
102913
|
])
|
|
102840
102914
|
])
|
|
@@ -107458,11 +107532,11 @@ function explainMissingCallTarget(error) {
|
|
|
107458
107532
|
}
|
|
107459
107533
|
throw error;
|
|
107460
107534
|
}
|
|
107461
|
-
async function callInBridge(bridge,
|
|
107462
|
-
return bridge.send({ type: "call", path:
|
|
107535
|
+
async function callInBridge(bridge, path142, ...args) {
|
|
107536
|
+
return bridge.send({ type: "call", path: path142, args }).catch(explainMissingCallTarget);
|
|
107463
107537
|
}
|
|
107464
|
-
async function callInBridgeWrite(bridge,
|
|
107465
|
-
return bridge.send({ type: "call", path:
|
|
107538
|
+
async function callInBridgeWrite(bridge, path142, ...args) {
|
|
107539
|
+
return bridge.send({ type: "call", path: path142, args, acquireLock: true }).catch(explainMissingCallTarget);
|
|
107466
107540
|
}
|
|
107467
107541
|
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
107542
|
var init_ws_bridge = __esm({
|
|
@@ -108124,6 +108198,105 @@ var init_app_splash = __esm({
|
|
|
108124
108198
|
}
|
|
108125
108199
|
});
|
|
108126
108200
|
|
|
108201
|
+
// src/binarySidecarContract.ts
|
|
108202
|
+
function readPeachSidecarManifest(value) {
|
|
108203
|
+
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))
|
|
108204
|
+
throw new Error("invalid peach sidecar manifest");
|
|
108205
|
+
return {
|
|
108206
|
+
format: 1,
|
|
108207
|
+
platform: value.platform,
|
|
108208
|
+
bundleSha256: value.bundleSha256,
|
|
108209
|
+
nativePackages: readPackageVersions(value.nativePackages)
|
|
108210
|
+
};
|
|
108211
|
+
}
|
|
108212
|
+
var PEACH_SIDECAR_DIR, PEACH_SIDECAR_BUNDLE, PEACH_SIDECAR_MANIFEST, PEACH_SIDECAR_ASSETS;
|
|
108213
|
+
var init_binarySidecarContract = __esm({
|
|
108214
|
+
"src/binarySidecarContract.ts"() {
|
|
108215
|
+
"use strict";
|
|
108216
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
108217
|
+
init_package_versions();
|
|
108218
|
+
PEACH_SIDECAR_DIR = "peach";
|
|
108219
|
+
PEACH_SIDECAR_BUNDLE = "main.js.br";
|
|
108220
|
+
PEACH_SIDECAR_MANIFEST = "app.json";
|
|
108221
|
+
PEACH_SIDECAR_ASSETS = "assets";
|
|
108222
|
+
}
|
|
108223
|
+
});
|
|
108224
|
+
|
|
108225
|
+
// cli/binary-sidecar.ts
|
|
108226
|
+
function isAppBinaryPath(target) {
|
|
108227
|
+
return /\.(ipa|apk)$/i.test(target) && import_node_fs135.default.statSync(target, { throwIfNoEntry: false })?.isFile() === true;
|
|
108228
|
+
}
|
|
108229
|
+
function extractAppBinaryBundle(binary2) {
|
|
108230
|
+
const file = import_node_path137.default.resolve(binary2);
|
|
108231
|
+
const entries = (0, import_node_child_process61.execFileSync)("unzip", ["-Z1", file], {
|
|
108232
|
+
encoding: "utf8",
|
|
108233
|
+
maxBuffer: 256 * 1024 * 1024
|
|
108234
|
+
}).split("\n");
|
|
108235
|
+
const manifestEntry = entries.find(
|
|
108236
|
+
(entry) => new RegExp(
|
|
108237
|
+
`^(Payload/[^/]+\\.app|assets)/${PEACH_SIDECAR_DIR}/${PEACH_SIDECAR_MANIFEST.replace(".", "\\.")}$`
|
|
108238
|
+
).test(entry)
|
|
108239
|
+
);
|
|
108240
|
+
if (!manifestEntry)
|
|
108241
|
+
throw new Error(
|
|
108242
|
+
`${binary2} carries no peach sidecar; only apps built by Contrast include the plain javascript peach runs`
|
|
108243
|
+
);
|
|
108244
|
+
const sidecar = import_node_path137.default.posix.dirname(manifestEntry);
|
|
108245
|
+
const appRoot = import_node_path137.default.posix.dirname(sidecar);
|
|
108246
|
+
const digest3 = (0, import_node_crypto69.createHash)("sha256").update(import_node_fs135.default.readFileSync(file)).digest("hex");
|
|
108247
|
+
const out = import_node_path137.default.join(cacheDir(), "app-binaries", digest3);
|
|
108248
|
+
const bundlePath = import_node_path137.default.join(out, "main.js");
|
|
108249
|
+
const extracted = import_node_path137.default.join(out, "extracted");
|
|
108250
|
+
if (!import_node_fs135.default.existsSync(bundlePath)) {
|
|
108251
|
+
import_node_fs135.default.rmSync(out, { recursive: true, force: true });
|
|
108252
|
+
import_node_fs135.default.mkdirSync(extracted, { recursive: true });
|
|
108253
|
+
const patterns = [`${sidecar}/*`];
|
|
108254
|
+
const iosAssets = `${appRoot}/assets/`;
|
|
108255
|
+
if (appRoot.startsWith("Payload/") && entries.some((entry) => entry.startsWith(iosAssets)))
|
|
108256
|
+
patterns.push(`${iosAssets}*`);
|
|
108257
|
+
(0, import_node_child_process61.execFileSync)("unzip", ["-q", "-o", file, ...patterns, "-d", extracted]);
|
|
108258
|
+
const manifest = readPeachSidecarManifest(
|
|
108259
|
+
JSON.parse(import_node_fs135.default.readFileSync(import_node_path137.default.join(extracted, manifestEntry), "utf8"))
|
|
108260
|
+
);
|
|
108261
|
+
const bundle = (0, import_node_zlib4.brotliDecompressSync)(
|
|
108262
|
+
import_node_fs135.default.readFileSync(import_node_path137.default.join(extracted, sidecar, PEACH_SIDECAR_BUNDLE))
|
|
108263
|
+
);
|
|
108264
|
+
if ((0, import_node_crypto69.createHash)("sha256").update(bundle).digest("hex") !== manifest.bundleSha256)
|
|
108265
|
+
throw new Error(`${binary2}: the peach sidecar bundle does not match its manifest`);
|
|
108266
|
+
const assets2 = manifest.platform === "ios" ? import_node_path137.default.join(extracted, appRoot, "assets") : import_node_path137.default.join(extracted, sidecar, PEACH_SIDECAR_ASSETS);
|
|
108267
|
+
if (import_node_fs135.default.existsSync(assets2)) import_node_fs135.default.renameSync(assets2, import_node_path137.default.join(out, "assets"));
|
|
108268
|
+
import_node_fs135.default.copyFileSync(
|
|
108269
|
+
import_node_path137.default.join(extracted, manifestEntry),
|
|
108270
|
+
import_node_path137.default.join(out, PEACH_SIDECAR_MANIFEST)
|
|
108271
|
+
);
|
|
108272
|
+
import_node_fs135.default.writeFileSync(
|
|
108273
|
+
`${bundlePath}.partial`,
|
|
108274
|
+
insertPackageVersionsFooter(bundle.toString("utf8"), manifest.nativePackages)
|
|
108275
|
+
);
|
|
108276
|
+
import_node_fs135.default.renameSync(`${bundlePath}.partial`, bundlePath);
|
|
108277
|
+
import_node_fs135.default.rmSync(extracted, { recursive: true, force: true });
|
|
108278
|
+
}
|
|
108279
|
+
const { platform: platform2 } = readPeachSidecarManifest(
|
|
108280
|
+
JSON.parse(import_node_fs135.default.readFileSync(import_node_path137.default.join(out, PEACH_SIDECAR_MANIFEST), "utf8"))
|
|
108281
|
+
);
|
|
108282
|
+
return { bundlePath, platform: platform2 };
|
|
108283
|
+
}
|
|
108284
|
+
var import_node_child_process61, import_node_crypto69, import_node_fs135, import_node_path137, import_node_zlib4;
|
|
108285
|
+
var init_binary_sidecar = __esm({
|
|
108286
|
+
"cli/binary-sidecar.ts"() {
|
|
108287
|
+
"use strict";
|
|
108288
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
108289
|
+
import_node_child_process61 = require("node:child_process");
|
|
108290
|
+
import_node_crypto69 = require("node:crypto");
|
|
108291
|
+
import_node_fs135 = __toESM(require("node:fs"), 1);
|
|
108292
|
+
import_node_path137 = __toESM(require("node:path"), 1);
|
|
108293
|
+
import_node_zlib4 = require("node:zlib");
|
|
108294
|
+
init_package_versions();
|
|
108295
|
+
init_binarySidecarContract();
|
|
108296
|
+
init_home_paths();
|
|
108297
|
+
}
|
|
108298
|
+
});
|
|
108299
|
+
|
|
108127
108300
|
// src/bridge-contract-input.ts
|
|
108128
108301
|
var SEMANTIC_WAIT_MAX_TIMEOUT_MS;
|
|
108129
108302
|
var init_bridge_contract_input = __esm({
|
|
@@ -108938,7 +109111,7 @@ var init_core = __esm({
|
|
|
108938
109111
|
// cli/output-redaction.ts
|
|
108939
109112
|
function mask(value) {
|
|
108940
109113
|
if (MASKED.test(value)) return value;
|
|
108941
|
-
return `<redacted:${(0,
|
|
109114
|
+
return `<redacted:${(0, import_node_crypto70.createHash)("sha256").update(value).digest("hex").slice(0, 4)}>`;
|
|
108942
109115
|
}
|
|
108943
109116
|
function maskQuoted(quoted2) {
|
|
108944
109117
|
return `${quoted2[0]}${mask(quoted2.slice(1, -1))}${quoted2[0]}`;
|
|
@@ -109060,12 +109233,12 @@ function redactText(text6, configurationOnly, decodedString = false) {
|
|
|
109060
109233
|
(line, prefix, name3, value) => SECRET_NAME.test(name3) ? `${prefix}${mask(value)}` : line
|
|
109061
109234
|
).replace(EMAIL, mask).replace(OPAQUE_ID, mask);
|
|
109062
109235
|
}
|
|
109063
|
-
var
|
|
109236
|
+
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
109237
|
var init_output_redaction = __esm({
|
|
109065
109238
|
"cli/output-redaction.ts"() {
|
|
109066
109239
|
"use strict";
|
|
109067
109240
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
109068
|
-
|
|
109241
|
+
import_node_crypto70 = require("node:crypto");
|
|
109069
109242
|
init_config();
|
|
109070
109243
|
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
109244
|
JWT = /\beyJ[\w-]{6,}\.[\w-]{6,}\.[\w-]{6,}/g;
|
|
@@ -109566,7 +109739,7 @@ function macDesktopLaunchHome(bridgePort) {
|
|
|
109566
109739
|
const dev = readDevBridgeLockfiles().find(
|
|
109567
109740
|
(lock) => lock.bridgePort === bridgePort && isDevBridgeLockfileFresh(lock)
|
|
109568
109741
|
);
|
|
109569
|
-
const homeKey = (0,
|
|
109742
|
+
const homeKey = (0, import_node_crypto71.createHash)("sha256").update(home).digest("hex");
|
|
109570
109743
|
const dir = (0, import_path7.join)((0, import_os3.tmpdir)(), "peach-desktop-launch", homeKey, String(bridgePort));
|
|
109571
109744
|
(0, import_fs8.mkdirSync)(dir, { recursive: true });
|
|
109572
109745
|
if ((0, import_fs8.existsSync)(home)) {
|
|
@@ -109672,14 +109845,14 @@ function buildMacLaunchUrl(url, opts, nativeApp = false) {
|
|
|
109672
109845
|
}
|
|
109673
109846
|
return deepLink.toString();
|
|
109674
109847
|
}
|
|
109675
|
-
var import_child_process5, import_fs8,
|
|
109848
|
+
var import_child_process5, import_fs8, import_node_crypto71, import_os3, import_path7, import_url2, import_meta2, _sootsimRoot;
|
|
109676
109849
|
var init_desktop_companion = __esm({
|
|
109677
109850
|
"cli/desktop-companion.ts"() {
|
|
109678
109851
|
"use strict";
|
|
109679
109852
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
109680
109853
|
import_child_process5 = require("child_process");
|
|
109681
109854
|
import_fs8 = require("fs");
|
|
109682
|
-
|
|
109855
|
+
import_node_crypto71 = require("node:crypto");
|
|
109683
109856
|
import_os3 = require("os");
|
|
109684
109857
|
import_path7 = require("path");
|
|
109685
109858
|
import_url2 = require("url");
|
|
@@ -109827,13 +110000,13 @@ function resolvePlaywright() {
|
|
|
109827
110000
|
try {
|
|
109828
110001
|
const modulePath = requireFromRoot.resolve(spec);
|
|
109829
110002
|
const packageJsonPath = requireFromRoot.resolve(`${spec}/package.json`);
|
|
109830
|
-
const parsed = JSON.parse((0,
|
|
110003
|
+
const parsed = JSON.parse((0, import_node_fs136.readFileSync)(packageJsonPath, "utf8"));
|
|
109831
110004
|
if (!isRecord(parsed) || typeof parsed.version !== "string") continue;
|
|
109832
110005
|
const corePackagePath = (0, import_node_module23.createRequire)(modulePath).resolve(
|
|
109833
110006
|
"playwright-core/package.json"
|
|
109834
110007
|
);
|
|
109835
|
-
const cliPath = (0,
|
|
109836
|
-
if (!(0,
|
|
110008
|
+
const cliPath = (0, import_node_path138.join)((0, import_node_path138.dirname)(corePackagePath), "cli.js");
|
|
110009
|
+
if (!(0, import_node_fs136.existsSync)(cliPath)) continue;
|
|
109837
110010
|
return {
|
|
109838
110011
|
spec,
|
|
109839
110012
|
modulePath,
|
|
@@ -109861,7 +110034,7 @@ async function provisionPlaywright() {
|
|
|
109861
110034
|
await installVerifiedTarball({
|
|
109862
110035
|
url: `https://registry.npmjs.org/playwright-core/-/playwright-core-${version2}.tgz`,
|
|
109863
110036
|
digest: { algorithm, encoding: "base64", value: digest3 },
|
|
109864
|
-
destDir: (0,
|
|
110037
|
+
destDir: (0, import_node_path138.join)(playwrightCoreDir(version2), "node_modules", "playwright-core"),
|
|
109865
110038
|
installedMarker: "package.json",
|
|
109866
110039
|
// npm tarballs hold the package under a leading `package/`
|
|
109867
110040
|
stripComponents: 1,
|
|
@@ -109876,12 +110049,12 @@ async function provisionPlaywright() {
|
|
|
109876
110049
|
return installed2;
|
|
109877
110050
|
}
|
|
109878
110051
|
function chromiumPathsFile() {
|
|
109879
|
-
return (0,
|
|
110052
|
+
return (0, import_node_path138.join)(cacheDir(), "playwright-chromium-paths.json");
|
|
109880
110053
|
}
|
|
109881
110054
|
function readChromiumPaths() {
|
|
109882
110055
|
let parsed;
|
|
109883
110056
|
try {
|
|
109884
|
-
parsed = JSON.parse((0,
|
|
110057
|
+
parsed = JSON.parse((0, import_node_fs136.readFileSync)(chromiumPathsFile(), "utf8"));
|
|
109885
110058
|
} catch {
|
|
109886
110059
|
return {};
|
|
109887
110060
|
}
|
|
@@ -109905,7 +110078,7 @@ function packageChromiumPath(resolved, env) {
|
|
|
109905
110078
|
const cached4 = known[key2];
|
|
109906
110079
|
if (cached4) return { ok: true, path: cached4 };
|
|
109907
110080
|
const self = rnxSelfInvocation();
|
|
109908
|
-
const probe2 = (0,
|
|
110081
|
+
const probe2 = (0, import_node_child_process62.spawnSync)(
|
|
109909
110082
|
self.executable,
|
|
109910
110083
|
[...self.prefixArgs, RNX_INTERNAL_COMMAND, RNX_INTERNAL_CHILDREN.playwrightProbe],
|
|
109911
110084
|
{
|
|
@@ -109933,15 +110106,15 @@ function packageChromiumPath(resolved, env) {
|
|
|
109933
110106
|
const keys = Object.keys(known);
|
|
109934
110107
|
for (const old of keys.slice(0, Math.max(0, keys.length - CHROMIUM_PATHS_KEPT)))
|
|
109935
110108
|
delete known[old];
|
|
109936
|
-
(0,
|
|
110109
|
+
(0, import_node_fs136.mkdirSync)(cacheDir(), { recursive: true });
|
|
109937
110110
|
const staged = `${chromiumPathsFile()}.${process.pid}`;
|
|
109938
|
-
(0,
|
|
109939
|
-
(0,
|
|
110111
|
+
(0, import_node_fs136.writeFileSync)(staged, JSON.stringify(known));
|
|
110112
|
+
(0, import_node_fs136.renameSync)(staged, chromiumPathsFile());
|
|
109940
110113
|
return { ok: true, path: parsed.expectedPath };
|
|
109941
110114
|
}
|
|
109942
|
-
function isExecutable(
|
|
110115
|
+
function isExecutable(path142) {
|
|
109943
110116
|
try {
|
|
109944
|
-
(0,
|
|
110117
|
+
(0, import_node_fs136.accessSync)(path142, import_node_fs136.constants.X_OK);
|
|
109945
110118
|
return true;
|
|
109946
110119
|
} catch {
|
|
109947
110120
|
return false;
|
|
@@ -109950,7 +110123,7 @@ function isExecutable(path141) {
|
|
|
109950
110123
|
function probeBrowser(resolved, env, shell) {
|
|
109951
110124
|
const override = env.PEACH_CHROMIUM_EXECUTABLE;
|
|
109952
110125
|
if (override) {
|
|
109953
|
-
const executablePath2 = (0,
|
|
110126
|
+
const executablePath2 = (0, import_node_path138.resolve)(override);
|
|
109954
110127
|
if (!isExecutable(executablePath2))
|
|
109955
110128
|
return {
|
|
109956
110129
|
ok: false,
|
|
@@ -109961,9 +110134,9 @@ function probeBrowser(resolved, env, shell) {
|
|
|
109961
110134
|
const expected = packageChromiumPath(resolved, env);
|
|
109962
110135
|
if (!expected.ok) return expected;
|
|
109963
110136
|
const expectedPath = expected.path;
|
|
109964
|
-
let browserDir = (0,
|
|
109965
|
-
while (!/^chromium-\d+$/.test((0,
|
|
109966
|
-
const parent = (0,
|
|
110137
|
+
let browserDir = (0, import_node_path138.dirname)(expectedPath);
|
|
110138
|
+
while (!/^chromium-\d+$/.test((0, import_node_path138.basename)(browserDir))) {
|
|
110139
|
+
const parent = (0, import_node_path138.dirname)(browserDir);
|
|
109967
110140
|
if (parent === browserDir)
|
|
109968
110141
|
return {
|
|
109969
110142
|
ok: false,
|
|
@@ -109971,28 +110144,28 @@ function probeBrowser(resolved, env, shell) {
|
|
|
109971
110144
|
};
|
|
109972
110145
|
browserDir = parent;
|
|
109973
110146
|
}
|
|
109974
|
-
const browsersDir = (0,
|
|
110147
|
+
const browsersDir = (0, import_node_path138.dirname)(browserDir);
|
|
109975
110148
|
const prefix = shell ? "chromium_headless_shell-" : "chromium-";
|
|
109976
110149
|
const paths = shell ? process.platform === "win32" ? ["chrome-headless-shell-win64/chrome-headless-shell.exe"] : [
|
|
109977
110150
|
process.arch === "arm64" ? "chrome-headless-shell-linux-arm64/chrome-headless-shell" : "chrome-headless-shell-linux64/chrome-headless-shell",
|
|
109978
110151
|
"chrome-linux/headless_shell"
|
|
109979
|
-
] : process.platform === "linux" ? [(0,
|
|
109980
|
-
let executablePath = shell ? (0,
|
|
110152
|
+
] : process.platform === "linux" ? [(0, import_node_path138.relative)(browserDir, expectedPath), "chrome-linux/chrome"] : [(0, import_node_path138.relative)(browserDir, expectedPath)];
|
|
110153
|
+
let executablePath = shell ? (0, import_node_path138.join)(
|
|
109981
110154
|
browsersDir,
|
|
109982
|
-
`${prefix}${(0,
|
|
110155
|
+
`${prefix}${(0, import_node_path138.basename)(browserDir).slice("chromium-".length)}`,
|
|
109983
110156
|
paths[0]
|
|
109984
110157
|
) : expectedPath;
|
|
109985
|
-
const revisions = (0,
|
|
110158
|
+
const revisions = (0, import_node_fs136.existsSync)(browsersDir) ? (0, import_node_fs136.readdirSync)(browsersDir).filter(
|
|
109986
110159
|
(name3) => name3.startsWith(prefix) && /^\d+$/.test(name3.slice(prefix.length))
|
|
109987
110160
|
).sort((a, b) => Number(b.slice(prefix.length)) - Number(a.slice(prefix.length))) : [];
|
|
109988
110161
|
for (const revision of revisions) {
|
|
109989
|
-
const installed2 = paths.map((
|
|
110162
|
+
const installed2 = paths.map((path142) => (0, import_node_path138.join)(browsersDir, revision, path142)).find(isExecutable);
|
|
109990
110163
|
if (installed2) {
|
|
109991
110164
|
executablePath = installed2;
|
|
109992
110165
|
break;
|
|
109993
110166
|
}
|
|
109994
110167
|
}
|
|
109995
|
-
return { ok: true, executablePath, exists: (0,
|
|
110168
|
+
return { ok: true, executablePath, exists: (0, import_node_fs136.existsSync)(executablePath) };
|
|
109996
110169
|
}
|
|
109997
110170
|
async function ensurePlaywrightBrowser(resolved, headless, env = process.env) {
|
|
109998
110171
|
const headlessShell = headless && process.platform !== "darwin";
|
|
@@ -110010,7 +110183,7 @@ async function ensurePlaywrightBrowser(resolved, headless, env = process.env) {
|
|
|
110010
110183
|
};
|
|
110011
110184
|
}
|
|
110012
110185
|
const installer = rnxSelfInvocation();
|
|
110013
|
-
const install = (0,
|
|
110186
|
+
const install = (0, import_node_child_process62.spawnSync)(
|
|
110014
110187
|
installer.executable,
|
|
110015
110188
|
[
|
|
110016
110189
|
...installer.prefixArgs,
|
|
@@ -110069,15 +110242,15 @@ async function launchProvisionedPlaywright() {
|
|
|
110069
110242
|
{ headless: true }
|
|
110070
110243
|
);
|
|
110071
110244
|
}
|
|
110072
|
-
var
|
|
110245
|
+
var import_node_child_process62, import_node_fs136, import_node_module23, import_node_path138, CHROMIUM_PATHS_KEPT;
|
|
110073
110246
|
var init_playwright_provisioning = __esm({
|
|
110074
110247
|
"cli/drivers/playwright-provisioning.ts"() {
|
|
110075
110248
|
"use strict";
|
|
110076
110249
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
110077
|
-
|
|
110078
|
-
|
|
110250
|
+
import_node_child_process62 = require("node:child_process");
|
|
110251
|
+
import_node_fs136 = require("node:fs");
|
|
110079
110252
|
import_node_module23 = require("node:module");
|
|
110080
|
-
|
|
110253
|
+
import_node_path138 = require("node:path");
|
|
110081
110254
|
init_src();
|
|
110082
110255
|
init_home_paths();
|
|
110083
110256
|
init_is_record();
|
|
@@ -114506,12 +114679,12 @@ function linuxUnitPath() {
|
|
|
114506
114679
|
function getDaemonServiceStatus() {
|
|
114507
114680
|
if (shouldSkipPersistentDaemon()) return { supported: false, installed: false };
|
|
114508
114681
|
if (process.platform === "darwin") {
|
|
114509
|
-
const
|
|
114510
|
-
return { supported: true, installed: (0, import_fs10.existsSync)(
|
|
114682
|
+
const path142 = macPlistPath();
|
|
114683
|
+
return { supported: true, installed: (0, import_fs10.existsSync)(path142), path: path142 };
|
|
114511
114684
|
}
|
|
114512
114685
|
if (process.platform === "linux") {
|
|
114513
|
-
const
|
|
114514
|
-
return { supported: linuxUserManagerReachable(), installed: (0, import_fs10.existsSync)(
|
|
114686
|
+
const path142 = linuxUnitPath();
|
|
114687
|
+
return { supported: linuxUserManagerReachable(), installed: (0, import_fs10.existsSync)(path142), path: path142 };
|
|
114515
114688
|
}
|
|
114516
114689
|
return { supported: false, installed: false };
|
|
114517
114690
|
}
|
|
@@ -114556,9 +114729,9 @@ function macBridgeHasListener(pid, port) {
|
|
|
114556
114729
|
}
|
|
114557
114730
|
return result.stdout.trim() === String(pid);
|
|
114558
114731
|
}
|
|
114559
|
-
function sameFile(
|
|
114732
|
+
function sameFile(path142, device, inode) {
|
|
114560
114733
|
try {
|
|
114561
|
-
const stats = (0, import_fs10.statSync)(
|
|
114734
|
+
const stats = (0, import_fs10.statSync)(path142, { bigint: true });
|
|
114562
114735
|
return stats.dev === device && stats.ino === inode;
|
|
114563
114736
|
} catch {
|
|
114564
114737
|
return false;
|
|
@@ -114640,13 +114813,13 @@ async function stopMacDaemonBridge(invocation, target = macServiceTarget()) {
|
|
|
114640
114813
|
}
|
|
114641
114814
|
throw new Error(`bridge pid ${lock.pid} did not release port ${lock.bridgePort}`);
|
|
114642
114815
|
}
|
|
114643
|
-
async function startMacDaemon(
|
|
114816
|
+
async function startMacDaemon(path142, invocation = resolveDaemonInvocation(), target = macServiceTarget()) {
|
|
114644
114817
|
const service = readMacDaemonState(target);
|
|
114645
114818
|
const lock = readDaemonLockfile();
|
|
114646
114819
|
if (service?.state === "running" && service.pid !== null && isDaemonLockfileFresh(lock) && lock.pid === service.pid && macBridgeHasListener(lock.pid, lock.bridgePort))
|
|
114647
114820
|
return service.pid;
|
|
114648
114821
|
await stopMacDaemonBridge(invocation, target);
|
|
114649
|
-
runLaunchctl(["bootstrap", target.slice(0, target.lastIndexOf("/")),
|
|
114822
|
+
runLaunchctl(["bootstrap", target.slice(0, target.lastIndexOf("/")), path142]);
|
|
114650
114823
|
const deadline = Date.now() + 4e3;
|
|
114651
114824
|
while (Date.now() < deadline) {
|
|
114652
114825
|
const service2 = readMacDaemonState(target);
|
|
@@ -114724,19 +114897,19 @@ async function waitForBridgeRelease(hasListener, lock) {
|
|
|
114724
114897
|
}
|
|
114725
114898
|
async function daemonRestart() {
|
|
114726
114899
|
if (process.platform === "darwin") {
|
|
114727
|
-
const
|
|
114728
|
-
if (!(0, import_fs10.existsSync)(
|
|
114900
|
+
const path142 = macPlistPath();
|
|
114901
|
+
if (!(0, import_fs10.existsSync)(path142)) {
|
|
114729
114902
|
console.error(" daemon not registered. run `peach daemon install`");
|
|
114730
114903
|
peachExit(1);
|
|
114731
114904
|
}
|
|
114732
114905
|
await stopMacDaemonBridge(resolveDaemonInvocation());
|
|
114733
|
-
await startMacDaemon(
|
|
114906
|
+
await startMacDaemon(path142);
|
|
114734
114907
|
console.log(" restarted");
|
|
114735
114908
|
return;
|
|
114736
114909
|
}
|
|
114737
114910
|
if (process.platform === "linux") {
|
|
114738
|
-
const
|
|
114739
|
-
if (!(0, import_fs10.existsSync)(
|
|
114911
|
+
const path142 = linuxUnitPath();
|
|
114912
|
+
if (!(0, import_fs10.existsSync)(path142)) {
|
|
114740
114913
|
console.error(" daemon not registered. run `peach daemon install`");
|
|
114741
114914
|
peachExit(1);
|
|
114742
114915
|
}
|
|
@@ -115349,9 +115522,9 @@ function property(object6, key2) {
|
|
|
115349
115522
|
function oneNativeAppIdentity(source, platform2 = "ios") {
|
|
115350
115523
|
if (source === void 0) return null;
|
|
115351
115524
|
const app = property(property(readSource(source).oneOptions(), "native"), "app");
|
|
115352
|
-
const text6 = (...
|
|
115525
|
+
const text6 = (...path142) => {
|
|
115353
115526
|
let at = app;
|
|
115354
|
-
for (const key2 of
|
|
115527
|
+
for (const key2 of path142) at = property(at, key2);
|
|
115355
115528
|
return at?.kind === "string" ? at.value : void 0;
|
|
115356
115529
|
};
|
|
115357
115530
|
const name3 = text6("displayName") ?? text6("name");
|
|
@@ -115397,8 +115570,8 @@ function oneNativeAppIdentity(source, platform2 = "ios") {
|
|
|
115397
115570
|
if (key2 !== null && value.kind === "boolean") infoPlistBooleans[key2] = value.value;
|
|
115398
115571
|
}
|
|
115399
115572
|
}
|
|
115400
|
-
for (const [key2, ...
|
|
115401
|
-
const purpose = text6(...
|
|
115573
|
+
for (const [key2, ...path142] of IOS_PURPOSE_STRINGS) {
|
|
115574
|
+
const purpose = text6(...path142);
|
|
115402
115575
|
if (purpose !== void 0) infoPlistStrings[key2] = purpose;
|
|
115403
115576
|
}
|
|
115404
115577
|
const permissionUsageDescriptions = Object.fromEntries(
|
|
@@ -115507,29 +115680,29 @@ function launcherActivities(application) {
|
|
|
115507
115680
|
function readModuleNamespace(moduleRoot, manifest) {
|
|
115508
115681
|
if (manifest.attributes.package) return manifest.attributes.package;
|
|
115509
115682
|
for (const name3 of ["build.gradle", "build.gradle.kts"]) {
|
|
115510
|
-
const file =
|
|
115511
|
-
if (!
|
|
115683
|
+
const file = import_node_path139.default.join(moduleRoot, name3);
|
|
115684
|
+
if (!import_node_fs137.default.existsSync(file)) continue;
|
|
115512
115685
|
const match = /\bnamespace\s*=?\s*["']([\w.]+)["']/.exec(
|
|
115513
|
-
|
|
115686
|
+
import_node_fs137.default.readFileSync(file, "utf8")
|
|
115514
115687
|
);
|
|
115515
115688
|
if (match) return match[1];
|
|
115516
115689
|
}
|
|
115517
115690
|
return void 0;
|
|
115518
115691
|
}
|
|
115519
115692
|
function readModuleRootModuleName(moduleRoot) {
|
|
115520
|
-
const sourceSets =
|
|
115521
|
-
const manifestFile =
|
|
115522
|
-
if (!
|
|
115523
|
-
const document = parseXml(
|
|
115693
|
+
const sourceSets = import_node_path139.default.join(moduleRoot, "src");
|
|
115694
|
+
const manifestFile = import_node_path139.default.join(sourceSets, "main/AndroidManifest.xml");
|
|
115695
|
+
if (!import_node_fs137.default.existsSync(manifestFile)) return null;
|
|
115696
|
+
const document = parseXml(import_node_fs137.default.readFileSync(manifestFile, "utf8"), manifestFile);
|
|
115524
115697
|
const manifest = document.children[0];
|
|
115525
115698
|
const application = manifest?.children.find((child) => child.name === "application");
|
|
115526
115699
|
if (manifest?.name !== "manifest" || !application) return null;
|
|
115527
115700
|
const launchers = launcherActivities(application);
|
|
115528
115701
|
if (launchers.length === 0) return null;
|
|
115529
|
-
for (const set2 of
|
|
115530
|
-
const file =
|
|
115531
|
-
if (!set2.isDirectory() || set2.name === "main" || !
|
|
115532
|
-
if (
|
|
115702
|
+
for (const set2 of import_node_fs137.default.readdirSync(sourceSets, { withFileTypes: true })) {
|
|
115703
|
+
const file = import_node_path139.default.join(sourceSets, set2.name, "AndroidManifest.xml");
|
|
115704
|
+
if (!set2.isDirectory() || set2.name === "main" || !import_node_fs137.default.existsSync(file)) continue;
|
|
115705
|
+
if (import_node_fs137.default.readFileSync(file, "utf8").includes("<activity")) return void 0;
|
|
115533
115706
|
}
|
|
115534
115707
|
const launcher = launchers[0];
|
|
115535
115708
|
const enabled2 = launcher.attributes["android:enabled"];
|
|
@@ -115541,32 +115714,32 @@ function readModuleRootModuleName(moduleRoot) {
|
|
|
115541
115714
|
const qualified3 = declared.startsWith(".") ? namespace && `${namespace}${declared}` : declared.includes(".") ? declared : namespace && `${namespace}.${declared}`;
|
|
115542
115715
|
if (!qualified3 || qualified3.includes("$")) return void 0;
|
|
115543
115716
|
const relative6 = qualified3.split(".").join("/");
|
|
115544
|
-
const files2 =
|
|
115717
|
+
const files2 = import_node_fs137.default.readdirSync(sourceSets, { withFileTypes: true }).filter((set2) => set2.isDirectory()).flatMap(
|
|
115545
115718
|
(set2) => ["java", "kotlin"].flatMap(
|
|
115546
115719
|
(language) => ["kt", "java"].map(
|
|
115547
|
-
(extension) =>
|
|
115720
|
+
(extension) => import_node_path139.default.join(sourceSets, set2.name, language, `${relative6}.${extension}`)
|
|
115548
115721
|
)
|
|
115549
115722
|
)
|
|
115550
|
-
).filter((file) =>
|
|
115723
|
+
).filter((file) => import_node_fs137.default.existsSync(file));
|
|
115551
115724
|
if (files2.length !== 1) return void 0;
|
|
115552
115725
|
return readAndroidRootModuleFromActivitySource(
|
|
115553
|
-
|
|
115726
|
+
import_node_fs137.default.readFileSync(files2[0], "utf8"),
|
|
115554
115727
|
qualified3.slice(qualified3.lastIndexOf(".") + 1)
|
|
115555
115728
|
);
|
|
115556
115729
|
}
|
|
115557
115730
|
function readAndroidLauncherRootModuleName(projectRoot) {
|
|
115558
|
-
const androidRoot =
|
|
115559
|
-
if (!
|
|
115560
|
-
const names =
|
|
115731
|
+
const androidRoot = import_node_path139.default.join(projectRoot, "android");
|
|
115732
|
+
if (!import_node_fs137.default.existsSync(androidRoot)) return void 0;
|
|
115733
|
+
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
115734
|
return names.length === 1 ? names[0] : void 0;
|
|
115562
115735
|
}
|
|
115563
|
-
var
|
|
115736
|
+
var import_node_fs137, import_node_path139, STRINGS_AND_COMMENTS, DECLARATION, KOTLIN_LITERAL, JAVA_LITERAL;
|
|
115564
115737
|
var init_android_root_module = __esm({
|
|
115565
115738
|
"src/android-root-module.ts"() {
|
|
115566
115739
|
"use strict";
|
|
115567
115740
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
115568
|
-
|
|
115569
|
-
|
|
115741
|
+
import_node_fs137 = __toESM(require("node:fs"), 1);
|
|
115742
|
+
import_node_path139 = __toESM(require("node:path"), 1);
|
|
115570
115743
|
init_android_xml();
|
|
115571
115744
|
STRINGS_AND_COMMENTS = /"(?:\\.|[^"\\])*"|\/\/[^\n]*|\/\*[\s\S]*?\*\//g;
|
|
115572
115745
|
DECLARATION = /\b(?:fun|String)\s+getMainComponentName\s*\(/g;
|
|
@@ -115576,8 +115749,8 @@ var init_android_root_module = __esm({
|
|
|
115576
115749
|
});
|
|
115577
115750
|
|
|
115578
115751
|
// src/appBundleResourcesContract.ts
|
|
115579
|
-
function isAppBundleResourcePath(
|
|
115580
|
-
return
|
|
115752
|
+
function isAppBundleResourcePath(path142) {
|
|
115753
|
+
return path142.length > 0 && !path142.includes("\0") && !/[\\?#]/.test(path142) && path142.split("/").every((part) => part !== "" && part !== "." && part !== "..");
|
|
115581
115754
|
}
|
|
115582
115755
|
var init_appBundleResourcesContract = __esm({
|
|
115583
115756
|
"src/appBundleResourcesContract.ts"() {
|
|
@@ -115590,27 +115763,27 @@ var init_appBundleResourcesContract = __esm({
|
|
|
115590
115763
|
function stageAppBundleResources(appDir, origin, iosTarget, environment) {
|
|
115591
115764
|
const app = readIosAppTarget(appDir, iosTarget, environment);
|
|
115592
115765
|
if (!app) return {};
|
|
115593
|
-
let root =
|
|
115766
|
+
let root = import_node_fs138.default.realpathSync(findWorkspaceRoot(appDir));
|
|
115594
115767
|
for (; ; ) {
|
|
115595
115768
|
const escaped = app.resources.some((file) => {
|
|
115596
|
-
const relative6 =
|
|
115597
|
-
return relative6.startsWith(`..${
|
|
115769
|
+
const relative6 = import_node_path140.default.relative(root, import_node_fs138.default.realpathSync(file));
|
|
115770
|
+
return relative6.startsWith(`..${import_node_path140.default.sep}`) || import_node_path140.default.isAbsolute(relative6);
|
|
115598
115771
|
});
|
|
115599
115772
|
if (!escaped) break;
|
|
115600
|
-
const wider =
|
|
115773
|
+
const wider = import_node_fs138.default.realpathSync(findWorkspaceRoot(import_node_path140.default.dirname(root)));
|
|
115601
115774
|
if (wider === root) break;
|
|
115602
115775
|
root = wider;
|
|
115603
115776
|
}
|
|
115604
115777
|
const members2 = /* @__PURE__ */ new Map();
|
|
115605
115778
|
for (const file of app.resources) {
|
|
115606
|
-
const real =
|
|
115607
|
-
const relative6 =
|
|
115608
|
-
if (relative6.startsWith(`..${
|
|
115779
|
+
const real = import_node_fs138.default.realpathSync(file);
|
|
115780
|
+
const relative6 = import_node_path140.default.relative(root, real);
|
|
115781
|
+
if (relative6.startsWith(`..${import_node_path140.default.sep}`) || import_node_path140.default.isAbsolute(relative6))
|
|
115609
115782
|
throw new Error("native app resource escapes the Xcode input root");
|
|
115610
|
-
const lexical =
|
|
115611
|
-
if (lexical === ".." || lexical.startsWith(`..${
|
|
115783
|
+
const lexical = import_node_path140.default.relative(root, file);
|
|
115784
|
+
if (lexical === ".." || lexical.startsWith(`..${import_node_path140.default.sep}`) || import_node_path140.default.isAbsolute(lexical))
|
|
115612
115785
|
throw new Error("native app resource escapes the selected project");
|
|
115613
|
-
const name3 = `Resources/${lexical.split(
|
|
115786
|
+
const name3 = `Resources/${lexical.split(import_node_path140.default.sep).join("/")}`;
|
|
115614
115787
|
members2.set(name3, file);
|
|
115615
115788
|
}
|
|
115616
115789
|
const resources = enumerateBundleResources([...members2.keys()]);
|
|
@@ -115626,21 +115799,21 @@ function stageAppBundleResources(appDir, origin, iosTarget, environment) {
|
|
|
115626
115799
|
const content = bytes[index];
|
|
115627
115800
|
result[base] = {
|
|
115628
115801
|
uri: urls[index],
|
|
115629
|
-
sha256: (0,
|
|
115802
|
+
sha256: (0, import_node_crypto72.createHash)("sha256").update(content).digest("hex"),
|
|
115630
115803
|
contentType: preferredMimeType(base) ?? "application/octet-stream",
|
|
115631
115804
|
byteLength: content.byteLength
|
|
115632
115805
|
};
|
|
115633
115806
|
});
|
|
115634
115807
|
return result;
|
|
115635
115808
|
}
|
|
115636
|
-
var
|
|
115809
|
+
var import_node_crypto72, import_node_fs138, import_node_path140;
|
|
115637
115810
|
var init_app_bundle_resources = __esm({
|
|
115638
115811
|
"cli/app-bundle-resources.ts"() {
|
|
115639
115812
|
"use strict";
|
|
115640
115813
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
115641
|
-
|
|
115642
|
-
|
|
115643
|
-
|
|
115814
|
+
import_node_crypto72 = require("node:crypto");
|
|
115815
|
+
import_node_fs138 = __toESM(require("node:fs"), 1);
|
|
115816
|
+
import_node_path140 = __toESM(require("node:path"), 1);
|
|
115644
115817
|
init_uttype_mime();
|
|
115645
115818
|
init_bundleAssets();
|
|
115646
115819
|
init_appBundleResourcesContract();
|
|
@@ -115743,45 +115916,45 @@ var init_material_symbol_fonts = __esm({
|
|
|
115743
115916
|
|
|
115744
115917
|
// cli/material-symbol-fonts.ts
|
|
115745
115918
|
function materialSymbolFontPaths(appDir) {
|
|
115746
|
-
const appRequire = (0, import_node_module24.createRequire)(
|
|
115919
|
+
const appRequire = (0, import_node_module24.createRequire)(import_node_path141.default.join(appDir, "package.json"));
|
|
115747
115920
|
let nativeManifest;
|
|
115748
115921
|
try {
|
|
115749
115922
|
nativeManifest = appRequire.resolve("@react-navigation/native/package.json");
|
|
115750
115923
|
} catch {
|
|
115751
115924
|
return [];
|
|
115752
115925
|
}
|
|
115753
|
-
const nativePackage = JSON.parse(
|
|
115926
|
+
const nativePackage = JSON.parse(import_node_fs139.default.readFileSync(nativeManifest, "utf8"));
|
|
115754
115927
|
const dependencies = nativePackage && typeof nativePackage === "object" ? Reflect.get(nativePackage, "dependencies") : null;
|
|
115755
115928
|
if (!dependencies || typeof dependencies !== "object" || !Reflect.has(dependencies, "@react-navigation/material-symbols"))
|
|
115756
115929
|
return [];
|
|
115757
115930
|
const nativeRequire = (0, import_node_module24.createRequire)(nativeManifest);
|
|
115758
|
-
const symbolsDir =
|
|
115931
|
+
const symbolsDir = import_node_path141.default.dirname(
|
|
115759
115932
|
nativeRequire.resolve("@react-navigation/material-symbols/package.json")
|
|
115760
115933
|
);
|
|
115761
|
-
const fontsDir =
|
|
115762
|
-
const available =
|
|
115934
|
+
const fontsDir = import_node_path141.default.join(symbolsDir, "assets/fonts");
|
|
115935
|
+
const available = import_node_fs139.default.existsSync(fontsDir) ? import_node_fs139.default.readdirSync(fontsDir).filter((name3) => name3.startsWith("MaterialSymbols") && name3.endsWith(".ttf")) : [];
|
|
115763
115936
|
const manifest = JSON.parse(
|
|
115764
|
-
|
|
115937
|
+
import_node_fs139.default.readFileSync(import_node_path141.default.join(appDir, "package.json"), "utf8")
|
|
115765
115938
|
);
|
|
115766
115939
|
return materialSymbolFontNames(manifest, available, symbolsDir).map(
|
|
115767
|
-
(name3) =>
|
|
115940
|
+
(name3) => import_node_path141.default.join(fontsDir, name3)
|
|
115768
115941
|
);
|
|
115769
115942
|
}
|
|
115770
115943
|
function materialSymbolFontAssets(fontPaths) {
|
|
115771
115944
|
const selected = fontPaths.filter(
|
|
115772
115945
|
(fontPath) => /^MaterialSymbols(?:Outlined|Rounded|Sharp)_\d+(?:_Filled)?\.ttf$/.test(
|
|
115773
|
-
|
|
115946
|
+
import_node_path141.default.basename(fontPath)
|
|
115774
115947
|
)
|
|
115775
115948
|
);
|
|
115776
115949
|
if (!selected.length) return void 0;
|
|
115777
|
-
const directory2 =
|
|
115778
|
-
const codepointsFile =
|
|
115779
|
-
const mirroredFile =
|
|
115780
|
-
const digest3 = (0,
|
|
115950
|
+
const directory2 = import_node_path141.default.dirname(selected[0]);
|
|
115951
|
+
const codepointsFile = import_node_path141.default.join(directory2, "MaterialSymbols.codepoints");
|
|
115952
|
+
const mirroredFile = import_node_path141.default.join(directory2, "MaterialSymbols.mirrored");
|
|
115953
|
+
const digest3 = (0, import_node_crypto73.createHash)("md5");
|
|
115781
115954
|
for (const asset of [...selected, codepointsFile, mirroredFile].sort(
|
|
115782
|
-
(a, b) =>
|
|
115955
|
+
(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
115956
|
)) {
|
|
115784
|
-
digest3.update(
|
|
115957
|
+
digest3.update(import_node_fs139.default.readFileSync(asset));
|
|
115785
115958
|
}
|
|
115786
115959
|
return {
|
|
115787
115960
|
hash: digest3.digest("hex").slice(0, 8),
|
|
@@ -115789,15 +115962,15 @@ function materialSymbolFontAssets(fontPaths) {
|
|
|
115789
115962
|
mirroredPath: mirroredFile
|
|
115790
115963
|
};
|
|
115791
115964
|
}
|
|
115792
|
-
var
|
|
115965
|
+
var import_node_crypto73, import_node_fs139, import_node_module24, import_node_path141;
|
|
115793
115966
|
var init_material_symbol_fonts2 = __esm({
|
|
115794
115967
|
"cli/material-symbol-fonts.ts"() {
|
|
115795
115968
|
"use strict";
|
|
115796
115969
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
115797
|
-
|
|
115798
|
-
|
|
115970
|
+
import_node_crypto73 = require("node:crypto");
|
|
115971
|
+
import_node_fs139 = __toESM(require("node:fs"), 1);
|
|
115799
115972
|
import_node_module24 = require("node:module");
|
|
115800
|
-
|
|
115973
|
+
import_node_path141 = __toESM(require("node:path"), 1);
|
|
115801
115974
|
init_material_symbol_fonts();
|
|
115802
115975
|
}
|
|
115803
115976
|
});
|
|
@@ -115805,11 +115978,11 @@ var init_material_symbol_fonts2 = __esm({
|
|
|
115805
115978
|
// cli/app-fonts.ts
|
|
115806
115979
|
function discoverNativeLinkedAppFonts(opts) {
|
|
115807
115980
|
const { paths, materialSymbols } = discoverNativeLinkedAppFontAssets(opts);
|
|
115808
|
-
const realProjectRoot =
|
|
115981
|
+
const realProjectRoot = import_node_fs140.default.realpathSync(opts.projectDir);
|
|
115809
115982
|
const specs = getCliRuntime().engine_config_plugin_fonts.nativeLinkedFontSpecsFromPaths(
|
|
115810
115983
|
projectRelativeFontPaths(opts.projectDir, paths),
|
|
115811
115984
|
nativeFontPlatform(opts.platform),
|
|
115812
|
-
(fontPath) => stageHostFile(
|
|
115985
|
+
(fontPath) => stageHostFile(import_node_path142.default.resolve(realProjectRoot, fontPath), opts.nativeAssetOrigin)
|
|
115813
115986
|
);
|
|
115814
115987
|
attachMaterialSymbolMetadata(
|
|
115815
115988
|
specs,
|
|
@@ -115833,28 +116006,28 @@ function attachMaterialSymbolMetadata(specs, files2, assetUrl) {
|
|
|
115833
116006
|
};
|
|
115834
116007
|
}
|
|
115835
116008
|
function projectRelativeFontPaths(projectDir, fontPaths) {
|
|
115836
|
-
const projectRoot =
|
|
115837
|
-
const realProjectRoot =
|
|
116009
|
+
const projectRoot = import_node_path142.default.resolve(projectDir);
|
|
116010
|
+
const realProjectRoot = import_node_fs140.default.realpathSync(projectDir);
|
|
115838
116011
|
return fontPaths.map((fontPath) => {
|
|
115839
|
-
const lexical =
|
|
115840
|
-
const relative6 = lexical.startsWith("..") ||
|
|
115841
|
-
return relative6.split(
|
|
116012
|
+
const lexical = import_node_path142.default.relative(projectRoot, fontPath);
|
|
116013
|
+
const relative6 = lexical.startsWith("..") || import_node_path142.default.isAbsolute(lexical) ? import_node_path142.default.relative(realProjectRoot, import_node_fs140.default.realpathSync(fontPath)) : lexical;
|
|
116014
|
+
return relative6.split(import_node_path142.default.sep).join("/");
|
|
115842
116015
|
});
|
|
115843
116016
|
}
|
|
115844
116017
|
function resolveDeclaredFontPath(appDir, declared) {
|
|
115845
|
-
let resolved =
|
|
115846
|
-
if (!
|
|
116018
|
+
let resolved = import_node_path142.default.resolve(appDir, declared);
|
|
116019
|
+
if (!import_node_fs140.default.existsSync(resolved)) {
|
|
115847
116020
|
try {
|
|
115848
|
-
resolved = (0, import_node_module25.createRequire)(
|
|
116021
|
+
resolved = (0, import_node_module25.createRequire)(import_node_path142.default.join(appDir, "package.json")).resolve(declared);
|
|
115849
116022
|
} catch {
|
|
115850
116023
|
return [];
|
|
115851
116024
|
}
|
|
115852
116025
|
}
|
|
115853
|
-
return
|
|
116026
|
+
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
116027
|
}
|
|
115855
116028
|
function isFile(filePath) {
|
|
115856
116029
|
try {
|
|
115857
|
-
return
|
|
116030
|
+
return import_node_fs140.default.statSync(filePath).isFile();
|
|
115858
116031
|
} catch {
|
|
115859
116032
|
return false;
|
|
115860
116033
|
}
|
|
@@ -115900,13 +116073,13 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
115900
116073
|
scannedFontDirectories++;
|
|
115901
116074
|
let entries;
|
|
115902
116075
|
try {
|
|
115903
|
-
entries =
|
|
116076
|
+
entries = import_node_fs140.default.readdirSync(current2.dir, { withFileTypes: true });
|
|
115904
116077
|
} catch {
|
|
115905
116078
|
continue;
|
|
115906
116079
|
}
|
|
115907
116080
|
for (const entry of entries) {
|
|
115908
116081
|
if (entry.isSymbolicLink()) continue;
|
|
115909
|
-
const fullPath =
|
|
116082
|
+
const fullPath = import_node_path142.default.join(current2.dir, entry.name);
|
|
115910
116083
|
if (entry.isDirectory()) {
|
|
115911
116084
|
if (current2.depth < 4 && pending2.length < 64 && !entry.name.startsWith(".")) {
|
|
115912
116085
|
pending2.push({ dir: fullPath, depth: current2.depth + 1 });
|
|
@@ -115921,7 +116094,7 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
115921
116094
|
};
|
|
115922
116095
|
try {
|
|
115923
116096
|
const packageJson = JSON.parse(
|
|
115924
|
-
|
|
116097
|
+
import_node_fs140.default.readFileSync(import_node_path142.default.join(selectedAppDir, "package.json"), "utf8")
|
|
115925
116098
|
);
|
|
115926
116099
|
const dependencyNames = /* @__PURE__ */ new Set();
|
|
115927
116100
|
for (const field2 of ["dependencies", "devDependencies", "optionalDependencies"]) {
|
|
@@ -115936,22 +116109,22 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
115936
116109
|
const config = Reflect.get(packageJson, "reactNativeVectorIcons");
|
|
115937
116110
|
const configuredFontDir = config && typeof config === "object" ? Reflect.get(config, "fontDir") : null;
|
|
115938
116111
|
const configuredDir = typeof configuredFontDir === "string" ? configuredFontDir : "rnvi-fonts";
|
|
115939
|
-
const root =
|
|
115940
|
-
const relativeRoot =
|
|
115941
|
-
if (!relativeRoot.startsWith("..") && !
|
|
116112
|
+
const root = import_node_path142.default.resolve(selectedAppDir, configuredDir);
|
|
116113
|
+
const relativeRoot = import_node_path142.default.relative(selectedAppDir, root);
|
|
116114
|
+
if (!relativeRoot.startsWith("..") && !import_node_path142.default.isAbsolute(relativeRoot)) {
|
|
115942
116115
|
collectFontFiles(root);
|
|
115943
116116
|
}
|
|
115944
|
-
const vectorIconRequire = (0, import_node_module25.createRequire)(
|
|
116117
|
+
const vectorIconRequire = (0, import_node_module25.createRequire)(import_node_path142.default.join(selectedAppDir, "package.json"));
|
|
115945
116118
|
for (const dependencyName of vectorIconDependencies) {
|
|
115946
116119
|
try {
|
|
115947
116120
|
const entryPath = vectorIconRequire.resolve(dependencyName);
|
|
115948
|
-
const dependencyPath = dependencyName.split("/").join(
|
|
115949
|
-
const marker = `${
|
|
116121
|
+
const dependencyPath = dependencyName.split("/").join(import_node_path142.default.sep);
|
|
116122
|
+
const marker = `${import_node_path142.default.sep}node_modules${import_node_path142.default.sep}${dependencyPath}${import_node_path142.default.sep}`;
|
|
115950
116123
|
const markerIndex = entryPath.lastIndexOf(marker);
|
|
115951
116124
|
if (markerIndex === -1) continue;
|
|
115952
116125
|
const packageRoot = entryPath.slice(0, markerIndex + marker.length - 1);
|
|
115953
116126
|
const fontsDir = dependencyName === "react-native-vector-icons" ? "Fonts" : "fonts";
|
|
115954
|
-
collectFontFiles(
|
|
116127
|
+
collectFontFiles(import_node_path142.default.join(packageRoot, fontsDir));
|
|
115955
116128
|
} catch {
|
|
115956
116129
|
}
|
|
115957
116130
|
}
|
|
@@ -115959,17 +116132,17 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
115959
116132
|
} catch {
|
|
115960
116133
|
}
|
|
115961
116134
|
try {
|
|
115962
|
-
const configPath =
|
|
115963
|
-
if (
|
|
115964
|
-
const appConfigRequire = (0, import_node_module25.createRequire)(
|
|
116135
|
+
const configPath = import_node_path142.default.join(selectedAppDir, "react-native.config.js");
|
|
116136
|
+
if (import_node_fs140.default.statSync(configPath).isFile()) {
|
|
116137
|
+
const appConfigRequire = (0, import_node_module25.createRequire)(import_node_path142.default.join(selectedAppDir, "package.json"));
|
|
115965
116138
|
const rnConfig = appConfigRequire(configPath);
|
|
115966
116139
|
const assets2 = rnConfig && typeof rnConfig === "object" ? Reflect.get(rnConfig, "assets") : null;
|
|
115967
116140
|
if (Array.isArray(assets2)) {
|
|
115968
116141
|
for (const assetDir of assets2) {
|
|
115969
116142
|
if (typeof assetDir !== "string") continue;
|
|
115970
|
-
const root =
|
|
115971
|
-
const relativeRoot =
|
|
115972
|
-
if (relativeRoot.startsWith("..") ||
|
|
116143
|
+
const root = import_node_path142.default.resolve(selectedAppDir, assetDir);
|
|
116144
|
+
const relativeRoot = import_node_path142.default.relative(selectedAppDir, root);
|
|
116145
|
+
if (relativeRoot.startsWith("..") || import_node_path142.default.isAbsolute(relativeRoot)) continue;
|
|
115973
116146
|
collectFontFiles(root);
|
|
115974
116147
|
}
|
|
115975
116148
|
}
|
|
@@ -115977,33 +116150,33 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
115977
116150
|
} catch {
|
|
115978
116151
|
}
|
|
115979
116152
|
if (platform2 === "ios") {
|
|
115980
|
-
const iosDir =
|
|
116153
|
+
const iosDir = import_node_path142.default.join(selectedAppDir, "ios");
|
|
115981
116154
|
try {
|
|
115982
|
-
const targetDirs =
|
|
116155
|
+
const targetDirs = import_node_fs140.default.readdirSync(iosDir, { withFileTypes: true }).filter(
|
|
115983
116156
|
(entry) => entry.isDirectory() && !entry.isSymbolicLink() && entry.name !== "Pods" && entry.name !== "build" && !entry.name.startsWith(".")
|
|
115984
116157
|
).slice(0, 64);
|
|
115985
116158
|
const bundledByName = /* @__PURE__ */ new Map();
|
|
115986
|
-
for (const entry of
|
|
116159
|
+
for (const entry of import_node_fs140.default.readdirSync(iosDir, { withFileTypes: true })) {
|
|
115987
116160
|
if (!entry.isDirectory() || !entry.name.endsWith(".xcodeproj")) continue;
|
|
115988
|
-
const xcodeproj =
|
|
116161
|
+
const xcodeproj = import_node_path142.default.join(iosDir, entry.name);
|
|
115989
116162
|
for (const target of listXcodeAppTargets(xcodeproj, { requireSources: false })) {
|
|
115990
116163
|
const members2 = readXcodeAppTarget(xcodeproj, target, void 0, {
|
|
115991
116164
|
requireSources: false
|
|
115992
116165
|
});
|
|
115993
116166
|
for (const file of members2.resources) {
|
|
115994
|
-
if (!bundledByName.has(
|
|
115995
|
-
bundledByName.set(
|
|
116167
|
+
if (!bundledByName.has(import_node_path142.default.basename(file)))
|
|
116168
|
+
bundledByName.set(import_node_path142.default.basename(file), file);
|
|
115996
116169
|
}
|
|
115997
116170
|
}
|
|
115998
116171
|
}
|
|
115999
|
-
const plistPaths = [
|
|
116172
|
+
const plistPaths = [import_node_path142.default.join(iosDir, "Info.plist")];
|
|
116000
116173
|
for (const entry of targetDirs) {
|
|
116001
|
-
plistPaths.push(
|
|
116174
|
+
plistPaths.push(import_node_path142.default.join(iosDir, entry.name, "Info.plist"));
|
|
116002
116175
|
}
|
|
116003
116176
|
for (const plistPath of plistPaths) {
|
|
116004
116177
|
let parsed;
|
|
116005
116178
|
try {
|
|
116006
|
-
parsed = parsePlistSource(
|
|
116179
|
+
parsed = parsePlistSource(import_node_fs140.default.readFileSync(plistPath, "utf8"));
|
|
116007
116180
|
} catch {
|
|
116008
116181
|
continue;
|
|
116009
116182
|
}
|
|
@@ -116014,12 +116187,12 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
116014
116187
|
if (typeof declaredFont !== "string") continue;
|
|
116015
116188
|
const bundled = bundledByName.get(declaredFont);
|
|
116016
116189
|
const candidates = [
|
|
116017
|
-
|
|
116018
|
-
|
|
116190
|
+
import_node_path142.default.resolve(import_node_path142.default.dirname(plistPath), declaredFont),
|
|
116191
|
+
import_node_path142.default.resolve(iosDir, declaredFont)
|
|
116019
116192
|
];
|
|
116020
116193
|
const fontPath = candidates.find((candidate) => {
|
|
116021
|
-
const relative6 =
|
|
116022
|
-
if (relative6.startsWith("..") ||
|
|
116194
|
+
const relative6 = import_node_path142.default.relative(selectedAppDir, candidate);
|
|
116195
|
+
if (relative6.startsWith("..") || import_node_path142.default.isAbsolute(relative6)) return false;
|
|
116023
116196
|
return isFile(candidate);
|
|
116024
116197
|
}) ?? (bundled && isFile(bundled) ? bundled : void 0);
|
|
116025
116198
|
if (fontPath) fontPaths.push(fontPath);
|
|
@@ -116033,14 +116206,14 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
116033
116206
|
materialSymbols: materialSymbolFontAssets(materialFonts)
|
|
116034
116207
|
};
|
|
116035
116208
|
}
|
|
116036
|
-
var
|
|
116209
|
+
var import_node_fs140, import_node_module25, import_node_path142, require3;
|
|
116037
116210
|
var init_app_fonts = __esm({
|
|
116038
116211
|
"cli/app-fonts.ts"() {
|
|
116039
116212
|
"use strict";
|
|
116040
116213
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
116041
|
-
|
|
116214
|
+
import_node_fs140 = __toESM(require("node:fs"), 1);
|
|
116042
116215
|
import_node_module25 = require("node:module");
|
|
116043
|
-
|
|
116216
|
+
import_node_path142 = __toESM(require("node:path"), 1);
|
|
116044
116217
|
init_cli_runtime();
|
|
116045
116218
|
init_staged_host_files();
|
|
116046
116219
|
init_native_firebase_config();
|
|
@@ -116313,7 +116486,7 @@ function splashImageOnDisk(imageUrl, appDir) {
|
|
|
116313
116486
|
const { pathname } = new URL(imageUrl);
|
|
116314
116487
|
if (!pathname.startsWith("/assets/")) return false;
|
|
116315
116488
|
try {
|
|
116316
|
-
return
|
|
116489
|
+
return import_node_fs141.default.statSync(import_node_path143.default.join(appDir, decodeURIComponent(pathname.slice("/assets/".length)))).isFile();
|
|
116317
116490
|
} catch {
|
|
116318
116491
|
return false;
|
|
116319
116492
|
}
|
|
@@ -116359,18 +116532,18 @@ function stageBuiltBundleManifest(bundleUrl, config) {
|
|
|
116359
116532
|
const bundle = new URL(bundleUrl);
|
|
116360
116533
|
if (!isStagedHostFileRequest(bundle.pathname) || Object.keys(config).length === 0)
|
|
116361
116534
|
return null;
|
|
116362
|
-
const directory2 =
|
|
116535
|
+
const directory2 = import_node_fs141.default.mkdtempSync(import_node_path143.default.join(import_node_os24.default.tmpdir(), "peach-app-manifest-"));
|
|
116363
116536
|
try {
|
|
116364
|
-
const file =
|
|
116365
|
-
|
|
116537
|
+
const file = import_node_path143.default.join(directory2, "manifest.json");
|
|
116538
|
+
import_node_fs141.default.writeFileSync(file, JSON.stringify({ extra: { expoClient: config } }));
|
|
116366
116539
|
return stageHostFile(file, bundle.origin);
|
|
116367
116540
|
} finally {
|
|
116368
|
-
|
|
116541
|
+
import_node_fs141.default.rmSync(directory2, { recursive: true, force: true });
|
|
116369
116542
|
}
|
|
116370
116543
|
}
|
|
116371
116544
|
function readOneConfigNativeAppIdentity(appDir, platform2) {
|
|
116372
|
-
const config =
|
|
116373
|
-
return
|
|
116545
|
+
const config = import_node_path143.default.join(appDir, "vite.config.ts");
|
|
116546
|
+
return import_node_fs141.default.existsSync(config) ? oneNativeAppIdentity(import_node_fs141.default.readFileSync(config, "utf8"), platform2) : null;
|
|
116374
116547
|
}
|
|
116375
116548
|
function readProjectNativeAppIdentityWire(project2, platform2, iosTarget, environment) {
|
|
116376
116549
|
if (!canExtractNativeAppIdentity(platform2)) return null;
|
|
@@ -116583,14 +116756,14 @@ function applyShellLaunchOptions(url, opts) {
|
|
|
116583
116756
|
for (const entry of opts.args ?? []) url.searchParams.append("arg", entry);
|
|
116584
116757
|
return url;
|
|
116585
116758
|
}
|
|
116586
|
-
var
|
|
116759
|
+
var import_node_fs141, import_node_os24, import_node_path143, SHELL_APPS, DEV_BUNDLE_RESOLVE_ATTEMPTS, DEV_BUNDLE_RESOLVE_INTERVAL_MS, startedExpoConfigReads;
|
|
116587
116760
|
var init_shell_url = __esm({
|
|
116588
116761
|
"cli/commands/shell-url.ts"() {
|
|
116589
116762
|
"use strict";
|
|
116590
116763
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
116591
|
-
|
|
116764
|
+
import_node_fs141 = __toESM(require("node:fs"), 1);
|
|
116592
116765
|
import_node_os24 = __toESM(require("node:os"), 1);
|
|
116593
|
-
|
|
116766
|
+
import_node_path143 = __toESM(require("node:path"), 1);
|
|
116594
116767
|
init_oneViteAliases();
|
|
116595
116768
|
init_dev_server_scanner();
|
|
116596
116769
|
init_android_root_module();
|
|
@@ -116640,12 +116813,12 @@ var init_shell_url = __esm({
|
|
|
116640
116813
|
// cli/commands/skills.ts
|
|
116641
116814
|
function getSkillsDir() {
|
|
116642
116815
|
if (typeof __PEACH_BUNDLED_SKILLS__ !== "undefined") {
|
|
116643
|
-
const dir =
|
|
116816
|
+
const dir = path127.join(rnxHomeDir(), "skills", getCliVersion());
|
|
116644
116817
|
for (const [file, body] of Object.entries(__PEACH_BUNDLED_SKILLS__)) {
|
|
116645
|
-
const target =
|
|
116646
|
-
if (
|
|
116647
|
-
|
|
116648
|
-
|
|
116818
|
+
const target = path127.join(dir, file);
|
|
116819
|
+
if (fs101.existsSync(target)) continue;
|
|
116820
|
+
fs101.mkdirSync(path127.dirname(target), { recursive: true });
|
|
116821
|
+
fs101.writeFileSync(target, body);
|
|
116649
116822
|
}
|
|
116650
116823
|
return dir;
|
|
116651
116824
|
}
|
|
@@ -116653,10 +116826,10 @@ function getSkillsDir() {
|
|
|
116653
116826
|
const pkgPath = (0, import_url3.fileURLToPath)(
|
|
116654
116827
|
import_meta4.resolve(`${rnxPublicBrand.packageName}/package.json`)
|
|
116655
116828
|
);
|
|
116656
|
-
return primaryCheckoutPath(
|
|
116829
|
+
return primaryCheckoutPath(path127.join(path127.dirname(pkgPath), "skills"));
|
|
116657
116830
|
} catch {
|
|
116658
|
-
const __dirname =
|
|
116659
|
-
return primaryCheckoutPath(
|
|
116831
|
+
const __dirname = path127.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
|
|
116832
|
+
return primaryCheckoutPath(path127.resolve(__dirname, "../../skills"));
|
|
116660
116833
|
}
|
|
116661
116834
|
}
|
|
116662
116835
|
function primaryCheckoutPath(dir) {
|
|
@@ -116679,39 +116852,39 @@ function primaryCheckoutPath(dir) {
|
|
|
116679
116852
|
} catch {
|
|
116680
116853
|
return dir;
|
|
116681
116854
|
}
|
|
116682
|
-
if (
|
|
116683
|
-
const primary =
|
|
116684
|
-
return
|
|
116855
|
+
if (path127.basename(common) !== ".git") return dir;
|
|
116856
|
+
const primary = path127.join(path127.dirname(common), path127.relative(top, dir));
|
|
116857
|
+
return fs101.existsSync(primary) ? primary : dir;
|
|
116685
116858
|
}
|
|
116686
116859
|
function skillsDir() {
|
|
116687
116860
|
skillsDirPath ??= getSkillsDir();
|
|
116688
116861
|
return skillsDirPath;
|
|
116689
116862
|
}
|
|
116690
116863
|
function targetFromHome(envName, fallbackDir) {
|
|
116691
|
-
const home = process.env[envName] ||
|
|
116692
|
-
return
|
|
116864
|
+
const home = process.env[envName] || path127.join(os21.homedir(), fallbackDir);
|
|
116865
|
+
return path127.join(home, "skills");
|
|
116693
116866
|
}
|
|
116694
116867
|
function codexTargets() {
|
|
116695
116868
|
const homes = /* @__PURE__ */ new Map();
|
|
116696
116869
|
const userHome = process.env.HOME || os21.homedir();
|
|
116697
|
-
const primaryCodexHome = process.env.CODEX_HOME ||
|
|
116698
|
-
homes.set(
|
|
116870
|
+
const primaryCodexHome = process.env.CODEX_HOME || path127.join(userHome, ".codex");
|
|
116871
|
+
homes.set(path127.resolve(primaryCodexHome), "codex");
|
|
116699
116872
|
const tmCodexHomes = process.env.TM_CODEX_HOMES;
|
|
116700
116873
|
if (tmCodexHomes) {
|
|
116701
|
-
for (const h of tmCodexHomes.split(
|
|
116874
|
+
for (const h of tmCodexHomes.split(path127.delimiter)) {
|
|
116702
116875
|
if (h.trim()) {
|
|
116703
|
-
const resolved =
|
|
116876
|
+
const resolved = path127.resolve(h.trim());
|
|
116704
116877
|
if (!homes.has(resolved)) {
|
|
116705
|
-
homes.set(resolved,
|
|
116878
|
+
homes.set(resolved, path127.basename(resolved).replace(/^\./, ""));
|
|
116706
116879
|
}
|
|
116707
116880
|
}
|
|
116708
116881
|
}
|
|
116709
116882
|
}
|
|
116710
|
-
const tmHome = process.env.TM_HOME ||
|
|
116711
|
-
const enginePath =
|
|
116712
|
-
if (
|
|
116883
|
+
const tmHome = process.env.TM_HOME || path127.join(userHome, ".team-machine");
|
|
116884
|
+
const enginePath = path127.join(tmHome, "engine.yaml");
|
|
116885
|
+
if (fs101.existsSync(enginePath)) {
|
|
116713
116886
|
try {
|
|
116714
|
-
const engine = parse(
|
|
116887
|
+
const engine = parse(fs101.readFileSync(enginePath, "utf8"));
|
|
116715
116888
|
let accounts = engine;
|
|
116716
116889
|
for (const key2 of ["accounts", "providers", "codex", "accounts"]) {
|
|
116717
116890
|
accounts = isRecord(accounts) ? accounts[key2] : void 0;
|
|
@@ -116719,8 +116892,8 @@ function codexTargets() {
|
|
|
116719
116892
|
for (const [name3, account] of Object.entries(isRecord(accounts) ? accounts : {})) {
|
|
116720
116893
|
const configured = isRecord(account) ? account.home : void 0;
|
|
116721
116894
|
if (typeof configured !== "string") continue;
|
|
116722
|
-
const homeDir = configured.startsWith("~") ?
|
|
116723
|
-
const resolved =
|
|
116895
|
+
const homeDir = configured.startsWith("~") ? path127.join(userHome, configured.slice(1)) : configured;
|
|
116896
|
+
const resolved = path127.resolve(homeDir);
|
|
116724
116897
|
if (!homes.has(resolved)) {
|
|
116725
116898
|
homes.set(resolved, `codex-${name3}`);
|
|
116726
116899
|
}
|
|
@@ -116729,13 +116902,13 @@ function codexTargets() {
|
|
|
116729
116902
|
}
|
|
116730
116903
|
}
|
|
116731
116904
|
try {
|
|
116732
|
-
for (const entry of
|
|
116905
|
+
for (const entry of fs101.readdirSync(userHome)) {
|
|
116733
116906
|
if (entry.startsWith(".codex-")) {
|
|
116734
|
-
const fullPath =
|
|
116907
|
+
const fullPath = path127.join(userHome, entry);
|
|
116735
116908
|
try {
|
|
116736
|
-
const stat2 =
|
|
116909
|
+
const stat2 = fs101.statSync(fullPath);
|
|
116737
116910
|
if (stat2.isDirectory()) {
|
|
116738
|
-
const resolved =
|
|
116911
|
+
const resolved = path127.resolve(fullPath);
|
|
116739
116912
|
if (!homes.has(resolved)) {
|
|
116740
116913
|
homes.set(resolved, entry.replace(/^\./, ""));
|
|
116741
116914
|
}
|
|
@@ -116750,7 +116923,7 @@ function codexTargets() {
|
|
|
116750
116923
|
for (const [homePath, label] of homes) {
|
|
116751
116924
|
targets.push({
|
|
116752
116925
|
label,
|
|
116753
|
-
dir:
|
|
116926
|
+
dir: path127.join(homePath, "skills")
|
|
116754
116927
|
});
|
|
116755
116928
|
}
|
|
116756
116929
|
return targets;
|
|
@@ -116766,7 +116939,7 @@ function hasInstalledPeachSkills() {
|
|
|
116766
116939
|
(file) => /^([^/]+)\/SKILL\.md$/.exec(file)?.[1] ?? []
|
|
116767
116940
|
) : listSkills().map((skill7) => skill7.name);
|
|
116768
116941
|
return defaultAgentTargets().some(
|
|
116769
|
-
({ dir }) => names.some((name3) =>
|
|
116942
|
+
({ dir }) => names.some((name3) => fs101.existsSync(path127.join(dir, name3, "SKILL.md")))
|
|
116770
116943
|
);
|
|
116771
116944
|
}
|
|
116772
116945
|
function parseSkillFrontmatter(content) {
|
|
@@ -116809,27 +116982,27 @@ function readFrontmatterField(frontmatter, field2) {
|
|
|
116809
116982
|
return null;
|
|
116810
116983
|
}
|
|
116811
116984
|
function listSkills() {
|
|
116812
|
-
if (!
|
|
116985
|
+
if (!fs101.existsSync(skillsDir())) return [];
|
|
116813
116986
|
const skills = [];
|
|
116814
|
-
for (const entry of
|
|
116815
|
-
const skillMd =
|
|
116816
|
-
if (!
|
|
116817
|
-
const meta = parseSkillFrontmatter(
|
|
116987
|
+
for (const entry of fs101.readdirSync(skillsDir())) {
|
|
116988
|
+
const skillMd = path127.join(skillsDir(), entry, "SKILL.md");
|
|
116989
|
+
if (!fs101.existsSync(skillMd)) continue;
|
|
116990
|
+
const meta = parseSkillFrontmatter(fs101.readFileSync(skillMd, "utf8"));
|
|
116818
116991
|
if (meta) {
|
|
116819
116992
|
skills.push({ name: entry, description: meta.description });
|
|
116820
116993
|
}
|
|
116821
116994
|
}
|
|
116822
116995
|
return skills.sort((a, b) => a.name.localeCompare(b.name));
|
|
116823
116996
|
}
|
|
116824
|
-
var import_child_process9,
|
|
116997
|
+
var import_child_process9, fs101, os21, path127, import_url3, import_meta4, skillsDirPath;
|
|
116825
116998
|
var init_skills = __esm({
|
|
116826
116999
|
"cli/commands/skills.ts"() {
|
|
116827
117000
|
"use strict";
|
|
116828
117001
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
116829
117002
|
import_child_process9 = require("child_process");
|
|
116830
|
-
|
|
117003
|
+
fs101 = __toESM(require("fs"), 1);
|
|
116831
117004
|
os21 = __toESM(require("os"), 1);
|
|
116832
|
-
|
|
117005
|
+
path127 = __toESM(require("path"), 1);
|
|
116833
117006
|
import_url3 = require("url");
|
|
116834
117007
|
init_browser();
|
|
116835
117008
|
init_cli_version();
|
|
@@ -117181,8 +117354,8 @@ __export(metro_bundle_assets_exports, {
|
|
|
117181
117354
|
stageMetroBundleAssets: () => stageMetroBundleAssets
|
|
117182
117355
|
});
|
|
117183
117356
|
async function stageMetroBundleAssets(bundleFile, source, origin) {
|
|
117184
|
-
const directory2 =
|
|
117185
|
-
if (!
|
|
117357
|
+
const directory2 = import_node_path144.default.join(import_node_path144.default.dirname(bundleFile), "assets");
|
|
117358
|
+
if (!import_node_fs142.default.existsSync(directory2)) return;
|
|
117186
117359
|
const descriptors = extractAssetDescriptors(source).filter(
|
|
117187
117360
|
(descriptor) => !isEmbeddedAssetDescriptor(descriptor)
|
|
117188
117361
|
);
|
|
@@ -117206,14 +117379,14 @@ async function stageMetroBundleAssets(bundleFile, source, origin) {
|
|
|
117206
117379
|
const bytes = scales.map((scale) => {
|
|
117207
117380
|
const relative6 = placement.files.get(scale);
|
|
117208
117381
|
if (!relative6 || !search.dest) throw new Error("Metro asset scale is missing");
|
|
117209
|
-
return
|
|
117382
|
+
return import_node_fs142.default.readFileSync(import_node_path144.default.join(search.dest.directory, relative6));
|
|
117210
117383
|
});
|
|
117211
117384
|
const verified2 = perFile && hashes ? bytes.every((content, i) => {
|
|
117212
|
-
const hash = (0,
|
|
117385
|
+
const hash = (0, import_node_crypto74.createHash)("md5").update(content).digest("hex");
|
|
117213
117386
|
return descriptor.scales.some(
|
|
117214
117387
|
(scale, j) => scale === scales[i] && hashes[j] === hash
|
|
117215
117388
|
);
|
|
117216
|
-
}) : scales.length === descriptor.scales.length && (0,
|
|
117389
|
+
}) : scales.length === descriptor.scales.length && (0, import_node_crypto74.createHash)("md5").update(Buffer.concat(bytes)).digest("hex") === descriptor.hash;
|
|
117217
117390
|
if (!verified2)
|
|
117218
117391
|
throw new Error(`Metro asset changed while staging: ${descriptor.name}`);
|
|
117219
117392
|
scales.forEach((scale, i) => {
|
|
@@ -117240,14 +117413,14 @@ async function stageMetroBundleAssets(bundleFile, source, origin) {
|
|
|
117240
117413
|
});
|
|
117241
117414
|
stageHostMetroAssets(staged, origin);
|
|
117242
117415
|
}
|
|
117243
|
-
var
|
|
117416
|
+
var import_node_crypto74, import_node_fs142, import_node_path144;
|
|
117244
117417
|
var init_metro_bundle_assets = __esm({
|
|
117245
117418
|
"cli/metro-bundle-assets.ts"() {
|
|
117246
117419
|
"use strict";
|
|
117247
117420
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
117248
|
-
|
|
117249
|
-
|
|
117250
|
-
|
|
117421
|
+
import_node_crypto74 = require("node:crypto");
|
|
117422
|
+
import_node_fs142 = __toESM(require("node:fs"), 1);
|
|
117423
|
+
import_node_path144 = __toESM(require("node:path"), 1);
|
|
117251
117424
|
init_metroAssetArtifact();
|
|
117252
117425
|
init_staged_host_files();
|
|
117253
117426
|
}
|
|
@@ -117274,9 +117447,9 @@ async function runStreamCommand(args, opts = {}) {
|
|
|
117274
117447
|
});
|
|
117275
117448
|
if (typeof simId !== "string" || !simId)
|
|
117276
117449
|
throw new Error("Could not identify the local simulator.");
|
|
117277
|
-
const directory2 = (0,
|
|
117278
|
-
(0,
|
|
117279
|
-
const file = (0,
|
|
117450
|
+
const directory2 = (0, import_node_path145.join)(rnxHomeDir(), "streams");
|
|
117451
|
+
(0, import_node_fs143.mkdirSync)(directory2, { recursive: true });
|
|
117452
|
+
const file = (0, import_node_path145.join)(directory2, `${encodeURIComponent(simId)}.json`);
|
|
117280
117453
|
const state = await callInBridge(bridge, "SootSim.bridges.videoStream.state");
|
|
117281
117454
|
if (action === "status") {
|
|
117282
117455
|
console.log(` stream: ${state}`);
|
|
@@ -117301,13 +117474,13 @@ async function runStreamCommand(args, opts = {}) {
|
|
|
117301
117474
|
await callInBridge(bridge, "SootSim.bridges.videoStream.stop");
|
|
117302
117475
|
let record4 = null;
|
|
117303
117476
|
try {
|
|
117304
|
-
record4 = recordSchema.parse(JSON.parse((0,
|
|
117477
|
+
record4 = recordSchema.parse(JSON.parse((0, import_node_fs143.readFileSync)(file, "utf8")));
|
|
117305
117478
|
} catch (error) {
|
|
117306
117479
|
if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
|
|
117307
117480
|
throw error;
|
|
117308
117481
|
}
|
|
117309
117482
|
if (record4) await stopSession(record4);
|
|
117310
|
-
(0,
|
|
117483
|
+
(0, import_node_fs143.rmSync)(file, { force: true });
|
|
117311
117484
|
console.log(" stream: off");
|
|
117312
117485
|
return;
|
|
117313
117486
|
}
|
|
@@ -117343,7 +117516,7 @@ async function runStreamCommand(args, opts = {}) {
|
|
|
117343
117516
|
token: registration.token
|
|
117344
117517
|
});
|
|
117345
117518
|
writeSecureJsonAtomic(file, record3);
|
|
117346
|
-
removeRecord = () => (0,
|
|
117519
|
+
removeRecord = () => (0, import_node_fs143.rmSync)(file, { force: true });
|
|
117347
117520
|
console.log(` ${record3.watchUrl}`);
|
|
117348
117521
|
console.log(" Press Ctrl+C to stop streaming.");
|
|
117349
117522
|
await new Promise((resolve14) => {
|
|
@@ -117353,10 +117526,10 @@ async function runStreamCommand(args, opts = {}) {
|
|
|
117353
117526
|
process.off("SIGTERM", finish);
|
|
117354
117527
|
resolve14();
|
|
117355
117528
|
};
|
|
117356
|
-
const watcher = (0,
|
|
117529
|
+
const watcher = (0, import_node_fs143.watch)(directory2, (_event, filename) => {
|
|
117357
117530
|
if (filename !== `${encodeURIComponent(simId)}.json`) return;
|
|
117358
117531
|
try {
|
|
117359
|
-
(0,
|
|
117532
|
+
(0, import_node_fs143.readFileSync)(file);
|
|
117360
117533
|
} catch (error) {
|
|
117361
117534
|
if (error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
117362
117535
|
finish();
|
|
@@ -117380,13 +117553,13 @@ async function runStreamCommand(args, opts = {}) {
|
|
|
117380
117553
|
}
|
|
117381
117554
|
}
|
|
117382
117555
|
}
|
|
117383
|
-
var
|
|
117556
|
+
var import_node_fs143, import_node_path145, import_zod2, STREAM_FLAG, registrationSchema, recordSchema;
|
|
117384
117557
|
var init_stream = __esm({
|
|
117385
117558
|
"cli/commands/stream.ts"() {
|
|
117386
117559
|
"use strict";
|
|
117387
117560
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
117388
|
-
|
|
117389
|
-
|
|
117561
|
+
import_node_fs143 = require("node:fs");
|
|
117562
|
+
import_node_path145 = require("node:path");
|
|
117390
117563
|
import_zod2 = require("zod");
|
|
117391
117564
|
init_home_paths();
|
|
117392
117565
|
init_public_brand();
|
|
@@ -117428,14 +117601,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
117428
117601
|
const neededPackages = /* @__PURE__ */ new Set();
|
|
117429
117602
|
const factories = [];
|
|
117430
117603
|
const visit3 = (filePath) => {
|
|
117431
|
-
const real =
|
|
117604
|
+
const real = import_node_fs144.default.realpathSync(filePath);
|
|
117432
117605
|
const previous = files2.get(real);
|
|
117433
117606
|
if (previous !== void 0) return previous;
|
|
117434
117607
|
const id = "peach-config-file:" + files2.size;
|
|
117435
117608
|
files2.set(real, id);
|
|
117436
117609
|
const compiled = compileReplacementModule({
|
|
117437
117610
|
filePath: real,
|
|
117438
|
-
source:
|
|
117611
|
+
source: import_node_fs144.default.readFileSync(real, "utf8"),
|
|
117439
117612
|
runtimePackages,
|
|
117440
117613
|
localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
|
|
117441
117614
|
});
|
|
@@ -117459,7 +117632,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
117459
117632
|
if (!entries || typeof entries !== "object") continue;
|
|
117460
117633
|
for (const resolution of Object.values(entries)) {
|
|
117461
117634
|
if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
|
|
117462
|
-
resolution.file = visit3(
|
|
117635
|
+
resolution.file = visit3(import_node_path146.default.resolve(resolution.file));
|
|
117463
117636
|
}
|
|
117464
117637
|
}
|
|
117465
117638
|
}
|
|
@@ -117483,13 +117656,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
117483
117656
|
const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
|
|
117484
117657
|
return prefix + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
|
|
117485
117658
|
}
|
|
117486
|
-
var
|
|
117659
|
+
var import_node_fs144, import_node_path146, import_sucrase3, import_terser2, PREFIX_START, PREFIX_END;
|
|
117487
117660
|
var init_configured_bundle_producer = __esm({
|
|
117488
117661
|
"src/configured-bundle-producer.ts"() {
|
|
117489
117662
|
"use strict";
|
|
117490
117663
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
117491
|
-
|
|
117492
|
-
|
|
117664
|
+
import_node_fs144 = __toESM(require("node:fs"), 1);
|
|
117665
|
+
import_node_path146 = __toESM(require("node:path"), 1);
|
|
117493
117666
|
init_bundle_global_footer();
|
|
117494
117667
|
import_sucrase3 = require("sucrase");
|
|
117495
117668
|
import_terser2 = require("terser");
|
|
@@ -117799,9 +117972,9 @@ var init_android_theme = __esm({
|
|
|
117799
117972
|
|
|
117800
117973
|
// src/android-drawables.ts
|
|
117801
117974
|
function readAndroidDrawables(moduleDir, sources) {
|
|
117802
|
-
const res =
|
|
117975
|
+
const res = import_node_path147.default.join(moduleDir, "src/main/res");
|
|
117803
117976
|
const byName = /* @__PURE__ */ new Map();
|
|
117804
|
-
for (const dir of
|
|
117977
|
+
for (const dir of import_node_fs145.default.existsSync(res) ? import_node_fs145.default.readdirSync(res).sort() : []) {
|
|
117805
117978
|
if (!dir.startsWith("drawable")) continue;
|
|
117806
117979
|
const match = DRAWABLE_DIR.exec(dir);
|
|
117807
117980
|
const qualifier = match?.[1];
|
|
@@ -117811,10 +117984,10 @@ function readAndroidDrawables(moduleDir, sources) {
|
|
|
117811
117984
|
`${res}/${dir}: drawables under this qualifier are not resolved by Peach yet`
|
|
117812
117985
|
);
|
|
117813
117986
|
const version2 = Number(match[2] ?? 0);
|
|
117814
|
-
for (const entry of
|
|
117987
|
+
for (const entry of import_node_fs145.default.readdirSync(import_node_path147.default.join(res, dir)).sort()) {
|
|
117815
117988
|
if (!entry.endsWith(".xml") && !BITMAP.test(entry)) continue;
|
|
117816
117989
|
const name3 = entry.replace(BITMAP, "").replace(/\.xml$/, "");
|
|
117817
|
-
const file =
|
|
117990
|
+
const file = import_node_path147.default.join(res, dir, entry);
|
|
117818
117991
|
const files2 = byName.get(name3) ?? [];
|
|
117819
117992
|
byName.set(name3, files2);
|
|
117820
117993
|
if (version2 > DEVICE_API) continue;
|
|
@@ -117827,7 +118000,7 @@ function readAndroidDrawables(moduleDir, sources) {
|
|
|
117827
118000
|
ninePatch: entry.endsWith(".9.png")
|
|
117828
118001
|
});
|
|
117829
118002
|
else {
|
|
117830
|
-
const root = parseXml(
|
|
118003
|
+
const root = parseXml(import_node_fs145.default.readFileSync(file, "utf8"), file).children[0];
|
|
117831
118004
|
files2.push(
|
|
117832
118005
|
root?.name === "vector" ? {
|
|
117833
118006
|
file,
|
|
@@ -117994,13 +118167,13 @@ function readVector(root, file, sources) {
|
|
|
117994
118167
|
calls
|
|
117995
118168
|
};
|
|
117996
118169
|
}
|
|
117997
|
-
var
|
|
118170
|
+
var import_node_fs145, import_node_path147, DEVICE_API, BUCKETS, DRAWABLE_DIR, BITMAP;
|
|
117998
118171
|
var init_android_drawables = __esm({
|
|
117999
118172
|
"src/android-drawables.ts"() {
|
|
118000
118173
|
"use strict";
|
|
118001
118174
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
118002
|
-
|
|
118003
|
-
|
|
118175
|
+
import_node_fs145 = __toESM(require("node:fs"), 1);
|
|
118176
|
+
import_node_path147 = __toESM(require("node:path"), 1);
|
|
118004
118177
|
init_android_theme();
|
|
118005
118178
|
init_android_xml();
|
|
118006
118179
|
DEVICE_API = 37;
|
|
@@ -118022,12 +118195,12 @@ var init_android_drawables = __esm({
|
|
|
118022
118195
|
|
|
118023
118196
|
// src/android-layout-ids.ts
|
|
118024
118197
|
function readAndroidLayoutIds(moduleDir) {
|
|
118025
|
-
const res =
|
|
118198
|
+
const res = import_node_path148.default.join(moduleDir, "src/main/res");
|
|
118026
118199
|
const layouts = /* @__PURE__ */ new Set();
|
|
118027
118200
|
const ids = /* @__PURE__ */ new Set();
|
|
118028
118201
|
const elements = /* @__PURE__ */ new Map();
|
|
118029
|
-
for (const dir of
|
|
118030
|
-
const directory2 =
|
|
118202
|
+
for (const dir of import_node_fs146.default.existsSync(res) ? import_node_fs146.default.readdirSync(res).sort() : []) {
|
|
118203
|
+
const directory2 = import_node_path148.default.join(res, dir);
|
|
118031
118204
|
if (dir === "layout" || dir.startsWith("layout-")) {
|
|
118032
118205
|
const match = LAYOUT_DIR.exec(dir);
|
|
118033
118206
|
if (!match)
|
|
@@ -118037,13 +118210,13 @@ function readAndroidLayoutIds(moduleDir) {
|
|
|
118037
118210
|
const orientation = match[1] === "port" ? 1 : match[1] === "land" ? 2 : 0;
|
|
118038
118211
|
const night = match[2] === "notnight" ? 1 : match[2] === "night" ? 2 : 0;
|
|
118039
118212
|
const version2 = Number(match[3] ?? 0);
|
|
118040
|
-
for (const entry of
|
|
118213
|
+
for (const entry of import_node_fs146.default.readdirSync(directory2).sort()) {
|
|
118041
118214
|
if (!entry.endsWith(".xml")) continue;
|
|
118042
118215
|
const name3 = entry.slice(0, -".xml".length);
|
|
118043
118216
|
layouts.add(name3);
|
|
118044
|
-
const xml =
|
|
118217
|
+
const xml = import_node_fs146.default.readFileSync(import_node_path148.default.join(directory2, entry), "utf8");
|
|
118045
118218
|
for (const reference of xml.matchAll(ID_REFERENCE)) ids.add(reference[1]);
|
|
118046
|
-
const element = parseXml(xml,
|
|
118219
|
+
const element = parseXml(xml, import_node_path148.default.join(directory2, entry)).children[0];
|
|
118047
118220
|
if (!element || version2 > DEVICE_API) continue;
|
|
118048
118221
|
elements.set(name3, [
|
|
118049
118222
|
...elements.get(name3) ?? [],
|
|
@@ -118051,9 +118224,9 @@ function readAndroidLayoutIds(moduleDir) {
|
|
|
118051
118224
|
]);
|
|
118052
118225
|
}
|
|
118053
118226
|
} else if (dir.startsWith("values")) {
|
|
118054
|
-
for (const entry of
|
|
118227
|
+
for (const entry of import_node_fs146.default.readdirSync(directory2).sort()) {
|
|
118055
118228
|
if (!entry.endsWith(".xml")) continue;
|
|
118056
|
-
const xml =
|
|
118229
|
+
const xml = import_node_fs146.default.readFileSync(import_node_path148.default.join(directory2, entry), "utf8");
|
|
118057
118230
|
for (const item of xml.matchAll(ID_ITEM)) {
|
|
118058
118231
|
const name3 = ITEM_NAME.exec(item[0])?.[1];
|
|
118059
118232
|
if (name3) ids.add(name3);
|
|
@@ -118063,13 +118236,13 @@ function readAndroidLayoutIds(moduleDir) {
|
|
|
118063
118236
|
}
|
|
118064
118237
|
return { layouts: [...layouts].sort(), ids: [...ids].sort(), elements };
|
|
118065
118238
|
}
|
|
118066
|
-
var
|
|
118239
|
+
var import_node_fs146, import_node_path148, LAYOUT_DIR, ID_REFERENCE, ID_ITEM, ITEM_NAME;
|
|
118067
118240
|
var init_android_layout_ids = __esm({
|
|
118068
118241
|
"src/android-layout-ids.ts"() {
|
|
118069
118242
|
"use strict";
|
|
118070
118243
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
118071
|
-
|
|
118072
|
-
|
|
118244
|
+
import_node_fs146 = __toESM(require("node:fs"), 1);
|
|
118245
|
+
import_node_path148 = __toESM(require("node:path"), 1);
|
|
118073
118246
|
init_android_drawables();
|
|
118074
118247
|
init_android_xml();
|
|
118075
118248
|
LAYOUT_DIR = /^layout(?:-(port|land))?(?:-(notnight|night))?(?:-v(\d+))?$/;
|
|
@@ -118084,15 +118257,15 @@ function readAndroidStrings(moduleDir) {
|
|
|
118084
118257
|
const strings7 = /* @__PURE__ */ new Map();
|
|
118085
118258
|
const plurals = /* @__PURE__ */ new Map();
|
|
118086
118259
|
const arrays = /* @__PURE__ */ new Map();
|
|
118087
|
-
const res =
|
|
118088
|
-
const dirs =
|
|
118260
|
+
const res = import_node_path149.default.join(moduleDir, "src/main/res");
|
|
118261
|
+
const dirs = import_node_fs147.default.existsSync(res) ? import_node_fs147.default.readdirSync(res).sort() : [];
|
|
118089
118262
|
for (const dir of dirs) {
|
|
118090
118263
|
if (!dir.startsWith("values")) continue;
|
|
118091
118264
|
const qualifier = VALUES_DIR.exec(dir);
|
|
118092
|
-
for (const entry of
|
|
118265
|
+
for (const entry of import_node_fs147.default.readdirSync(import_node_path149.default.join(res, dir)).sort()) {
|
|
118093
118266
|
if (!entry.endsWith(".xml")) continue;
|
|
118094
|
-
const file =
|
|
118095
|
-
const text6 =
|
|
118267
|
+
const file = import_node_path149.default.join(res, dir, entry);
|
|
118268
|
+
const text6 = import_node_fs147.default.readFileSync(file, "utf8").replace(/<!--[\s\S]*?-->/g, "");
|
|
118096
118269
|
for (const match of text6.matchAll(ELEMENT)) {
|
|
118097
118270
|
const kind = match[1] ?? "";
|
|
118098
118271
|
const name3 = NAME.exec(match[2] ?? "")?.[1];
|
|
@@ -118143,13 +118316,13 @@ function compileString(raw2, where) {
|
|
|
118143
118316
|
where
|
|
118144
118317
|
);
|
|
118145
118318
|
}
|
|
118146
|
-
var
|
|
118319
|
+
var import_node_fs147, import_node_path149, VALUES_DIR, ELEMENT, ITEM, NAME, QUANTITY, QUANTITIES, isQuantity, sorted;
|
|
118147
118320
|
var init_android_strings = __esm({
|
|
118148
118321
|
"src/android-strings.ts"() {
|
|
118149
118322
|
"use strict";
|
|
118150
118323
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
118151
|
-
|
|
118152
|
-
|
|
118324
|
+
import_node_fs147 = __toESM(require("node:fs"), 1);
|
|
118325
|
+
import_node_path149 = __toESM(require("node:path"), 1);
|
|
118153
118326
|
init_android_string_value();
|
|
118154
118327
|
init_android_xml();
|
|
118155
118328
|
VALUES_DIR = /^values(?:-([a-z]{2,3})(?:-r([A-Z]{2}))?)?$/;
|
|
@@ -129533,7 +129706,7 @@ function repositories(body, where) {
|
|
|
129533
129706
|
if (name3 === "google") roots.push("https://dl.google.com/dl/android/maven2");
|
|
129534
129707
|
else if (name3 === "mavenCentral") roots.push("https://repo1.maven.org/maven2");
|
|
129535
129708
|
else if (name3 === "mavenLocal")
|
|
129536
|
-
roots.push(
|
|
129709
|
+
roots.push(import_node_path150.default.join(import_node_os25.default.homedir(), ".m2", "repository"));
|
|
129537
129710
|
else {
|
|
129538
129711
|
const declared = direct ?? /["']([^"']+)["']/.exec(block2 ?? "")?.[1];
|
|
129539
129712
|
if (!declared)
|
|
@@ -129548,9 +129721,9 @@ function repositories(body, where) {
|
|
|
129548
129721
|
return roots;
|
|
129549
129722
|
}
|
|
129550
129723
|
function mavenRepositories(projectDir, where) {
|
|
129551
|
-
const file = ["settings.gradle.kts", "settings.gradle"].map((name3) =>
|
|
129724
|
+
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
129725
|
if (!file) throw new Error(`${where}: ${projectDir} has no settings.gradle`);
|
|
129553
|
-
const text6 =
|
|
129726
|
+
const text6 = import_node_fs148.default.readFileSync(file, "utf8");
|
|
129554
129727
|
const management = text6.search(/\bdependencyResolutionManagement\b/);
|
|
129555
129728
|
if (management < 0)
|
|
129556
129729
|
throw new Error(`${where}: ${file} declares no dependency repositories`);
|
|
@@ -129605,43 +129778,43 @@ function zipSources(bytes, where) {
|
|
|
129605
129778
|
const localExtra = bytes.readUInt16LE(localOffset + 28);
|
|
129606
129779
|
const start = localOffset + 30 + localName + localExtra;
|
|
129607
129780
|
const payload = bytes.subarray(start, start + compressed);
|
|
129608
|
-
const data = method === 0 ? Buffer.from(payload) : method === 8 ? (0,
|
|
129781
|
+
const data = method === 0 ? Buffer.from(payload) : method === 8 ? (0, import_node_zlib5.inflateRawSync)(payload) : null;
|
|
129609
129782
|
if (!data) throw new Error(`${where}: ${name3} uses zip method ${method}`);
|
|
129610
129783
|
entries.push({ name: name3, data });
|
|
129611
129784
|
}
|
|
129612
129785
|
return entries;
|
|
129613
129786
|
}
|
|
129614
129787
|
function extract(bytes, where) {
|
|
129615
|
-
const key2 = (0,
|
|
129788
|
+
const key2 = (0, import_node_crypto75.createHash)("sha256").update(bytes).digest("hex");
|
|
129616
129789
|
const cached4 = pending.get(key2);
|
|
129617
129790
|
if (cached4) return cached4;
|
|
129618
129791
|
const request = (async () => {
|
|
129619
|
-
const dest =
|
|
129620
|
-
const marker =
|
|
129621
|
-
if (!
|
|
129792
|
+
const dest = import_node_path150.default.join(import_node_os25.default.tmpdir(), "peach-maven-sources", key2);
|
|
129793
|
+
const marker = import_node_path150.default.join(dest, ".complete");
|
|
129794
|
+
if (!import_node_fs148.default.existsSync(marker)) {
|
|
129622
129795
|
const entries = zipSources(bytes, where);
|
|
129623
129796
|
const java = entries.find((entry) => entry.name.endsWith(".java"));
|
|
129624
129797
|
if (java) throw new Error(`${where}: ${java.name} is a Java source`);
|
|
129625
129798
|
const kotlin = entries.filter((entry) => entry.name.endsWith(".kt"));
|
|
129626
129799
|
if (kotlin.length === 0) throw new Error(`${where}: sources jar has no Kotlin`);
|
|
129627
129800
|
const staging = `${dest}.partial-${process.pid}`;
|
|
129628
|
-
|
|
129801
|
+
import_node_fs148.default.rmSync(staging, { recursive: true, force: true });
|
|
129629
129802
|
for (const entry of kotlin) {
|
|
129630
|
-
const file =
|
|
129631
|
-
|
|
129632
|
-
|
|
129803
|
+
const file = import_node_path150.default.join(staging, entry.name);
|
|
129804
|
+
import_node_fs148.default.mkdirSync(import_node_path150.default.dirname(file), { recursive: true });
|
|
129805
|
+
import_node_fs148.default.writeFileSync(file, entry.data);
|
|
129633
129806
|
}
|
|
129634
|
-
|
|
129807
|
+
import_node_fs148.default.writeFileSync(import_node_path150.default.join(staging, ".complete"), "");
|
|
129635
129808
|
try {
|
|
129636
|
-
|
|
129809
|
+
import_node_fs148.default.renameSync(staging, dest);
|
|
129637
129810
|
} catch (error) {
|
|
129638
|
-
|
|
129639
|
-
if (!
|
|
129811
|
+
import_node_fs148.default.rmSync(staging, { recursive: true, force: true });
|
|
129812
|
+
if (!import_node_fs148.default.existsSync(marker)) throw error;
|
|
129640
129813
|
}
|
|
129641
129814
|
}
|
|
129642
|
-
return
|
|
129815
|
+
return import_node_fs148.default.readdirSync(dest, { recursive: true }).flatMap((entry) => {
|
|
129643
129816
|
const name3 = String(entry);
|
|
129644
|
-
return name3.endsWith(".kt") ? [
|
|
129817
|
+
return name3.endsWith(".kt") ? [import_node_path150.default.join(dest, name3)] : [];
|
|
129645
129818
|
}).sort();
|
|
129646
129819
|
})().catch((error) => {
|
|
129647
129820
|
pending.delete(key2);
|
|
@@ -129664,8 +129837,8 @@ async function sourcesJar(root, group, artifact, version2) {
|
|
|
129664
129837
|
if (!response.ok) throw new Error(`${url} answered ${response.status}`);
|
|
129665
129838
|
return Buffer.from(await response.arrayBuffer());
|
|
129666
129839
|
}
|
|
129667
|
-
const file =
|
|
129668
|
-
return
|
|
129840
|
+
const file = import_node_path150.default.join(root, ...parts);
|
|
129841
|
+
return import_node_fs148.default.existsSync(file) ? import_node_fs148.default.readFileSync(file) : null;
|
|
129669
129842
|
}
|
|
129670
129843
|
async function mavenKotlinSources(projectDir, coordinate, where) {
|
|
129671
129844
|
const { group, artifact, version: version2 } = coordinate;
|
|
@@ -129675,28 +129848,28 @@ async function mavenKotlinSources(projectDir, coordinate, where) {
|
|
|
129675
129848
|
}
|
|
129676
129849
|
return null;
|
|
129677
129850
|
}
|
|
129678
|
-
var
|
|
129851
|
+
var import_node_crypto75, import_node_fs148, import_node_os25, import_node_path150, import_node_zlib5, pending;
|
|
129679
129852
|
var init_kotlin_maven_sources = __esm({
|
|
129680
129853
|
"src/kotlin-maven-sources.ts"() {
|
|
129681
129854
|
"use strict";
|
|
129682
129855
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
129683
|
-
|
|
129684
|
-
|
|
129856
|
+
import_node_crypto75 = require("node:crypto");
|
|
129857
|
+
import_node_fs148 = __toESM(require("node:fs"), 1);
|
|
129685
129858
|
import_node_os25 = __toESM(require("node:os"), 1);
|
|
129686
|
-
|
|
129687
|
-
|
|
129859
|
+
import_node_path150 = __toESM(require("node:path"), 1);
|
|
129860
|
+
import_node_zlib5 = require("node:zlib");
|
|
129688
129861
|
pending = /* @__PURE__ */ new Map();
|
|
129689
129862
|
}
|
|
129690
129863
|
});
|
|
129691
129864
|
|
|
129692
129865
|
// src/kotlin-version-catalog.ts
|
|
129693
|
-
var
|
|
129866
|
+
var import_node_fs149, import_node_path151, import_smol_toml, accessorName, KotlinVersionCatalog;
|
|
129694
129867
|
var init_kotlin_version_catalog = __esm({
|
|
129695
129868
|
"src/kotlin-version-catalog.ts"() {
|
|
129696
129869
|
"use strict";
|
|
129697
129870
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
129698
|
-
|
|
129699
|
-
|
|
129871
|
+
import_node_fs149 = __toESM(require("node:fs"), 1);
|
|
129872
|
+
import_node_path151 = __toESM(require("node:path"), 1);
|
|
129700
129873
|
import_smol_toml = require("smol-toml");
|
|
129701
129874
|
init_is_record();
|
|
129702
129875
|
accessorName = (name3) => name3.replace(/[-_.]/g, ".");
|
|
@@ -129704,8 +129877,8 @@ var init_kotlin_version_catalog = __esm({
|
|
|
129704
129877
|
file;
|
|
129705
129878
|
tables;
|
|
129706
129879
|
constructor(projectDir) {
|
|
129707
|
-
this.file =
|
|
129708
|
-
this.tables =
|
|
129880
|
+
this.file = import_node_path151.default.join(projectDir, "gradle/libs.versions.toml");
|
|
129881
|
+
this.tables = import_node_fs149.default.existsSync(this.file) ? (0, import_smol_toml.parse)(import_node_fs149.default.readFileSync(this.file, "utf8")) : {};
|
|
129709
129882
|
}
|
|
129710
129883
|
entry(section, accessor, where) {
|
|
129711
129884
|
const table = this.tables[section];
|
|
@@ -129763,7 +129936,7 @@ __export(kotlin_app_exports, {
|
|
|
129763
129936
|
});
|
|
129764
129937
|
function readAndroidPins(moduleRoot) {
|
|
129765
129938
|
const toolchain = JSON.parse(
|
|
129766
|
-
|
|
129939
|
+
import_node_fs150.default.readFileSync(import_node_path152.default.join(moduleRoot, "toolchain.json"), "utf8")
|
|
129767
129940
|
);
|
|
129768
129941
|
if (!isRecord(toolchain))
|
|
129769
129942
|
throw new Error("peachsim kotlin/toolchain.json is not an object");
|
|
@@ -129804,8 +129977,8 @@ function readAndroidPins(moduleRoot) {
|
|
|
129804
129977
|
}
|
|
129805
129978
|
function readGradle(dir) {
|
|
129806
129979
|
for (const name3 of ["build.gradle.kts", "build.gradle"]) {
|
|
129807
|
-
const file =
|
|
129808
|
-
if (
|
|
129980
|
+
const file = import_node_path152.default.join(dir, name3);
|
|
129981
|
+
if (import_node_fs150.default.existsSync(file)) return { file, text: import_node_fs150.default.readFileSync(file, "utf8") };
|
|
129809
129982
|
}
|
|
129810
129983
|
return null;
|
|
129811
129984
|
}
|
|
@@ -130002,15 +130175,15 @@ function themeSources(moduleDir, night) {
|
|
|
130002
130175
|
} : { android, app: read("values") };
|
|
130003
130176
|
}
|
|
130004
130177
|
function valuesFiles(moduleDir, qualifier) {
|
|
130005
|
-
const values =
|
|
130006
|
-
return
|
|
130007
|
-
const file =
|
|
130008
|
-
return { file, text:
|
|
130178
|
+
const values = import_node_path152.default.join(moduleDir, "src/main/res", qualifier);
|
|
130179
|
+
return import_node_fs150.default.existsSync(values) ? import_node_fs150.default.readdirSync(values).filter((entry) => entry.endsWith(".xml")).map((entry) => {
|
|
130180
|
+
const file = import_node_path152.default.join(values, entry);
|
|
130181
|
+
return { file, text: import_node_fs150.default.readFileSync(file, "utf8") };
|
|
130009
130182
|
}) : [];
|
|
130010
130183
|
}
|
|
130011
130184
|
function readAppColors(moduleDir, theme) {
|
|
130012
|
-
const res =
|
|
130013
|
-
for (const dir of
|
|
130185
|
+
const res = import_node_path152.default.join(moduleDir, "src/main/res");
|
|
130186
|
+
for (const dir of import_node_fs150.default.existsSync(res) ? import_node_fs150.default.readdirSync(res).sort() : []) {
|
|
130014
130187
|
if (!dir.startsWith("values") || dir === "values" || dir === "values-night") continue;
|
|
130015
130188
|
const colors = Object.keys(readResourceValues(valuesFiles(moduleDir, dir)).colors);
|
|
130016
130189
|
if (colors.length > 0)
|
|
@@ -130082,17 +130255,17 @@ function isLauncher(element) {
|
|
|
130082
130255
|
);
|
|
130083
130256
|
}
|
|
130084
130257
|
async function readKotlinApp(moduleArg, options) {
|
|
130085
|
-
const moduleDir =
|
|
130086
|
-
const manifestFile =
|
|
130087
|
-
if (!
|
|
130258
|
+
const moduleDir = import_node_fs150.default.realpathSync(import_node_path152.default.resolve(moduleArg));
|
|
130259
|
+
const manifestFile = import_node_path152.default.join(moduleDir, "src/main/AndroidManifest.xml");
|
|
130260
|
+
if (!import_node_fs150.default.existsSync(manifestFile))
|
|
130088
130261
|
throw new Error(
|
|
130089
130262
|
`${moduleDir} is not an Android app module: no src/main/AndroidManifest.xml`
|
|
130090
130263
|
);
|
|
130091
130264
|
let projectDir = moduleDir;
|
|
130092
130265
|
while (!["settings.gradle.kts", "settings.gradle"].some(
|
|
130093
|
-
(name3) =>
|
|
130266
|
+
(name3) => import_node_fs150.default.existsSync(import_node_path152.default.join(projectDir, name3))
|
|
130094
130267
|
)) {
|
|
130095
|
-
const parent =
|
|
130268
|
+
const parent = import_node_path152.default.dirname(projectDir);
|
|
130096
130269
|
if (parent === projectDir)
|
|
130097
130270
|
throw new Error(`${moduleDir} has no settings.gradle above it`);
|
|
130098
130271
|
projectDir = parent;
|
|
@@ -130134,7 +130307,7 @@ async function readKotlinApp(moduleArg, options) {
|
|
|
130134
130307
|
const language = /^(\d+)\.(\d+)/.exec(kotlin)?.slice(1, 3).join(".");
|
|
130135
130308
|
if (!language)
|
|
130136
130309
|
throw new Error(`Kotlin plugin version ${kotlin} names no language version`);
|
|
130137
|
-
const manifest = parseXml(
|
|
130310
|
+
const manifest = parseXml(import_node_fs150.default.readFileSync(manifestFile, "utf8"), manifestFile);
|
|
130138
130311
|
const root = manifest.children.find((element) => element.name === "manifest");
|
|
130139
130312
|
const application = root?.children.find((element) => element.name === "application");
|
|
130140
130313
|
if (!root || !application) throw new Error(`${manifestFile} has no <application>`);
|
|
@@ -130228,11 +130401,11 @@ async function readKotlinApp(moduleArg, options) {
|
|
|
130228
130401
|
const sources = selected ? selected.kotlin : [];
|
|
130229
130402
|
if (!selected)
|
|
130230
130403
|
for (const set2 of ["java", "kotlin"]) {
|
|
130231
|
-
const dir =
|
|
130232
|
-
if (!
|
|
130404
|
+
const dir = import_node_path152.default.join(moduleDir, "src/main", set2);
|
|
130405
|
+
if (!import_node_fs150.default.existsSync(dir)) continue;
|
|
130233
130406
|
const walk3 = (current2) => {
|
|
130234
|
-
for (const entry of
|
|
130235
|
-
const full =
|
|
130407
|
+
for (const entry of import_node_fs150.default.readdirSync(current2, { withFileTypes: true })) {
|
|
130408
|
+
const full = import_node_path152.default.join(current2, entry.name);
|
|
130236
130409
|
if (entry.isDirectory()) walk3(full);
|
|
130237
130410
|
else if (entry.name.endsWith(".java"))
|
|
130238
130411
|
throw new Error(`${full}: Java sources are not supported by peach open`);
|
|
@@ -130277,13 +130450,13 @@ async function readKotlinApp(moduleArg, options) {
|
|
|
130277
130450
|
layoutIds: readAndroidLayoutIds(moduleDir)
|
|
130278
130451
|
};
|
|
130279
130452
|
}
|
|
130280
|
-
var
|
|
130453
|
+
var import_node_fs150, import_node_path152, ANDROID_NS, MAIN, LAUNCHER, PLUGINS, PLATFORM_GROUPS, PLATFORM_ARTIFACTS, ANDROID_PIN;
|
|
130281
130454
|
var init_kotlin_app = __esm({
|
|
130282
130455
|
"src/kotlin-app.ts"() {
|
|
130283
130456
|
"use strict";
|
|
130284
130457
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
130285
|
-
|
|
130286
|
-
|
|
130458
|
+
import_node_fs150 = __toESM(require("node:fs"), 1);
|
|
130459
|
+
import_node_path152 = __toESM(require("node:path"), 1);
|
|
130287
130460
|
init_android_drawables();
|
|
130288
130461
|
init_android_layout_ids();
|
|
130289
130462
|
init_android_strings();
|
|
@@ -130335,24 +130508,24 @@ __export(native_input_exports, {
|
|
|
130335
130508
|
});
|
|
130336
130509
|
function resolveNativeInput(target) {
|
|
130337
130510
|
if (!target || /^\w+:\/\//.test(target) || /^\d+$/.test(target)) return null;
|
|
130338
|
-
const resolved =
|
|
130339
|
-
const stat2 =
|
|
130511
|
+
const resolved = import_node_path153.default.resolve(target);
|
|
130512
|
+
const stat2 = import_node_fs151.default.statSync(resolved, { throwIfNoEntry: false });
|
|
130340
130513
|
if (!stat2) return null;
|
|
130341
130514
|
if (stat2.isFile()) {
|
|
130342
|
-
if (resolved.endsWith(".swift") &&
|
|
130343
|
-
return { kind: "swift-file", path:
|
|
130344
|
-
if (
|
|
130345
|
-
return { kind: "swift-package", path:
|
|
130515
|
+
if (resolved.endsWith(".swift") && import_node_path153.default.basename(resolved) !== "Package.swift")
|
|
130516
|
+
return { kind: "swift-file", path: import_node_fs151.default.realpathSync(resolved) };
|
|
130517
|
+
if (import_node_path153.default.basename(resolved) === "Package.swift")
|
|
130518
|
+
return { kind: "swift-package", path: import_node_fs151.default.realpathSync(import_node_path153.default.dirname(resolved)) };
|
|
130346
130519
|
return null;
|
|
130347
130520
|
}
|
|
130348
130521
|
if (!stat2.isDirectory()) return null;
|
|
130349
|
-
if (
|
|
130350
|
-
return { kind: "swift-package", path:
|
|
130522
|
+
if (import_node_fs151.default.existsSync(import_node_path153.default.join(resolved, "Package.swift")))
|
|
130523
|
+
return { kind: "swift-package", path: import_node_fs151.default.realpathSync(resolved) };
|
|
130351
130524
|
const xcode = findXcodeProject(resolved);
|
|
130352
|
-
if (xcode) return { kind: "xcode", path:
|
|
130353
|
-
if (
|
|
130354
|
-
return { kind: "kotlin", path:
|
|
130355
|
-
if (!
|
|
130525
|
+
if (xcode) return { kind: "xcode", path: import_node_fs151.default.realpathSync(xcode) };
|
|
130526
|
+
if (import_node_fs151.default.existsSync(import_node_path153.default.join(resolved, "src/main/AndroidManifest.xml")))
|
|
130527
|
+
return { kind: "kotlin", path: import_node_fs151.default.realpathSync(resolved) };
|
|
130528
|
+
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
130529
|
throw new Error(
|
|
130357
130530
|
`${target} holds Swift files but no Package.swift or Xcode project; open one .swift file, a Swift package, or an Xcode project`
|
|
130358
130531
|
);
|
|
@@ -130381,7 +130554,7 @@ async function prepareSwiftInput(input, opts = {}) {
|
|
|
130381
130554
|
module2?.root,
|
|
130382
130555
|
run14?.configuration
|
|
130383
130556
|
) : input.path;
|
|
130384
|
-
const name3 = input.kind === "swift-file" ?
|
|
130557
|
+
const name3 = input.kind === "swift-file" ? import_node_path153.default.basename(input.path, ".swift") : import_node_path153.default.basename(packagePath);
|
|
130385
130558
|
const appProject = resolveAppProject(packagePath);
|
|
130386
130559
|
let appInfo;
|
|
130387
130560
|
try {
|
|
@@ -130436,7 +130609,7 @@ async function prepareNativeInput(input, opts) {
|
|
|
130436
130609
|
const metadata = await host2.kotlinAppArtifact(project2, moduleRoot, opts.origin);
|
|
130437
130610
|
const prefix = new URL(metadata.url).pathname.slice(0, -"app.mjs".length);
|
|
130438
130611
|
return {
|
|
130439
|
-
name:
|
|
130612
|
+
name: import_node_path153.default.basename(project2.projectDir),
|
|
130440
130613
|
guestSource: kotlinGuestBundle(),
|
|
130441
130614
|
guestPath: KOTLIN_GUEST_PATH,
|
|
130442
130615
|
metadataPath: host2.KOTLIN_PACKAGE_PATH,
|
|
@@ -130471,13 +130644,13 @@ async function prepareNativeInput(input, opts) {
|
|
|
130471
130644
|
throw error;
|
|
130472
130645
|
}
|
|
130473
130646
|
}
|
|
130474
|
-
var
|
|
130647
|
+
var import_node_fs151, import_node_path153;
|
|
130475
130648
|
var init_native_input = __esm({
|
|
130476
130649
|
"cli/native-input.ts"() {
|
|
130477
130650
|
"use strict";
|
|
130478
130651
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
130479
|
-
|
|
130480
|
-
|
|
130652
|
+
import_node_fs151 = __toESM(require("node:fs"), 1);
|
|
130653
|
+
import_node_path153 = __toESM(require("node:path"), 1);
|
|
130481
130654
|
init_configured_bundle_producer();
|
|
130482
130655
|
init_guest_bundle();
|
|
130483
130656
|
init_kotlinDiscoveryContract();
|
|
@@ -130615,7 +130788,7 @@ async function runKotlin(args, opts = {}) {
|
|
|
130615
130788
|
throw new Error(`unknown peach open flag for an Android app: ${arg}`);
|
|
130616
130789
|
else if (modulePath)
|
|
130617
130790
|
throw new Error("peach open expects one Android app module directory");
|
|
130618
|
-
else modulePath =
|
|
130791
|
+
else modulePath = import_node_path154.default.resolve(arg);
|
|
130619
130792
|
}
|
|
130620
130793
|
if (!modulePath) throw new Error("usage: peach open <android-app-module>");
|
|
130621
130794
|
const device = opts.device ?? opts.openArgs?.find((_, index) => opts.openArgs?.[index - 1] === "--device") ?? DEFAULT_DEVICE_BY_PLATFORM.android;
|
|
@@ -130638,7 +130811,7 @@ async function runKotlin(args, opts = {}) {
|
|
|
130638
130811
|
let origin = "";
|
|
130639
130812
|
let artifact;
|
|
130640
130813
|
let compileError = "Kotlin compilation is starting";
|
|
130641
|
-
const projectName =
|
|
130814
|
+
const projectName = import_node_path154.default.basename(project2.projectDir);
|
|
130642
130815
|
const routes2 = () => ({
|
|
130643
130816
|
root: project2.projectDir,
|
|
130644
130817
|
moduleRoot,
|
|
@@ -130763,7 +130936,7 @@ async function runKotlin(args, opts = {}) {
|
|
|
130763
130936
|
});
|
|
130764
130937
|
console.log(` Kotlin app: ${project2.launcher.name} in ${project2.moduleDir}`);
|
|
130765
130938
|
console.log(` Kotlin preview host: ${origin}`);
|
|
130766
|
-
watcher =
|
|
130939
|
+
watcher = import_node_fs152.default.watch(project2.projectDir, { recursive: true }, (_event, file) => {
|
|
130767
130940
|
if (file && file.split(/[\\/]/).some((segment) => segment === "build" || segment.startsWith(".")))
|
|
130768
130941
|
return;
|
|
130769
130942
|
void rebuild();
|
|
@@ -130818,14 +130991,14 @@ async function runKotlin(args, opts = {}) {
|
|
|
130818
130991
|
}
|
|
130819
130992
|
return code;
|
|
130820
130993
|
}
|
|
130821
|
-
var
|
|
130994
|
+
var import_node_fs152, import_node_http3, import_node_path154, import_ws5, HMR_PATH;
|
|
130822
130995
|
var init_kotlin = __esm({
|
|
130823
130996
|
"cli/commands/kotlin.ts"() {
|
|
130824
130997
|
"use strict";
|
|
130825
130998
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
130826
|
-
|
|
130999
|
+
import_node_fs152 = __toESM(require("node:fs"), 1);
|
|
130827
131000
|
import_node_http3 = __toESM(require("node:http"), 1);
|
|
130828
|
-
|
|
131001
|
+
import_node_path154 = __toESM(require("node:path"), 1);
|
|
130829
131002
|
import_ws5 = require("ws");
|
|
130830
131003
|
init_device_catalog();
|
|
130831
131004
|
init_guest_bundle();
|
|
@@ -130882,7 +131055,7 @@ async function runSwift(args, opts = {}) {
|
|
|
130882
131055
|
const value = input[++index];
|
|
130883
131056
|
if (!value || value.startsWith("-"))
|
|
130884
131057
|
throw new Error("--swift-sdks-path requires a value");
|
|
130885
|
-
process.env.PEACH_SWIFT_SDKS_PATH =
|
|
131058
|
+
process.env.PEACH_SWIFT_SDKS_PATH = import_node_path155.default.resolve(value);
|
|
130886
131059
|
} else if (arg === "--host-port" || valueFlags.has(arg)) {
|
|
130887
131060
|
const value = input[++index];
|
|
130888
131061
|
if (!value || value.startsWith("-")) throw new Error(`${arg} requires a value`);
|
|
@@ -130896,7 +131069,7 @@ async function runSwift(args, opts = {}) {
|
|
|
130896
131069
|
else if (arg.startsWith("-"))
|
|
130897
131070
|
throw new Error(`unknown peach open flag for a Swift app: ${arg}`);
|
|
130898
131071
|
else if (packagePath) throw new Error("peach open expects one project");
|
|
130899
|
-
else packagePath =
|
|
131072
|
+
else packagePath = import_node_path155.default.resolve(arg);
|
|
130900
131073
|
}
|
|
130901
131074
|
if (!packagePath) {
|
|
130902
131075
|
throw new Error(
|
|
@@ -131071,7 +131244,7 @@ async function runSwift(args, opts = {}) {
|
|
|
131071
131244
|
code = 1;
|
|
131072
131245
|
stop();
|
|
131073
131246
|
});
|
|
131074
|
-
watcher =
|
|
131247
|
+
watcher = import_node_fs153.default.watch(
|
|
131075
131248
|
nativeInput.kind === "swift-file" ? nativeInput.path : packagePath,
|
|
131076
131249
|
{ recursive: nativeInput.kind !== "swift-file" },
|
|
131077
131250
|
(_event, file) => {
|
|
@@ -131139,14 +131312,14 @@ async function runSwift(args, opts = {}) {
|
|
|
131139
131312
|
}
|
|
131140
131313
|
return code;
|
|
131141
131314
|
}
|
|
131142
|
-
var
|
|
131315
|
+
var import_node_fs153, import_node_http4, import_node_path155, import_ws6;
|
|
131143
131316
|
var init_swift = __esm({
|
|
131144
131317
|
"cli/commands/swift.ts"() {
|
|
131145
131318
|
"use strict";
|
|
131146
131319
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
131147
|
-
|
|
131320
|
+
import_node_fs153 = __toESM(require("node:fs"), 1);
|
|
131148
131321
|
import_node_http4 = __toESM(require("node:http"), 1);
|
|
131149
|
-
|
|
131322
|
+
import_node_path155 = __toESM(require("node:path"), 1);
|
|
131150
131323
|
import_ws6 = require("ws");
|
|
131151
131324
|
init_backend_origin();
|
|
131152
131325
|
init_swift_submit();
|
|
@@ -131356,14 +131529,14 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
131356
131529
|
);
|
|
131357
131530
|
}
|
|
131358
131531
|
const { executable, prefixArgs } = rnxSelfInvocation();
|
|
131359
|
-
const bridgeLogPath =
|
|
131532
|
+
const bridgeLogPath = import_node_path156.default.join(
|
|
131360
131533
|
import_node_os26.default.tmpdir(),
|
|
131361
131534
|
`peach-bridge-${Date.now()}-${process.pid}.log`
|
|
131362
131535
|
);
|
|
131363
|
-
const bridgeLogFd =
|
|
131536
|
+
const bridgeLogFd = import_node_fs154.default.openSync(bridgeLogPath, "a");
|
|
131364
131537
|
let child;
|
|
131365
131538
|
try {
|
|
131366
|
-
child = (0,
|
|
131539
|
+
child = (0, import_node_child_process63.spawn)(
|
|
131367
131540
|
executable,
|
|
131368
131541
|
[...prefixArgs, "serve", "--quiet", "--port", String(preferredPort)],
|
|
131369
131542
|
{
|
|
@@ -131374,7 +131547,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
131374
131547
|
}
|
|
131375
131548
|
);
|
|
131376
131549
|
} finally {
|
|
131377
|
-
|
|
131550
|
+
import_node_fs154.default.closeSync(bridgeLogFd);
|
|
131378
131551
|
}
|
|
131379
131552
|
if (resources) {
|
|
131380
131553
|
resources.bridge = child;
|
|
@@ -131416,7 +131589,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
131416
131589
|
await sleep2(Math.max(0, Math.min(150, deadline - Date.now())));
|
|
131417
131590
|
}
|
|
131418
131591
|
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 =
|
|
131592
|
+
const bridgeLog = import_node_fs154.default.readFileSync(bridgeLogPath, "utf8").trim().slice(-2e3);
|
|
131420
131593
|
throw new Error(
|
|
131421
131594
|
`${reason}${bridgeLog ? `
|
|
131422
131595
|
${bridgeLog}` : ""}
|
|
@@ -131428,8 +131601,8 @@ async function retireOutdatedIdleBridge(lock) {
|
|
|
131428
131601
|
const current2 = getCliVersion();
|
|
131429
131602
|
if (isSootsimDevCheckout() || lock.cliVersion === current2) return;
|
|
131430
131603
|
if (lock.cliVersion && compareSemver(current2, lock.cliVersion) <= 0) return;
|
|
131431
|
-
const appRecord =
|
|
131432
|
-
if (
|
|
131604
|
+
const appRecord = import_node_path156.default.join(rnxHomeDir(), "app-runtime.json");
|
|
131605
|
+
if (import_node_fs154.default.existsSync(appRecord)) return;
|
|
131433
131606
|
const bridge = createBridge(lock.bridgePort, { commandTimeoutMs: 2e3 });
|
|
131434
131607
|
const simCount = await bridge.listSims({ includeRetained: true }).then(
|
|
131435
131608
|
(sims) => sims.length,
|
|
@@ -131455,31 +131628,31 @@ function isolateHomeForExplicitPort(preferredPort, explicitPort, lock) {
|
|
|
131455
131628
|
return;
|
|
131456
131629
|
}
|
|
131457
131630
|
const sharedRuntimes = runtimesDir();
|
|
131458
|
-
const home =
|
|
131631
|
+
const home = import_node_path156.default.join(rnxHomeDir(), "port-homes", String(preferredPort));
|
|
131459
131632
|
activatePeachHome(home);
|
|
131460
|
-
const runtimes =
|
|
131633
|
+
const runtimes = import_node_path156.default.join(home, "runtimes");
|
|
131461
131634
|
if (resolveDevCheckoutRuntimeRoot()) {
|
|
131462
131635
|
removePortHomeSharedRuntimesLink(runtimes, sharedRuntimes);
|
|
131463
|
-
} else if (
|
|
131464
|
-
|
|
131636
|
+
} else if (import_node_fs154.default.existsSync(sharedRuntimes) && !import_node_fs154.default.existsSync(runtimes)) {
|
|
131637
|
+
import_node_fs154.default.symlinkSync(sharedRuntimes, runtimes);
|
|
131465
131638
|
}
|
|
131466
131639
|
process.env[PEACH_HOME_ENV] = home;
|
|
131467
131640
|
}
|
|
131468
131641
|
function removePortHomeSharedRuntimesLink(runtimes, sharedRuntimes) {
|
|
131469
131642
|
let stat2;
|
|
131470
131643
|
try {
|
|
131471
|
-
stat2 =
|
|
131644
|
+
stat2 = import_node_fs154.default.lstatSync(runtimes);
|
|
131472
131645
|
} catch {
|
|
131473
131646
|
return;
|
|
131474
131647
|
}
|
|
131475
131648
|
if (!stat2.isSymbolicLink()) return;
|
|
131476
131649
|
let target;
|
|
131477
131650
|
try {
|
|
131478
|
-
target =
|
|
131651
|
+
target = import_node_path156.default.resolve(import_node_path156.default.dirname(runtimes), import_node_fs154.default.readlinkSync(runtimes));
|
|
131479
131652
|
} catch {
|
|
131480
131653
|
return;
|
|
131481
131654
|
}
|
|
131482
|
-
if (target === sharedRuntimes)
|
|
131655
|
+
if (target === sharedRuntimes) import_node_fs154.default.unlinkSync(runtimes);
|
|
131483
131656
|
}
|
|
131484
131657
|
async function ensureRuntimeForOpen() {
|
|
131485
131658
|
if (resolveDevCheckoutRuntimeRoot()) return;
|
|
@@ -131489,12 +131662,12 @@ async function ensureRuntimeForOpen() {
|
|
|
131489
131662
|
);
|
|
131490
131663
|
}
|
|
131491
131664
|
const active = readActiveRuntime();
|
|
131492
|
-
if (active &&
|
|
131665
|
+
if (active && import_node_fs154.default.existsSync(import_node_path156.default.join(runtimeDir(active), "index.html"))) {
|
|
131493
131666
|
await ensureCliCompanion(runtimeDir(active));
|
|
131494
131667
|
return;
|
|
131495
131668
|
}
|
|
131496
131669
|
const directory2 = runtimesDir();
|
|
131497
|
-
if (
|
|
131670
|
+
if (import_node_fs154.default.existsSync(directory2) && import_node_fs154.default.readdirSync(directory2).length > 0) {
|
|
131498
131671
|
throw new Error(
|
|
131499
131672
|
"peach open: runtime staging or selection is incomplete. finish staging and select the runtime with peach runtime use <version> before opening."
|
|
131500
131673
|
);
|
|
@@ -131580,11 +131753,11 @@ async function readSimDevice(bridge, simId) {
|
|
|
131580
131753
|
}
|
|
131581
131754
|
function prebuiltBundleFile(target) {
|
|
131582
131755
|
if (!/\.(js|bundle|jsbundle)$/i.test(target)) return null;
|
|
131583
|
-
const file =
|
|
131584
|
-
return
|
|
131756
|
+
const file = import_node_path156.default.resolve(process.cwd(), target);
|
|
131757
|
+
return import_node_fs154.default.statSync(file, { throwIfNoEntry: false })?.isFile() ? file : null;
|
|
131585
131758
|
}
|
|
131586
131759
|
async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
|
|
131587
|
-
const bytes =
|
|
131760
|
+
const bytes = import_node_fs154.default.readFileSync(file);
|
|
131588
131761
|
const source = bytes.toString("utf8");
|
|
131589
131762
|
const mode = await detectBundleModeFromText(source);
|
|
131590
131763
|
if (!mode) {
|
|
@@ -131602,7 +131775,7 @@ async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
|
|
|
131602
131775
|
stageHostBytes(
|
|
131603
131776
|
prepared === source ? bytes : Buffer.from(prepared, "utf8"),
|
|
131604
131777
|
`http://127.0.0.1:${bridgePort}`,
|
|
131605
|
-
|
|
131778
|
+
import_node_path156.default.extname(file)
|
|
131606
131779
|
)
|
|
131607
131780
|
);
|
|
131608
131781
|
url.searchParams.set("dev", String(mode === "development"));
|
|
@@ -131610,10 +131783,10 @@ async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
|
|
|
131610
131783
|
}
|
|
131611
131784
|
function normalizeReplacementPath(filePath) {
|
|
131612
131785
|
if (filePath.startsWith("~/")) {
|
|
131613
|
-
return
|
|
131786
|
+
return import_node_path156.default.join(import_node_os26.default.homedir(), filePath.slice(2));
|
|
131614
131787
|
}
|
|
131615
|
-
if (
|
|
131616
|
-
return
|
|
131788
|
+
if (import_node_path156.default.isAbsolute(filePath)) return filePath;
|
|
131789
|
+
return import_node_path156.default.resolve(process.cwd(), filePath);
|
|
131617
131790
|
}
|
|
131618
131791
|
function parseOpenRuntimeConfig(args) {
|
|
131619
131792
|
const modules = {};
|
|
@@ -131632,7 +131805,7 @@ function parseOpenRuntimeConfig(args) {
|
|
|
131632
131805
|
}
|
|
131633
131806
|
const moduleName2 = raw2.slice(0, eqIndex).trim();
|
|
131634
131807
|
const filePath = normalizeReplacementPath(raw2.slice(eqIndex + 1).trim());
|
|
131635
|
-
if (!
|
|
131808
|
+
if (!import_node_fs154.default.existsSync(filePath)) {
|
|
131636
131809
|
console.error(` peach open: replacement file not found: ${filePath}`);
|
|
131637
131810
|
peachExit(1);
|
|
131638
131811
|
}
|
|
@@ -131658,7 +131831,7 @@ function parseOpenRuntimeConfig(args) {
|
|
|
131658
131831
|
return config.modules || config.network ? config : void 0;
|
|
131659
131832
|
}
|
|
131660
131833
|
async function ensureConfiguredRuntime(version2) {
|
|
131661
|
-
if (
|
|
131834
|
+
if (import_node_fs154.default.existsSync(import_node_path156.default.join(runtimeDir(version2), "index.html"))) return;
|
|
131662
131835
|
console.error(` installing configured engine runtime ${version2}...`);
|
|
131663
131836
|
const result = await rnxRuntime.install({
|
|
131664
131837
|
version: version2,
|
|
@@ -131738,7 +131911,7 @@ async function waitForSimMatchOrHostExit(wsPort, commandTimeoutMs, predicate, ho
|
|
|
131738
131911
|
const watchHost = !!hostPid && Number.isInteger(hostPid) && hostPid > 1;
|
|
131739
131912
|
const hostExited = () => watchHost && hostPid !== void 0 && !isProcessRunning(hostPid);
|
|
131740
131913
|
if (opts.admittedFile && watchHost) {
|
|
131741
|
-
while (!
|
|
131914
|
+
while (!import_node_fs154.default.existsSync(opts.admittedFile)) {
|
|
131742
131915
|
opts.signal?.throwIfAborted();
|
|
131743
131916
|
if (hostExited()) return { kind: "host-exit" };
|
|
131744
131917
|
await sleep2(intervalMs);
|
|
@@ -131798,7 +131971,7 @@ function playwrightHostPidForSim(sim) {
|
|
|
131798
131971
|
function signalDriverLaunchConnected(result) {
|
|
131799
131972
|
if (!result.connectAckFile) return false;
|
|
131800
131973
|
try {
|
|
131801
|
-
|
|
131974
|
+
import_node_fs154.default.writeFileSync(
|
|
131802
131975
|
result.connectAckFile,
|
|
131803
131976
|
`${JSON.stringify({ connectedAt: Date.now(), pid: result.pid ?? null })}
|
|
131804
131977
|
`,
|
|
@@ -131812,7 +131985,7 @@ function signalDriverLaunchConnected(result) {
|
|
|
131812
131985
|
function readUnservedUrl(result) {
|
|
131813
131986
|
if (!result.diagnosticLogPath) return null;
|
|
131814
131987
|
try {
|
|
131815
|
-
const detail =
|
|
131988
|
+
const detail = import_node_fs154.default.readFileSync(result.diagnosticLogPath, "utf8");
|
|
131816
131989
|
const match = detail.match(/\[unserved\] nothing serves (\S+)/);
|
|
131817
131990
|
return match ? match[1] : null;
|
|
131818
131991
|
} catch {
|
|
@@ -131822,14 +131995,14 @@ function readUnservedUrl(result) {
|
|
|
131822
131995
|
function printDriverDiagnosticLogTail(result) {
|
|
131823
131996
|
if (!result.diagnosticLogPath) return;
|
|
131824
131997
|
try {
|
|
131825
|
-
const detail =
|
|
131998
|
+
const detail = import_node_fs154.default.readFileSync(result.diagnosticLogPath, "utf8").trim();
|
|
131826
131999
|
if (!detail) {
|
|
131827
|
-
console.error(` ${
|
|
132000
|
+
console.error(` ${import_node_path156.default.basename(result.diagnosticLogPath)} was empty`);
|
|
131828
132001
|
return;
|
|
131829
132002
|
}
|
|
131830
132003
|
const shown = detail.length > 4e3 ? `\u2026
|
|
131831
132004
|
${detail.slice(-4e3)}` : detail;
|
|
131832
|
-
console.error(` ${
|
|
132005
|
+
console.error(` ${import_node_path156.default.basename(result.diagnosticLogPath)}:`);
|
|
131833
132006
|
console.error(shown);
|
|
131834
132007
|
if (/No usable sandbox/i.test(detail)) {
|
|
131835
132008
|
console.error(
|
|
@@ -131839,7 +132012,7 @@ ${detail.slice(-4e3)}` : detail;
|
|
|
131839
132012
|
} catch (err) {
|
|
131840
132013
|
const message = err instanceof Error ? err.message : String(err);
|
|
131841
132014
|
console.error(
|
|
131842
|
-
` failed to read ${
|
|
132015
|
+
` failed to read ${import_node_path156.default.basename(result.diagnosticLogPath)}: ${message}`
|
|
131843
132016
|
);
|
|
131844
132017
|
}
|
|
131845
132018
|
}
|
|
@@ -131854,16 +132027,16 @@ async function waitForProcessExit(pid, timeoutMs = 2500) {
|
|
|
131854
132027
|
function isPlaywrightHostProcess(pid) {
|
|
131855
132028
|
if (process.platform === "linux") {
|
|
131856
132029
|
try {
|
|
131857
|
-
return
|
|
132030
|
+
return import_node_fs154.default.readFileSync(`/proc/${pid}/environ`, "utf8").split("\0").some((entry) => entry.startsWith("SOOTSIM_PW_URL="));
|
|
131858
132031
|
} catch {
|
|
131859
132032
|
return false;
|
|
131860
132033
|
}
|
|
131861
132034
|
}
|
|
131862
|
-
const plain = (0,
|
|
132035
|
+
const plain = (0, import_node_child_process63.spawnSync)("ps", ["-o", "command=", "-p", String(pid)], {
|
|
131863
132036
|
encoding: "utf8",
|
|
131864
132037
|
stdio: ["ignore", "pipe", "pipe"]
|
|
131865
132038
|
});
|
|
131866
|
-
const withEnv = (0,
|
|
132039
|
+
const withEnv = (0, import_node_child_process63.spawnSync)("ps", ["eww", "-o", "command=", "-p", String(pid)], {
|
|
131867
132040
|
encoding: "utf8",
|
|
131868
132041
|
stdio: ["ignore", "pipe", "pipe"]
|
|
131869
132042
|
});
|
|
@@ -132091,6 +132264,20 @@ async function runOpenCommand(args, opts = {}) {
|
|
|
132091
132264
|
}
|
|
132092
132265
|
}
|
|
132093
132266
|
async function openSim(args, opts) {
|
|
132267
|
+
const binary2 = args.find((arg) => !arg.startsWith("-") && isAppBinaryPath(arg));
|
|
132268
|
+
if (binary2) {
|
|
132269
|
+
try {
|
|
132270
|
+
const { bundlePath, platform: platform2 } = extractAppBinaryBundle(binary2);
|
|
132271
|
+
args = args.map((arg) => arg === binary2 ? bundlePath : arg);
|
|
132272
|
+
if (platform2 === "android" && !args.includes("--device") && !args.includes("-d"))
|
|
132273
|
+
args = [...args, "--device", "pixel-8"];
|
|
132274
|
+
} catch (error) {
|
|
132275
|
+
console.error(
|
|
132276
|
+
` peach open: ${error instanceof Error ? error.message : String(error)}`
|
|
132277
|
+
);
|
|
132278
|
+
peachExit(1);
|
|
132279
|
+
}
|
|
132280
|
+
}
|
|
132094
132281
|
const openArgOptions = {
|
|
132095
132282
|
stripBooleanFlags: [
|
|
132096
132283
|
"--new",
|
|
@@ -133167,18 +133354,18 @@ async function runCloseCommand(args, opts = {}) {
|
|
|
133167
133354
|
bridge.close();
|
|
133168
133355
|
}
|
|
133169
133356
|
}
|
|
133170
|
-
var
|
|
133357
|
+
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
133358
|
var init_control = __esm({
|
|
133172
133359
|
"cli/commands/control.ts"() {
|
|
133173
133360
|
"use strict";
|
|
133174
133361
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
133175
|
-
|
|
133176
|
-
|
|
133362
|
+
import_node_child_process63 = require("node:child_process");
|
|
133363
|
+
import_node_fs154 = __toESM(require("node:fs"), 1);
|
|
133177
133364
|
import_node_http5 = __toESM(require("node:http"), 1);
|
|
133178
133365
|
import_node_https2 = __toESM(require("node:https"), 1);
|
|
133179
133366
|
import_node_net = __toESM(require("node:net"), 1);
|
|
133180
133367
|
import_node_os26 = __toESM(require("node:os"), 1);
|
|
133181
|
-
|
|
133368
|
+
import_node_path156 = __toESM(require("node:path"), 1);
|
|
133182
133369
|
init_src();
|
|
133183
133370
|
import_ws7 = require("ws");
|
|
133184
133371
|
init_agent_identity();
|
|
@@ -133208,6 +133395,7 @@ var init_control = __esm({
|
|
|
133208
133395
|
init_app_config();
|
|
133209
133396
|
init_app_project();
|
|
133210
133397
|
init_app_splash();
|
|
133398
|
+
init_binary_sidecar();
|
|
133211
133399
|
init_bridge_diagnostics();
|
|
133212
133400
|
init_current_sim();
|
|
133213
133401
|
init_desktop_companion();
|
|
@@ -133677,10 +133865,14 @@ function renderActivityIdleScript({
|
|
|
133677
133865
|
maxMs,
|
|
133678
133866
|
requiredStillMs,
|
|
133679
133867
|
transitionStartWindowMs,
|
|
133680
|
-
transitionTimeoutMs
|
|
133868
|
+
transitionTimeoutMs,
|
|
133869
|
+
skipIfInspectActive
|
|
133681
133870
|
}) {
|
|
133682
133871
|
return `(async () => {
|
|
133683
133872
|
const start = Date.now()
|
|
133873
|
+
if (${skipIfInspectActive} && globalThis.__sootsimEngineState?.inspectActive === true) {
|
|
133874
|
+
return { settled: true, elapsed: 0, blockedBy: '' }
|
|
133875
|
+
}
|
|
133684
133876
|
const budgetMs = ${Math.max(0, Math.round(maxMs))}
|
|
133685
133877
|
const requiredStillMs = ${Math.max(1, Math.round(requiredStillMs))}
|
|
133686
133878
|
let deadline = start + budgetMs
|
|
@@ -133784,6 +133976,7 @@ async function waitForSootsimIdle({
|
|
|
133784
133976
|
screenStill = false,
|
|
133785
133977
|
maestro = false,
|
|
133786
133978
|
motionOnly = false,
|
|
133979
|
+
skipIfInspectActive = false,
|
|
133787
133980
|
readyPlayback = false,
|
|
133788
133981
|
transitionStartWindowMs = 80,
|
|
133789
133982
|
transitionTimeoutMs = 4e3
|
|
@@ -133799,7 +133992,8 @@ async function waitForSootsimIdle({
|
|
|
133799
133992
|
maxMs,
|
|
133800
133993
|
requiredStillMs: Math.max(1, Math.round(stablePolls)) * Math.max(1, Math.round(pollMs)),
|
|
133801
133994
|
transitionStartWindowMs,
|
|
133802
|
-
transitionTimeoutMs
|
|
133995
|
+
transitionTimeoutMs,
|
|
133996
|
+
skipIfInspectActive
|
|
133803
133997
|
}) : `(async () => {
|
|
133804
133998
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
|
133805
133999
|
// tests inject a virtual clock as globalThis.__sootsimIdleClock ({ now, sleep })
|
|
@@ -134003,7 +134197,8 @@ async function waitForSootsimIdle({
|
|
|
134003
134197
|
!screenStill && stats.hasPendingReadinessAnimationFrames === true && 'pendingReadinessFrames',
|
|
134004
134198
|
].filter(Boolean).join('+')
|
|
134005
134199
|
// the runtime reports only layout work that can reach the window:
|
|
134006
|
-
// a covered screen or inactive tab committing does not hold it
|
|
134200
|
+
// a covered screen or inactive tab committing does not hold it,
|
|
134201
|
+
// and readiness does not wait on ongoing playback's own layout.
|
|
134007
134202
|
layoutDirty =
|
|
134008
134203
|
stats.layoutDirty === true && stats.renderRequested === true
|
|
134009
134204
|
// a freshly-pushed screen showing a skeleton is layout-stable
|
|
@@ -135162,16 +135357,16 @@ function readRecentShellAppId(state) {
|
|
|
135162
135357
|
}
|
|
135163
135358
|
function resolveProjectRelativeFlowBase(flowDir) {
|
|
135164
135359
|
if (!flowDir) return process.cwd();
|
|
135165
|
-
return
|
|
135360
|
+
return path140.basename(flowDir) === ".maestro" ? path140.dirname(flowDir) : flowDir;
|
|
135166
135361
|
}
|
|
135167
135362
|
function resolveFlowScreenshotPathWithMode(screenshotDir, name3, opts) {
|
|
135168
135363
|
const normalizedName = name3.endsWith(".png") ? name3 : `${name3}.png`;
|
|
135169
|
-
if (
|
|
135364
|
+
if (path140.isAbsolute(normalizedName)) return normalizedName;
|
|
135170
135365
|
if (opts.mode === "flow" && /[\\/]/.test(normalizedName)) {
|
|
135171
135366
|
const baseDir = normalizedName.startsWith("./") || normalizedName.startsWith("../") ? opts.flowDir ?? process.cwd() : resolveProjectRelativeFlowBase(opts.flowDir);
|
|
135172
|
-
return
|
|
135367
|
+
return path140.resolve(baseDir, normalizedName);
|
|
135173
135368
|
}
|
|
135174
|
-
return
|
|
135369
|
+
return path140.join(screenshotDir, normalizedName);
|
|
135175
135370
|
}
|
|
135176
135371
|
function normalizeFlowScreenshotSpec(step) {
|
|
135177
135372
|
if (typeof step === "string") {
|
|
@@ -135273,13 +135468,13 @@ function normalizeBareStringStep(verb2) {
|
|
|
135273
135468
|
function parseFlowSteps(content) {
|
|
135274
135469
|
return parseFlowFile(content).steps;
|
|
135275
135470
|
}
|
|
135276
|
-
var
|
|
135471
|
+
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
135472
|
var init_bridge_flow_runner = __esm({
|
|
135278
135473
|
"cli/bridge-flow-runner.ts"() {
|
|
135279
135474
|
"use strict";
|
|
135280
135475
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
135281
|
-
|
|
135282
|
-
|
|
135476
|
+
fs115 = __toESM(require("fs"), 1);
|
|
135477
|
+
path140 = __toESM(require("path"), 1);
|
|
135283
135478
|
init_src2();
|
|
135284
135479
|
import_frame_identity = __toESM(require_frame_identity(), 1);
|
|
135285
135480
|
init_device_catalog();
|
|
@@ -135693,14 +135888,14 @@ var init_bridge_flow_runner = __esm({
|
|
|
135693
135888
|
if (chunks.length === 0) {
|
|
135694
135889
|
throw new Error("recording requested but no video buffer was produced");
|
|
135695
135890
|
}
|
|
135696
|
-
|
|
135891
|
+
fs115.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
|
|
135697
135892
|
const videoMime = stopped.mime || this.opts.recordingFormat || "video/webm";
|
|
135698
135893
|
const extension = videoMime.includes("mp4") ? "mp4" : "webm";
|
|
135699
|
-
const outputPath2 =
|
|
135894
|
+
const outputPath2 = path140.join(
|
|
135700
135895
|
this.opts.recordingOutputDir,
|
|
135701
135896
|
`peach-${Date.now()}.${extension}`
|
|
135702
135897
|
);
|
|
135703
|
-
|
|
135898
|
+
fs115.writeFileSync(outputPath2, Buffer.concat(chunks));
|
|
135704
135899
|
return outputPath2;
|
|
135705
135900
|
}
|
|
135706
135901
|
async waitForRecordingTail(opts) {
|
|
@@ -136000,7 +136195,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
136000
136195
|
}
|
|
136001
136196
|
const direct = await test.activatePressAt(point.x, point.y, ${nodeId})
|
|
136002
136197
|
if (direct?.ok) {
|
|
136003
|
-
|
|
136198
|
+
globalThis.dispatchEvent(
|
|
136004
136199
|
new CustomEvent('sootsim:agentAction', {
|
|
136005
136200
|
detail: { type: 'tap', x: point.x, y: point.y, target: ${JSON.stringify(
|
|
136006
136201
|
replayTarget
|
|
@@ -136017,7 +136212,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
136017
136212
|
if (!test?.activatePressAt) return null
|
|
136018
136213
|
const direct = await test.activatePressAt(${x}, ${y})
|
|
136019
136214
|
if (direct?.ok) {
|
|
136020
|
-
|
|
136215
|
+
globalThis.dispatchEvent(
|
|
136021
136216
|
new CustomEvent('sootsim:agentAction', {
|
|
136022
136217
|
detail: { type: 'tap', x: ${x}, y: ${y} },
|
|
136023
136218
|
}),
|
|
@@ -136416,7 +136611,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
136416
136611
|
flowDir: this.opts.flowDir
|
|
136417
136612
|
}
|
|
136418
136613
|
);
|
|
136419
|
-
|
|
136614
|
+
fs115.mkdirSync(path140.dirname(outputPath2), { recursive: true });
|
|
136420
136615
|
const layers = spec.layers ?? this.opts.screenshotLayers;
|
|
136421
136616
|
const screenshotRequest = {
|
|
136422
136617
|
type: "screenshot",
|
|
@@ -136451,11 +136646,11 @@ var init_bridge_flow_runner = __esm({
|
|
|
136451
136646
|
throw new Error("could not read current device model for framed screenshot");
|
|
136452
136647
|
}
|
|
136453
136648
|
const framed = await composeFramedScreenshot(rawBuffer, model);
|
|
136454
|
-
|
|
136649
|
+
fs115.writeFileSync(outputPath2, framed);
|
|
136455
136650
|
console.log(`[flow] screenshot: ${outputPath2} (frame: ${model})`);
|
|
136456
136651
|
return outputPath2;
|
|
136457
136652
|
}
|
|
136458
|
-
|
|
136653
|
+
fs115.writeFileSync(outputPath2, rawBuffer);
|
|
136459
136654
|
console.log(`[flow] screenshot: ${outputPath2}`);
|
|
136460
136655
|
return outputPath2;
|
|
136461
136656
|
}
|
|
@@ -136494,11 +136689,11 @@ var init_bridge_flow_runner = __esm({
|
|
|
136494
136689
|
// + a11y tree + console errors/warnings + failed network requests +
|
|
136495
136690
|
// shell state, all under one directory so post-mortem is one grep away.
|
|
136496
136691
|
async captureFailureBundle(outputDir, context) {
|
|
136497
|
-
|
|
136692
|
+
fs115.mkdirSync(outputDir, { recursive: true });
|
|
136498
136693
|
const write = (name3, content) => {
|
|
136499
136694
|
try {
|
|
136500
|
-
|
|
136501
|
-
|
|
136695
|
+
fs115.writeFileSync(
|
|
136696
|
+
path140.join(outputDir, name3),
|
|
136502
136697
|
typeof content === "string" ? redactForSharing(content) : content
|
|
136503
136698
|
);
|
|
136504
136699
|
} catch {
|
|
@@ -136994,12 +137189,13 @@ var init_bridge_flow_runner = __esm({
|
|
|
136994
137189
|
}
|
|
136995
137190
|
async setLaunchPermissions(permissions) {
|
|
136996
137191
|
const statuses = maestroLaunchPermissions(permissions);
|
|
136997
|
-
|
|
136998
|
-
|
|
136999
|
-
|
|
137000
|
-
|
|
137001
|
-
|
|
137002
|
-
|
|
137192
|
+
await this.evaluate(`(async () => {
|
|
137193
|
+
const test = globalThis.__sootsimTest
|
|
137194
|
+
const appId = await test.permissionGuestAppId()
|
|
137195
|
+
for (const [kind, status] of ${JSON.stringify([...statuses])}) {
|
|
137196
|
+
await test.permissionSetAppPermission(appId, kind, { status })
|
|
137197
|
+
}
|
|
137198
|
+
})()`);
|
|
137003
137199
|
}
|
|
137004
137200
|
// ios waits up to three seconds for a still screen, then compares native
|
|
137005
137201
|
// hierarchies.
|
|
@@ -137213,8 +137409,8 @@ var init_bridge_flow_runner = __esm({
|
|
|
137213
137409
|
runScript(target) {
|
|
137214
137410
|
const spec = typeof target === "string" ? { file: target } : target;
|
|
137215
137411
|
if (!spec.file) throw new Error("runScript requires a file");
|
|
137216
|
-
const scriptPath =
|
|
137217
|
-
const source =
|
|
137412
|
+
const scriptPath = path140.resolve(this.opts.flowDir, spec.file);
|
|
137413
|
+
const source = fs115.readFileSync(scriptPath, "utf8");
|
|
137218
137414
|
this.js.evaluate(source, { env: spec.env });
|
|
137219
137415
|
console.log(`[flow] runScript: ${spec.file} done`);
|
|
137220
137416
|
}
|
|
@@ -137246,10 +137442,10 @@ var init_bridge_flow_runner = __esm({
|
|
|
137246
137442
|
throw new Error("addMedia requires at least one file path");
|
|
137247
137443
|
}
|
|
137248
137444
|
for (const fileSpec of rawFiles) {
|
|
137249
|
-
const filePath =
|
|
137250
|
-
const stat2 =
|
|
137251
|
-
const bytes =
|
|
137252
|
-
const ext =
|
|
137445
|
+
const filePath = path140.resolve(this.opts.flowDir, fileSpec);
|
|
137446
|
+
const stat2 = fs115.statSync(filePath);
|
|
137447
|
+
const bytes = fs115.readFileSync(filePath);
|
|
137448
|
+
const ext = path140.extname(filePath).slice(1).toLowerCase();
|
|
137253
137449
|
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
137450
|
const dataUrl = `data:${mimeType};base64,${bytes.toString("base64")}`;
|
|
137255
137451
|
const added = await this.evaluate(
|
|
@@ -137638,14 +137834,14 @@ var init_bridge_flow_runner = __esm({
|
|
|
137638
137834
|
for (const [k, v6] of Object.entries(env)) this.js.putEnv(k, v6);
|
|
137639
137835
|
}
|
|
137640
137836
|
if (file) {
|
|
137641
|
-
const flowPath =
|
|
137642
|
-
const flowContent =
|
|
137837
|
+
const flowPath = path140.resolve(this.opts.flowDir, file);
|
|
137838
|
+
const flowContent = fs115.readFileSync(flowPath, "utf8");
|
|
137643
137839
|
const { frontmatter } = parseFlowFile(flowContent);
|
|
137644
137840
|
if (frontmatter.env && typeof frontmatter.env === "object") {
|
|
137645
137841
|
this.js.defineVariables(frontmatter.env);
|
|
137646
137842
|
}
|
|
137647
137843
|
const previousDir = this.opts.flowDir;
|
|
137648
|
-
this.opts.flowDir =
|
|
137844
|
+
this.opts.flowDir = path140.dirname(flowPath);
|
|
137649
137845
|
try {
|
|
137650
137846
|
await this.runFlow(parseFlowSteps(flowContent));
|
|
137651
137847
|
} finally {
|
|
@@ -137803,8 +137999,8 @@ __export(registry_exports, {
|
|
|
137803
137999
|
});
|
|
137804
138000
|
module.exports = __toCommonJS(registry_exports);
|
|
137805
138001
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
137806
|
-
var
|
|
137807
|
-
var
|
|
138002
|
+
var fs116 = __toESM(require("fs"), 1);
|
|
138003
|
+
var path141 = __toESM(require("path"), 1);
|
|
137808
138004
|
|
|
137809
138005
|
// src/skills/builtin/a11y-review.ts
|
|
137810
138006
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -137824,8 +138020,8 @@ var skill = {
|
|
|
137824
138020
|
},
|
|
137825
138021
|
async execute(params, context) {
|
|
137826
138022
|
const { chromium } = await import("playwright");
|
|
137827
|
-
const
|
|
137828
|
-
const
|
|
138023
|
+
const path142 = await import("path");
|
|
138024
|
+
const fs117 = await import("fs");
|
|
137829
138025
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
137830
138026
|
headless: true
|
|
137831
138027
|
});
|
|
@@ -137882,9 +138078,9 @@ var skill = {
|
|
|
137882
138078
|
warnings: issues.filter((i) => i.severity === "warning").length,
|
|
137883
138079
|
tree: typeof tree3 === "string" ? tree3 : JSON.stringify(tree3)
|
|
137884
138080
|
};
|
|
137885
|
-
const reportPath =
|
|
137886
|
-
|
|
137887
|
-
|
|
138081
|
+
const reportPath = path142.join(context.outputDir, "a11y-report.json");
|
|
138082
|
+
fs117.mkdirSync(path142.dirname(reportPath), { recursive: true });
|
|
138083
|
+
fs117.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
137888
138084
|
return {
|
|
137889
138085
|
success: issues.filter((i) => i.severity === "error").length === 0,
|
|
137890
138086
|
message: `${report.errors} errors, ${report.warnings} warnings across ${report.nodeCount} nodes`,
|
|
@@ -137918,14 +138114,14 @@ var skill2 = {
|
|
|
137918
138114
|
}
|
|
137919
138115
|
},
|
|
137920
138116
|
async execute(params, context) {
|
|
137921
|
-
const
|
|
137922
|
-
const
|
|
138117
|
+
const fs117 = await import("node:fs");
|
|
138118
|
+
const path142 = await import("node:path");
|
|
137923
138119
|
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 (!
|
|
138120
|
+
const packagePath = path142.join(context.projectDir, "package.json");
|
|
138121
|
+
if (!fs117.existsSync(packagePath)) {
|
|
137926
138122
|
return { success: false, message: "No package.json found" };
|
|
137927
138123
|
}
|
|
137928
|
-
const parsed = JSON.parse(
|
|
138124
|
+
const parsed = JSON.parse(fs117.readFileSync(packagePath, "utf8"));
|
|
137929
138125
|
if (!parsed || typeof parsed !== "object") {
|
|
137930
138126
|
return { success: false, message: "package.json is not an object" };
|
|
137931
138127
|
}
|
|
@@ -137937,9 +138133,9 @@ var skill2 = {
|
|
|
137937
138133
|
}) : scanDeps2(parsed);
|
|
137938
138134
|
const packageResult = params.packageName ? scan2.packages[0] : void 0;
|
|
137939
138135
|
const message = packageResult ? `${params.packageName}: ${formatPackageStatus2(packageResult)}. ${COMPAT_RESULT_CAVEAT2}` : `${formatScanCounts2(scan2)}. ${COMPAT_RESULT_CAVEAT2}`;
|
|
137940
|
-
const reportPath =
|
|
137941
|
-
|
|
137942
|
-
|
|
138136
|
+
const reportPath = path142.join(context.outputDir, "compat-report.json");
|
|
138137
|
+
fs117.mkdirSync(path142.dirname(reportPath), { recursive: true });
|
|
138138
|
+
fs117.writeFileSync(reportPath, `${JSON.stringify(scan2, null, 2)}
|
|
137943
138139
|
`);
|
|
137944
138140
|
return {
|
|
137945
138141
|
success: true,
|
|
@@ -137982,8 +138178,8 @@ var skill3 = {
|
|
|
137982
138178
|
record: { type: "boolean", description: "Record video of the flow" }
|
|
137983
138179
|
},
|
|
137984
138180
|
async execute(params, context) {
|
|
137985
|
-
const
|
|
137986
|
-
const
|
|
138181
|
+
const fs117 = await import("fs");
|
|
138182
|
+
const path142 = await import("path");
|
|
137987
138183
|
const { parseFlowFile: parseFlowFile2 } = await Promise.resolve().then(() => (init_flow_file(), flow_file_exports));
|
|
137988
138184
|
const { DEFAULT_SOOTSIM_BRIDGE_PORT: DEFAULT_SOOTSIM_BRIDGE_PORT2 } = await Promise.resolve().then(() => (init_bridge_constants(), bridge_constants_exports));
|
|
137989
138185
|
const { SootSimBridgeHost: SootSimBridgeHost2 } = await Promise.resolve().then(() => (init_bridge_host(), bridge_host_exports));
|
|
@@ -137993,7 +138189,7 @@ var skill3 = {
|
|
|
137993
138189
|
const host2 = new SootSimBridgeHost2({ port: DEFAULT_SOOTSIM_BRIDGE_PORT2 });
|
|
137994
138190
|
host2.start({ silent: true });
|
|
137995
138191
|
try {
|
|
137996
|
-
const flowContent =
|
|
138192
|
+
const flowContent = fs117.readFileSync(params.flowPath, "utf8");
|
|
137997
138193
|
const { steps } = parseFlowFile2(flowContent);
|
|
137998
138194
|
const beforeIds = new Set(host2.listSims().map((sim) => sim.id));
|
|
137999
138195
|
await runOpenCommand2([context.url, "--new", "--headless", "--no-describe"], {
|
|
@@ -138018,7 +138214,7 @@ var skill3 = {
|
|
|
138018
138214
|
});
|
|
138019
138215
|
const driver = new SootSimBridgeFlowRunner2(bridge, {
|
|
138020
138216
|
screenshotDir: context.outputDir,
|
|
138021
|
-
flowDir:
|
|
138217
|
+
flowDir: path142.dirname(path142.resolve(params.flowPath)),
|
|
138022
138218
|
simId,
|
|
138023
138219
|
recordingOutputDir: params.record ? context.outputDir : void 0
|
|
138024
138220
|
});
|
|
@@ -138040,7 +138236,7 @@ var skill3 = {
|
|
|
138040
138236
|
simId,
|
|
138041
138237
|
videoPath: videoPath || void 0
|
|
138042
138238
|
},
|
|
138043
|
-
artifacts: videoPath ? [{ type: "video", name:
|
|
138239
|
+
artifacts: videoPath ? [{ type: "video", name: path142.basename(videoPath), path: videoPath }] : void 0
|
|
138044
138240
|
};
|
|
138045
138241
|
} finally {
|
|
138046
138242
|
try {
|
|
@@ -138088,8 +138284,8 @@ var skill4 = {
|
|
|
138088
138284
|
},
|
|
138089
138285
|
async execute(params, context) {
|
|
138090
138286
|
const { chromium } = await import("playwright");
|
|
138091
|
-
const
|
|
138092
|
-
const
|
|
138287
|
+
const path142 = await import("path");
|
|
138288
|
+
const fs117 = await import("fs");
|
|
138093
138289
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
138094
138290
|
headless: true
|
|
138095
138291
|
});
|
|
@@ -138117,9 +138313,9 @@ var skill4 = {
|
|
|
138117
138313
|
...profile,
|
|
138118
138314
|
fps: syncCount > 0 ? (syncCount / (duration / 1e3)).toFixed(1) : "0"
|
|
138119
138315
|
};
|
|
138120
|
-
const reportPath =
|
|
138121
|
-
|
|
138122
|
-
|
|
138316
|
+
const reportPath = path142.join(context.outputDir, "perf-report.json");
|
|
138317
|
+
fs117.mkdirSync(path142.dirname(reportPath), { recursive: true });
|
|
138318
|
+
fs117.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
138123
138319
|
return {
|
|
138124
138320
|
success: true,
|
|
138125
138321
|
message: `${report.fps} fps, ${profile.avgSyncMs?.toFixed(1)}ms avg sync, ${nodeCount} nodes`,
|
|
@@ -138153,8 +138349,8 @@ var skill5 = {
|
|
|
138153
138349
|
},
|
|
138154
138350
|
async execute(params, context) {
|
|
138155
138351
|
const { chromium } = await import("playwright");
|
|
138156
|
-
const
|
|
138157
|
-
const
|
|
138352
|
+
const path142 = await import("path");
|
|
138353
|
+
const fs117 = await import("fs");
|
|
138158
138354
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
138159
138355
|
headless: true
|
|
138160
138356
|
});
|
|
@@ -138162,8 +138358,8 @@ var skill5 = {
|
|
|
138162
138358
|
try {
|
|
138163
138359
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
138164
138360
|
await page.waitForTimeout(2e3);
|
|
138165
|
-
const outputPath2 =
|
|
138166
|
-
|
|
138361
|
+
const outputPath2 = path142.join(context.outputDir, `${params.name}.png`);
|
|
138362
|
+
fs117.mkdirSync(path142.dirname(outputPath2), { recursive: true });
|
|
138167
138363
|
await page.screenshot({ path: outputPath2 });
|
|
138168
138364
|
return {
|
|
138169
138365
|
success: true,
|
|
@@ -138205,8 +138401,8 @@ var skill6 = {
|
|
|
138205
138401
|
},
|
|
138206
138402
|
async execute(params, context) {
|
|
138207
138403
|
const { chromium } = await import("playwright");
|
|
138208
|
-
const
|
|
138209
|
-
const
|
|
138404
|
+
const path142 = await import("path");
|
|
138405
|
+
const fs117 = await import("fs");
|
|
138210
138406
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
138211
138407
|
headless: true
|
|
138212
138408
|
});
|
|
@@ -138214,14 +138410,14 @@ var skill6 = {
|
|
|
138214
138410
|
try {
|
|
138215
138411
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
138216
138412
|
await page.waitForTimeout(2e3);
|
|
138217
|
-
const currentPath =
|
|
138218
|
-
|
|
138413
|
+
const currentPath = path142.join(context.outputDir, `${params.name}-current.png`);
|
|
138414
|
+
fs117.mkdirSync(path142.dirname(currentPath), { recursive: true });
|
|
138219
138415
|
await page.screenshot({ path: currentPath });
|
|
138220
138416
|
try {
|
|
138221
138417
|
const { PNG } = await import("pngjs");
|
|
138222
138418
|
const pixelmatch = (await import("pixelmatch")).default;
|
|
138223
|
-
const baseline = PNG.sync.read(
|
|
138224
|
-
const current2 = PNG.sync.read(
|
|
138419
|
+
const baseline = PNG.sync.read(fs117.readFileSync(params.baseline));
|
|
138420
|
+
const current2 = PNG.sync.read(fs117.readFileSync(currentPath));
|
|
138225
138421
|
const { width, height } = baseline;
|
|
138226
138422
|
const diff = new PNG({ width, height });
|
|
138227
138423
|
const numDiffPixels = pixelmatch(
|
|
@@ -138232,8 +138428,8 @@ var skill6 = {
|
|
|
138232
138428
|
height,
|
|
138233
138429
|
{ threshold: params.threshold || 0.1 }
|
|
138234
138430
|
);
|
|
138235
|
-
const diffPath =
|
|
138236
|
-
|
|
138431
|
+
const diffPath = path142.join(context.outputDir, `${params.name}-diff.png`);
|
|
138432
|
+
fs117.writeFileSync(diffPath, PNG.sync.write(diff));
|
|
138237
138433
|
const totalPixels = width * height;
|
|
138238
138434
|
const diffPercent = (numDiffPixels / totalPixels * 100).toFixed(2);
|
|
138239
138435
|
return {
|
|
@@ -138297,10 +138493,10 @@ var skillRegistry = {
|
|
|
138297
138493
|
},
|
|
138298
138494
|
// load skills from a project manifest (rnx-skills.json)
|
|
138299
138495
|
async loadFromManifest(projectDir) {
|
|
138300
|
-
const manifestPath =
|
|
138301
|
-
if (!
|
|
138496
|
+
const manifestPath = path141.join(projectDir, "rnx-skills.json");
|
|
138497
|
+
if (!fs116.existsSync(manifestPath)) return;
|
|
138302
138498
|
try {
|
|
138303
|
-
const manifest = JSON.parse(
|
|
138499
|
+
const manifest = JSON.parse(fs116.readFileSync(manifestPath, "utf8"));
|
|
138304
138500
|
if (Array.isArray(manifest.skills)) {
|
|
138305
138501
|
for (const entry of manifest.skills) {
|
|
138306
138502
|
if (typeof entry === "string") {
|
|
@@ -138311,7 +138507,7 @@ var skillRegistry = {
|
|
|
138311
138507
|
}
|
|
138312
138508
|
} else if (entry.file) {
|
|
138313
138509
|
try {
|
|
138314
|
-
const mod = await import(
|
|
138510
|
+
const mod = await import(path141.resolve(projectDir, entry.file));
|
|
138315
138511
|
if (mod.skill) this.register(mod.skill);
|
|
138316
138512
|
} catch {
|
|
138317
138513
|
}
|
|
@@ -138324,10 +138520,10 @@ var skillRegistry = {
|
|
|
138324
138520
|
// auto-discover skills based on project dependencies
|
|
138325
138521
|
suggestSkills(projectDir) {
|
|
138326
138522
|
const suggestions = [];
|
|
138327
|
-
const pkgPath =
|
|
138328
|
-
if (!
|
|
138523
|
+
const pkgPath = path141.join(projectDir, "package.json");
|
|
138524
|
+
if (!fs116.existsSync(pkgPath)) return suggestions;
|
|
138329
138525
|
try {
|
|
138330
|
-
const pkg = JSON.parse(
|
|
138526
|
+
const pkg = JSON.parse(fs116.readFileSync(pkgPath, "utf8"));
|
|
138331
138527
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
138332
138528
|
if (deps["detox"] || deps["maestro"]) {
|
|
138333
138529
|
suggestions.push("maestro-test");
|