peachsim 0.1.824 → 0.1.826
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/commands/record.ts +33 -14
- package/cli/drivers/playwright-sim-host.ts +5 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.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 +1 -1
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +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/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +1 -1
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +9 -1
- package/dist-lib/host/bridge-host.cjs +265 -219
- package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +2 -2
- package/dist-lib/index.cjs +1 -1
- 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 +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/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/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +504 -456
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +1 -1
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
- package/scripts/dev-server-scanner.ts +4 -1
- package/src/home-paths.ts +8 -0
- package/src/host/bridge-host.ts +4 -1
- package/src/host/fetch-proxy-handler.ts +5 -1
- package/src/host/fetch-proxy-transport.ts +76 -18
- package/src/host/websocket-proxy.ts +3 -1
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.826 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -196,14 +196,14 @@ function killOwnedTree(tracked) {
|
|
|
196
196
|
if (tracked.readIdentity(tracked.pid) !== tracked.identity) return;
|
|
197
197
|
killTree(tracked.pid);
|
|
198
198
|
}
|
|
199
|
-
function trackReapPid(pid,
|
|
200
|
-
const identity =
|
|
199
|
+
function trackReapPid(pid, readIdentity2 = processIdentity) {
|
|
200
|
+
const identity = readIdentity2(pid);
|
|
201
201
|
if (identity === null) return null;
|
|
202
202
|
const current = reapPids.get(pid);
|
|
203
|
-
if (current?.identity === identity && current.readIdentity ===
|
|
203
|
+
if (current?.identity === identity && current.readIdentity === readIdentity2) {
|
|
204
204
|
return current;
|
|
205
205
|
}
|
|
206
|
-
const tracked = { pid, identity, readIdentity };
|
|
206
|
+
const tracked = { pid, identity, readIdentity: readIdentity2 };
|
|
207
207
|
reapPids.set(pid, tracked);
|
|
208
208
|
installReaper();
|
|
209
209
|
return tracked;
|
|
@@ -225,10 +225,10 @@ function browserControl(b) {
|
|
|
225
225
|
return null;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
|
-
function registerChromePid(browser, control, pid,
|
|
228
|
+
function registerChromePid(browser, control, pid, readIdentity2 = processIdentity) {
|
|
229
229
|
if (browser && typeof browser === "object") discoveredChromePids.set(browser, pid);
|
|
230
230
|
discoveredChromePids.set(control, pid);
|
|
231
|
-
const tracked = trackReapPid(pid,
|
|
231
|
+
const tracked = trackReapPid(pid, readIdentity2);
|
|
232
232
|
if (tracked === null) return;
|
|
233
233
|
if (browser && typeof browser === "object") {
|
|
234
234
|
discoveredChromeProcesses.set(browser, tracked);
|
|
@@ -265,12 +265,12 @@ async function rejectLaunchedBrowser(browser) {
|
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
async function validateLaunchedGpuBrowser(browser, runtime, rendererTarget, commandForPid = processCommand,
|
|
268
|
+
async function validateLaunchedGpuBrowser(browser, runtime, rendererTarget, commandForPid = processCommand, readIdentity2 = processIdentity) {
|
|
269
269
|
if (softwareChromeAllowed(runtime)) return;
|
|
270
270
|
const root = rootChromePid(browser);
|
|
271
271
|
const launchedControl = browserControl(browser);
|
|
272
272
|
if (root !== null && launchedControl) {
|
|
273
|
-
registerChromePid(browser, launchedControl, root,
|
|
273
|
+
registerChromePid(browser, launchedControl, root, readIdentity2);
|
|
274
274
|
}
|
|
275
275
|
if (root !== null && (runtime.platform === "darwin" || runtime.platform === "linux")) {
|
|
276
276
|
assertGpuBrowserCommand(commandForPid(root), runtime);
|
|
@@ -284,7 +284,7 @@ async function validateLaunchedGpuBrowser(browser, runtime, rendererTarget, comm
|
|
|
284
284
|
if (pid === null) {
|
|
285
285
|
throw new Error("[reap-browser] Chrome did not report its browser process id");
|
|
286
286
|
}
|
|
287
|
-
registerChromePid(browser, control, pid,
|
|
287
|
+
registerChromePid(browser, control, pid, readIdentity2);
|
|
288
288
|
if (rendererBrowser && typeof rendererBrowser === "object") {
|
|
289
289
|
discoveredChromePids.set(rendererBrowser, pid);
|
|
290
290
|
}
|
|
@@ -317,7 +317,7 @@ function installReaper() {
|
|
|
317
317
|
}
|
|
318
318
|
process.on("exit", reap);
|
|
319
319
|
}
|
|
320
|
-
async function launchReapedScoped(launch2,
|
|
320
|
+
async function launchReapedScoped(launch2, readIdentity2 = processIdentity) {
|
|
321
321
|
const browser = await launch2();
|
|
322
322
|
let root = rootChromePid(browser);
|
|
323
323
|
if (root === null) {
|
|
@@ -329,7 +329,7 @@ async function launchReapedScoped(launch2, readIdentity = processIdentity) {
|
|
|
329
329
|
}
|
|
330
330
|
const mine = /* @__PURE__ */ new Set();
|
|
331
331
|
if (root != null) {
|
|
332
|
-
const tracked = trackReapPid(root,
|
|
332
|
+
const tracked = trackReapPid(root, readIdentity2);
|
|
333
333
|
if (tracked !== null) mine.add(tracked);
|
|
334
334
|
}
|
|
335
335
|
const evented = browserControl(browser) ?? browser;
|
|
@@ -352,8 +352,8 @@ async function launchReapedScoped(launch2, readIdentity = processIdentity) {
|
|
|
352
352
|
};
|
|
353
353
|
return { browser, reapNow };
|
|
354
354
|
}
|
|
355
|
-
async function launchReaped(launch2,
|
|
356
|
-
const { browser } = await launchReapedScoped(launch2,
|
|
355
|
+
async function launchReaped(launch2, readIdentity2 = processIdentity) {
|
|
356
|
+
const { browser } = await launchReapedScoped(launch2, readIdentity2);
|
|
357
357
|
return browser;
|
|
358
358
|
}
|
|
359
359
|
function gpuChromeArgs(platform = process.platform) {
|
|
@@ -19023,17 +19023,17 @@ function visit(node, visitor) {
|
|
|
19023
19023
|
} else
|
|
19024
19024
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
19025
19025
|
}
|
|
19026
|
-
function visit_(key2, node, visitor,
|
|
19027
|
-
const ctrl = callVisitor(key2, node, visitor,
|
|
19026
|
+
function visit_(key2, node, visitor, path39) {
|
|
19027
|
+
const ctrl = callVisitor(key2, node, visitor, path39);
|
|
19028
19028
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
19029
|
-
replaceNode(key2,
|
|
19030
|
-
return visit_(key2, ctrl, visitor,
|
|
19029
|
+
replaceNode(key2, path39, ctrl);
|
|
19030
|
+
return visit_(key2, ctrl, visitor, path39);
|
|
19031
19031
|
}
|
|
19032
19032
|
if (typeof ctrl !== "symbol") {
|
|
19033
19033
|
if (isCollection(node)) {
|
|
19034
|
-
|
|
19034
|
+
path39 = Object.freeze(path39.concat(node));
|
|
19035
19035
|
for (let i = 0; i < node.items.length; ++i) {
|
|
19036
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
19036
|
+
const ci = visit_(i, node.items[i], visitor, path39);
|
|
19037
19037
|
if (typeof ci === "number")
|
|
19038
19038
|
i = ci - 1;
|
|
19039
19039
|
else if (ci === BREAK)
|
|
@@ -19044,13 +19044,13 @@ function visit_(key2, node, visitor, path38) {
|
|
|
19044
19044
|
}
|
|
19045
19045
|
}
|
|
19046
19046
|
} else if (isPair(node)) {
|
|
19047
|
-
|
|
19048
|
-
const ck = visit_("key", node.key, visitor,
|
|
19047
|
+
path39 = Object.freeze(path39.concat(node));
|
|
19048
|
+
const ck = visit_("key", node.key, visitor, path39);
|
|
19049
19049
|
if (ck === BREAK)
|
|
19050
19050
|
return BREAK;
|
|
19051
19051
|
else if (ck === REMOVE)
|
|
19052
19052
|
node.key = null;
|
|
19053
|
-
const cv = visit_("value", node.value, visitor,
|
|
19053
|
+
const cv = visit_("value", node.value, visitor, path39);
|
|
19054
19054
|
if (cv === BREAK)
|
|
19055
19055
|
return BREAK;
|
|
19056
19056
|
else if (cv === REMOVE)
|
|
@@ -19068,17 +19068,17 @@ async function visitAsync(node, visitor) {
|
|
|
19068
19068
|
} else
|
|
19069
19069
|
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
19070
19070
|
}
|
|
19071
|
-
async function visitAsync_(key2, node, visitor,
|
|
19072
|
-
const ctrl = await callVisitor(key2, node, visitor,
|
|
19071
|
+
async function visitAsync_(key2, node, visitor, path39) {
|
|
19072
|
+
const ctrl = await callVisitor(key2, node, visitor, path39);
|
|
19073
19073
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
19074
|
-
replaceNode(key2,
|
|
19075
|
-
return visitAsync_(key2, ctrl, visitor,
|
|
19074
|
+
replaceNode(key2, path39, ctrl);
|
|
19075
|
+
return visitAsync_(key2, ctrl, visitor, path39);
|
|
19076
19076
|
}
|
|
19077
19077
|
if (typeof ctrl !== "symbol") {
|
|
19078
19078
|
if (isCollection(node)) {
|
|
19079
|
-
|
|
19079
|
+
path39 = Object.freeze(path39.concat(node));
|
|
19080
19080
|
for (let i = 0; i < node.items.length; ++i) {
|
|
19081
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
19081
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path39);
|
|
19082
19082
|
if (typeof ci === "number")
|
|
19083
19083
|
i = ci - 1;
|
|
19084
19084
|
else if (ci === BREAK)
|
|
@@ -19089,13 +19089,13 @@ async function visitAsync_(key2, node, visitor, path38) {
|
|
|
19089
19089
|
}
|
|
19090
19090
|
}
|
|
19091
19091
|
} else if (isPair(node)) {
|
|
19092
|
-
|
|
19093
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
19092
|
+
path39 = Object.freeze(path39.concat(node));
|
|
19093
|
+
const ck = await visitAsync_("key", node.key, visitor, path39);
|
|
19094
19094
|
if (ck === BREAK)
|
|
19095
19095
|
return BREAK;
|
|
19096
19096
|
else if (ck === REMOVE)
|
|
19097
19097
|
node.key = null;
|
|
19098
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
19098
|
+
const cv = await visitAsync_("value", node.value, visitor, path39);
|
|
19099
19099
|
if (cv === BREAK)
|
|
19100
19100
|
return BREAK;
|
|
19101
19101
|
else if (cv === REMOVE)
|
|
@@ -19122,23 +19122,23 @@ function initVisitor(visitor) {
|
|
|
19122
19122
|
}
|
|
19123
19123
|
return visitor;
|
|
19124
19124
|
}
|
|
19125
|
-
function callVisitor(key2, node, visitor,
|
|
19125
|
+
function callVisitor(key2, node, visitor, path39) {
|
|
19126
19126
|
if (typeof visitor === "function")
|
|
19127
|
-
return visitor(key2, node,
|
|
19127
|
+
return visitor(key2, node, path39);
|
|
19128
19128
|
if (isMap(node))
|
|
19129
|
-
return visitor.Map?.(key2, node,
|
|
19129
|
+
return visitor.Map?.(key2, node, path39);
|
|
19130
19130
|
if (isSeq(node))
|
|
19131
|
-
return visitor.Seq?.(key2, node,
|
|
19131
|
+
return visitor.Seq?.(key2, node, path39);
|
|
19132
19132
|
if (isPair(node))
|
|
19133
|
-
return visitor.Pair?.(key2, node,
|
|
19133
|
+
return visitor.Pair?.(key2, node, path39);
|
|
19134
19134
|
if (isScalar(node))
|
|
19135
|
-
return visitor.Scalar?.(key2, node,
|
|
19135
|
+
return visitor.Scalar?.(key2, node, path39);
|
|
19136
19136
|
if (isAlias(node))
|
|
19137
|
-
return visitor.Alias?.(key2, node,
|
|
19137
|
+
return visitor.Alias?.(key2, node, path39);
|
|
19138
19138
|
return void 0;
|
|
19139
19139
|
}
|
|
19140
|
-
function replaceNode(key2,
|
|
19141
|
-
const parent =
|
|
19140
|
+
function replaceNode(key2, path39, node) {
|
|
19141
|
+
const parent = path39[path39.length - 1];
|
|
19142
19142
|
if (isCollection(parent)) {
|
|
19143
19143
|
parent.items[key2] = node;
|
|
19144
19144
|
} else if (isPair(parent)) {
|
|
@@ -19738,10 +19738,10 @@ var init_createNode = __esm({
|
|
|
19738
19738
|
});
|
|
19739
19739
|
|
|
19740
19740
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
19741
|
-
function collectionFromPath(schema4,
|
|
19741
|
+
function collectionFromPath(schema4, path39, value) {
|
|
19742
19742
|
let v = value;
|
|
19743
|
-
for (let i =
|
|
19744
|
-
const k =
|
|
19743
|
+
for (let i = path39.length - 1; i >= 0; --i) {
|
|
19744
|
+
const k = path39[i];
|
|
19745
19745
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
19746
19746
|
const a = [];
|
|
19747
19747
|
a[k] = v;
|
|
@@ -19766,7 +19766,7 @@ var init_Collection = __esm({
|
|
|
19766
19766
|
init_createNode();
|
|
19767
19767
|
init_identity();
|
|
19768
19768
|
init_Node();
|
|
19769
|
-
isEmptyPath = (
|
|
19769
|
+
isEmptyPath = (path39) => path39 == null || typeof path39 === "object" && !!path39[Symbol.iterator]().next().done;
|
|
19770
19770
|
Collection = class extends NodeBase {
|
|
19771
19771
|
constructor(type, schema4) {
|
|
19772
19772
|
super(type);
|
|
@@ -19796,11 +19796,11 @@ var init_Collection = __esm({
|
|
|
19796
19796
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
19797
19797
|
* that already exists in the map.
|
|
19798
19798
|
*/
|
|
19799
|
-
addIn(
|
|
19800
|
-
if (isEmptyPath(
|
|
19799
|
+
addIn(path39, value) {
|
|
19800
|
+
if (isEmptyPath(path39))
|
|
19801
19801
|
this.add(value);
|
|
19802
19802
|
else {
|
|
19803
|
-
const [key2, ...rest] =
|
|
19803
|
+
const [key2, ...rest] = path39;
|
|
19804
19804
|
const node = this.get(key2, true);
|
|
19805
19805
|
if (isCollection(node))
|
|
19806
19806
|
node.addIn(rest, value);
|
|
@@ -19814,8 +19814,8 @@ var init_Collection = __esm({
|
|
|
19814
19814
|
* Removes a value from the collection.
|
|
19815
19815
|
* @returns `true` if the item was found and removed.
|
|
19816
19816
|
*/
|
|
19817
|
-
deleteIn(
|
|
19818
|
-
const [key2, ...rest] =
|
|
19817
|
+
deleteIn(path39) {
|
|
19818
|
+
const [key2, ...rest] = path39;
|
|
19819
19819
|
if (rest.length === 0)
|
|
19820
19820
|
return this.delete(key2);
|
|
19821
19821
|
const node = this.get(key2, true);
|
|
@@ -19829,8 +19829,8 @@ var init_Collection = __esm({
|
|
|
19829
19829
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
19830
19830
|
* `true` (collections are always returned intact).
|
|
19831
19831
|
*/
|
|
19832
|
-
getIn(
|
|
19833
|
-
const [key2, ...rest] =
|
|
19832
|
+
getIn(path39, keepScalar) {
|
|
19833
|
+
const [key2, ...rest] = path39;
|
|
19834
19834
|
const node = this.get(key2, true);
|
|
19835
19835
|
if (rest.length === 0)
|
|
19836
19836
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -19848,8 +19848,8 @@ var init_Collection = __esm({
|
|
|
19848
19848
|
/**
|
|
19849
19849
|
* Checks if the collection includes a value with the key `key`.
|
|
19850
19850
|
*/
|
|
19851
|
-
hasIn(
|
|
19852
|
-
const [key2, ...rest] =
|
|
19851
|
+
hasIn(path39) {
|
|
19852
|
+
const [key2, ...rest] = path39;
|
|
19853
19853
|
if (rest.length === 0)
|
|
19854
19854
|
return this.has(key2);
|
|
19855
19855
|
const node = this.get(key2, true);
|
|
@@ -19859,8 +19859,8 @@ var init_Collection = __esm({
|
|
|
19859
19859
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
19860
19860
|
* boolean to add/remove the item from the set.
|
|
19861
19861
|
*/
|
|
19862
|
-
setIn(
|
|
19863
|
-
const [key2, ...rest] =
|
|
19862
|
+
setIn(path39, value) {
|
|
19863
|
+
const [key2, ...rest] = path39;
|
|
19864
19864
|
if (rest.length === 0) {
|
|
19865
19865
|
this.set(key2, value);
|
|
19866
19866
|
} else {
|
|
@@ -22294,9 +22294,9 @@ var init_Document = __esm({
|
|
|
22294
22294
|
this.contents.add(value);
|
|
22295
22295
|
}
|
|
22296
22296
|
/** Adds a value to the document. */
|
|
22297
|
-
addIn(
|
|
22297
|
+
addIn(path39, value) {
|
|
22298
22298
|
if (assertCollection(this.contents))
|
|
22299
|
-
this.contents.addIn(
|
|
22299
|
+
this.contents.addIn(path39, value);
|
|
22300
22300
|
}
|
|
22301
22301
|
/**
|
|
22302
22302
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -22371,14 +22371,14 @@ var init_Document = __esm({
|
|
|
22371
22371
|
* Removes a value from the document.
|
|
22372
22372
|
* @returns `true` if the item was found and removed.
|
|
22373
22373
|
*/
|
|
22374
|
-
deleteIn(
|
|
22375
|
-
if (isEmptyPath(
|
|
22374
|
+
deleteIn(path39) {
|
|
22375
|
+
if (isEmptyPath(path39)) {
|
|
22376
22376
|
if (this.contents == null)
|
|
22377
22377
|
return false;
|
|
22378
22378
|
this.contents = null;
|
|
22379
22379
|
return true;
|
|
22380
22380
|
}
|
|
22381
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
22381
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path39) : false;
|
|
22382
22382
|
}
|
|
22383
22383
|
/**
|
|
22384
22384
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -22393,10 +22393,10 @@ var init_Document = __esm({
|
|
|
22393
22393
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
22394
22394
|
* `true` (collections are always returned intact).
|
|
22395
22395
|
*/
|
|
22396
|
-
getIn(
|
|
22397
|
-
if (isEmptyPath(
|
|
22396
|
+
getIn(path39, keepScalar) {
|
|
22397
|
+
if (isEmptyPath(path39))
|
|
22398
22398
|
return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
|
|
22399
|
-
return isCollection(this.contents) ? this.contents.getIn(
|
|
22399
|
+
return isCollection(this.contents) ? this.contents.getIn(path39, keepScalar) : void 0;
|
|
22400
22400
|
}
|
|
22401
22401
|
/**
|
|
22402
22402
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -22407,10 +22407,10 @@ var init_Document = __esm({
|
|
|
22407
22407
|
/**
|
|
22408
22408
|
* Checks if the document includes a value at `path`.
|
|
22409
22409
|
*/
|
|
22410
|
-
hasIn(
|
|
22411
|
-
if (isEmptyPath(
|
|
22410
|
+
hasIn(path39) {
|
|
22411
|
+
if (isEmptyPath(path39))
|
|
22412
22412
|
return this.contents !== void 0;
|
|
22413
|
-
return isCollection(this.contents) ? this.contents.hasIn(
|
|
22413
|
+
return isCollection(this.contents) ? this.contents.hasIn(path39) : false;
|
|
22414
22414
|
}
|
|
22415
22415
|
/**
|
|
22416
22416
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -22427,13 +22427,13 @@ var init_Document = __esm({
|
|
|
22427
22427
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
22428
22428
|
* boolean to add/remove the item from the set.
|
|
22429
22429
|
*/
|
|
22430
|
-
setIn(
|
|
22431
|
-
if (isEmptyPath(
|
|
22430
|
+
setIn(path39, value) {
|
|
22431
|
+
if (isEmptyPath(path39)) {
|
|
22432
22432
|
this.contents = value;
|
|
22433
22433
|
} else if (this.contents == null) {
|
|
22434
|
-
this.contents = collectionFromPath(this.schema, Array.from(
|
|
22434
|
+
this.contents = collectionFromPath(this.schema, Array.from(path39), value);
|
|
22435
22435
|
} else if (assertCollection(this.contents)) {
|
|
22436
|
-
this.contents.setIn(
|
|
22436
|
+
this.contents.setIn(path39, value);
|
|
22437
22437
|
}
|
|
22438
22438
|
}
|
|
22439
22439
|
/**
|
|
@@ -24338,15 +24338,15 @@ function visit2(cst, visitor) {
|
|
|
24338
24338
|
cst = { start: cst.start, value: cst.value };
|
|
24339
24339
|
_visit(Object.freeze([]), cst, visitor);
|
|
24340
24340
|
}
|
|
24341
|
-
function _visit(
|
|
24342
|
-
let ctrl = visitor(item,
|
|
24341
|
+
function _visit(path39, item, visitor) {
|
|
24342
|
+
let ctrl = visitor(item, path39);
|
|
24343
24343
|
if (typeof ctrl === "symbol")
|
|
24344
24344
|
return ctrl;
|
|
24345
24345
|
for (const field of ["key", "value"]) {
|
|
24346
24346
|
const token = item[field];
|
|
24347
24347
|
if (token && "items" in token) {
|
|
24348
24348
|
for (let i = 0; i < token.items.length; ++i) {
|
|
24349
|
-
const ci = _visit(Object.freeze(
|
|
24349
|
+
const ci = _visit(Object.freeze(path39.concat([[field, i]])), token.items[i], visitor);
|
|
24350
24350
|
if (typeof ci === "number")
|
|
24351
24351
|
i = ci - 1;
|
|
24352
24352
|
else if (ci === BREAK2)
|
|
@@ -24357,10 +24357,10 @@ function _visit(path38, item, visitor) {
|
|
|
24357
24357
|
}
|
|
24358
24358
|
}
|
|
24359
24359
|
if (typeof ctrl === "function" && field === "key")
|
|
24360
|
-
ctrl = ctrl(item,
|
|
24360
|
+
ctrl = ctrl(item, path39);
|
|
24361
24361
|
}
|
|
24362
24362
|
}
|
|
24363
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
24363
|
+
return typeof ctrl === "function" ? ctrl(item, path39) : ctrl;
|
|
24364
24364
|
}
|
|
24365
24365
|
var BREAK2, SKIP2, REMOVE2;
|
|
24366
24366
|
var init_cst_visit = __esm({
|
|
@@ -24371,9 +24371,9 @@ var init_cst_visit = __esm({
|
|
|
24371
24371
|
visit2.BREAK = BREAK2;
|
|
24372
24372
|
visit2.SKIP = SKIP2;
|
|
24373
24373
|
visit2.REMOVE = REMOVE2;
|
|
24374
|
-
visit2.itemAtPath = (cst,
|
|
24374
|
+
visit2.itemAtPath = (cst, path39) => {
|
|
24375
24375
|
let item = cst;
|
|
24376
|
-
for (const [field, index] of
|
|
24376
|
+
for (const [field, index] of path39) {
|
|
24377
24377
|
const tok = item?.[field];
|
|
24378
24378
|
if (tok && "items" in tok) {
|
|
24379
24379
|
item = tok.items[index];
|
|
@@ -24382,9 +24382,9 @@ var init_cst_visit = __esm({
|
|
|
24382
24382
|
}
|
|
24383
24383
|
return item;
|
|
24384
24384
|
};
|
|
24385
|
-
visit2.parentCollection = (cst,
|
|
24386
|
-
const parent = visit2.itemAtPath(cst,
|
|
24387
|
-
const field =
|
|
24385
|
+
visit2.parentCollection = (cst, path39) => {
|
|
24386
|
+
const parent = visit2.itemAtPath(cst, path39.slice(0, -1));
|
|
24387
|
+
const field = path39[path39.length - 1][0];
|
|
24388
24388
|
const coll = parent?.[field];
|
|
24389
24389
|
if (coll && "items" in coll)
|
|
24390
24390
|
return coll;
|
|
@@ -27199,9 +27199,9 @@ function safeChildPlistName(value) {
|
|
|
27199
27199
|
name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
|
|
27200
27200
|
};
|
|
27201
27201
|
}
|
|
27202
|
-
async function readableSettingsBundle(
|
|
27202
|
+
async function readableSettingsBundle(path39) {
|
|
27203
27203
|
try {
|
|
27204
|
-
const root = await (0, import_promises.stat)((0, import_node_path.join)(
|
|
27204
|
+
const root = await (0, import_promises.stat)((0, import_node_path.join)(path39, "Root.plist"));
|
|
27205
27205
|
return root.isFile() && root.size <= MAX_PLIST_BYTES;
|
|
27206
27206
|
} catch {
|
|
27207
27207
|
return false;
|
|
@@ -27246,11 +27246,11 @@ async function settingsBundleFingerprint(bundlePath) {
|
|
|
27246
27246
|
return null;
|
|
27247
27247
|
}
|
|
27248
27248
|
}
|
|
27249
|
-
async function parsePlistRecord(
|
|
27249
|
+
async function parsePlistRecord(path39) {
|
|
27250
27250
|
try {
|
|
27251
|
-
const metadata = await (0, import_promises.stat)(
|
|
27251
|
+
const metadata = await (0, import_promises.stat)(path39);
|
|
27252
27252
|
if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
|
|
27253
|
-
const source = await (0, import_promises.readFile)(
|
|
27253
|
+
const source = await (0, import_promises.readFile)(path39, "utf8");
|
|
27254
27254
|
const parsed = parsePlistSource(source);
|
|
27255
27255
|
return isRecord2(parsed) ? parsed : null;
|
|
27256
27256
|
} catch {
|
|
@@ -27574,7 +27574,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
|
27574
27574
|
return null;
|
|
27575
27575
|
}
|
|
27576
27576
|
}
|
|
27577
|
-
function httpGet(hostname, port,
|
|
27577
|
+
function httpGet(hostname, port, path39, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
27578
27578
|
return new Promise((resolve10) => {
|
|
27579
27579
|
let settled = false;
|
|
27580
27580
|
let killing = false;
|
|
@@ -27583,7 +27583,7 @@ function httpGet(hostname, port, path38, method = "GET", timeout = TIMEOUT_MS, h
|
|
|
27583
27583
|
settled = true;
|
|
27584
27584
|
resolve10(value);
|
|
27585
27585
|
};
|
|
27586
|
-
const req = import_http.default.request({ hostname, port, path:
|
|
27586
|
+
const req = import_http.default.request({ hostname, port, path: path39, method, headers }, (res) => {
|
|
27587
27587
|
let body = "";
|
|
27588
27588
|
res.on("data", (c) => body += c.toString());
|
|
27589
27589
|
const contentType = (() => {
|
|
@@ -27649,7 +27649,7 @@ async function listListeners() {
|
|
|
27649
27649
|
let timedOut = false;
|
|
27650
27650
|
try {
|
|
27651
27651
|
const { stdout } = await execGuarded(
|
|
27652
|
-
`lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'`,
|
|
27652
|
+
`lsof -a -c node -c bun -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'`,
|
|
27653
27653
|
LISTING_TIMEOUT_MS
|
|
27654
27654
|
);
|
|
27655
27655
|
const seen = /* @__PURE__ */ new Map();
|
|
@@ -28249,6 +28249,7 @@ __export(home_paths_exports, {
|
|
|
28249
28249
|
DAEMON_HEARTBEAT_STALE_MS: () => DAEMON_HEARTBEAT_STALE_MS,
|
|
28250
28250
|
DAEMON_LOCKFILE: () => DAEMON_LOCKFILE,
|
|
28251
28251
|
DEV_BRIDGES_DIR: () => DEV_BRIDGES_DIR,
|
|
28252
|
+
FETCH_TRANSPORT_DIR: () => FETCH_TRANSPORT_DIR,
|
|
28252
28253
|
PEACH_HOME_ENV: () => PEACH_HOME_ENV,
|
|
28253
28254
|
activeRuntimeDir: () => activeRuntimeDir,
|
|
28254
28255
|
activeRuntimeFile: () => activeRuntimeFile,
|
|
@@ -28270,6 +28271,7 @@ __export(home_paths_exports, {
|
|
|
28270
28271
|
electronUserDataDir: () => electronUserDataDir,
|
|
28271
28272
|
electronVersionDir: () => electronVersionDir,
|
|
28272
28273
|
ensureRnxHome: () => ensureRnxHome,
|
|
28274
|
+
fetchTransportIdentityPath: () => fetchTransportIdentityPath,
|
|
28273
28275
|
isDaemonLockfileFresh: () => isDaemonLockfileFresh,
|
|
28274
28276
|
isDevBridgeLockfileFresh: () => isDevBridgeLockfileFresh,
|
|
28275
28277
|
isDevWorkstation: () => isDevWorkstation,
|
|
@@ -28379,6 +28381,9 @@ function daemonLockfilePath() {
|
|
|
28379
28381
|
function devBridgesDir() {
|
|
28380
28382
|
return import_node_path4.default.join(rnxHomeDir(), DEV_BRIDGES_DIR);
|
|
28381
28383
|
}
|
|
28384
|
+
function fetchTransportIdentityPath(bridgePort) {
|
|
28385
|
+
return import_node_path4.default.join(rnxHomeDir(), FETCH_TRANSPORT_DIR, `${bridgePort}.json`);
|
|
28386
|
+
}
|
|
28382
28387
|
function devBridgeLockfilePath(bridgePort) {
|
|
28383
28388
|
if (!Number.isInteger(bridgePort) || bridgePort <= 0) {
|
|
28384
28389
|
throw new Error(`invalid development bridge port: ${bridgePort}`);
|
|
@@ -28789,7 +28794,7 @@ function removeDevBridgeLockfile(owner) {
|
|
|
28789
28794
|
} catch {
|
|
28790
28795
|
}
|
|
28791
28796
|
}
|
|
28792
|
-
var import_node_crypto, import_node_fs3, import_node_os, import_node_path4, PEACH_HOME_ENV, ACTIVE_RUNTIME_FILE, DAEMON_LOCKFILE, DEV_BRIDGES_DIR, CONFIG_FILE, CLI_UPDATE_FILE, DAEMON_HEARTBEAT_STALE_MS, CURRENT_ONBOARDING_VERSION, DAEMON_LOCKFILE_MAX_BYTES, DAEMON_CLAIM_STALE_MS;
|
|
28797
|
+
var import_node_crypto, import_node_fs3, import_node_os, import_node_path4, PEACH_HOME_ENV, ACTIVE_RUNTIME_FILE, DAEMON_LOCKFILE, DEV_BRIDGES_DIR, FETCH_TRANSPORT_DIR, CONFIG_FILE, CLI_UPDATE_FILE, DAEMON_HEARTBEAT_STALE_MS, CURRENT_ONBOARDING_VERSION, DAEMON_LOCKFILE_MAX_BYTES, DAEMON_CLAIM_STALE_MS;
|
|
28793
28798
|
var init_home_paths = __esm({
|
|
28794
28799
|
"src/home-paths.ts"() {
|
|
28795
28800
|
"use strict";
|
|
@@ -28801,6 +28806,7 @@ var init_home_paths = __esm({
|
|
|
28801
28806
|
ACTIVE_RUNTIME_FILE = "active";
|
|
28802
28807
|
DAEMON_LOCKFILE = "daemon.json";
|
|
28803
28808
|
DEV_BRIDGES_DIR = "dev-bridges";
|
|
28809
|
+
FETCH_TRANSPORT_DIR = "fetch-transport";
|
|
28804
28810
|
CONFIG_FILE = "config.json";
|
|
28805
28811
|
CLI_UPDATE_FILE = "cli-update.json";
|
|
28806
28812
|
DAEMON_HEARTBEAT_STALE_MS = 3e4;
|
|
@@ -31684,8 +31690,8 @@ function pickImagesetFile(images) {
|
|
|
31684
31690
|
scale: pick.scale === "2x" ? 2 : pick.scale === "3x" ? 3 : 1
|
|
31685
31691
|
};
|
|
31686
31692
|
}
|
|
31687
|
-
function flatScale(
|
|
31688
|
-
const match = /@([23])x\.[^./]+$/.exec(
|
|
31693
|
+
function flatScale(path39) {
|
|
31694
|
+
const match = /@([23])x\.[^./]+$/.exec(path39);
|
|
31689
31695
|
return match ? Number(match[1]) : 1;
|
|
31690
31696
|
}
|
|
31691
31697
|
function providesNamespace(text3) {
|
|
@@ -31712,13 +31718,13 @@ function catalogEntryName(contentsPath, kind, readText2) {
|
|
|
31712
31718
|
}
|
|
31713
31719
|
return segments.join("/");
|
|
31714
31720
|
}
|
|
31715
|
-
function isFlatResourceImage(
|
|
31716
|
-
return
|
|
31721
|
+
function isFlatResourceImage(path39) {
|
|
31722
|
+
return path39.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path39));
|
|
31717
31723
|
}
|
|
31718
31724
|
function enumerateBundleImages(paths, readText2) {
|
|
31719
31725
|
const table = [];
|
|
31720
31726
|
const seen = /* @__PURE__ */ new Set();
|
|
31721
|
-
const catalogs = paths.filter((
|
|
31727
|
+
const catalogs = paths.filter((path39) => baseOf(path39) === "Contents.json");
|
|
31722
31728
|
for (const contentsPath of catalogs) {
|
|
31723
31729
|
const name2 = catalogEntryName(contentsPath, ".imageset", readText2);
|
|
31724
31730
|
if (name2 === null || seen.has(name2)) continue;
|
|
@@ -31739,12 +31745,12 @@ function enumerateBundleImages(paths, readText2) {
|
|
|
31739
31745
|
seen.add(name2);
|
|
31740
31746
|
table.push({ name: name2, file: `${dir}/${pick.filename}`, scale: pick.scale });
|
|
31741
31747
|
}
|
|
31742
|
-
for (const
|
|
31743
|
-
if (!isFlatResourceImage(
|
|
31744
|
-
const name2 = baseOf(
|
|
31748
|
+
for (const path39 of paths) {
|
|
31749
|
+
if (!isFlatResourceImage(path39)) continue;
|
|
31750
|
+
const name2 = baseOf(path39).slice(0, -extOf(path39).length);
|
|
31745
31751
|
if (name2 === "" || seen.has(name2)) continue;
|
|
31746
31752
|
seen.add(name2);
|
|
31747
|
-
table.push({ name: name2, file:
|
|
31753
|
+
table.push({ name: name2, file: path39, scale: flatScale(path39) });
|
|
31748
31754
|
}
|
|
31749
31755
|
return table;
|
|
31750
31756
|
}
|
|
@@ -31773,7 +31779,7 @@ function colorsetValue(color) {
|
|
|
31773
31779
|
}
|
|
31774
31780
|
function enumerateBundleColors(paths, readText2) {
|
|
31775
31781
|
const table = {};
|
|
31776
|
-
for (const contentsPath of paths.filter((
|
|
31782
|
+
for (const contentsPath of paths.filter((path39) => baseOf(path39) === "Contents.json")) {
|
|
31777
31783
|
const name2 = catalogEntryName(contentsPath, ".colorset", readText2);
|
|
31778
31784
|
if (name2 === null || name2 in table) continue;
|
|
31779
31785
|
let colors;
|
|
@@ -31837,8 +31843,8 @@ function axisExtremes(points) {
|
|
|
31837
31843
|
function pathBounds(d) {
|
|
31838
31844
|
const xs = [];
|
|
31839
31845
|
const ys = [];
|
|
31840
|
-
for (const
|
|
31841
|
-
(0, import_svgpath.default)(
|
|
31846
|
+
for (const path39 of d)
|
|
31847
|
+
(0, import_svgpath.default)(path39).abs().unshort().unarc().iterate((segment, _index, x, y) => {
|
|
31842
31848
|
const [command, ...args] = segment;
|
|
31843
31849
|
if (command === "M" || command === "L") {
|
|
31844
31850
|
xs.push(Number(args[0]));
|
|
@@ -31865,7 +31871,7 @@ function guide(svg, id, axis) {
|
|
|
31865
31871
|
}
|
|
31866
31872
|
function enumerateBundleSymbols(paths, readText2) {
|
|
31867
31873
|
const table = {};
|
|
31868
|
-
for (const contentsPath of paths.filter((
|
|
31874
|
+
for (const contentsPath of paths.filter((path39) => baseOf(path39) === "Contents.json")) {
|
|
31869
31875
|
const name2 = catalogEntryName(contentsPath, ".symbolset", readText2);
|
|
31870
31876
|
if (name2 === null || name2 in table) continue;
|
|
31871
31877
|
let symbols;
|
|
@@ -31898,8 +31904,8 @@ function enumerateBundleSymbols(paths, readText2) {
|
|
|
31898
31904
|
viewBox: "0 0 24 24",
|
|
31899
31905
|
advance,
|
|
31900
31906
|
box: [12 - advance / 2, 12 - tall / 2, advance, tall],
|
|
31901
|
-
layers: d.map((
|
|
31902
|
-
d: (0, import_svgpath.default)(
|
|
31907
|
+
layers: d.map((path39) => ({
|
|
31908
|
+
d: (0, import_svgpath.default)(path39).abs().scale(scale).translate(translateX, translateY).round(3).toString()
|
|
31903
31909
|
}))
|
|
31904
31910
|
};
|
|
31905
31911
|
}
|
|
@@ -31909,7 +31915,7 @@ function enumerateBundleJson(paths) {
|
|
|
31909
31915
|
const found = [];
|
|
31910
31916
|
const seen = /* @__PURE__ */ new Set();
|
|
31911
31917
|
const ordered = [...paths].filter(
|
|
31912
|
-
(
|
|
31918
|
+
(path39) => path39.split("/").includes("Resources") && path39.split("/").every((segment) => segment !== "" && segment !== "..") && (extOf(path39) === ".json" || extOf(path39) === ".xcstrings")
|
|
31913
31919
|
).sort((a, b) => {
|
|
31914
31920
|
const aDepth = a.split("/").length;
|
|
31915
31921
|
const bDepth = b.split("/").length;
|
|
@@ -33208,10 +33214,10 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33208
33214
|
owners.push(...physical.map(() => current));
|
|
33209
33215
|
};
|
|
33210
33216
|
const scoped = (body) => (symbol, ...rest) => {
|
|
33211
|
-
const
|
|
33212
|
-
if (omit.has(
|
|
33217
|
+
const path39 = pathOf(symbol);
|
|
33218
|
+
if (omit.has(path39)) return void skipped.push({ path: path39, reason: omit.get(path39) });
|
|
33213
33219
|
const previous = current;
|
|
33214
|
-
current =
|
|
33220
|
+
current = path39;
|
|
33215
33221
|
try {
|
|
33216
33222
|
body(symbol, ...rest);
|
|
33217
33223
|
} finally {
|
|
@@ -33231,14 +33237,14 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33231
33237
|
const access = (symbol, openOwner) => symbol.accessLevel === "open" && openOwner ? "open" : "public";
|
|
33232
33238
|
const emitMember = scoped(
|
|
33233
33239
|
(member, indent, context) => {
|
|
33234
|
-
const
|
|
33240
|
+
const path39 = pathOf(member);
|
|
33235
33241
|
if (TYPE_KINDS.has(member.kind.identifier)) {
|
|
33236
33242
|
emitType(member, indent);
|
|
33237
33243
|
return;
|
|
33238
33244
|
}
|
|
33239
33245
|
if (member.kind.identifier === "swift.enum.case") return;
|
|
33240
33246
|
if (!MEMBER_KINDS.has(member.kind.identifier)) {
|
|
33241
|
-
skipped.push({ path:
|
|
33247
|
+
skipped.push({ path: path39, reason: `unhandled ${member.kind.identifier}` });
|
|
33242
33248
|
return;
|
|
33243
33249
|
}
|
|
33244
33250
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
@@ -33252,12 +33258,12 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33252
33258
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
33253
33259
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
33254
33260
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
33255
|
-
const override = context.inClass && !options.plain?.has(
|
|
33261
|
+
const override = context.inClass && !options.plain?.has(path39) && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path39) || isObjC(member) && path39.endsWith(".init()")) ? "override " : "";
|
|
33256
33262
|
const head = `${indent}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
33257
|
-
const measured = behavior.get(
|
|
33258
|
-
if (measured) used.add(
|
|
33263
|
+
const measured = behavior.get(path39);
|
|
33264
|
+
if (measured) used.add(path39);
|
|
33259
33265
|
const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
|
|
33260
|
-
const body = overloadBody ?? measured?.body ?? trap(
|
|
33266
|
+
const body = overloadBody ?? measured?.body ?? trap(path39);
|
|
33261
33267
|
switch (member.kind.identifier) {
|
|
33262
33268
|
case "swift.property":
|
|
33263
33269
|
case "swift.type.property":
|
|
@@ -33278,7 +33284,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33278
33284
|
return;
|
|
33279
33285
|
}
|
|
33280
33286
|
emit(
|
|
33281
|
-
`${head}${computed} { get${effects} { ${body} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? trap(
|
|
33287
|
+
`${head}${computed} { get${effects} { ${body} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? trap(path39)} }` : ""} }`
|
|
33282
33288
|
);
|
|
33283
33289
|
return;
|
|
33284
33290
|
}
|
|
@@ -33331,7 +33337,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33331
33337
|
};
|
|
33332
33338
|
const emitType = scoped(
|
|
33333
33339
|
(symbol, indent) => {
|
|
33334
|
-
const
|
|
33340
|
+
const path39 = pathOf(symbol);
|
|
33335
33341
|
const id = symbol.identifier.precise;
|
|
33336
33342
|
const inner = `${indent} `;
|
|
33337
33343
|
switch (symbol.kind.identifier) {
|
|
@@ -33343,10 +33349,10 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33343
33349
|
case "swift.class": {
|
|
33344
33350
|
const shape = header(symbol, "class", indent);
|
|
33345
33351
|
if (!shape)
|
|
33346
|
-
return void skipped.push({ path:
|
|
33347
|
-
const parent = options.superclasses?.get(
|
|
33352
|
+
return void skipped.push({ path: path39, reason: `unparsed class ${text(symbol)}` });
|
|
33353
|
+
const parent = options.superclasses?.get(path39) ?? superclass.get(id);
|
|
33348
33354
|
const blocked = classBlocked(id);
|
|
33349
|
-
if (blocked) return void skipped.push({ path:
|
|
33355
|
+
if (blocked) return void skipped.push({ path: path39, reason: blocked });
|
|
33350
33356
|
const ancestors = /* @__PURE__ */ new Set();
|
|
33351
33357
|
for (let at = superId.get(id); at; at = superId.get(at))
|
|
33352
33358
|
for (const name2 of conforms.get(at) ?? []) ancestors.add(name2);
|
|
@@ -33362,9 +33368,9 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33362
33368
|
`${indent}${shape.attrs}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
|
|
33363
33369
|
);
|
|
33364
33370
|
const members = membersOf(id);
|
|
33365
|
-
const extra = options.behavior?.get(
|
|
33371
|
+
const extra = options.behavior?.get(path39)?.members;
|
|
33366
33372
|
if (extra) {
|
|
33367
|
-
used.add(
|
|
33373
|
+
used.add(path39);
|
|
33368
33374
|
emit(`${inner}${extra}`);
|
|
33369
33375
|
}
|
|
33370
33376
|
for (const member of members)
|
|
@@ -33416,13 +33422,13 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33416
33422
|
continue;
|
|
33417
33423
|
have.add(witnessKey(member));
|
|
33418
33424
|
have.add(sideLeaf(member));
|
|
33419
|
-
emitWitness(member, inner,
|
|
33425
|
+
emitWitness(member, inner, path39);
|
|
33420
33426
|
}
|
|
33421
33427
|
}
|
|
33422
33428
|
const coder = members.some((member) => leaf(member) === "init(coder:)");
|
|
33423
33429
|
if (designated && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
33424
33430
|
emit(
|
|
33425
|
-
`${inner}public required init?(coder: NSCoder) { ${trap(`${
|
|
33431
|
+
`${inner}public required init?(coder: NSCoder) { ${trap(`${path39}.init(coder:)`)} }`
|
|
33426
33432
|
);
|
|
33427
33433
|
emit(`${indent}}`);
|
|
33428
33434
|
return;
|
|
@@ -33430,7 +33436,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33430
33436
|
case "swift.struct": {
|
|
33431
33437
|
const shape = header(symbol, "struct", indent);
|
|
33432
33438
|
if (!shape)
|
|
33433
|
-
return void skipped.push({ path:
|
|
33439
|
+
return void skipped.push({ path: path39, reason: `unparsed struct ${text(symbol)}` });
|
|
33434
33440
|
const members = membersOf(id);
|
|
33435
33441
|
const raw2 = rawType(members);
|
|
33436
33442
|
const list2 = inheritance(id);
|
|
@@ -33462,7 +33468,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33462
33468
|
case "swift.enum": {
|
|
33463
33469
|
const shape = header(symbol, "enum", indent);
|
|
33464
33470
|
if (!shape)
|
|
33465
|
-
return void skipped.push({ path:
|
|
33471
|
+
return void skipped.push({ path: path39, reason: `unparsed enum ${text(symbol)}` });
|
|
33466
33472
|
const members = membersOf(id);
|
|
33467
33473
|
const raw2 = rawType(members);
|
|
33468
33474
|
const cases = members.filter(
|
|
@@ -33471,7 +33477,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33471
33477
|
const missing = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
|
|
33472
33478
|
if (raw2 && isObjC(symbol) && missing.length > 0)
|
|
33473
33479
|
return void skipped.push({
|
|
33474
|
-
path:
|
|
33480
|
+
path: path39,
|
|
33475
33481
|
reason: `no header value for ${missing.map(leaf).join(", ")}`
|
|
33476
33482
|
});
|
|
33477
33483
|
const list2 = inheritance(id, raw2 ?? void 0).filter(
|
|
@@ -33511,7 +33517,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33511
33517
|
const shape = header(symbol, "protocol", indent);
|
|
33512
33518
|
if (!shape)
|
|
33513
33519
|
return void skipped.push({
|
|
33514
|
-
path:
|
|
33520
|
+
path: path39,
|
|
33515
33521
|
reason: `unparsed protocol ${text(symbol)}`
|
|
33516
33522
|
});
|
|
33517
33523
|
const list2 = [...isObjC(symbol) ? ["AnyObject"] : [], ...inheritance(id)];
|
|
@@ -33536,7 +33542,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33536
33542
|
}
|
|
33537
33543
|
emit(`${indent}}`);
|
|
33538
33544
|
if (defaults.length > 0) {
|
|
33539
|
-
emit(`${indent}extension ${
|
|
33545
|
+
emit(`${indent}extension ${path39} {`);
|
|
33540
33546
|
for (const member of defaults) {
|
|
33541
33547
|
const decl = text(member);
|
|
33542
33548
|
if (optional.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
|
|
@@ -33582,7 +33588,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33582
33588
|
return init ? /rawValue:\s*([^)]+)\)/.exec(text(init))?.[1]?.trim() ?? null : null;
|
|
33583
33589
|
};
|
|
33584
33590
|
const emitGlobal = scoped((symbol) => {
|
|
33585
|
-
const
|
|
33591
|
+
const path39 = pathOf(symbol);
|
|
33586
33592
|
const kind = symbol.kind.identifier;
|
|
33587
33593
|
if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
|
|
33588
33594
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol));
|
|
@@ -33593,17 +33599,17 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33593
33599
|
if (fix && !/^(?:prefix|infix|postfix)\b/.test(spelled))
|
|
33594
33600
|
spelled = `${fix} ${spelled}`;
|
|
33595
33601
|
}
|
|
33596
|
-
emit(`${attrs}public ${spelled} { ${trap(
|
|
33602
|
+
emit(`${attrs}public ${spelled} { ${trap(path39)} }`);
|
|
33597
33603
|
} else if (kind === "swift.var") {
|
|
33598
33604
|
const parsed = splitAccessors(text(symbol).replace(/^let /, "var "));
|
|
33599
|
-
const measured = behavior.get(
|
|
33600
|
-
if (measured) used.add(
|
|
33601
|
-
emit(`public ${parsed.decl} { ${measured?.body ?? trap(
|
|
33602
|
-
} else skipped.push({ path:
|
|
33605
|
+
const measured = behavior.get(path39);
|
|
33606
|
+
if (measured) used.add(path39);
|
|
33607
|
+
emit(`public ${parsed.decl} { ${measured?.body ?? trap(path39)} }`);
|
|
33608
|
+
} else skipped.push({ path: path39, reason: `unhandled top-level ${kind}` });
|
|
33603
33609
|
});
|
|
33604
33610
|
const roots = [...byId.values()].filter((symbol) => !owner.has(symbol.identifier.precise) && !unavailable(symbol)).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
|
|
33605
33611
|
for (const symbol of roots) {
|
|
33606
|
-
const
|
|
33612
|
+
const path39 = pathOf(symbol);
|
|
33607
33613
|
if (TYPE_KINDS.has(symbol.kind.identifier)) emitType(symbol, "");
|
|
33608
33614
|
else emitGlobal(symbol);
|
|
33609
33615
|
}
|
|
@@ -33644,9 +33650,9 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33644
33650
|
...imports.map((name2) => `import ${name2}`),
|
|
33645
33651
|
""
|
|
33646
33652
|
];
|
|
33647
|
-
for (const
|
|
33648
|
-
if (!used.has(
|
|
33649
|
-
skipped.push({ path:
|
|
33653
|
+
for (const path39 of behavior.keys())
|
|
33654
|
+
if (!used.has(path39))
|
|
33655
|
+
skipped.push({ path: path39, reason: "behavior names no emitted declaration" });
|
|
33650
33656
|
return {
|
|
33651
33657
|
source: `${[...banner, ...lines].join("\n")}
|
|
33652
33658
|
`,
|
|
@@ -33732,7 +33738,7 @@ var init_swift_standin_emit = __esm({
|
|
|
33732
33738
|
sideLeaf = (symbol) => `${symbol.kind.identifier.startsWith("swift.type.") ? "type" : "instance"}|leaf|${leaf(symbol)}`;
|
|
33733
33739
|
isObjC = (symbol) => symbol.identifier.precise.startsWith("c:");
|
|
33734
33740
|
synthesizedEquality = (symbol, conforms) => conforms.includes("Hashable") ? ["==(_:_:)", "hash(into:)", "hashValue"].includes(leaf(symbol)) : conforms.includes("Equatable") && leaf(symbol) === "==(_:_:)";
|
|
33735
|
-
trap = (
|
|
33741
|
+
trap = (path39) => `fatalError("${path39} is a binary framework peach cannot run")`;
|
|
33736
33742
|
KEYWORDS = /* @__PURE__ */ new Set([
|
|
33737
33743
|
"Type",
|
|
33738
33744
|
"Protocol",
|
|
@@ -38026,8 +38032,8 @@ function sourceEntryPath() {
|
|
|
38026
38032
|
return null;
|
|
38027
38033
|
}
|
|
38028
38034
|
}
|
|
38029
|
-
function isCliEntry(
|
|
38030
|
-
const name2 = (0, import_node_path22.basename)(
|
|
38035
|
+
function isCliEntry(path39) {
|
|
38036
|
+
const name2 = (0, import_node_path22.basename)(path39);
|
|
38031
38037
|
return name2 === "bin.ts" || name2 === "bin.js";
|
|
38032
38038
|
}
|
|
38033
38039
|
function rnxSelfInvocation() {
|
|
@@ -39636,7 +39642,7 @@ async function handleFetchProxyRequest(req, res) {
|
|
|
39636
39642
|
const abort = () => proxyReq.destroy(new Error("fetch proxy client disconnected"));
|
|
39637
39643
|
req.once("aborted", abort);
|
|
39638
39644
|
proxyReq.once("close", () => req.off("aborted", abort));
|
|
39639
|
-
proxyReq.
|
|
39645
|
+
proxyReq.on("error", reject);
|
|
39640
39646
|
if (nextBody === void 0) proxyReq.end();
|
|
39641
39647
|
else proxyReq.end(nextBody);
|
|
39642
39648
|
});
|
|
@@ -39802,7 +39808,28 @@ var init_fetch_proxy_handler = __esm({
|
|
|
39802
39808
|
});
|
|
39803
39809
|
|
|
39804
39810
|
// src/host/fetch-proxy-transport.ts
|
|
39805
|
-
|
|
39811
|
+
function readIdentity(identityPath) {
|
|
39812
|
+
let parsed;
|
|
39813
|
+
try {
|
|
39814
|
+
parsed = JSON.parse((0, import_node_fs25.readFileSync)(identityPath, "utf8"));
|
|
39815
|
+
} catch {
|
|
39816
|
+
return null;
|
|
39817
|
+
}
|
|
39818
|
+
if (!parsed || typeof parsed !== "object") return null;
|
|
39819
|
+
const key2 = Reflect.get(parsed, "key");
|
|
39820
|
+
const cert = Reflect.get(parsed, "cert");
|
|
39821
|
+
const spki = Reflect.get(parsed, "spki");
|
|
39822
|
+
const port = Reflect.get(parsed, "port");
|
|
39823
|
+
if (typeof key2 !== "string" || typeof cert !== "string" || typeof spki !== "string" || typeof port !== "number") {
|
|
39824
|
+
return null;
|
|
39825
|
+
}
|
|
39826
|
+
return { key: key2, cert, spki, port };
|
|
39827
|
+
}
|
|
39828
|
+
function writeIdentity(identityPath, identity) {
|
|
39829
|
+
(0, import_node_fs25.mkdirSync)(import_node_path26.default.dirname(identityPath), { recursive: true });
|
|
39830
|
+
(0, import_node_fs25.writeFileSync)(identityPath, JSON.stringify(identity), { mode: 384 });
|
|
39831
|
+
}
|
|
39832
|
+
async function createIdentity() {
|
|
39806
39833
|
const algorithm = { name: "ECDSA", namedCurve: "P-256", hash: "SHA-256" };
|
|
39807
39834
|
const keys = await crypto.subtle.generateKey(algorithm, true, ["sign", "verify"]);
|
|
39808
39835
|
const certificate = await import_x509.X509CertificateGenerator.createSelfSigned(
|
|
@@ -39820,15 +39847,22 @@ async function startFetchProxyTransport() {
|
|
|
39820
39847
|
crypto
|
|
39821
39848
|
);
|
|
39822
39849
|
const privateKey = Buffer.from(await crypto.subtle.exportKey("pkcs8", keys.privateKey));
|
|
39823
|
-
|
|
39824
|
-
|
|
39825
|
-
|
|
39826
|
-
{
|
|
39827
|
-
cert: certificate.toString("pem"),
|
|
39828
|
-
key: `-----BEGIN PRIVATE KEY-----
|
|
39850
|
+
return {
|
|
39851
|
+
cert: certificate.toString("pem"),
|
|
39852
|
+
key: `-----BEGIN PRIVATE KEY-----
|
|
39829
39853
|
${privateKey.toString("base64").match(/.{1,64}/g)?.join("\n")}
|
|
39830
39854
|
-----END PRIVATE KEY-----
|
|
39831
39855
|
`,
|
|
39856
|
+
spki: (0, import_node_crypto13.createHash)("sha256").update(Buffer.from(await crypto.subtle.exportKey("spki", keys.publicKey))).digest("base64")
|
|
39857
|
+
};
|
|
39858
|
+
}
|
|
39859
|
+
async function startFetchProxyTransport(identityPath) {
|
|
39860
|
+
const identity = readIdentity(identityPath) ?? { ...await createIdentity(), port: 0 };
|
|
39861
|
+
const sessions = /* @__PURE__ */ new Set();
|
|
39862
|
+
const server = (0, import_node_http22.createSecureServer)(
|
|
39863
|
+
{
|
|
39864
|
+
cert: identity.cert,
|
|
39865
|
+
key: identity.key,
|
|
39832
39866
|
settings: { maxConcurrentStreams: 256 }
|
|
39833
39867
|
},
|
|
39834
39868
|
(req, res) => {
|
|
@@ -39848,30 +39882,42 @@ ${privateKey.toString("base64").match(/.{1,64}/g)?.join("\n")}
|
|
|
39848
39882
|
session.once("close", () => sessions.delete(session));
|
|
39849
39883
|
session.on("error", () => session.destroy());
|
|
39850
39884
|
});
|
|
39851
|
-
|
|
39885
|
+
const listen = (port) => new Promise((resolve10, reject) => {
|
|
39852
39886
|
server.once("error", reject);
|
|
39853
|
-
server.listen(
|
|
39887
|
+
server.listen(port, "127.0.0.1", () => {
|
|
39854
39888
|
server.off("error", reject);
|
|
39855
39889
|
resolve10();
|
|
39856
39890
|
});
|
|
39857
39891
|
});
|
|
39892
|
+
try {
|
|
39893
|
+
await listen(identity.port);
|
|
39894
|
+
} catch (error) {
|
|
39895
|
+
const taken = error instanceof Error && Reflect.get(error, "code") === "EADDRINUSE";
|
|
39896
|
+
if (identity.port === 0 || !taken) throw error;
|
|
39897
|
+
await listen(0);
|
|
39898
|
+
}
|
|
39858
39899
|
const address = server.address();
|
|
39859
39900
|
if (!address || typeof address === "string")
|
|
39860
39901
|
throw new Error("fetch proxy has no address");
|
|
39902
|
+
if (address.port !== identity.port) {
|
|
39903
|
+
writeIdentity(identityPath, { ...identity, port: address.port });
|
|
39904
|
+
}
|
|
39861
39905
|
return {
|
|
39862
|
-
descriptor: { origin: `https://127.0.0.1:${address.port}`, spki },
|
|
39906
|
+
descriptor: { origin: `https://127.0.0.1:${address.port}`, spki: identity.spki },
|
|
39863
39907
|
async close() {
|
|
39864
39908
|
for (const session of sessions) session.destroy();
|
|
39865
39909
|
await new Promise((resolve10) => server.close(() => resolve10()));
|
|
39866
39910
|
}
|
|
39867
39911
|
};
|
|
39868
39912
|
}
|
|
39869
|
-
var import_node_crypto13, import_node_http22, import_x509;
|
|
39913
|
+
var import_node_crypto13, import_node_fs25, import_node_http22, import_node_path26, import_x509;
|
|
39870
39914
|
var init_fetch_proxy_transport = __esm({
|
|
39871
39915
|
"src/host/fetch-proxy-transport.ts"() {
|
|
39872
39916
|
"use strict";
|
|
39873
39917
|
import_node_crypto13 = require("node:crypto");
|
|
39918
|
+
import_node_fs25 = require("node:fs");
|
|
39874
39919
|
import_node_http22 = require("node:http2");
|
|
39920
|
+
import_node_path26 = __toESM(require("node:path"), 1);
|
|
39875
39921
|
import_x509 = require("@peculiar/x509");
|
|
39876
39922
|
init_fetch_proxy_handler();
|
|
39877
39923
|
}
|
|
@@ -40120,23 +40166,23 @@ function looksBinary(filePath, size) {
|
|
|
40120
40166
|
if (size === 0) return false;
|
|
40121
40167
|
let fd;
|
|
40122
40168
|
try {
|
|
40123
|
-
fd =
|
|
40169
|
+
fd = import_node_fs26.default.openSync(filePath, "r");
|
|
40124
40170
|
const buffer = Buffer.alloc(Math.min(BINARY_SNIFF_BYTES, size));
|
|
40125
|
-
const read =
|
|
40171
|
+
const read = import_node_fs26.default.readSync(fd, buffer, 0, buffer.length, 0);
|
|
40126
40172
|
return buffer.subarray(0, read).includes(0);
|
|
40127
40173
|
} catch {
|
|
40128
40174
|
return false;
|
|
40129
40175
|
} finally {
|
|
40130
|
-
if (fd !== void 0)
|
|
40176
|
+
if (fd !== void 0) import_node_fs26.default.closeSync(fd);
|
|
40131
40177
|
}
|
|
40132
40178
|
}
|
|
40133
|
-
var import_node_child_process12,
|
|
40179
|
+
var import_node_child_process12, import_node_fs26, import_node_path27, CheckoutRequiresGitError, BINARY_SNIFF_BYTES, LIST_FILES_TIMEOUT_MS, LIST_FILES_ATTEMPTS, LIST_FILES_RETRY_MS, CheckoutFilePlane;
|
|
40134
40180
|
var init_checkout_plane = __esm({
|
|
40135
40181
|
"cli/commands/box/checkout-plane.ts"() {
|
|
40136
40182
|
"use strict";
|
|
40137
40183
|
import_node_child_process12 = require("node:child_process");
|
|
40138
|
-
|
|
40139
|
-
|
|
40184
|
+
import_node_fs26 = __toESM(require("node:fs"), 1);
|
|
40185
|
+
import_node_path27 = __toESM(require("node:path"), 1);
|
|
40140
40186
|
CheckoutRequiresGitError = class extends Error {
|
|
40141
40187
|
};
|
|
40142
40188
|
BINARY_SNIFF_BYTES = 8192;
|
|
@@ -40153,7 +40199,7 @@ var init_checkout_plane = __esm({
|
|
|
40153
40199
|
listTimeoutMs;
|
|
40154
40200
|
trackedOnly;
|
|
40155
40201
|
constructor(root, options = {}) {
|
|
40156
|
-
this.root =
|
|
40202
|
+
this.root = import_node_path27.default.resolve(root);
|
|
40157
40203
|
this.listTimeoutMs = options.listTimeoutMs ?? LIST_FILES_TIMEOUT_MS;
|
|
40158
40204
|
this.trackedOnly = options.trackedOnly ?? false;
|
|
40159
40205
|
}
|
|
@@ -40215,13 +40261,13 @@ var init_checkout_plane = __esm({
|
|
|
40215
40261
|
if (!relative3) continue;
|
|
40216
40262
|
let stat2;
|
|
40217
40263
|
try {
|
|
40218
|
-
stat2 =
|
|
40264
|
+
stat2 = import_node_fs26.default.statSync(import_node_path27.default.join(this.root, relative3));
|
|
40219
40265
|
} catch {
|
|
40220
40266
|
continue;
|
|
40221
40267
|
}
|
|
40222
40268
|
if (!stat2.isFile()) continue;
|
|
40223
40269
|
const seen = this.sniffed.get(relative3);
|
|
40224
|
-
const binary2 = seen && seen.size === stat2.size && seen.mtimeMs === stat2.mtimeMs ? seen.binary : looksBinary(
|
|
40270
|
+
const binary2 = seen && seen.size === stat2.size && seen.mtimeMs === stat2.mtimeMs ? seen.binary : looksBinary(import_node_path27.default.join(this.root, relative3), stat2.size);
|
|
40225
40271
|
nextSniffed.set(relative3, { size: stat2.size, mtimeMs: stat2.mtimeMs, binary: binary2 });
|
|
40226
40272
|
next.set(relative3, {
|
|
40227
40273
|
size: stat2.size,
|
|
@@ -40235,22 +40281,22 @@ var init_checkout_plane = __esm({
|
|
|
40235
40281
|
this.sniffed = nextSniffed;
|
|
40236
40282
|
}
|
|
40237
40283
|
absolute(planePath) {
|
|
40238
|
-
const resolved =
|
|
40239
|
-
if (resolved !== this.root && !resolved.startsWith(`${this.root}${
|
|
40284
|
+
const resolved = import_node_path27.default.resolve(this.root, planePath);
|
|
40285
|
+
if (resolved !== this.root && !resolved.startsWith(`${this.root}${import_node_path27.default.sep}`)) {
|
|
40240
40286
|
throw new Error(`path escapes the project: ${planePath}`);
|
|
40241
40287
|
}
|
|
40242
40288
|
return resolved;
|
|
40243
40289
|
}
|
|
40244
40290
|
async read(planePath) {
|
|
40245
|
-
return
|
|
40291
|
+
return import_node_fs26.default.promises.readFile(this.absolute(planePath), "utf8");
|
|
40246
40292
|
}
|
|
40247
40293
|
async readBytes(planePath) {
|
|
40248
|
-
return
|
|
40294
|
+
return import_node_fs26.default.promises.readFile(this.absolute(planePath));
|
|
40249
40295
|
}
|
|
40250
40296
|
async write(planePath, content) {
|
|
40251
40297
|
const absolute = this.absolute(planePath);
|
|
40252
|
-
await
|
|
40253
|
-
await
|
|
40298
|
+
await import_node_fs26.default.promises.mkdir(import_node_path27.default.dirname(absolute), { recursive: true });
|
|
40299
|
+
await import_node_fs26.default.promises.writeFile(absolute, content);
|
|
40254
40300
|
this.entries.set(planePath, {
|
|
40255
40301
|
size: content.byteLength,
|
|
40256
40302
|
readOnly: false,
|
|
@@ -40259,7 +40305,7 @@ var init_checkout_plane = __esm({
|
|
|
40259
40305
|
});
|
|
40260
40306
|
}
|
|
40261
40307
|
async delete(planePath) {
|
|
40262
|
-
await
|
|
40308
|
+
await import_node_fs26.default.promises.rm(this.absolute(planePath), { force: true });
|
|
40263
40309
|
this.entries.delete(planePath);
|
|
40264
40310
|
}
|
|
40265
40311
|
};
|
|
@@ -40267,12 +40313,12 @@ var init_checkout_plane = __esm({
|
|
|
40267
40313
|
});
|
|
40268
40314
|
|
|
40269
40315
|
// src/host/plane-host.ts
|
|
40270
|
-
var
|
|
40316
|
+
var import_node_fs27, import_node_path28, WS_OPEN2, PlaneNotRegisteredError, PlaneHost;
|
|
40271
40317
|
var init_plane_host = __esm({
|
|
40272
40318
|
"src/host/plane-host.ts"() {
|
|
40273
40319
|
"use strict";
|
|
40274
|
-
|
|
40275
|
-
|
|
40320
|
+
import_node_fs27 = __toESM(require("node:fs"), 1);
|
|
40321
|
+
import_node_path28 = __toESM(require("node:path"), 1);
|
|
40276
40322
|
init_plane();
|
|
40277
40323
|
init_checkout_plane();
|
|
40278
40324
|
WS_OPEN2 = 1;
|
|
@@ -40395,14 +40441,14 @@ var init_plane_host = __esm({
|
|
|
40395
40441
|
// root and an opened one cannot disagree about the same directory.
|
|
40396
40442
|
realRoot(root) {
|
|
40397
40443
|
if (!root) throw new Error("root is required");
|
|
40398
|
-
const resolved =
|
|
40444
|
+
const resolved = import_node_path28.default.resolve(root);
|
|
40399
40445
|
let real;
|
|
40400
40446
|
try {
|
|
40401
|
-
real =
|
|
40447
|
+
real = import_node_fs27.default.realpathSync(resolved);
|
|
40402
40448
|
} catch {
|
|
40403
40449
|
throw new Error(`no such directory: ${resolved}`);
|
|
40404
40450
|
}
|
|
40405
|
-
if (!
|
|
40451
|
+
if (!import_node_fs27.default.statSync(real).isDirectory()) throw new Error(`not a directory: ${real}`);
|
|
40406
40452
|
return real;
|
|
40407
40453
|
}
|
|
40408
40454
|
respond(ws, id, result) {
|
|
@@ -40758,16 +40804,16 @@ function sendJavaScript(req, res, source) {
|
|
|
40758
40804
|
res.end(req.method === "HEAD" ? void 0 : source);
|
|
40759
40805
|
}
|
|
40760
40806
|
function resolveReplacementModuleFile(fromFile, specifier) {
|
|
40761
|
-
const base =
|
|
40807
|
+
const base = import_node_path29.default.resolve(import_node_path29.default.dirname(fromFile), specifier);
|
|
40762
40808
|
const candidates = [
|
|
40763
40809
|
...REPLACEMENT_MODULE_EXTENSIONS.some(
|
|
40764
|
-
(ext) => ext ===
|
|
40810
|
+
(ext) => ext === import_node_path29.default.extname(base).toLowerCase()
|
|
40765
40811
|
) ? [base] : [],
|
|
40766
40812
|
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
|
|
40767
|
-
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) =>
|
|
40813
|
+
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path29.default.join(base, `index${ext}`))
|
|
40768
40814
|
];
|
|
40769
40815
|
const found = candidates.find(
|
|
40770
|
-
(candidate) => (0,
|
|
40816
|
+
(candidate) => (0, import_node_fs28.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
|
|
40771
40817
|
);
|
|
40772
40818
|
if (!found) {
|
|
40773
40819
|
throw new Error(
|
|
@@ -40822,13 +40868,13 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
40822
40868
|
res.end("missing path param");
|
|
40823
40869
|
return true;
|
|
40824
40870
|
}
|
|
40825
|
-
const extension =
|
|
40871
|
+
const extension = import_node_path29.default.extname(targetPath).toLowerCase();
|
|
40826
40872
|
if (!REPLACEMENT_MODULE_EXTENSIONS.some((allowed) => allowed === extension)) {
|
|
40827
40873
|
res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
|
|
40828
40874
|
res.end(`replacement files must be ${REPLACEMENT_MODULE_EXTENSIONS.join(", ")}`);
|
|
40829
40875
|
return true;
|
|
40830
40876
|
}
|
|
40831
|
-
if (!
|
|
40877
|
+
if (!import_node_path29.default.isAbsolute(targetPath)) {
|
|
40832
40878
|
res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
|
|
40833
40879
|
res.end("replacement file path must be absolute");
|
|
40834
40880
|
return true;
|
|
@@ -40836,10 +40882,10 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
40836
40882
|
const runtimePackages = new Set(url.searchParams.getAll("runtimePackage"));
|
|
40837
40883
|
let resolvedProjectRoot;
|
|
40838
40884
|
if (options.projectRoot) {
|
|
40839
|
-
const lexicalProjectRoot =
|
|
40885
|
+
const lexicalProjectRoot = import_node_path29.default.resolve(options.projectRoot);
|
|
40840
40886
|
resolvedProjectRoot = await import_promises5.default.realpath(options.projectRoot);
|
|
40841
|
-
const lexicalTarget =
|
|
40842
|
-
if (lexicalTarget.startsWith("..") ||
|
|
40887
|
+
const lexicalTarget = import_node_path29.default.relative(lexicalProjectRoot, targetPath);
|
|
40888
|
+
if (lexicalTarget.startsWith("..") || import_node_path29.default.isAbsolute(lexicalTarget)) {
|
|
40843
40889
|
res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
|
|
40844
40890
|
res.end("replacement file must be inside the project root");
|
|
40845
40891
|
return true;
|
|
@@ -40855,8 +40901,8 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
40855
40901
|
return true;
|
|
40856
40902
|
}
|
|
40857
40903
|
if (resolvedProjectRoot) {
|
|
40858
|
-
const relativeTarget =
|
|
40859
|
-
if (relativeTarget.startsWith("..") ||
|
|
40904
|
+
const relativeTarget = import_node_path29.default.relative(resolvedProjectRoot, resolvedTargetPath);
|
|
40905
|
+
if (relativeTarget.startsWith("..") || import_node_path29.default.isAbsolute(relativeTarget)) {
|
|
40860
40906
|
res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
|
|
40861
40907
|
res.end("replacement file must be inside the project root");
|
|
40862
40908
|
return true;
|
|
@@ -40891,13 +40937,13 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
40891
40937
|
}
|
|
40892
40938
|
return true;
|
|
40893
40939
|
}
|
|
40894
|
-
var
|
|
40940
|
+
var import_node_fs28, import_promises5, import_node_path29, REPLACEMENT_MODULE_ROUTE;
|
|
40895
40941
|
var init_replacement_module_handler = __esm({
|
|
40896
40942
|
"src/host/replacement-module-handler.ts"() {
|
|
40897
40943
|
"use strict";
|
|
40898
|
-
|
|
40944
|
+
import_node_fs28 = require("node:fs");
|
|
40899
40945
|
import_promises5 = __toESM(require("node:fs/promises"), 1);
|
|
40900
|
-
|
|
40946
|
+
import_node_path29 = __toESM(require("node:path"), 1);
|
|
40901
40947
|
init_replacementModule();
|
|
40902
40948
|
init_backend_origin();
|
|
40903
40949
|
REPLACEMENT_MODULE_ROUTE = "/__sootsim-replacement-module";
|
|
@@ -41099,7 +41145,7 @@ function handleWebSocketProxyUpgrade(req, socket, head, forwardOrigin = true) {
|
|
|
41099
41145
|
response.resume();
|
|
41100
41146
|
fail(502, "upstream websocket rejected upgrade");
|
|
41101
41147
|
});
|
|
41102
|
-
upstreamRequest.
|
|
41148
|
+
upstreamRequest.on("error", () => {
|
|
41103
41149
|
fail(502, "upstream websocket error");
|
|
41104
41150
|
});
|
|
41105
41151
|
upstreamRequest.once("upgrade", (response, upstreamSocket, upstreamHead) => {
|
|
@@ -42899,8 +42945,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
|
|
|
42899
42945
|
}
|
|
42900
42946
|
const out = [];
|
|
42901
42947
|
for (const dir of dirs) {
|
|
42902
|
-
const
|
|
42903
|
-
if (!out.includes(
|
|
42948
|
+
const path39 = `${dir}/${filename}`;
|
|
42949
|
+
if (!out.includes(path39)) out.push(path39);
|
|
42904
42950
|
}
|
|
42905
42951
|
if (!out.includes(filename)) out.push(filename);
|
|
42906
42952
|
return out;
|
|
@@ -43864,13 +43910,13 @@ function readFactoryStringLiterals(factory) {
|
|
|
43864
43910
|
return literals;
|
|
43865
43911
|
}
|
|
43866
43912
|
function normalizeFingerprintLiteral(literal) {
|
|
43867
|
-
const
|
|
43913
|
+
const path39 = literal.replaceAll("\\\\", "/").replaceAll("\\/", "/");
|
|
43868
43914
|
const nodeModulesMarker = "/node_modules/";
|
|
43869
|
-
const nodeModulesIndex =
|
|
43915
|
+
const nodeModulesIndex = path39.lastIndexOf(nodeModulesMarker);
|
|
43870
43916
|
if (nodeModulesIndex >= 0) {
|
|
43871
|
-
return `node_modules/${
|
|
43917
|
+
return `node_modules/${path39.slice(nodeModulesIndex + nodeModulesMarker.length)}`;
|
|
43872
43918
|
}
|
|
43873
|
-
if ((
|
|
43919
|
+
if ((path39.startsWith("/") || /^[A-Za-z]:\//.test(path39) || path39.startsWith("file:/")) && /\.[cm]?[jt]sx?(?::\d+(?::\d+)?)?$/.test(path39)) {
|
|
43874
43920
|
return null;
|
|
43875
43921
|
}
|
|
43876
43922
|
return literal;
|
|
@@ -44108,10 +44154,10 @@ function templateAssignment(template, embeddings) {
|
|
|
44108
44154
|
if (existingNode !== void 0 && existingNode !== nodeIndex) return null;
|
|
44109
44155
|
nodesByModuleId.set(moduleId, nodeIndex);
|
|
44110
44156
|
const node = template.nodes[nodeIndex];
|
|
44111
|
-
const
|
|
44157
|
+
const path39 = node.landmarkPath ?? `node_modules/${template.packageName}/__rnx_inferred__/${moduleId}.js`;
|
|
44112
44158
|
const existingPath = pathsByModuleId.get(moduleId);
|
|
44113
|
-
if (existingPath !== void 0 && existingPath !==
|
|
44114
|
-
pathsByModuleId.set(moduleId,
|
|
44159
|
+
if (existingPath !== void 0 && existingPath !== path39) return null;
|
|
44160
|
+
pathsByModuleId.set(moduleId, path39);
|
|
44115
44161
|
}
|
|
44116
44162
|
}
|
|
44117
44163
|
return {
|
|
@@ -44273,14 +44319,14 @@ async function inferMetroModuleIdentity(args) {
|
|
|
44273
44319
|
const packageClaims = claimsByPackage.values().next().value;
|
|
44274
44320
|
if (!packageClaims) continue;
|
|
44275
44321
|
const exactClaims = packageClaims.filter((assignment2) => {
|
|
44276
|
-
const
|
|
44277
|
-
return
|
|
44322
|
+
const path39 = assignment2.pathsByModuleId.get(moduleId);
|
|
44323
|
+
return path39 !== void 0 && !path39.includes("/__rnx_inferred__/");
|
|
44278
44324
|
});
|
|
44279
44325
|
const preferredClaims = exactClaims.length > 0 ? exactClaims : packageClaims;
|
|
44280
44326
|
const routes = new Set(
|
|
44281
44327
|
preferredClaims.flatMap((assignment2) => {
|
|
44282
|
-
const
|
|
44283
|
-
return
|
|
44328
|
+
const path39 = assignment2.pathsByModuleId.get(moduleId);
|
|
44329
|
+
return path39 ? [metroFingerprintModuleClaimRoute(assignment2.packageName, path39)] : [];
|
|
44284
44330
|
})
|
|
44285
44331
|
);
|
|
44286
44332
|
if (routes.size !== 1) continue;
|
|
@@ -44575,8 +44621,8 @@ function detectFramework2(deps) {
|
|
|
44575
44621
|
return "unknown";
|
|
44576
44622
|
}
|
|
44577
44623
|
function detectProject(dir) {
|
|
44578
|
-
const pkgPath = (0,
|
|
44579
|
-
if (!(0,
|
|
44624
|
+
const pkgPath = (0, import_node_path30.join)(dir, "package.json");
|
|
44625
|
+
if (!(0, import_node_fs29.existsSync)(pkgPath)) return null;
|
|
44580
44626
|
const pkg = readProjectManifest(dir);
|
|
44581
44627
|
if (!pkg) return null;
|
|
44582
44628
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
@@ -44588,25 +44634,25 @@ function detectProject(dir) {
|
|
|
44588
44634
|
if (framework === "unknown") return null;
|
|
44589
44635
|
return {
|
|
44590
44636
|
dir,
|
|
44591
|
-
name: pkg.name || (0,
|
|
44637
|
+
name: pkg.name || (0, import_node_path30.basename)(dir),
|
|
44592
44638
|
framework,
|
|
44593
44639
|
// a config file is a config file whatever module system it declares. real
|
|
44594
44640
|
// apps write .cjs as often as .js, and missing one reads as "this project
|
|
44595
44641
|
// has no bundler config" and sends the user to create a second one.
|
|
44596
44642
|
hasViteConfig: CONFIG_EXTENSIONS.some(
|
|
44597
|
-
(ext) => (0,
|
|
44643
|
+
(ext) => (0, import_node_fs29.existsSync)((0, import_node_path30.join)(dir, `vite.config.${ext}`))
|
|
44598
44644
|
),
|
|
44599
44645
|
hasMetroConfig: CONFIG_EXTENSIONS.some(
|
|
44600
|
-
(ext) => (0,
|
|
44646
|
+
(ext) => (0, import_node_fs29.existsSync)((0, import_node_path30.join)(dir, `metro.config.${ext}`))
|
|
44601
44647
|
),
|
|
44602
44648
|
devCommand: typeof devCommand === "string" ? devCommand : null
|
|
44603
44649
|
};
|
|
44604
44650
|
}
|
|
44605
|
-
function readProjectMetadata(
|
|
44651
|
+
function readProjectMetadata(path39) {
|
|
44606
44652
|
try {
|
|
44607
|
-
const info = (0,
|
|
44653
|
+
const info = (0, import_node_fs29.lstatSync)(path39);
|
|
44608
44654
|
if (!info.isFile() || info.size > 4 * 1024 * 1024) return null;
|
|
44609
|
-
return (0,
|
|
44655
|
+
return (0, import_node_fs29.readFileSync)(path39, "utf8");
|
|
44610
44656
|
} catch {
|
|
44611
44657
|
return null;
|
|
44612
44658
|
}
|
|
@@ -44615,8 +44661,8 @@ function metadataValue(value, key2) {
|
|
|
44615
44661
|
if (!value || typeof value !== "object") return void 0;
|
|
44616
44662
|
return Object.getOwnPropertyDescriptor(value, key2)?.value;
|
|
44617
44663
|
}
|
|
44618
|
-
function readProjectJson(
|
|
44619
|
-
const text3 = readProjectMetadata(
|
|
44664
|
+
function readProjectJson(path39) {
|
|
44665
|
+
const text3 = readProjectMetadata(path39);
|
|
44620
44666
|
if (text3 === null) return null;
|
|
44621
44667
|
try {
|
|
44622
44668
|
const value = JSON.parse(text3);
|
|
@@ -44626,7 +44672,7 @@ function readProjectJson(path38) {
|
|
|
44626
44672
|
}
|
|
44627
44673
|
}
|
|
44628
44674
|
function readProjectManifest(dir) {
|
|
44629
|
-
const parsed = readProjectJson((0,
|
|
44675
|
+
const parsed = readProjectJson((0, import_node_path30.join)(dir, "package.json"));
|
|
44630
44676
|
if (!parsed || typeof parsed !== "object") return null;
|
|
44631
44677
|
const record2 = (value) => {
|
|
44632
44678
|
if (!value || typeof value !== "object") return {};
|
|
@@ -44643,12 +44689,12 @@ function readProjectManifest(dir) {
|
|
|
44643
44689
|
devDependencies: record2(metadataValue(parsed, "devDependencies"))
|
|
44644
44690
|
};
|
|
44645
44691
|
}
|
|
44646
|
-
var
|
|
44692
|
+
var import_node_fs29, import_node_path30, import_json52, CONFIG_EXTENSIONS;
|
|
44647
44693
|
var init_detect = __esm({
|
|
44648
44694
|
"cli/commands/detect.ts"() {
|
|
44649
44695
|
"use strict";
|
|
44650
|
-
|
|
44651
|
-
|
|
44696
|
+
import_node_fs29 = require("node:fs");
|
|
44697
|
+
import_node_path30 = require("node:path");
|
|
44652
44698
|
import_json52 = __toESM(require_lib(), 1);
|
|
44653
44699
|
init_browser();
|
|
44654
44700
|
CONFIG_EXTENSIONS = ["ts", "js", "cjs", "mjs", "mts", "cts"];
|
|
@@ -44685,21 +44731,21 @@ function resolveCloudOrigin(value) {
|
|
|
44685
44731
|
return normalizeCloudOrigin(source);
|
|
44686
44732
|
}
|
|
44687
44733
|
function readImmutableBundleSource(bundlePath) {
|
|
44688
|
-
const filepath = (0,
|
|
44689
|
-
if ((0,
|
|
44734
|
+
const filepath = (0, import_node_path31.resolve)(bundlePath);
|
|
44735
|
+
if ((0, import_node_path31.extname)(filepath) !== ".js") {
|
|
44690
44736
|
throw new Error(`${REMOTE_COMMAND} requires one local Metro .js bundle`);
|
|
44691
44737
|
}
|
|
44692
|
-
const descriptor = (0,
|
|
44738
|
+
const descriptor = (0, import_node_fs30.openSync)(filepath, "r");
|
|
44693
44739
|
try {
|
|
44694
|
-
const before = (0,
|
|
44740
|
+
const before = (0, import_node_fs30.fstatSync)(descriptor, { bigint: true });
|
|
44695
44741
|
if (!before.isFile()) {
|
|
44696
44742
|
throw new Error(`${REMOTE_COMMAND} bundle must be a regular local file`);
|
|
44697
44743
|
}
|
|
44698
44744
|
if (before.size <= 0n) {
|
|
44699
44745
|
throw new Error(`${REMOTE_COMMAND} bundle is empty`);
|
|
44700
44746
|
}
|
|
44701
|
-
const bytes = (0,
|
|
44702
|
-
const after = (0,
|
|
44747
|
+
const bytes = (0, import_node_fs30.readFileSync)(descriptor);
|
|
44748
|
+
const after = (0, import_node_fs30.fstatSync)(descriptor, { bigint: true });
|
|
44703
44749
|
if (before.dev !== after.dev || before.ino !== after.ino || before.size !== after.size || before.mtimeNs !== after.mtimeNs || bytes.length !== Number(before.size)) {
|
|
44704
44750
|
throw new Error(`${REMOTE_COMMAND} bundle changed while it was being read`);
|
|
44705
44751
|
}
|
|
@@ -44714,7 +44760,7 @@ function readImmutableBundleSource(bundlePath) {
|
|
|
44714
44760
|
}
|
|
44715
44761
|
return source;
|
|
44716
44762
|
} finally {
|
|
44717
|
-
(0,
|
|
44763
|
+
(0, import_node_fs30.closeSync)(descriptor);
|
|
44718
44764
|
}
|
|
44719
44765
|
}
|
|
44720
44766
|
async function fetchBundleSource(bundleUrl) {
|
|
@@ -44761,15 +44807,15 @@ async function loadBundleSource(bundleInput) {
|
|
|
44761
44807
|
return readImmutableBundleSource(bundleInput);
|
|
44762
44808
|
}
|
|
44763
44809
|
function listMetroAssetDest(assetsPath) {
|
|
44764
|
-
const directory = (0,
|
|
44765
|
-
if (!(0,
|
|
44766
|
-
const skipNested = (0,
|
|
44810
|
+
const directory = (0, import_node_path31.resolve)(assetsPath);
|
|
44811
|
+
if (!(0, import_node_fs30.existsSync)(directory)) return { directory, files: [], truncated: false };
|
|
44812
|
+
const skipNested = (0, import_node_fs30.existsSync)((0, import_node_path31.join)(directory, "package.json"));
|
|
44767
44813
|
const files2 = [];
|
|
44768
44814
|
let truncated = false;
|
|
44769
44815
|
const walk2 = (dir, prefix) => {
|
|
44770
44816
|
let entries;
|
|
44771
44817
|
try {
|
|
44772
|
-
entries = (0,
|
|
44818
|
+
entries = (0, import_node_fs30.readdirSync)(dir, { withFileTypes: true });
|
|
44773
44819
|
} catch {
|
|
44774
44820
|
return;
|
|
44775
44821
|
}
|
|
@@ -44781,7 +44827,7 @@ function listMetroAssetDest(assetsPath) {
|
|
|
44781
44827
|
if (entry.isDirectory()) {
|
|
44782
44828
|
if (entry.name === ".git") continue;
|
|
44783
44829
|
if (skipNested && PROJECT_ONLY_DIRECTORIES.has(entry.name)) continue;
|
|
44784
|
-
walk2((0,
|
|
44830
|
+
walk2((0, import_node_path31.join)(dir, entry.name), prefix ? `${prefix}/${entry.name}` : entry.name);
|
|
44785
44831
|
} else if (entry.isFile()) {
|
|
44786
44832
|
files2.push(prefix ? `${prefix}/${entry.name}` : entry.name);
|
|
44787
44833
|
}
|
|
@@ -44816,7 +44862,7 @@ function distinctByContent(directory, options) {
|
|
|
44816
44862
|
for (const relative3 of options) {
|
|
44817
44863
|
let bytes;
|
|
44818
44864
|
try {
|
|
44819
|
-
bytes = (0,
|
|
44865
|
+
bytes = (0, import_node_fs30.readFileSync)((0, import_node_path31.join)(directory, relative3));
|
|
44820
44866
|
} catch {
|
|
44821
44867
|
continue;
|
|
44822
44868
|
}
|
|
@@ -44848,7 +44894,7 @@ function placeMetroDescriptor(listing, descriptor) {
|
|
|
44848
44894
|
let bytes;
|
|
44849
44895
|
try {
|
|
44850
44896
|
bytes = combination.map(
|
|
44851
|
-
(relative3) => (0,
|
|
44897
|
+
(relative3) => (0, import_node_fs30.readFileSync)((0, import_node_path31.join)(listing.directory, relative3))
|
|
44852
44898
|
);
|
|
44853
44899
|
} catch {
|
|
44854
44900
|
continue;
|
|
@@ -44876,10 +44922,10 @@ function unverifiedContentKey(dest, fileDigests) {
|
|
|
44876
44922
|
return JSON.stringify(
|
|
44877
44923
|
dest.placements.map(
|
|
44878
44924
|
(placement) => placement.verified ? null : [...placement.files].map(([scale, relative3]) => {
|
|
44879
|
-
const file = (0,
|
|
44925
|
+
const file = (0, import_node_path31.join)(dest.directory, relative3);
|
|
44880
44926
|
let digest = fileDigests.get(file);
|
|
44881
44927
|
if (digest === void 0) {
|
|
44882
|
-
digest = (0, import_node_crypto14.createHash)("sha256").update((0,
|
|
44928
|
+
digest = (0, import_node_crypto14.createHash)("sha256").update((0, import_node_fs30.readFileSync)(file)).digest("hex");
|
|
44883
44929
|
fileDigests.set(file, digest);
|
|
44884
44930
|
}
|
|
44885
44931
|
return [scale, digest];
|
|
@@ -44888,22 +44934,22 @@ function unverifiedContentKey(dest, fileDigests) {
|
|
|
44888
44934
|
);
|
|
44889
44935
|
}
|
|
44890
44936
|
function searchMetroAssetDest(bundlePath, descriptors) {
|
|
44891
|
-
const bundleDirectory = (0,
|
|
44937
|
+
const bundleDirectory = (0, import_node_path31.dirname)((0, import_node_path31.resolve)(bundlePath));
|
|
44892
44938
|
const candidates = [
|
|
44893
|
-
(0,
|
|
44939
|
+
(0, import_node_path31.join)(bundleDirectory, "assets"),
|
|
44894
44940
|
bundleDirectory,
|
|
44895
|
-
(0,
|
|
44941
|
+
(0, import_node_path31.resolve)(bundleDirectory, "..", "assets")
|
|
44896
44942
|
];
|
|
44897
44943
|
const cwd = process.cwd();
|
|
44898
44944
|
let projectDirectory = null;
|
|
44899
44945
|
for (const start of [bundleDirectory, cwd]) {
|
|
44900
|
-
let directory = (0,
|
|
44946
|
+
let directory = (0, import_node_path31.resolve)(start);
|
|
44901
44947
|
while (true) {
|
|
44902
44948
|
if (detectProject(directory)?.hasMetroConfig) {
|
|
44903
44949
|
projectDirectory = directory;
|
|
44904
44950
|
break;
|
|
44905
44951
|
}
|
|
44906
|
-
const parent = (0,
|
|
44952
|
+
const parent = (0, import_node_path31.dirname)(directory);
|
|
44907
44953
|
if (parent === directory) break;
|
|
44908
44954
|
directory = parent;
|
|
44909
44955
|
}
|
|
@@ -44911,11 +44957,11 @@ function searchMetroAssetDest(bundlePath, descriptors) {
|
|
|
44911
44957
|
}
|
|
44912
44958
|
if (projectDirectory) {
|
|
44913
44959
|
candidates.push(
|
|
44914
|
-
(0,
|
|
44915
|
-
(0,
|
|
44916
|
-
(0,
|
|
44917
|
-
(0,
|
|
44918
|
-
(0,
|
|
44960
|
+
(0, import_node_path31.join)(projectDirectory, "assets"),
|
|
44961
|
+
(0, import_node_path31.join)(projectDirectory, "dist"),
|
|
44962
|
+
(0, import_node_path31.join)(projectDirectory, "dist", "assets"),
|
|
44963
|
+
(0, import_node_path31.join)(projectDirectory, "build"),
|
|
44964
|
+
(0, import_node_path31.join)(projectDirectory, "build", "assets")
|
|
44919
44965
|
);
|
|
44920
44966
|
}
|
|
44921
44967
|
const searched = [];
|
|
@@ -44923,7 +44969,7 @@ function searchMetroAssetDest(bundlePath, descriptors) {
|
|
|
44923
44969
|
const stale = [];
|
|
44924
44970
|
let truncated = false;
|
|
44925
44971
|
for (const candidate of candidates) {
|
|
44926
|
-
const directory = (0,
|
|
44972
|
+
const directory = (0, import_node_path31.resolve)(candidate);
|
|
44927
44973
|
if (searched.includes(directory)) continue;
|
|
44928
44974
|
searched.push(directory);
|
|
44929
44975
|
const listing = listMetroAssetDest(directory);
|
|
@@ -45032,7 +45078,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy) {
|
|
|
45032
45078
|
);
|
|
45033
45079
|
}
|
|
45034
45080
|
const relative3 = placement?.files.get(variant.scale);
|
|
45035
|
-
if (relative3 && dest) return (0,
|
|
45081
|
+
if (relative3 && dest) return (0, import_node_fs30.readFileSync)((0, import_node_path31.join)(dest.directory, relative3));
|
|
45036
45082
|
if (placement && placement.files.size > 0) return null;
|
|
45037
45083
|
if (placement && placement.ambiguous.length > 0 && dest) {
|
|
45038
45084
|
throw new Error(
|
|
@@ -45061,7 +45107,7 @@ async function embedBundleAssets(bundlePath, command, assetPolicy) {
|
|
|
45061
45107
|
);
|
|
45062
45108
|
const classic = metroIosAssetDestRelatives(variant.descriptor.httpServerLocation, filename)[0] ?? filename;
|
|
45063
45109
|
throw new Error(
|
|
45064
|
-
`${command} could not read ${(0,
|
|
45110
|
+
`${command} could not read ${(0, import_node_path31.join)(dest?.directory ?? ".", classic)} for ${variant.descriptor.name}.${variant.descriptor.type} at scale ${variant.scale}, and has no stand-in for a .${variant.descriptor.type} asset. Rebuild with \`react-native bundle --assets-dest\`.`
|
|
45065
45111
|
);
|
|
45066
45112
|
});
|
|
45067
45113
|
return {
|
|
@@ -45247,13 +45293,13 @@ function createCloudBridgeForParsed(parsed) {
|
|
|
45247
45293
|
if (!session) return null;
|
|
45248
45294
|
return session.service === "box" ? new CloudBoxBridge(session) : new CloudBridge(session);
|
|
45249
45295
|
}
|
|
45250
|
-
var import_node_crypto14,
|
|
45296
|
+
var import_node_crypto14, import_node_fs30, import_node_path31, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS, CloudBridge, CloudBoxBridge;
|
|
45251
45297
|
var init_cloud_client = __esm({
|
|
45252
45298
|
"cli/cloud-client.ts"() {
|
|
45253
45299
|
"use strict";
|
|
45254
45300
|
import_node_crypto14 = require("node:crypto");
|
|
45255
|
-
|
|
45256
|
-
|
|
45301
|
+
import_node_fs30 = require("node:fs");
|
|
45302
|
+
import_node_path31 = require("node:path");
|
|
45257
45303
|
init_metroAssetArtifact();
|
|
45258
45304
|
init_metroCloudArtifact();
|
|
45259
45305
|
init_metro_fingerprint_registry_client();
|
|
@@ -45712,7 +45758,9 @@ var init_bridge_host = __esm({
|
|
|
45712
45758
|
);
|
|
45713
45759
|
}
|
|
45714
45760
|
try {
|
|
45715
|
-
this.fetchProxyTransport = await startFetchProxyTransport(
|
|
45761
|
+
this.fetchProxyTransport = await startFetchProxyTransport(
|
|
45762
|
+
fetchTransportIdentityPath(boundPort)
|
|
45763
|
+
);
|
|
45716
45764
|
} catch (error) {
|
|
45717
45765
|
await this.close();
|
|
45718
45766
|
throw error;
|
|
@@ -47758,31 +47806,31 @@ var init_parent_pid = __esm({
|
|
|
47758
47806
|
|
|
47759
47807
|
// cli/secure-file.ts
|
|
47760
47808
|
function writeSecureJsonAtomic(filepath, value) {
|
|
47761
|
-
(0,
|
|
47809
|
+
(0, import_node_fs31.mkdirSync)((0, import_node_path32.dirname)(filepath), { recursive: true });
|
|
47762
47810
|
const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto15.randomUUID)()}`;
|
|
47763
47811
|
let descriptor = null;
|
|
47764
47812
|
try {
|
|
47765
|
-
descriptor = (0,
|
|
47766
|
-
(0,
|
|
47767
|
-
(0,
|
|
47813
|
+
descriptor = (0, import_node_fs31.openSync)(temporary, "wx", 384);
|
|
47814
|
+
(0, import_node_fs31.fchmodSync)(descriptor, 384);
|
|
47815
|
+
(0, import_node_fs31.writeFileSync)(descriptor, `${JSON.stringify(value, null, 2)}
|
|
47768
47816
|
`);
|
|
47769
|
-
(0,
|
|
47770
|
-
(0,
|
|
47817
|
+
(0, import_node_fs31.fsyncSync)(descriptor);
|
|
47818
|
+
(0, import_node_fs31.closeSync)(descriptor);
|
|
47771
47819
|
descriptor = null;
|
|
47772
|
-
(0,
|
|
47820
|
+
(0, import_node_fs31.renameSync)(temporary, filepath);
|
|
47773
47821
|
} catch (error) {
|
|
47774
|
-
if (descriptor !== null) (0,
|
|
47775
|
-
(0,
|
|
47822
|
+
if (descriptor !== null) (0, import_node_fs31.closeSync)(descriptor);
|
|
47823
|
+
(0, import_node_fs31.rmSync)(temporary, { force: true });
|
|
47776
47824
|
throw error;
|
|
47777
47825
|
}
|
|
47778
47826
|
}
|
|
47779
|
-
var import_node_crypto15,
|
|
47827
|
+
var import_node_crypto15, import_node_fs31, import_node_path32;
|
|
47780
47828
|
var init_secure_file = __esm({
|
|
47781
47829
|
"cli/secure-file.ts"() {
|
|
47782
47830
|
"use strict";
|
|
47783
47831
|
import_node_crypto15 = require("node:crypto");
|
|
47784
|
-
|
|
47785
|
-
|
|
47832
|
+
import_node_fs31 = require("node:fs");
|
|
47833
|
+
import_node_path32 = require("node:path");
|
|
47786
47834
|
}
|
|
47787
47835
|
});
|
|
47788
47836
|
|
|
@@ -47967,17 +48015,17 @@ function liveDevBridgeLockfiles() {
|
|
|
47967
48015
|
return readDevBridgeLockfiles().filter((lockfile) => isDevBridgeLockfileFresh(lockfile));
|
|
47968
48016
|
}
|
|
47969
48017
|
function checkoutRoot(cwd) {
|
|
47970
|
-
let current =
|
|
48018
|
+
let current = import_node_path33.default.resolve(cwd);
|
|
47971
48019
|
while (true) {
|
|
47972
|
-
if (
|
|
47973
|
-
const parent =
|
|
48020
|
+
if (import_node_fs32.default.existsSync(import_node_path33.default.join(current, ".git"))) return current;
|
|
48021
|
+
const parent = import_node_path33.default.dirname(current);
|
|
47974
48022
|
if (parent === current) return null;
|
|
47975
48023
|
current = parent;
|
|
47976
48024
|
}
|
|
47977
48025
|
}
|
|
47978
48026
|
function pathContains(parent, child) {
|
|
47979
|
-
const relative3 =
|
|
47980
|
-
return relative3 === "" || relative3 !== ".." && !relative3.startsWith(`..${
|
|
48027
|
+
const relative3 = import_node_path33.default.relative(parent, child);
|
|
48028
|
+
return relative3 === "" || relative3 !== ".." && !relative3.startsWith(`..${import_node_path33.default.sep}`) && !import_node_path33.default.isAbsolute(relative3);
|
|
47981
48029
|
}
|
|
47982
48030
|
function resolveDefaultDevBridgeLockfile() {
|
|
47983
48031
|
const lockfiles = liveDevBridgeLockfiles();
|
|
@@ -48575,18 +48623,18 @@ async function evalInBridge(bridge, code, opts = {}) {
|
|
|
48575
48623
|
if (opts.acquireLock) payload.acquireLock = true;
|
|
48576
48624
|
return bridge.send(payload);
|
|
48577
48625
|
}
|
|
48578
|
-
async function callInBridge(bridge,
|
|
48579
|
-
return bridge.send({ type: "call", path:
|
|
48626
|
+
async function callInBridge(bridge, path39, ...args) {
|
|
48627
|
+
return bridge.send({ type: "call", path: path39, args });
|
|
48580
48628
|
}
|
|
48581
|
-
async function callInBridgeWrite(bridge,
|
|
48582
|
-
return bridge.send({ type: "call", path:
|
|
48629
|
+
async function callInBridgeWrite(bridge, path39, ...args) {
|
|
48630
|
+
return bridge.send({ type: "call", path: path39, args, acquireLock: true });
|
|
48583
48631
|
}
|
|
48584
|
-
var
|
|
48632
|
+
var import_node_fs32, import_node_path33, import_ws2, PEACH_PLACEMENT_ENV, resolvedWorld, BridgeSimLockedError, BRIDGE_VALUE_FLAGS_TABLE, BRIDGE_VALUE_FLAGS;
|
|
48585
48633
|
var init_ws_bridge = __esm({
|
|
48586
48634
|
"cli/ws-bridge.ts"() {
|
|
48587
48635
|
"use strict";
|
|
48588
|
-
|
|
48589
|
-
|
|
48636
|
+
import_node_fs32 = __toESM(require("node:fs"), 1);
|
|
48637
|
+
import_node_path33 = __toESM(require("node:path"), 1);
|
|
48590
48638
|
import_ws2 = require("ws");
|
|
48591
48639
|
init_bridge_constants();
|
|
48592
48640
|
init_cli_constants();
|
|
@@ -48714,8 +48762,8 @@ function getDefaultPortForProtocol(protocol) {
|
|
|
48714
48762
|
return protocol === "https:" ? 443 : 80;
|
|
48715
48763
|
}
|
|
48716
48764
|
function isBaseServerUrl(url) {
|
|
48717
|
-
const
|
|
48718
|
-
return (
|
|
48765
|
+
const path39 = url.pathname || "/";
|
|
48766
|
+
return (path39 === "/" || path39 === "") && !url.search && !url.hash;
|
|
48719
48767
|
}
|
|
48720
48768
|
async function resolvePortViaServerScan(port) {
|
|
48721
48769
|
try {
|
|
@@ -48888,8 +48936,8 @@ var init_dev_bundle_resolution = __esm({
|
|
|
48888
48936
|
|
|
48889
48937
|
// src/dot-env.ts
|
|
48890
48938
|
function selectEnvFile(env, notices) {
|
|
48891
|
-
if (
|
|
48892
|
-
return { name:
|
|
48939
|
+
if (import_node_fs33.default.existsSync("/tmp/envfile")) {
|
|
48940
|
+
return { name: import_node_fs33.default.readFileSync("/tmp/envfile", "utf8").trim(), fromEnvfile: false };
|
|
48893
48941
|
}
|
|
48894
48942
|
const requested = env.ENVFILE;
|
|
48895
48943
|
if (!requested) return { name: DEFAULT_ENV_FILE, fromEnvfile: false };
|
|
@@ -48952,16 +49000,16 @@ function readProjectDotEnv(envsRoot, env = process.env) {
|
|
|
48952
49000
|
const notices = [];
|
|
48953
49001
|
const selection = selectEnvFile(env, notices);
|
|
48954
49002
|
const requestedPaths = [
|
|
48955
|
-
|
|
48956
|
-
|
|
49003
|
+
import_node_path34.default.resolve(import_node_path34.default.join(envsRoot, selection.name)),
|
|
49004
|
+
import_node_path34.default.resolve(selection.name)
|
|
48957
49005
|
];
|
|
48958
49006
|
const candidates = [
|
|
48959
49007
|
...requestedPaths,
|
|
48960
|
-
|
|
49008
|
+
import_node_path34.default.resolve(import_node_path34.default.join(envsRoot, DEFAULT_ENV_FILE))
|
|
48961
49009
|
];
|
|
48962
|
-
if (!
|
|
49010
|
+
if (!import_node_fs33.default.existsSync(candidates[2])) candidates.push(import_node_path34.default.resolve(DEFAULT_ENV_FILE));
|
|
48963
49011
|
const tried = [...new Set(candidates)];
|
|
48964
|
-
const resolved = tried.find((candidate) =>
|
|
49012
|
+
const resolved = tried.find((candidate) => import_node_fs33.default.existsSync(candidate));
|
|
48965
49013
|
if (!resolved) {
|
|
48966
49014
|
notices.push(
|
|
48967
49015
|
"*** Missing .env file ****",
|
|
@@ -48981,7 +49029,7 @@ function readProjectDotEnv(envsRoot, env = process.env) {
|
|
|
48981
49029
|
);
|
|
48982
49030
|
}
|
|
48983
49031
|
const config = {};
|
|
48984
|
-
for (const line of
|
|
49032
|
+
for (const line of import_node_fs33.default.readFileSync(resolved, "utf8").split("\n")) {
|
|
48985
49033
|
if (!line.trim()) continue;
|
|
48986
49034
|
if (/^[ \t\n\v\f\r]*#/.test(line)) continue;
|
|
48987
49035
|
const match = DOTENV_PATTERN.exec(line);
|
|
@@ -48991,12 +49039,12 @@ function readProjectDotEnv(envsRoot, env = process.env) {
|
|
|
48991
49039
|
}
|
|
48992
49040
|
return { config, notices };
|
|
48993
49041
|
}
|
|
48994
|
-
var
|
|
49042
|
+
var import_node_fs33, import_node_path34, DEFAULT_ENV_FILE, DOTENV_PATTERN, BUILD_SETTING_PATTERN, INVALID_ENTRY;
|
|
48995
49043
|
var init_dot_env = __esm({
|
|
48996
49044
|
"src/dot-env.ts"() {
|
|
48997
49045
|
"use strict";
|
|
48998
|
-
|
|
48999
|
-
|
|
49046
|
+
import_node_fs33 = __toESM(require("node:fs"), 1);
|
|
49047
|
+
import_node_path34 = __toESM(require("node:path"), 1);
|
|
49000
49048
|
DEFAULT_ENV_FILE = ".env";
|
|
49001
49049
|
DOTENV_PATTERN = /^(?:export[ \t\n\v\f\r]+|)(?<key>[\p{Alphabetic}\p{Nd}_]+)[ \t\n\v\f\r]*=[ \t\n\v\f\r]*((?<quote>["'])?(?<val>[^\n]*?[^\\\n])\k<quote>?|)$/u;
|
|
49002
49050
|
BUILD_SETTING_PATTERN = /\$[({]([A-Za-z_][A-Za-z0-9_]*)[)}]|\$([A-Za-z_][A-Za-z0-9_]*)/g;
|
|
@@ -49020,8 +49068,8 @@ var init_flow_timeout_scale = __esm({
|
|
|
49020
49068
|
function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
|
|
49021
49069
|
const result = {};
|
|
49022
49070
|
let config = {};
|
|
49023
|
-
const appJsonPath =
|
|
49024
|
-
const appJson =
|
|
49071
|
+
const appJsonPath = import_node_path35.default.join(projectRoot, "app.json");
|
|
49072
|
+
const appJson = import_node_fs34.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs34.default.readFileSync(appJsonPath, "utf8")) : null;
|
|
49025
49073
|
const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
|
|
49026
49074
|
(value) => isRecord(value) && typeof value.googleServicesFile === "string"
|
|
49027
49075
|
));
|
|
@@ -49030,9 +49078,9 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
|
|
|
49030
49078
|
"app.config.ts",
|
|
49031
49079
|
"app.config.cjs",
|
|
49032
49080
|
"app.config.mjs"
|
|
49033
|
-
].some((name2) =>
|
|
49081
|
+
].some((name2) => import_node_fs34.default.existsSync(import_node_path35.default.join(projectRoot, name2)));
|
|
49034
49082
|
if (staticExpo || dynamicExpo) {
|
|
49035
|
-
const require4 = (0, import_node_module2.createRequire)(
|
|
49083
|
+
const require4 = (0, import_node_module2.createRequire)(import_node_path35.default.join(projectRoot, "package.json"));
|
|
49036
49084
|
const configModule = require4("@expo/config");
|
|
49037
49085
|
if (!isRecord(configModule) || typeof configModule.getConfig !== "function")
|
|
49038
49086
|
throw new Error("Expo native configuration is unavailable.");
|
|
@@ -49044,23 +49092,23 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
|
|
|
49044
49092
|
}
|
|
49045
49093
|
const ios = config.ios;
|
|
49046
49094
|
if (platforms.includes("ios") && (!isRecord(ios) || typeof ios.googleServicesFile !== "string")) {
|
|
49047
|
-
const iosRoot =
|
|
49048
|
-
if (
|
|
49049
|
-
const projects2 =
|
|
49095
|
+
const iosRoot = import_node_path35.default.join(projectRoot, "ios");
|
|
49096
|
+
if (import_node_fs34.default.existsSync(iosRoot)) {
|
|
49097
|
+
const projects2 = import_node_fs34.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
|
|
49050
49098
|
if (projects2.length > 1)
|
|
49051
49099
|
throw new Error("native Firebase configuration requires a selected Xcode project");
|
|
49052
49100
|
if (projects2.length === 1) {
|
|
49053
|
-
const xcodeproj =
|
|
49101
|
+
const xcodeproj = import_node_path35.default.join(iosRoot, projects2[0].name);
|
|
49054
49102
|
const appTargets = listXcodeAppTargets(xcodeproj);
|
|
49055
49103
|
if (appTargets.length > 1)
|
|
49056
49104
|
throw new Error("native Firebase configuration requires a selected app target");
|
|
49057
49105
|
if (appTargets.length === 1) {
|
|
49058
49106
|
const app = readXcodeAppTarget(xcodeproj, appTargets[0]);
|
|
49059
49107
|
const delegates = app.allSources.filter(
|
|
49060
|
-
(file) => /^AppDelegate\.(swift|mm|m)$/.test(
|
|
49108
|
+
(file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path35.default.basename(file))
|
|
49061
49109
|
);
|
|
49062
49110
|
const defaultConfigured = delegates.some((file) => {
|
|
49063
|
-
const source =
|
|
49111
|
+
const source = import_node_fs34.default.readFileSync(file, "utf8").replace(
|
|
49064
49112
|
/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"(?:\\.|[^"\\])*"/g,
|
|
49065
49113
|
(token) => token.startsWith('"') ? '""' : token.replace(/[^\n]/g, " ")
|
|
49066
49114
|
);
|
|
@@ -49088,15 +49136,15 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
|
|
|
49088
49136
|
});
|
|
49089
49137
|
if (defaultConfigured) {
|
|
49090
49138
|
const resources = app.resources.filter(
|
|
49091
|
-
(file) => /^GoogleService-Info\.plist$/.test(
|
|
49139
|
+
(file) => /^GoogleService-Info\.plist$/.test(import_node_path35.default.basename(file))
|
|
49092
49140
|
);
|
|
49093
49141
|
if (resources.length !== 1)
|
|
49094
49142
|
throw new Error(
|
|
49095
49143
|
"native Firebase default initialization requires one GoogleService-Info.plist build resource"
|
|
49096
49144
|
);
|
|
49097
49145
|
config.ios = {
|
|
49098
|
-
googleServicesFile:
|
|
49099
|
-
|
|
49146
|
+
googleServicesFile: import_node_path35.default.relative(
|
|
49147
|
+
import_node_fs34.default.realpathSync(projectRoot),
|
|
49100
49148
|
resources[0]
|
|
49101
49149
|
)
|
|
49102
49150
|
};
|
|
@@ -49109,8 +49157,8 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
|
|
|
49109
49157
|
const native = config[platform];
|
|
49110
49158
|
if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
|
|
49111
49159
|
try {
|
|
49112
|
-
const source =
|
|
49113
|
-
|
|
49160
|
+
const source = import_node_fs34.default.readFileSync(
|
|
49161
|
+
import_node_path35.default.resolve(projectRoot, native.googleServicesFile),
|
|
49114
49162
|
"utf8"
|
|
49115
49163
|
);
|
|
49116
49164
|
const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
|
|
@@ -49162,13 +49210,13 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
|
|
|
49162
49210
|
}
|
|
49163
49211
|
return result;
|
|
49164
49212
|
}
|
|
49165
|
-
var
|
|
49213
|
+
var import_node_fs34, import_node_module2, import_node_path35;
|
|
49166
49214
|
var init_native_firebase_config = __esm({
|
|
49167
49215
|
"src/native-firebase-config.ts"() {
|
|
49168
49216
|
"use strict";
|
|
49169
|
-
|
|
49217
|
+
import_node_fs34 = __toESM(require("node:fs"), 1);
|
|
49170
49218
|
import_node_module2 = require("node:module");
|
|
49171
|
-
|
|
49219
|
+
import_node_path35 = __toESM(require("node:path"), 1);
|
|
49172
49220
|
init_is_record();
|
|
49173
49221
|
init_plist();
|
|
49174
49222
|
init_xcode_project();
|
|
@@ -49282,59 +49330,59 @@ var init_profiles = __esm({
|
|
|
49282
49330
|
// cli/app-catalog.ts
|
|
49283
49331
|
function listDir(dir) {
|
|
49284
49332
|
try {
|
|
49285
|
-
return
|
|
49333
|
+
return import_node_fs35.default.readdirSync(dir, { withFileTypes: true });
|
|
49286
49334
|
} catch {
|
|
49287
49335
|
return [];
|
|
49288
49336
|
}
|
|
49289
49337
|
}
|
|
49290
49338
|
function readText(file) {
|
|
49291
49339
|
try {
|
|
49292
|
-
return
|
|
49340
|
+
return import_node_fs35.default.readFileSync(file, "utf8");
|
|
49293
49341
|
} catch {
|
|
49294
49342
|
return null;
|
|
49295
49343
|
}
|
|
49296
49344
|
}
|
|
49297
49345
|
function catalogFiles(dir, found) {
|
|
49298
49346
|
for (const entry of listDir(dir)) {
|
|
49299
|
-
const full =
|
|
49347
|
+
const full = import_node_path36.default.join(dir, entry.name);
|
|
49300
49348
|
if (entry.isDirectory()) catalogFiles(full, found);
|
|
49301
49349
|
else if (entry.name === "Contents.json") found.push(full);
|
|
49302
49350
|
}
|
|
49303
49351
|
}
|
|
49304
49352
|
function discoverAppCatalog(appDir) {
|
|
49305
|
-
const iosDir =
|
|
49353
|
+
const iosDir = import_node_path36.default.join(appDir, "ios");
|
|
49306
49354
|
const target = listDir(iosDir).find(
|
|
49307
|
-
(entry) => entry.isDirectory() && entry.name !== "Pods" && listDir(
|
|
49355
|
+
(entry) => entry.isDirectory() && entry.name !== "Pods" && listDir(import_node_path36.default.join(iosDir, entry.name)).some(
|
|
49308
49356
|
(file) => /^AppDelegate\.(swift|mm|m)$/.test(file.name)
|
|
49309
49357
|
)
|
|
49310
49358
|
);
|
|
49311
49359
|
if (!target) return null;
|
|
49312
|
-
const targetDir =
|
|
49360
|
+
const targetDir = import_node_path36.default.join(iosDir, target.name);
|
|
49313
49361
|
const files2 = [];
|
|
49314
49362
|
for (const entry of listDir(targetDir)) {
|
|
49315
49363
|
if (entry.isDirectory() && entry.name.endsWith(".xcassets"))
|
|
49316
|
-
catalogFiles(
|
|
49364
|
+
catalogFiles(import_node_path36.default.join(targetDir, entry.name), files2);
|
|
49317
49365
|
}
|
|
49318
49366
|
const relative3 = files2.map(
|
|
49319
|
-
(file) =>
|
|
49367
|
+
(file) => import_node_path36.default.relative(targetDir, file).split(import_node_path36.default.sep).join(import_node_path36.default.posix.sep)
|
|
49320
49368
|
);
|
|
49321
49369
|
const colors = enumerateBundleColors(
|
|
49322
49370
|
relative3,
|
|
49323
|
-
(candidate) => candidate.endsWith("Contents.json") ? readText(
|
|
49371
|
+
(candidate) => candidate.endsWith("Contents.json") ? readText(import_node_path36.default.join(targetDir, candidate)) : null
|
|
49324
49372
|
);
|
|
49325
49373
|
const pbxproj = listDir(iosDir).find((entry) => entry.name.endsWith(".xcodeproj"));
|
|
49326
|
-
const accentName = readText(
|
|
49374
|
+
const accentName = readText(import_node_path36.default.join(targetDir, "Info.plist"))?.match(PLIST_ACCENT)?.[1] ?? (pbxproj ? readText(import_node_path36.default.join(iosDir, pbxproj.name, "project.pbxproj"))?.match(
|
|
49327
49375
|
ACCENT_BUILD_SETTING
|
|
49328
49376
|
)?.[1] : void 0) ?? null;
|
|
49329
49377
|
if (accentName === null && Object.keys(colors).length === 0) return null;
|
|
49330
49378
|
return { colors, accentName };
|
|
49331
49379
|
}
|
|
49332
|
-
var
|
|
49380
|
+
var import_node_fs35, import_node_path36, ACCENT_BUILD_SETTING, PLIST_ACCENT;
|
|
49333
49381
|
var init_app_catalog = __esm({
|
|
49334
49382
|
"cli/app-catalog.ts"() {
|
|
49335
49383
|
"use strict";
|
|
49336
|
-
|
|
49337
|
-
|
|
49384
|
+
import_node_fs35 = __toESM(require("node:fs"), 1);
|
|
49385
|
+
import_node_path36 = __toESM(require("node:path"), 1);
|
|
49338
49386
|
init_bundleAssets();
|
|
49339
49387
|
ACCENT_BUILD_SETTING = /ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "?([^";]+)"?;/;
|
|
49340
49388
|
PLIST_ACCENT = /<key>NSAccentColorName<\/key>\s*<string>([^<]+)<\/string>/;
|
|
@@ -49344,9 +49392,9 @@ var init_app_catalog = __esm({
|
|
|
49344
49392
|
// cli/app-project.ts
|
|
49345
49393
|
function firstNamedFile(dir, names) {
|
|
49346
49394
|
for (const name2 of names) {
|
|
49347
|
-
const candidate =
|
|
49395
|
+
const candidate = import_node_path37.default.join(dir, name2);
|
|
49348
49396
|
try {
|
|
49349
|
-
if (
|
|
49397
|
+
if (import_node_fs36.default.statSync(candidate).isFile()) return candidate;
|
|
49350
49398
|
} catch {
|
|
49351
49399
|
}
|
|
49352
49400
|
}
|
|
@@ -49359,24 +49407,24 @@ function findRNXAppConfig(dir) {
|
|
|
49359
49407
|
return firstNamedFile(dir, PEACH_APP_CONFIG_NAMES);
|
|
49360
49408
|
}
|
|
49361
49409
|
function resolveAppProject(projectRoot) {
|
|
49362
|
-
const appDir =
|
|
49410
|
+
const appDir = import_node_path37.default.resolve(projectRoot);
|
|
49363
49411
|
try {
|
|
49364
|
-
if (!
|
|
49412
|
+
if (!import_node_fs36.default.statSync(appDir).isDirectory()) return null;
|
|
49365
49413
|
} catch {
|
|
49366
49414
|
return null;
|
|
49367
49415
|
}
|
|
49368
49416
|
const configPath = findRNXAppConfig(appDir);
|
|
49369
|
-
if (!configPath && !findExpoAppConfig(appDir) && !
|
|
49417
|
+
if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs36.default.existsSync(import_node_path37.default.join(appDir, "package.json"))) {
|
|
49370
49418
|
return null;
|
|
49371
49419
|
}
|
|
49372
49420
|
return { appDir, configPath };
|
|
49373
49421
|
}
|
|
49374
|
-
var
|
|
49422
|
+
var import_node_fs36, import_node_path37, EXPO_APP_CONFIG_NAMES, PEACH_APP_CONFIG_NAMES;
|
|
49375
49423
|
var init_app_project = __esm({
|
|
49376
49424
|
"cli/app-project.ts"() {
|
|
49377
49425
|
"use strict";
|
|
49378
|
-
|
|
49379
|
-
|
|
49426
|
+
import_node_fs36 = __toESM(require("node:fs"), 1);
|
|
49427
|
+
import_node_path37 = __toESM(require("node:path"), 1);
|
|
49380
49428
|
EXPO_APP_CONFIG_NAMES = [
|
|
49381
49429
|
"app.config.js",
|
|
49382
49430
|
"app.config.ts",
|
|
@@ -49399,12 +49447,12 @@ function resolveFileEntries(entries, configDir) {
|
|
|
49399
49447
|
return Object.fromEntries(
|
|
49400
49448
|
Object.entries(entries).map(([name2, resolution]) => [
|
|
49401
49449
|
name2,
|
|
49402
|
-
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file:
|
|
49450
|
+
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path38.default.resolve(configDir, resolution.file) } : resolution
|
|
49403
49451
|
])
|
|
49404
49452
|
);
|
|
49405
49453
|
}
|
|
49406
49454
|
function resolveConfigReplacementFiles(config, configPath) {
|
|
49407
|
-
const configDir =
|
|
49455
|
+
const configDir = import_node_path38.default.dirname(configPath);
|
|
49408
49456
|
return {
|
|
49409
49457
|
...config,
|
|
49410
49458
|
modules: resolveFileEntries(config.modules, configDir),
|
|
@@ -49439,11 +49487,11 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
|
|
|
49439
49487
|
const project = resolveAppProject(startDir);
|
|
49440
49488
|
return { project, config: await loadRNXAppConfig(project) };
|
|
49441
49489
|
}
|
|
49442
|
-
var
|
|
49490
|
+
var import_node_path38, import_jiti;
|
|
49443
49491
|
var init_app_config = __esm({
|
|
49444
49492
|
"cli/app-config.ts"() {
|
|
49445
49493
|
"use strict";
|
|
49446
|
-
|
|
49494
|
+
import_node_path38 = __toESM(require("node:path"), 1);
|
|
49447
49495
|
import_jiti = require("jiti");
|
|
49448
49496
|
init_config();
|
|
49449
49497
|
init_config();
|
|
@@ -49500,13 +49548,13 @@ function discoverNativeLinkedAppFonts(opts) {
|
|
|
49500
49548
|
scannedFontDirectories++;
|
|
49501
49549
|
let entries;
|
|
49502
49550
|
try {
|
|
49503
|
-
entries =
|
|
49551
|
+
entries = import_node_fs37.default.readdirSync(current.dir, { withFileTypes: true });
|
|
49504
49552
|
} catch {
|
|
49505
49553
|
continue;
|
|
49506
49554
|
}
|
|
49507
49555
|
for (const entry of entries) {
|
|
49508
49556
|
if (entry.isSymbolicLink()) continue;
|
|
49509
|
-
const fullPath =
|
|
49557
|
+
const fullPath = import_node_path39.default.join(current.dir, entry.name);
|
|
49510
49558
|
if (entry.isDirectory()) {
|
|
49511
49559
|
if (current.depth < 4 && pending.length < 64 && !entry.name.startsWith(".")) {
|
|
49512
49560
|
pending.push({ dir: fullPath, depth: current.depth + 1 });
|
|
@@ -49514,15 +49562,15 @@ function discoverNativeLinkedAppFonts(opts) {
|
|
|
49514
49562
|
continue;
|
|
49515
49563
|
}
|
|
49516
49564
|
if (!entry.isFile() || !/\.(ttf|otf|woff|woff2)$/i.test(entry.name)) continue;
|
|
49517
|
-
const relative3 =
|
|
49518
|
-
fontPaths.push(
|
|
49565
|
+
const relative3 = import_node_path39.default.relative(root, fullPath).split(import_node_path39.default.sep).join("/");
|
|
49566
|
+
fontPaths.push(import_node_path39.default.posix.join(metroPathPrefix, relative3));
|
|
49519
49567
|
if (fontPaths.length >= 256) break;
|
|
49520
49568
|
}
|
|
49521
49569
|
}
|
|
49522
49570
|
};
|
|
49523
49571
|
try {
|
|
49524
49572
|
const packageJson = JSON.parse(
|
|
49525
|
-
|
|
49573
|
+
import_node_fs37.default.readFileSync(import_node_path39.default.join(selectedAppDir, "package.json"), "utf8")
|
|
49526
49574
|
);
|
|
49527
49575
|
const dependencyNames = /* @__PURE__ */ new Set();
|
|
49528
49576
|
for (const field of ["dependencies", "devDependencies", "optionalDependencies"]) {
|
|
@@ -49537,32 +49585,32 @@ function discoverNativeLinkedAppFonts(opts) {
|
|
|
49537
49585
|
const config = Reflect.get(packageJson, "reactNativeVectorIcons");
|
|
49538
49586
|
const configuredFontDir = config && typeof config === "object" ? Reflect.get(config, "fontDir") : null;
|
|
49539
49587
|
const configuredDir = typeof configuredFontDir === "string" ? configuredFontDir : "rnvi-fonts";
|
|
49540
|
-
const root =
|
|
49541
|
-
const relativeRoot =
|
|
49542
|
-
if (!relativeRoot.startsWith("..") && !
|
|
49543
|
-
collectFontFiles(root, relativeRoot.split(
|
|
49588
|
+
const root = import_node_path39.default.resolve(selectedAppDir, configuredDir);
|
|
49589
|
+
const relativeRoot = import_node_path39.default.relative(selectedAppDir, root);
|
|
49590
|
+
if (!relativeRoot.startsWith("..") && !import_node_path39.default.isAbsolute(relativeRoot)) {
|
|
49591
|
+
collectFontFiles(root, relativeRoot.split(import_node_path39.default.sep).join("/"));
|
|
49544
49592
|
}
|
|
49545
|
-
const bundleDir =
|
|
49546
|
-
const appRelativeDir = bundleDir.split("/").join(
|
|
49593
|
+
const bundleDir = import_node_path39.default.posix.dirname(new URL(opts.bundleUrl).pathname).replace(/^\/+/, "");
|
|
49594
|
+
const appRelativeDir = bundleDir.split("/").join(import_node_path39.default.sep);
|
|
49547
49595
|
const metroRootCandidates = [selectedAppDir];
|
|
49548
|
-
if (bundleDir && selectedAppDir.endsWith(
|
|
49596
|
+
if (bundleDir && selectedAppDir.endsWith(import_node_path39.default.sep + appRelativeDir)) {
|
|
49549
49597
|
metroRootCandidates.push(selectedAppDir.slice(0, -appRelativeDir.length - 1));
|
|
49550
49598
|
}
|
|
49551
|
-
const vectorIconRequire = (0, import_node_module3.createRequire)(
|
|
49599
|
+
const vectorIconRequire = (0, import_node_module3.createRequire)(import_node_path39.default.join(selectedAppDir, "package.json"));
|
|
49552
49600
|
for (const dependencyName of vectorIconDependencies) {
|
|
49553
49601
|
try {
|
|
49554
49602
|
const entryPath = vectorIconRequire.resolve(dependencyName);
|
|
49555
|
-
const dependencyPath = dependencyName.split("/").join(
|
|
49556
|
-
const marker = `${
|
|
49603
|
+
const dependencyPath = dependencyName.split("/").join(import_node_path39.default.sep);
|
|
49604
|
+
const marker = `${import_node_path39.default.sep}node_modules${import_node_path39.default.sep}${dependencyPath}${import_node_path39.default.sep}`;
|
|
49557
49605
|
const markerIndex = entryPath.lastIndexOf(marker);
|
|
49558
49606
|
if (markerIndex === -1) continue;
|
|
49559
49607
|
const packageRoot = entryPath.slice(0, markerIndex + marker.length - 1);
|
|
49560
49608
|
const fontsDir = dependencyName === "react-native-vector-icons" ? "Fonts" : "fonts";
|
|
49561
|
-
const fontsRoot =
|
|
49609
|
+
const fontsRoot = import_node_path39.default.join(packageRoot, fontsDir);
|
|
49562
49610
|
for (const metroRoot of metroRootCandidates) {
|
|
49563
49611
|
collectFontFiles(
|
|
49564
49612
|
fontsRoot,
|
|
49565
|
-
|
|
49613
|
+
import_node_path39.default.relative(metroRoot, fontsRoot).split(import_node_path39.default.sep).join("/")
|
|
49566
49614
|
);
|
|
49567
49615
|
}
|
|
49568
49616
|
} catch {
|
|
@@ -49572,37 +49620,37 @@ function discoverNativeLinkedAppFonts(opts) {
|
|
|
49572
49620
|
} catch {
|
|
49573
49621
|
}
|
|
49574
49622
|
try {
|
|
49575
|
-
const configPath =
|
|
49576
|
-
if (
|
|
49577
|
-
const appConfigRequire = (0, import_node_module3.createRequire)(
|
|
49623
|
+
const configPath = import_node_path39.default.join(selectedAppDir, "react-native.config.js");
|
|
49624
|
+
if (import_node_fs37.default.statSync(configPath).isFile()) {
|
|
49625
|
+
const appConfigRequire = (0, import_node_module3.createRequire)(import_node_path39.default.join(selectedAppDir, "package.json"));
|
|
49578
49626
|
const rnConfig = appConfigRequire(configPath);
|
|
49579
49627
|
const assets2 = rnConfig && typeof rnConfig === "object" ? Reflect.get(rnConfig, "assets") : null;
|
|
49580
49628
|
if (Array.isArray(assets2)) {
|
|
49581
49629
|
for (const assetDir of assets2) {
|
|
49582
49630
|
if (typeof assetDir !== "string") continue;
|
|
49583
|
-
const root =
|
|
49584
|
-
const relativeRoot =
|
|
49585
|
-
if (relativeRoot.startsWith("..") ||
|
|
49586
|
-
collectFontFiles(root, relativeRoot.split(
|
|
49631
|
+
const root = import_node_path39.default.resolve(selectedAppDir, assetDir);
|
|
49632
|
+
const relativeRoot = import_node_path39.default.relative(selectedAppDir, root);
|
|
49633
|
+
if (relativeRoot.startsWith("..") || import_node_path39.default.isAbsolute(relativeRoot)) continue;
|
|
49634
|
+
collectFontFiles(root, relativeRoot.split(import_node_path39.default.sep).join("/"));
|
|
49587
49635
|
}
|
|
49588
49636
|
}
|
|
49589
49637
|
}
|
|
49590
49638
|
} catch {
|
|
49591
49639
|
}
|
|
49592
49640
|
if (platform === "ios") {
|
|
49593
|
-
const iosDir =
|
|
49641
|
+
const iosDir = import_node_path39.default.join(selectedAppDir, "ios");
|
|
49594
49642
|
try {
|
|
49595
|
-
const targetDirs =
|
|
49643
|
+
const targetDirs = import_node_fs37.default.readdirSync(iosDir, { withFileTypes: true }).filter(
|
|
49596
49644
|
(entry) => entry.isDirectory() && !entry.isSymbolicLink() && entry.name !== "Pods" && entry.name !== "build" && !entry.name.startsWith(".")
|
|
49597
49645
|
).slice(0, 64);
|
|
49598
|
-
const plistPaths = [
|
|
49646
|
+
const plistPaths = [import_node_path39.default.join(iosDir, "Info.plist")];
|
|
49599
49647
|
for (const entry of targetDirs) {
|
|
49600
|
-
plistPaths.push(
|
|
49648
|
+
plistPaths.push(import_node_path39.default.join(iosDir, entry.name, "Info.plist"));
|
|
49601
49649
|
}
|
|
49602
49650
|
for (const plistPath of plistPaths) {
|
|
49603
49651
|
let parsed;
|
|
49604
49652
|
try {
|
|
49605
|
-
parsed = parsePlistSource(
|
|
49653
|
+
parsed = parsePlistSource(import_node_fs37.default.readFileSync(plistPath, "utf8"));
|
|
49606
49654
|
} catch {
|
|
49607
49655
|
continue;
|
|
49608
49656
|
}
|
|
@@ -49612,21 +49660,21 @@ function discoverNativeLinkedAppFonts(opts) {
|
|
|
49612
49660
|
for (const declaredFont of declaredFonts) {
|
|
49613
49661
|
if (typeof declaredFont !== "string") continue;
|
|
49614
49662
|
const candidates = [
|
|
49615
|
-
|
|
49616
|
-
|
|
49663
|
+
import_node_path39.default.resolve(import_node_path39.default.dirname(plistPath), declaredFont),
|
|
49664
|
+
import_node_path39.default.resolve(iosDir, declaredFont)
|
|
49617
49665
|
];
|
|
49618
49666
|
const fontPath = candidates.find((candidate) => {
|
|
49619
|
-
const relative3 =
|
|
49620
|
-
if (relative3.startsWith("..") ||
|
|
49667
|
+
const relative3 = import_node_path39.default.relative(selectedAppDir, candidate);
|
|
49668
|
+
if (relative3.startsWith("..") || import_node_path39.default.isAbsolute(relative3)) return false;
|
|
49621
49669
|
try {
|
|
49622
|
-
return
|
|
49670
|
+
return import_node_fs37.default.statSync(candidate).isFile();
|
|
49623
49671
|
} catch {
|
|
49624
49672
|
return false;
|
|
49625
49673
|
}
|
|
49626
49674
|
});
|
|
49627
49675
|
if (!fontPath) continue;
|
|
49628
49676
|
fontPaths.push(
|
|
49629
|
-
|
|
49677
|
+
import_node_path39.default.relative(selectedAppDir, fontPath).split(import_node_path39.default.sep).join("/")
|
|
49630
49678
|
);
|
|
49631
49679
|
}
|
|
49632
49680
|
}
|
|
@@ -49668,13 +49716,13 @@ async function resolveMetroProjectRoot(bundleUrl, opts) {
|
|
|
49668
49716
|
function encodeAppFontsWire(specs) {
|
|
49669
49717
|
return specs.map((spec) => `${encodeURIComponent(spec.url)}::${encodeURIComponent(spec.family)}`).join(",");
|
|
49670
49718
|
}
|
|
49671
|
-
var
|
|
49719
|
+
var import_node_fs37, import_node_module3, import_node_path39, import_config_plugin_fonts, require2;
|
|
49672
49720
|
var init_app_fonts = __esm({
|
|
49673
49721
|
"cli/app-fonts.ts"() {
|
|
49674
49722
|
"use strict";
|
|
49675
|
-
|
|
49723
|
+
import_node_fs37 = __toESM(require("node:fs"), 1);
|
|
49676
49724
|
import_node_module3 = require("node:module");
|
|
49677
|
-
|
|
49725
|
+
import_node_path39 = __toESM(require("node:path"), 1);
|
|
49678
49726
|
import_config_plugin_fonts = require("peach-engine/engine/config-plugin-fonts");
|
|
49679
49727
|
init_dev_server_scanner();
|
|
49680
49728
|
init_backend_origin();
|
|
@@ -50614,7 +50662,7 @@ function desktopHostExecutable() {
|
|
|
50614
50662
|
function bundleValue(app, key2) {
|
|
50615
50663
|
const read = (0, import_node_child_process13.spawnSync)(
|
|
50616
50664
|
"plutil",
|
|
50617
|
-
["-extract", key2, "raw", "-o", "-",
|
|
50665
|
+
["-extract", key2, "raw", "-o", "-", import_node_path40.default.join(app, "Contents/Info.plist")],
|
|
50618
50666
|
{ encoding: "utf8" }
|
|
50619
50667
|
);
|
|
50620
50668
|
return read.status === 0 ? read.stdout.trim() : null;
|
|
@@ -50625,8 +50673,8 @@ function isNativeHostBundle(app) {
|
|
|
50625
50673
|
function placedHostVersion() {
|
|
50626
50674
|
if (desktopHostPlatform() === "linux-x64") {
|
|
50627
50675
|
try {
|
|
50628
|
-
const version =
|
|
50629
|
-
return /^\d+\.\d+$/.test(version) &&
|
|
50676
|
+
const version = import_node_fs38.default.readFileSync(import_node_path40.default.join(desktopHostsDir(), "active"), "utf8").trim();
|
|
50677
|
+
return /^\d+\.\d+$/.test(version) && import_node_fs38.default.existsSync(import_node_path40.default.join(desktopHostDir(version), desktopHostExecutable())) ? version : null;
|
|
50630
50678
|
} catch {
|
|
50631
50679
|
return null;
|
|
50632
50680
|
}
|
|
@@ -50642,18 +50690,18 @@ function headlessHostCommand() {
|
|
|
50642
50690
|
if (!version) return null;
|
|
50643
50691
|
const dir = desktopHostDir(version);
|
|
50644
50692
|
return [
|
|
50645
|
-
|
|
50693
|
+
import_node_path40.default.join(dir, "bin/node"),
|
|
50646
50694
|
"--experimental-vm-modules",
|
|
50647
|
-
|
|
50695
|
+
import_node_path40.default.join(dir, "node/host.mjs")
|
|
50648
50696
|
];
|
|
50649
50697
|
}
|
|
50650
|
-
var import_node_child_process13,
|
|
50698
|
+
var import_node_child_process13, import_node_fs38, import_node_path40, MAC_HOST_APP, HOST_BUNDLE_ID;
|
|
50651
50699
|
var init_desktop_host_delivery = __esm({
|
|
50652
50700
|
"src/desktop-host-delivery.ts"() {
|
|
50653
50701
|
"use strict";
|
|
50654
50702
|
import_node_child_process13 = require("node:child_process");
|
|
50655
|
-
|
|
50656
|
-
|
|
50703
|
+
import_node_fs38 = __toESM(require("node:fs"), 1);
|
|
50704
|
+
import_node_path40 = __toESM(require("node:path"), 1);
|
|
50657
50705
|
init_src();
|
|
50658
50706
|
init_home_paths();
|
|
50659
50707
|
MAC_HOST_APP = "/Applications/Peach.app";
|
|
@@ -52201,8 +52249,8 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
|
|
|
52201
52249
|
};
|
|
52202
52250
|
}
|
|
52203
52251
|
const lock = parseLinuxBrowserLibsLock(linux_browser_libs_lock_default);
|
|
52204
|
-
const dir = (0,
|
|
52205
|
-
if (!(0,
|
|
52252
|
+
const dir = (0, import_node_path41.join)(rnxHomeDir(), "linux-libs", `${lock.id}-${arch}`);
|
|
52253
|
+
if (!(0, import_node_fs39.existsSync)((0, import_node_path41.join)(dir, LINUX_BROWSER_LIBS_MARKER))) {
|
|
52206
52254
|
const url = `${DEFAULT_CLI_RELEASE_ORIGIN}/${linuxBrowserLibsKey(lock.id, arch)}`;
|
|
52207
52255
|
process.stderr.write(
|
|
52208
52256
|
`peach: this system lacks ${missing.length} shared libraries ${browser} links; downloading them\u2026
|
|
@@ -52230,7 +52278,7 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
|
|
|
52230
52278
|
};
|
|
52231
52279
|
}
|
|
52232
52280
|
}
|
|
52233
|
-
const libraryPath = [(0,
|
|
52281
|
+
const libraryPath = [(0, import_node_path41.join)(dir, "lib"), (0, import_node_path41.join)(dir, "lib", "nss")].join(":");
|
|
52234
52282
|
const stillMissing = missingLibraries(executablePath, libraryPath);
|
|
52235
52283
|
if (stillMissing.length) {
|
|
52236
52284
|
return {
|
|
@@ -52240,13 +52288,13 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
|
|
|
52240
52288
|
}
|
|
52241
52289
|
return { ok: true, libraryPath };
|
|
52242
52290
|
}
|
|
52243
|
-
var import_node_child_process14,
|
|
52291
|
+
var import_node_child_process14, import_node_fs39, import_node_path41, LINUX_BROWSER_LIBS_ARCHES, LINUX_BROWSER_LIBS_MARKER;
|
|
52244
52292
|
var init_linux_browser_libs = __esm({
|
|
52245
52293
|
"cli/drivers/linux-browser-libs.ts"() {
|
|
52246
52294
|
"use strict";
|
|
52247
52295
|
import_node_child_process14 = require("node:child_process");
|
|
52248
|
-
|
|
52249
|
-
|
|
52296
|
+
import_node_fs39 = require("node:fs");
|
|
52297
|
+
import_node_path41 = require("node:path");
|
|
52250
52298
|
init_src();
|
|
52251
52299
|
init_home_paths();
|
|
52252
52300
|
init_is_record();
|
|
@@ -52270,13 +52318,13 @@ function resolvePlaywright() {
|
|
|
52270
52318
|
try {
|
|
52271
52319
|
const modulePath = requireFromRoot.resolve(spec);
|
|
52272
52320
|
const packageJsonPath = requireFromRoot.resolve(`${spec}/package.json`);
|
|
52273
|
-
const parsed = JSON.parse((0,
|
|
52321
|
+
const parsed = JSON.parse((0, import_node_fs40.readFileSync)(packageJsonPath, "utf8"));
|
|
52274
52322
|
if (!isRecord(parsed) || typeof parsed.version !== "string") continue;
|
|
52275
52323
|
const corePackagePath = (0, import_node_module5.createRequire)(modulePath).resolve(
|
|
52276
52324
|
"playwright-core/package.json"
|
|
52277
52325
|
);
|
|
52278
|
-
const cliPath = (0,
|
|
52279
|
-
if (!(0,
|
|
52326
|
+
const cliPath = (0, import_node_path42.join)((0, import_node_path42.dirname)(corePackagePath), "cli.js");
|
|
52327
|
+
if (!(0, import_node_fs40.existsSync)(cliPath)) continue;
|
|
52280
52328
|
return {
|
|
52281
52329
|
spec,
|
|
52282
52330
|
modulePath,
|
|
@@ -52304,7 +52352,7 @@ async function provisionPlaywright() {
|
|
|
52304
52352
|
await installVerifiedTarball({
|
|
52305
52353
|
url: `https://registry.npmjs.org/playwright-core/-/playwright-core-${version}.tgz`,
|
|
52306
52354
|
digest: { algorithm, encoding: "base64", value: digest },
|
|
52307
|
-
destDir: (0,
|
|
52355
|
+
destDir: (0, import_node_path42.join)(playwrightCoreDir(version), "node_modules", "playwright-core"),
|
|
52308
52356
|
installedMarker: "package.json",
|
|
52309
52357
|
// npm tarballs hold the package under a leading `package/`
|
|
52310
52358
|
stripComponents: 1,
|
|
@@ -52347,7 +52395,7 @@ function probeBrowser(resolved, env) {
|
|
|
52347
52395
|
return {
|
|
52348
52396
|
ok: true,
|
|
52349
52397
|
executablePath: parsed.executablePath,
|
|
52350
|
-
exists: parsed.exists && (0,
|
|
52398
|
+
exists: parsed.exists && (0, import_node_fs40.existsSync)(parsed.executablePath)
|
|
52351
52399
|
};
|
|
52352
52400
|
} catch (error) {
|
|
52353
52401
|
return {
|
|
@@ -52415,14 +52463,14 @@ ${detail}` : ""}`
|
|
|
52415
52463
|
libraryPath: libraries.libraryPath
|
|
52416
52464
|
};
|
|
52417
52465
|
}
|
|
52418
|
-
var import_node_child_process15,
|
|
52466
|
+
var import_node_child_process15, import_node_fs40, import_node_module5, import_node_path42;
|
|
52419
52467
|
var init_playwright_provisioning = __esm({
|
|
52420
52468
|
"cli/drivers/playwright-provisioning.ts"() {
|
|
52421
52469
|
"use strict";
|
|
52422
52470
|
import_node_child_process15 = require("node:child_process");
|
|
52423
|
-
|
|
52471
|
+
import_node_fs40 = require("node:fs");
|
|
52424
52472
|
import_node_module5 = require("node:module");
|
|
52425
|
-
|
|
52473
|
+
import_node_path42 = require("node:path");
|
|
52426
52474
|
init_src();
|
|
52427
52475
|
init_home_paths();
|
|
52428
52476
|
init_is_record();
|
|
@@ -52926,11 +52974,11 @@ var init_runtime_diagnostics = __esm({
|
|
|
52926
52974
|
// cli/commands/skills.ts
|
|
52927
52975
|
function getSkillsDir() {
|
|
52928
52976
|
if (typeof __PEACH_BUNDLED_SKILLS__ !== "undefined") {
|
|
52929
|
-
const dir =
|
|
52977
|
+
const dir = path35.join(rnxHomeDir(), "skills", getCliVersion());
|
|
52930
52978
|
for (const [file, body] of Object.entries(__PEACH_BUNDLED_SKILLS__)) {
|
|
52931
|
-
const target =
|
|
52979
|
+
const target = path35.join(dir, file);
|
|
52932
52980
|
if (fs30.existsSync(target)) continue;
|
|
52933
|
-
fs30.mkdirSync(
|
|
52981
|
+
fs30.mkdirSync(path35.dirname(target), { recursive: true });
|
|
52934
52982
|
fs30.writeFileSync(target, body);
|
|
52935
52983
|
}
|
|
52936
52984
|
return dir;
|
|
@@ -52939,10 +52987,10 @@ function getSkillsDir() {
|
|
|
52939
52987
|
const pkgPath = (0, import_url3.fileURLToPath)(
|
|
52940
52988
|
import_meta3.resolve(`${rnxPublicBrand.packageName}/package.json`)
|
|
52941
52989
|
);
|
|
52942
|
-
return primaryCheckoutPath(
|
|
52990
|
+
return primaryCheckoutPath(path35.join(path35.dirname(pkgPath), "skills"));
|
|
52943
52991
|
} catch {
|
|
52944
|
-
const __dirname =
|
|
52945
|
-
return primaryCheckoutPath(
|
|
52992
|
+
const __dirname = path35.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
|
|
52993
|
+
return primaryCheckoutPath(path35.resolve(__dirname, "../../skills"));
|
|
52946
52994
|
}
|
|
52947
52995
|
}
|
|
52948
52996
|
function primaryCheckoutPath(dir) {
|
|
@@ -52965,8 +53013,8 @@ function primaryCheckoutPath(dir) {
|
|
|
52965
53013
|
} catch {
|
|
52966
53014
|
return dir;
|
|
52967
53015
|
}
|
|
52968
|
-
if (
|
|
52969
|
-
const primary =
|
|
53016
|
+
if (path35.basename(common) !== ".git") return dir;
|
|
53017
|
+
const primary = path35.join(path35.dirname(common), path35.relative(top, dir));
|
|
52970
53018
|
return fs30.existsSync(primary) ? primary : dir;
|
|
52971
53019
|
}
|
|
52972
53020
|
function skillsDir() {
|
|
@@ -52974,8 +53022,8 @@ function skillsDir() {
|
|
|
52974
53022
|
return skillsDirPath;
|
|
52975
53023
|
}
|
|
52976
53024
|
function targetFromHome(envName, fallbackDir) {
|
|
52977
|
-
const home = process.env[envName] ||
|
|
52978
|
-
return
|
|
53025
|
+
const home = process.env[envName] || path35.join(os9.homedir(), fallbackDir);
|
|
53026
|
+
return path35.join(home, "skills");
|
|
52979
53027
|
}
|
|
52980
53028
|
function defaultAgentTargets() {
|
|
52981
53029
|
return [
|
|
@@ -52988,7 +53036,7 @@ function hasInstalledPeachSkills() {
|
|
|
52988
53036
|
(file) => /^([^/]+)\/SKILL\.md$/.exec(file)?.[1] ?? []
|
|
52989
53037
|
) : listSkills().map((skill7) => skill7.name);
|
|
52990
53038
|
return defaultAgentTargets().some(
|
|
52991
|
-
({ dir }) => names.some((name2) => fs30.existsSync(
|
|
53039
|
+
({ dir }) => names.some((name2) => fs30.existsSync(path35.join(dir, name2, "SKILL.md")))
|
|
52992
53040
|
);
|
|
52993
53041
|
}
|
|
52994
53042
|
function parseSkillFrontmatter(content) {
|
|
@@ -53034,7 +53082,7 @@ function listSkills() {
|
|
|
53034
53082
|
if (!fs30.existsSync(skillsDir())) return [];
|
|
53035
53083
|
const skills = [];
|
|
53036
53084
|
for (const entry of fs30.readdirSync(skillsDir())) {
|
|
53037
|
-
const skillMd =
|
|
53085
|
+
const skillMd = path35.join(skillsDir(), entry, "SKILL.md");
|
|
53038
53086
|
if (!fs30.existsSync(skillMd)) continue;
|
|
53039
53087
|
const meta = parseSkillFrontmatter(fs30.readFileSync(skillMd, "utf8"));
|
|
53040
53088
|
if (meta) {
|
|
@@ -53043,14 +53091,14 @@ function listSkills() {
|
|
|
53043
53091
|
}
|
|
53044
53092
|
return skills.sort((a, b) => a.name.localeCompare(b.name));
|
|
53045
53093
|
}
|
|
53046
|
-
var import_child_process7, fs30, os9,
|
|
53094
|
+
var import_child_process7, fs30, os9, path35, import_url3, import_meta3, skillsDirPath;
|
|
53047
53095
|
var init_skills = __esm({
|
|
53048
53096
|
"cli/commands/skills.ts"() {
|
|
53049
53097
|
"use strict";
|
|
53050
53098
|
import_child_process7 = require("child_process");
|
|
53051
53099
|
fs30 = __toESM(require("fs"), 1);
|
|
53052
53100
|
os9 = __toESM(require("os"), 1);
|
|
53053
|
-
|
|
53101
|
+
path35 = __toESM(require("path"), 1);
|
|
53054
53102
|
import_url3 = require("url");
|
|
53055
53103
|
init_cli_version();
|
|
53056
53104
|
init_home_paths();
|
|
@@ -53537,7 +53585,7 @@ function assertExplicitBridgeLock(preferredPort, explicitPort, lock) {
|
|
|
53537
53585
|
async function ensureRuntimeForOpen() {
|
|
53538
53586
|
if (resolveDevCheckoutRuntimeRoot()) return;
|
|
53539
53587
|
const active = readActiveRuntime();
|
|
53540
|
-
if (active &&
|
|
53588
|
+
if (active && import_node_fs41.default.existsSync(runtimeDir(active))) return;
|
|
53541
53589
|
console.error(" installing peach engine runtime...");
|
|
53542
53590
|
const { runRuntime: runRuntime2 } = await Promise.resolve().then(() => (init_runtime(), runtime_exports));
|
|
53543
53591
|
await runRuntime2(["install"], {});
|
|
@@ -53692,10 +53740,10 @@ async function buildResolvedBundleOpenUrl(target, baseUrl, opts = {}) {
|
|
|
53692
53740
|
}
|
|
53693
53741
|
function normalizeReplacementPath(filePath) {
|
|
53694
53742
|
if (filePath.startsWith("~/")) {
|
|
53695
|
-
return
|
|
53743
|
+
return import_node_path43.default.join(import_node_os11.default.homedir(), filePath.slice(2));
|
|
53696
53744
|
}
|
|
53697
|
-
if (
|
|
53698
|
-
return
|
|
53745
|
+
if (import_node_path43.default.isAbsolute(filePath)) return filePath;
|
|
53746
|
+
return import_node_path43.default.resolve(process.cwd(), filePath);
|
|
53699
53747
|
}
|
|
53700
53748
|
function parseOpenRuntimeConfig(args) {
|
|
53701
53749
|
const modules = {};
|
|
@@ -53714,7 +53762,7 @@ function parseOpenRuntimeConfig(args) {
|
|
|
53714
53762
|
}
|
|
53715
53763
|
const moduleName = raw2.slice(0, eqIndex).trim();
|
|
53716
53764
|
const filePath = normalizeReplacementPath(raw2.slice(eqIndex + 1).trim());
|
|
53717
|
-
if (!
|
|
53765
|
+
if (!import_node_fs41.default.existsSync(filePath)) {
|
|
53718
53766
|
console.error(` peach open: replacement file not found: ${filePath}`);
|
|
53719
53767
|
rnxExit(1);
|
|
53720
53768
|
}
|
|
@@ -53745,7 +53793,7 @@ async function resolveAppProjectForBundleUrl(bundleUrl) {
|
|
|
53745
53793
|
return advertisedRoot ? resolveAppProject(advertisedRoot) : null;
|
|
53746
53794
|
}
|
|
53747
53795
|
async function ensureConfiguredRuntime(version) {
|
|
53748
|
-
if (
|
|
53796
|
+
if (import_node_fs41.default.existsSync(import_node_path43.default.join(runtimeDir(version), "index.html"))) return;
|
|
53749
53797
|
console.error(` installing configured engine runtime ${version}...`);
|
|
53750
53798
|
const result = await rnxRuntime.install({
|
|
53751
53799
|
version,
|
|
@@ -54081,7 +54129,7 @@ function playwrightHostPidForSim(sim) {
|
|
|
54081
54129
|
function signalDriverLaunchConnected(result) {
|
|
54082
54130
|
if (!result.connectAckFile) return false;
|
|
54083
54131
|
try {
|
|
54084
|
-
|
|
54132
|
+
import_node_fs41.default.writeFileSync(
|
|
54085
54133
|
result.connectAckFile,
|
|
54086
54134
|
`${JSON.stringify({ connectedAt: Date.now(), pid: result.pid ?? null })}
|
|
54087
54135
|
`,
|
|
@@ -54095,7 +54143,7 @@ function signalDriverLaunchConnected(result) {
|
|
|
54095
54143
|
function readUnservedUrl(result) {
|
|
54096
54144
|
if (!result.diagnosticLogPath) return null;
|
|
54097
54145
|
try {
|
|
54098
|
-
const detail =
|
|
54146
|
+
const detail = import_node_fs41.default.readFileSync(result.diagnosticLogPath, "utf8");
|
|
54099
54147
|
const match = detail.match(/\[unserved\] nothing serves (\S+)/);
|
|
54100
54148
|
return match ? match[1] : null;
|
|
54101
54149
|
} catch {
|
|
@@ -54105,19 +54153,19 @@ function readUnservedUrl(result) {
|
|
|
54105
54153
|
function printDriverDiagnosticLogTail(result) {
|
|
54106
54154
|
if (!result.diagnosticLogPath) return;
|
|
54107
54155
|
try {
|
|
54108
|
-
const detail =
|
|
54156
|
+
const detail = import_node_fs41.default.readFileSync(result.diagnosticLogPath, "utf8").trim();
|
|
54109
54157
|
if (!detail) {
|
|
54110
|
-
console.error(` ${
|
|
54158
|
+
console.error(` ${import_node_path43.default.basename(result.diagnosticLogPath)} was empty`);
|
|
54111
54159
|
return;
|
|
54112
54160
|
}
|
|
54113
54161
|
const shown = detail.length > 4e3 ? `\u2026
|
|
54114
54162
|
${detail.slice(-4e3)}` : detail;
|
|
54115
|
-
console.error(` ${
|
|
54163
|
+
console.error(` ${import_node_path43.default.basename(result.diagnosticLogPath)}:`);
|
|
54116
54164
|
console.error(shown);
|
|
54117
54165
|
} catch (err) {
|
|
54118
54166
|
const message = err instanceof Error ? err.message : String(err);
|
|
54119
54167
|
console.error(
|
|
54120
|
-
` failed to read ${
|
|
54168
|
+
` failed to read ${import_node_path43.default.basename(result.diagnosticLogPath)}: ${message}`
|
|
54121
54169
|
);
|
|
54122
54170
|
}
|
|
54123
54171
|
}
|
|
@@ -55123,14 +55171,14 @@ async function runCloseCommand(args, opts = {}) {
|
|
|
55123
55171
|
bridge.close();
|
|
55124
55172
|
}
|
|
55125
55173
|
}
|
|
55126
|
-
var import_node_child_process16,
|
|
55174
|
+
var import_node_child_process16, import_node_fs41, import_node_os11, import_node_path43, import_app_catalog_wire, import_devices2, import_ws4, DEFAULT_DRIVER_CONNECT_TIMEOUT_MS, DRIVER_CONNECT_INTERVAL_MS, DRIVER_CONNECT_HOST_GRACE_MS, OPEN_BRIDGE_SPAWN_TIMEOUT_MS, SHELL_APPS, DEV_BUNDLE_RESOLVE_ATTEMPTS, DEV_BUNDLE_RESOLVE_INTERVAL_MS;
|
|
55127
55175
|
var init_control = __esm({
|
|
55128
55176
|
"cli/commands/control.ts"() {
|
|
55129
55177
|
"use strict";
|
|
55130
55178
|
import_node_child_process16 = require("node:child_process");
|
|
55131
|
-
|
|
55179
|
+
import_node_fs41 = __toESM(require("node:fs"), 1);
|
|
55132
55180
|
import_node_os11 = __toESM(require("node:os"), 1);
|
|
55133
|
-
|
|
55181
|
+
import_node_path43 = __toESM(require("node:path"), 1);
|
|
55134
55182
|
import_app_catalog_wire = require("peach-engine/engine/app-catalog-wire");
|
|
55135
55183
|
import_devices2 = require("peach-engine/settings/devices");
|
|
55136
55184
|
import_ws4 = require("ws");
|
|
@@ -56591,16 +56639,16 @@ function readRecentShellAppId(state) {
|
|
|
56591
56639
|
}
|
|
56592
56640
|
function resolveProjectRelativeFlowBase(flowDir) {
|
|
56593
56641
|
if (!flowDir) return process.cwd();
|
|
56594
|
-
return
|
|
56642
|
+
return path37.basename(flowDir) === ".maestro" ? path37.dirname(flowDir) : flowDir;
|
|
56595
56643
|
}
|
|
56596
56644
|
function resolveFlowScreenshotPathWithMode(screenshotDir, name2, opts) {
|
|
56597
56645
|
const normalizedName = name2.endsWith(".png") ? name2 : `${name2}.png`;
|
|
56598
|
-
if (
|
|
56646
|
+
if (path37.isAbsolute(normalizedName)) return normalizedName;
|
|
56599
56647
|
if (opts.mode === "flow" && /[\\/]/.test(normalizedName)) {
|
|
56600
56648
|
const baseDir = normalizedName.startsWith("./") || normalizedName.startsWith("../") ? opts.flowDir ?? process.cwd() : resolveProjectRelativeFlowBase(opts.flowDir);
|
|
56601
|
-
return
|
|
56649
|
+
return path37.resolve(baseDir, normalizedName);
|
|
56602
56650
|
}
|
|
56603
|
-
return
|
|
56651
|
+
return path37.join(screenshotDir, normalizedName);
|
|
56604
56652
|
}
|
|
56605
56653
|
function normalizeFlowScreenshotSpec(step) {
|
|
56606
56654
|
if (typeof step === "string") {
|
|
@@ -56654,12 +56702,12 @@ function normalizeBareStringStep(verb) {
|
|
|
56654
56702
|
function parseFlowSteps(content) {
|
|
56655
56703
|
return parseFlowFile(content).steps;
|
|
56656
56704
|
}
|
|
56657
|
-
var fs33,
|
|
56705
|
+
var fs33, path37, import_devices4, import_proof_frame, DEFAULT_TIMEOUT, ASSERTION_LOOKUP_MS, FLOW_TIMEOUT_SCALE, scaledTimeout, MAESTRO_SELECTOR_KEYS, UNSUPPORTED_SELECTOR_KEYS, ACCESSIBILITY_SELECTOR_KEYS, ACCESSIBILITY_TRAIT_FILTERS, MAESTRO_PERMISSION_KINDS, MAESTRO_PERMISSION_STATUS, SootSimBridgeFlowRunner;
|
|
56658
56706
|
var init_bridge_flow_runner = __esm({
|
|
56659
56707
|
"cli/bridge-flow-runner.ts"() {
|
|
56660
56708
|
"use strict";
|
|
56661
56709
|
fs33 = __toESM(require("fs"), 1);
|
|
56662
|
-
|
|
56710
|
+
path37 = __toESM(require("path"), 1);
|
|
56663
56711
|
import_devices4 = require("peach-engine/settings/devices");
|
|
56664
56712
|
import_proof_frame = __toESM(require_proof_frame(), 1);
|
|
56665
56713
|
init_flow_timeout_scale();
|
|
@@ -56974,7 +57022,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
56974
57022
|
fs33.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
|
|
56975
57023
|
const videoMime = stopped.mime || this.opts.recordingFormat || "video/webm";
|
|
56976
57024
|
const extension = videoMime.includes("mp4") ? "mp4" : "webm";
|
|
56977
|
-
const outputPath =
|
|
57025
|
+
const outputPath = path37.join(
|
|
56978
57026
|
this.opts.recordingOutputDir,
|
|
56979
57027
|
`peach-${Date.now()}.${extension}`
|
|
56980
57028
|
);
|
|
@@ -57599,7 +57647,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
57599
57647
|
flowDir: this.opts.flowDir
|
|
57600
57648
|
}
|
|
57601
57649
|
);
|
|
57602
|
-
fs33.mkdirSync(
|
|
57650
|
+
fs33.mkdirSync(path37.dirname(outputPath), { recursive: true });
|
|
57603
57651
|
const layers = spec.layers ?? this.opts.screenshotLayers;
|
|
57604
57652
|
const screenshotRequest = {
|
|
57605
57653
|
type: "screenshot",
|
|
@@ -57663,7 +57711,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
57663
57711
|
fs33.mkdirSync(outputDir, { recursive: true });
|
|
57664
57712
|
const write = (name2, content) => {
|
|
57665
57713
|
try {
|
|
57666
|
-
fs33.writeFileSync(
|
|
57714
|
+
fs33.writeFileSync(path37.join(outputDir, name2), content);
|
|
57667
57715
|
} catch {
|
|
57668
57716
|
}
|
|
57669
57717
|
};
|
|
@@ -58258,7 +58306,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
58258
58306
|
runScript(target) {
|
|
58259
58307
|
const spec = typeof target === "string" ? { file: target } : target;
|
|
58260
58308
|
if (!spec.file) throw new Error("runScript requires a file");
|
|
58261
|
-
const scriptPath =
|
|
58309
|
+
const scriptPath = path37.resolve(this.opts.flowDir, spec.file);
|
|
58262
58310
|
const source = fs33.readFileSync(scriptPath, "utf8");
|
|
58263
58311
|
this.js.evaluate(source, { env: spec.env });
|
|
58264
58312
|
console.log(`[flow] runScript: ${spec.file} done`);
|
|
@@ -58619,14 +58667,14 @@ var init_bridge_flow_runner = __esm({
|
|
|
58619
58667
|
for (const [k, v] of Object.entries(env)) this.js.putEnv(k, v);
|
|
58620
58668
|
}
|
|
58621
58669
|
if (file) {
|
|
58622
|
-
const flowPath =
|
|
58670
|
+
const flowPath = path37.resolve(this.opts.flowDir, file);
|
|
58623
58671
|
const flowContent = fs33.readFileSync(flowPath, "utf8");
|
|
58624
58672
|
const { frontmatter } = parseFlowFile(flowContent);
|
|
58625
58673
|
if (frontmatter.env && typeof frontmatter.env === "object") {
|
|
58626
58674
|
this.js.defineVariables(frontmatter.env);
|
|
58627
58675
|
}
|
|
58628
58676
|
const previousDir = this.opts.flowDir;
|
|
58629
|
-
this.opts.flowDir =
|
|
58677
|
+
this.opts.flowDir = path37.dirname(flowPath);
|
|
58630
58678
|
try {
|
|
58631
58679
|
await this.runFlow(parseFlowSteps(flowContent));
|
|
58632
58680
|
} finally {
|
|
@@ -58798,7 +58846,7 @@ __export(registry_exports, {
|
|
|
58798
58846
|
});
|
|
58799
58847
|
module.exports = __toCommonJS(registry_exports);
|
|
58800
58848
|
var fs34 = __toESM(require("fs"), 1);
|
|
58801
|
-
var
|
|
58849
|
+
var path38 = __toESM(require("path"), 1);
|
|
58802
58850
|
|
|
58803
58851
|
// src/skills/builtin/a11y-review.ts
|
|
58804
58852
|
init_reap_browser();
|
|
@@ -58817,7 +58865,7 @@ var skill = {
|
|
|
58817
58865
|
},
|
|
58818
58866
|
async execute(params, context) {
|
|
58819
58867
|
const { chromium } = await import("playwright");
|
|
58820
|
-
const
|
|
58868
|
+
const path39 = await import("path");
|
|
58821
58869
|
const fs35 = await import("fs");
|
|
58822
58870
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
58823
58871
|
headless: true
|
|
@@ -58875,8 +58923,8 @@ var skill = {
|
|
|
58875
58923
|
warnings: issues.filter((i) => i.severity === "warning").length,
|
|
58876
58924
|
tree: typeof tree === "string" ? tree : JSON.stringify(tree)
|
|
58877
58925
|
};
|
|
58878
|
-
const reportPath =
|
|
58879
|
-
fs35.mkdirSync(
|
|
58926
|
+
const reportPath = path39.join(context.outputDir, "a11y-report.json");
|
|
58927
|
+
fs35.mkdirSync(path39.dirname(reportPath), { recursive: true });
|
|
58880
58928
|
fs35.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
58881
58929
|
return {
|
|
58882
58930
|
success: issues.filter((i) => i.severity === "error").length === 0,
|
|
@@ -58911,9 +58959,9 @@ var skill2 = {
|
|
|
58911
58959
|
},
|
|
58912
58960
|
async execute(params, context) {
|
|
58913
58961
|
const fs35 = await import("node:fs");
|
|
58914
|
-
const
|
|
58962
|
+
const path39 = await import("node:path");
|
|
58915
58963
|
const { COMPAT_RESULT_CAVEAT: COMPAT_RESULT_CAVEAT2, formatPackageStatus: formatPackageStatus2, formatScanCounts: formatScanCounts2, scanDeps: scanDeps2 } = await Promise.resolve().then(() => (init_web(), web_exports));
|
|
58916
|
-
const packagePath =
|
|
58964
|
+
const packagePath = path39.join(context.projectDir, "package.json");
|
|
58917
58965
|
if (!fs35.existsSync(packagePath)) {
|
|
58918
58966
|
return { success: false, message: "No package.json found" };
|
|
58919
58967
|
}
|
|
@@ -58929,8 +58977,8 @@ var skill2 = {
|
|
|
58929
58977
|
}) : scanDeps2(parsed);
|
|
58930
58978
|
const packageResult = params.packageName ? scan.packages[0] : void 0;
|
|
58931
58979
|
const message = packageResult ? `${params.packageName}: ${formatPackageStatus2(packageResult)}. ${COMPAT_RESULT_CAVEAT2}` : `${formatScanCounts2(scan)}. ${COMPAT_RESULT_CAVEAT2}`;
|
|
58932
|
-
const reportPath =
|
|
58933
|
-
fs35.mkdirSync(
|
|
58980
|
+
const reportPath = path39.join(context.outputDir, "compat-report.json");
|
|
58981
|
+
fs35.mkdirSync(path39.dirname(reportPath), { recursive: true });
|
|
58934
58982
|
fs35.writeFileSync(reportPath, `${JSON.stringify(scan, null, 2)}
|
|
58935
58983
|
`);
|
|
58936
58984
|
return {
|
|
@@ -58974,7 +59022,7 @@ var skill3 = {
|
|
|
58974
59022
|
},
|
|
58975
59023
|
async execute(params, context) {
|
|
58976
59024
|
const fs35 = await import("fs");
|
|
58977
|
-
const
|
|
59025
|
+
const path39 = await import("path");
|
|
58978
59026
|
const yaml = await Promise.resolve().then(() => (init_browser(), browser_exports));
|
|
58979
59027
|
const { DEFAULT_SOOTSIM_BRIDGE_PORT: DEFAULT_SOOTSIM_BRIDGE_PORT3 } = await Promise.resolve().then(() => (init_bridge_constants(), bridge_constants_exports));
|
|
58980
59028
|
const { SootSimBridgeHost: SootSimBridgeHost2 } = await Promise.resolve().then(() => (init_bridge_host(), bridge_host_exports));
|
|
@@ -59011,7 +59059,7 @@ var skill3 = {
|
|
|
59011
59059
|
});
|
|
59012
59060
|
const driver = new SootSimBridgeFlowRunner2(bridge, {
|
|
59013
59061
|
screenshotDir: context.outputDir,
|
|
59014
|
-
flowDir:
|
|
59062
|
+
flowDir: path39.dirname(path39.resolve(params.flowPath)),
|
|
59015
59063
|
simId,
|
|
59016
59064
|
recordingOutputDir: params.record ? context.outputDir : void 0
|
|
59017
59065
|
});
|
|
@@ -59033,7 +59081,7 @@ var skill3 = {
|
|
|
59033
59081
|
simId,
|
|
59034
59082
|
videoPath: videoPath || void 0
|
|
59035
59083
|
},
|
|
59036
|
-
artifacts: videoPath ? [{ type: "video", name:
|
|
59084
|
+
artifacts: videoPath ? [{ type: "video", name: path39.basename(videoPath), path: videoPath }] : void 0
|
|
59037
59085
|
};
|
|
59038
59086
|
} finally {
|
|
59039
59087
|
try {
|
|
@@ -59080,7 +59128,7 @@ var skill4 = {
|
|
|
59080
59128
|
},
|
|
59081
59129
|
async execute(params, context) {
|
|
59082
59130
|
const { chromium } = await import("playwright");
|
|
59083
|
-
const
|
|
59131
|
+
const path39 = await import("path");
|
|
59084
59132
|
const fs35 = await import("fs");
|
|
59085
59133
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
59086
59134
|
headless: true
|
|
@@ -59109,8 +59157,8 @@ var skill4 = {
|
|
|
59109
59157
|
...profile,
|
|
59110
59158
|
fps: syncCount > 0 ? (syncCount / (duration / 1e3)).toFixed(1) : "0"
|
|
59111
59159
|
};
|
|
59112
|
-
const reportPath =
|
|
59113
|
-
fs35.mkdirSync(
|
|
59160
|
+
const reportPath = path39.join(context.outputDir, "perf-report.json");
|
|
59161
|
+
fs35.mkdirSync(path39.dirname(reportPath), { recursive: true });
|
|
59114
59162
|
fs35.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
59115
59163
|
return {
|
|
59116
59164
|
success: true,
|
|
@@ -59144,7 +59192,7 @@ var skill5 = {
|
|
|
59144
59192
|
},
|
|
59145
59193
|
async execute(params, context) {
|
|
59146
59194
|
const { chromium } = await import("playwright");
|
|
59147
|
-
const
|
|
59195
|
+
const path39 = await import("path");
|
|
59148
59196
|
const fs35 = await import("fs");
|
|
59149
59197
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
59150
59198
|
headless: true
|
|
@@ -59153,8 +59201,8 @@ var skill5 = {
|
|
|
59153
59201
|
try {
|
|
59154
59202
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
59155
59203
|
await page.waitForTimeout(2e3);
|
|
59156
|
-
const outputPath =
|
|
59157
|
-
fs35.mkdirSync(
|
|
59204
|
+
const outputPath = path39.join(context.outputDir, `${params.name}.png`);
|
|
59205
|
+
fs35.mkdirSync(path39.dirname(outputPath), { recursive: true });
|
|
59158
59206
|
await page.screenshot({ path: outputPath });
|
|
59159
59207
|
return {
|
|
59160
59208
|
success: true,
|
|
@@ -59195,7 +59243,7 @@ var skill6 = {
|
|
|
59195
59243
|
},
|
|
59196
59244
|
async execute(params, context) {
|
|
59197
59245
|
const { chromium } = await import("playwright");
|
|
59198
|
-
const
|
|
59246
|
+
const path39 = await import("path");
|
|
59199
59247
|
const fs35 = await import("fs");
|
|
59200
59248
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
59201
59249
|
headless: true
|
|
@@ -59204,8 +59252,8 @@ var skill6 = {
|
|
|
59204
59252
|
try {
|
|
59205
59253
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
59206
59254
|
await page.waitForTimeout(2e3);
|
|
59207
|
-
const currentPath =
|
|
59208
|
-
fs35.mkdirSync(
|
|
59255
|
+
const currentPath = path39.join(context.outputDir, `${params.name}-current.png`);
|
|
59256
|
+
fs35.mkdirSync(path39.dirname(currentPath), { recursive: true });
|
|
59209
59257
|
await page.screenshot({ path: currentPath });
|
|
59210
59258
|
try {
|
|
59211
59259
|
const { PNG } = await import("pngjs");
|
|
@@ -59222,7 +59270,7 @@ var skill6 = {
|
|
|
59222
59270
|
height,
|
|
59223
59271
|
{ threshold: params.threshold || 0.1 }
|
|
59224
59272
|
);
|
|
59225
|
-
const diffPath =
|
|
59273
|
+
const diffPath = path39.join(context.outputDir, `${params.name}-diff.png`);
|
|
59226
59274
|
fs35.writeFileSync(diffPath, PNG.sync.write(diff));
|
|
59227
59275
|
const totalPixels = width * height;
|
|
59228
59276
|
const diffPercent = (numDiffPixels / totalPixels * 100).toFixed(2);
|
|
@@ -59287,7 +59335,7 @@ var skillRegistry = {
|
|
|
59287
59335
|
},
|
|
59288
59336
|
// load skills from a project manifest (rnx-skills.json)
|
|
59289
59337
|
async loadFromManifest(projectDir) {
|
|
59290
|
-
const manifestPath =
|
|
59338
|
+
const manifestPath = path38.join(projectDir, "rnx-skills.json");
|
|
59291
59339
|
if (!fs34.existsSync(manifestPath)) return;
|
|
59292
59340
|
try {
|
|
59293
59341
|
const manifest = JSON.parse(fs34.readFileSync(manifestPath, "utf8"));
|
|
@@ -59301,7 +59349,7 @@ var skillRegistry = {
|
|
|
59301
59349
|
}
|
|
59302
59350
|
} else if (entry.file) {
|
|
59303
59351
|
try {
|
|
59304
|
-
const mod = await import(
|
|
59352
|
+
const mod = await import(path38.resolve(projectDir, entry.file));
|
|
59305
59353
|
if (mod.skill) this.register(mod.skill);
|
|
59306
59354
|
} catch {
|
|
59307
59355
|
}
|
|
@@ -59314,7 +59362,7 @@ var skillRegistry = {
|
|
|
59314
59362
|
// auto-discover skills based on project dependencies
|
|
59315
59363
|
suggestSkills(projectDir) {
|
|
59316
59364
|
const suggestions = [];
|
|
59317
|
-
const pkgPath =
|
|
59365
|
+
const pkgPath = path38.join(projectDir, "package.json");
|
|
59318
59366
|
if (!fs34.existsSync(pkgPath)) return suggestions;
|
|
59319
59367
|
try {
|
|
59320
59368
|
const pkg = JSON.parse(fs34.readFileSync(pkgPath, "utf8"));
|