peachsim 0.1.745 → 0.1.746
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/drivers/playwright-sim-host.ts +2 -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/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 +98 -10
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +128 -11
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +4 -4
- 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 +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +129 -12
- package/dist-lib/swift-compile.cjs +58 -6
- package/dist-lib/swift-compile.mjs +57 -6
- 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 +383 -10
- package/dist-lib/vite.cjs +4 -4
- package/package.json +1 -1
- package/src/swift-compile.ts +76 -8
- package/src/swift-host.ts +23 -3
- package/src/vite-plugin-one.ts +2 -2
- package/src/vite-plugin.ts +10 -1
- package/src/xcode-project.ts +86 -1
package/dist-lib/vite-swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.746 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -7,6 +7,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
7
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
10
13
|
var __export = (target, all) => {
|
|
11
14
|
for (var name in all)
|
|
12
15
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -29,6 +32,245 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
32
|
));
|
|
30
33
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
34
|
|
|
35
|
+
// ../../node_modules/plist/lib/parse.js
|
|
36
|
+
var require_parse = __commonJS({
|
|
37
|
+
"../../node_modules/plist/lib/parse.js"(exports2) {
|
|
38
|
+
var { DOMParser } = require("@xmldom/xmldom");
|
|
39
|
+
exports2.parse = parse;
|
|
40
|
+
var TEXT_NODE = 3;
|
|
41
|
+
var CDATA_NODE = 4;
|
|
42
|
+
var COMMENT_NODE = 8;
|
|
43
|
+
function shouldIgnoreNode(node) {
|
|
44
|
+
return node.nodeType === TEXT_NODE || node.nodeType === COMMENT_NODE || node.nodeType === CDATA_NODE;
|
|
45
|
+
}
|
|
46
|
+
function isEmptyNode(node) {
|
|
47
|
+
if (!node.childNodes || node.childNodes.length === 0) {
|
|
48
|
+
return true;
|
|
49
|
+
} else {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function invariant(test, message) {
|
|
54
|
+
if (!test) {
|
|
55
|
+
throw new Error(message);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function parse(xml) {
|
|
59
|
+
var doc = new DOMParser().parseFromString(xml, "text/xml");
|
|
60
|
+
invariant(
|
|
61
|
+
doc.documentElement.nodeName === "plist",
|
|
62
|
+
"malformed document. First element should be <plist>"
|
|
63
|
+
);
|
|
64
|
+
var plist2 = parsePlistXML(doc.documentElement);
|
|
65
|
+
if (plist2.length == 1) plist2 = plist2[0];
|
|
66
|
+
return plist2;
|
|
67
|
+
}
|
|
68
|
+
function parsePlistXML(node) {
|
|
69
|
+
var i, new_obj, key, val, new_arr, res, counter, type;
|
|
70
|
+
if (!node) return null;
|
|
71
|
+
if (node.nodeName === "plist") {
|
|
72
|
+
new_arr = [];
|
|
73
|
+
if (isEmptyNode(node)) {
|
|
74
|
+
return new_arr;
|
|
75
|
+
}
|
|
76
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
77
|
+
if (!shouldIgnoreNode(node.childNodes[i])) {
|
|
78
|
+
new_arr.push(parsePlistXML(node.childNodes[i]));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return new_arr;
|
|
82
|
+
} else if (node.nodeName === "dict") {
|
|
83
|
+
new_obj = {};
|
|
84
|
+
key = null;
|
|
85
|
+
counter = 0;
|
|
86
|
+
if (isEmptyNode(node)) {
|
|
87
|
+
return new_obj;
|
|
88
|
+
}
|
|
89
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
90
|
+
if (shouldIgnoreNode(node.childNodes[i])) continue;
|
|
91
|
+
if (counter % 2 === 0) {
|
|
92
|
+
invariant(
|
|
93
|
+
node.childNodes[i].nodeName === "key",
|
|
94
|
+
"Missing key while parsing <dict/>."
|
|
95
|
+
);
|
|
96
|
+
key = parsePlistXML(node.childNodes[i]);
|
|
97
|
+
} else {
|
|
98
|
+
invariant(
|
|
99
|
+
node.childNodes[i].nodeName !== "key",
|
|
100
|
+
'Unexpected key "' + parsePlistXML(node.childNodes[i]) + '" while parsing <dict/>.'
|
|
101
|
+
);
|
|
102
|
+
new_obj[key] = parsePlistXML(node.childNodes[i]);
|
|
103
|
+
}
|
|
104
|
+
counter += 1;
|
|
105
|
+
}
|
|
106
|
+
if (counter % 2 === 1) {
|
|
107
|
+
new_obj[key] = "";
|
|
108
|
+
}
|
|
109
|
+
return new_obj;
|
|
110
|
+
} else if (node.nodeName === "array") {
|
|
111
|
+
new_arr = [];
|
|
112
|
+
if (isEmptyNode(node)) {
|
|
113
|
+
return new_arr;
|
|
114
|
+
}
|
|
115
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
116
|
+
if (!shouldIgnoreNode(node.childNodes[i])) {
|
|
117
|
+
res = parsePlistXML(node.childNodes[i]);
|
|
118
|
+
if (null != res) new_arr.push(res);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return new_arr;
|
|
122
|
+
} else if (node.nodeName === "#text") {
|
|
123
|
+
} else if (node.nodeName === "key") {
|
|
124
|
+
if (isEmptyNode(node)) {
|
|
125
|
+
return "";
|
|
126
|
+
}
|
|
127
|
+
invariant(
|
|
128
|
+
node.childNodes[0].nodeValue !== "__proto__",
|
|
129
|
+
"__proto__ keys can lead to prototype pollution. More details on CVE-2022-22912"
|
|
130
|
+
);
|
|
131
|
+
return node.childNodes[0].nodeValue;
|
|
132
|
+
} else if (node.nodeName === "string") {
|
|
133
|
+
res = "";
|
|
134
|
+
if (isEmptyNode(node)) {
|
|
135
|
+
return res;
|
|
136
|
+
}
|
|
137
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
138
|
+
var type = node.childNodes[i].nodeType;
|
|
139
|
+
if (type === TEXT_NODE || type === CDATA_NODE) {
|
|
140
|
+
res += node.childNodes[i].nodeValue;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return res;
|
|
144
|
+
} else if (node.nodeName === "integer") {
|
|
145
|
+
invariant(!isEmptyNode(node), 'Cannot parse "" as integer.');
|
|
146
|
+
return parseInt(node.childNodes[0].nodeValue, 10);
|
|
147
|
+
} else if (node.nodeName === "real") {
|
|
148
|
+
invariant(!isEmptyNode(node), 'Cannot parse "" as real.');
|
|
149
|
+
res = "";
|
|
150
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
151
|
+
if (node.childNodes[i].nodeType === TEXT_NODE) {
|
|
152
|
+
res += node.childNodes[i].nodeValue;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return parseFloat(res);
|
|
156
|
+
} else if (node.nodeName === "data") {
|
|
157
|
+
res = "";
|
|
158
|
+
if (isEmptyNode(node)) {
|
|
159
|
+
return Buffer.from(res, "base64");
|
|
160
|
+
}
|
|
161
|
+
for (i = 0; i < node.childNodes.length; i++) {
|
|
162
|
+
if (node.childNodes[i].nodeType === TEXT_NODE) {
|
|
163
|
+
res += node.childNodes[i].nodeValue.replace(/\s+/g, "");
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return Buffer.from(res, "base64");
|
|
167
|
+
} else if (node.nodeName === "date") {
|
|
168
|
+
invariant(!isEmptyNode(node), 'Cannot parse "" as Date.');
|
|
169
|
+
return new Date(node.childNodes[0].nodeValue);
|
|
170
|
+
} else if (node.nodeName === "null") {
|
|
171
|
+
return null;
|
|
172
|
+
} else if (node.nodeName === "true") {
|
|
173
|
+
return true;
|
|
174
|
+
} else if (node.nodeName === "false") {
|
|
175
|
+
return false;
|
|
176
|
+
} else {
|
|
177
|
+
throw new Error("Invalid PLIST tag " + node.nodeName);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// ../../node_modules/plist/lib/build.js
|
|
184
|
+
var require_build = __commonJS({
|
|
185
|
+
"../../node_modules/plist/lib/build.js"(exports2) {
|
|
186
|
+
var base64 = require("base64-js");
|
|
187
|
+
var xmlbuilder = require("xmlbuilder");
|
|
188
|
+
exports2.build = build;
|
|
189
|
+
function ISODateString(d) {
|
|
190
|
+
function pad(n) {
|
|
191
|
+
return n < 10 ? "0" + n : n;
|
|
192
|
+
}
|
|
193
|
+
return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "Z";
|
|
194
|
+
}
|
|
195
|
+
var toString = Object.prototype.toString;
|
|
196
|
+
function type(obj) {
|
|
197
|
+
var m = toString.call(obj).match(/\[object (.*)\]/);
|
|
198
|
+
return m ? m[1] : m;
|
|
199
|
+
}
|
|
200
|
+
function build(obj, opts) {
|
|
201
|
+
var XMLHDR = {
|
|
202
|
+
version: "1.0",
|
|
203
|
+
encoding: "UTF-8"
|
|
204
|
+
};
|
|
205
|
+
var XMLDTD = {
|
|
206
|
+
pubid: "-//Apple//DTD PLIST 1.0//EN",
|
|
207
|
+
sysid: "http://www.apple.com/DTDs/PropertyList-1.0.dtd"
|
|
208
|
+
};
|
|
209
|
+
var doc = xmlbuilder.create("plist");
|
|
210
|
+
doc.dec(XMLHDR.version, XMLHDR.encoding, XMLHDR.standalone);
|
|
211
|
+
doc.dtd(XMLDTD.pubid, XMLDTD.sysid);
|
|
212
|
+
doc.att("version", "1.0");
|
|
213
|
+
walk_obj(obj, doc);
|
|
214
|
+
if (!opts) opts = {};
|
|
215
|
+
opts.pretty = opts.pretty !== false;
|
|
216
|
+
return doc.end(opts);
|
|
217
|
+
}
|
|
218
|
+
function walk_obj(next, next_child) {
|
|
219
|
+
var tag_type, i, prop;
|
|
220
|
+
var name = type(next);
|
|
221
|
+
if ("Undefined" == name) {
|
|
222
|
+
return;
|
|
223
|
+
} else if (Array.isArray(next)) {
|
|
224
|
+
next_child = next_child.ele("array");
|
|
225
|
+
for (i = 0; i < next.length; i++) {
|
|
226
|
+
walk_obj(next[i], next_child);
|
|
227
|
+
}
|
|
228
|
+
} else if (Buffer.isBuffer(next)) {
|
|
229
|
+
next_child.ele("data").raw(next.toString("base64"));
|
|
230
|
+
} else if ("Object" == name) {
|
|
231
|
+
next_child = next_child.ele("dict");
|
|
232
|
+
for (prop in next) {
|
|
233
|
+
if (next.hasOwnProperty(prop)) {
|
|
234
|
+
next_child.ele("key").txt(prop);
|
|
235
|
+
walk_obj(next[prop], next_child);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
} else if ("Number" == name) {
|
|
239
|
+
tag_type = next % 1 === 0 ? "integer" : "real";
|
|
240
|
+
next_child.ele(tag_type).txt(next.toString());
|
|
241
|
+
} else if ("BigInt" == name) {
|
|
242
|
+
next_child.ele("integer").txt(next);
|
|
243
|
+
} else if ("Date" == name) {
|
|
244
|
+
next_child.ele("date").txt(ISODateString(new Date(next)));
|
|
245
|
+
} else if ("Boolean" == name) {
|
|
246
|
+
next_child.ele(next ? "true" : "false");
|
|
247
|
+
} else if ("String" == name) {
|
|
248
|
+
next_child.ele("string").txt(next);
|
|
249
|
+
} else if ("ArrayBuffer" == name) {
|
|
250
|
+
next_child.ele("data").raw(base64.fromByteArray(next));
|
|
251
|
+
} else if (next && next.buffer && "ArrayBuffer" == type(next.buffer)) {
|
|
252
|
+
next_child.ele("data").raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child));
|
|
253
|
+
} else if ("Null" === name) {
|
|
254
|
+
next_child.ele("null").txt("");
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// ../../node_modules/plist/index.js
|
|
261
|
+
var require_plist = __commonJS({
|
|
262
|
+
"../../node_modules/plist/index.js"(exports2) {
|
|
263
|
+
var parserFunctions = require_parse();
|
|
264
|
+
Object.keys(parserFunctions).forEach(function(k) {
|
|
265
|
+
exports2[k] = parserFunctions[k];
|
|
266
|
+
});
|
|
267
|
+
var builderFunctions = require_build();
|
|
268
|
+
Object.keys(builderFunctions).forEach(function(k) {
|
|
269
|
+
exports2[k] = builderFunctions[k];
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
|
|
32
274
|
// src/vite-plugin-swift.ts
|
|
33
275
|
var vite_plugin_swift_exports = {};
|
|
34
276
|
__export(vite_plugin_swift_exports, {
|
|
@@ -461,7 +703,10 @@ function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
|
461
703
|
var run2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
|
|
462
704
|
var WASM_TRIPLE = "wasm32-unknown-wasip1";
|
|
463
705
|
var cores = import_node_os.default.availableParallelism();
|
|
464
|
-
var BUILD_ENV = {
|
|
706
|
+
var BUILD_ENV = {
|
|
707
|
+
...process.env,
|
|
708
|
+
BINARYEN_CORES: String(Math.min(4, cores))
|
|
709
|
+
};
|
|
465
710
|
var BUILD_JOBS = String(Math.max(1, Math.floor(cores / 2)));
|
|
466
711
|
function swiftDistributionAt(root) {
|
|
467
712
|
const file = import_node_path2.default.join(root, SWIFT_DISTRIBUTION_MANIFEST);
|
|
@@ -486,7 +731,9 @@ function swiftModuleInputFiles(root) {
|
|
|
486
731
|
"toolchain.json"
|
|
487
732
|
];
|
|
488
733
|
const walk2 = (dir) => {
|
|
489
|
-
for (const entry of (0, import_node_fs2.readdirSync)(import_node_path2.default.join(root, dir), {
|
|
734
|
+
for (const entry of (0, import_node_fs2.readdirSync)(import_node_path2.default.join(root, dir), {
|
|
735
|
+
withFileTypes: true
|
|
736
|
+
})) {
|
|
490
737
|
const relative = `${dir}/${entry.name}`;
|
|
491
738
|
if (entry.isDirectory()) walk2(relative);
|
|
492
739
|
else if (/\.(swift|c|cpp|h)$/.test(entry.name)) files.push(relative);
|
|
@@ -1315,9 +1562,14 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
|
|
|
1315
1562
|
const reusableBodies = [];
|
|
1316
1563
|
let depth = 0;
|
|
1317
1564
|
let opensReusableBody = false;
|
|
1565
|
+
const sceneLifecycleBodies = /* @__PURE__ */ new Set();
|
|
1318
1566
|
for (const at of tokens) {
|
|
1319
1567
|
const rest = conditioned.slice(at, at + 400);
|
|
1320
1568
|
if (rest.startsWith("{")) {
|
|
1569
|
+
if (sceneLifecycleBodies.has(at)) {
|
|
1570
|
+
out += conditioned.slice(copied, at + 1) + " public var _peachUsesSceneLifecycle: Bool { true };";
|
|
1571
|
+
copied = at + 1;
|
|
1572
|
+
}
|
|
1321
1573
|
depth++;
|
|
1322
1574
|
if (opensReusableBody) reusableBodies.push(depth);
|
|
1323
1575
|
opensReusableBody = false;
|
|
@@ -1353,12 +1605,33 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
|
|
|
1353
1605
|
opensReusableBody = true;
|
|
1354
1606
|
}
|
|
1355
1607
|
const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
|
|
1608
|
+
const delegateClass = DELEGATE_CLASS.exec(rest);
|
|
1609
|
+
if (delegateClass && /\bUIApplicationDelegate\b/.test(delegateClass[0])) {
|
|
1610
|
+
const body = at + delegateClass[0].lastIndexOf("{");
|
|
1611
|
+
let bodyDepth = 0;
|
|
1612
|
+
for (const token of tokens) {
|
|
1613
|
+
if (token < body) continue;
|
|
1614
|
+
if (conditioned[token] === "{") bodyDepth++;
|
|
1615
|
+
else if (conditioned[token] === "}" && --bodyDepth === 0) break;
|
|
1616
|
+
else if (bodyDepth === 1 && /^func\s+application\s*\([^{}]*\bconfigurationForConnecting\s+/.test(
|
|
1617
|
+
conditioned.slice(token, token + 600)
|
|
1618
|
+
)) {
|
|
1619
|
+
sceneLifecycleBodies.add(body);
|
|
1620
|
+
break;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1356
1624
|
if (DELEGATE_CLASS.test(rest) && !/\b(?:final|open)\b/.test(modifiers)) {
|
|
1357
1625
|
out += `${conditioned.slice(copied, at)}final `;
|
|
1358
1626
|
copied = at;
|
|
1359
1627
|
}
|
|
1360
1628
|
continue;
|
|
1361
1629
|
}
|
|
1630
|
+
if (/^@UIApplicationMain\b/.test(rest)) {
|
|
1631
|
+
out += conditioned.slice(copied, at) + "@main".padEnd("@UIApplicationMain".length);
|
|
1632
|
+
copied = at + "@UIApplicationMain".length;
|
|
1633
|
+
continue;
|
|
1634
|
+
}
|
|
1362
1635
|
const selector = SELECTOR.exec(rest);
|
|
1363
1636
|
const match = selector ?? OBJC_ATTRIBUTE.exec(rest);
|
|
1364
1637
|
if (!match) continue;
|
|
@@ -1375,6 +1648,19 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
|
|
|
1375
1648
|
}
|
|
1376
1649
|
return lowerAnyObjectDoubleValue(out + conditioned.slice(copied));
|
|
1377
1650
|
}
|
|
1651
|
+
function swiftApplicationEntry(file, source) {
|
|
1652
|
+
const { tokens } = swiftCodeScan(source);
|
|
1653
|
+
let depth = 0;
|
|
1654
|
+
for (const at of tokens) {
|
|
1655
|
+
if (source[at] === "{") depth++;
|
|
1656
|
+
else if (source[at] === "}") depth--;
|
|
1657
|
+
else if (depth === 0 && /^@(?:main|UIApplicationMain)\b/.test(source.slice(at)))
|
|
1658
|
+
return true;
|
|
1659
|
+
else if (depth === 0 && import_node_path2.default.basename(file) === "main.swift" && /^UIApplicationMain\s*\(/.test(source.slice(at)))
|
|
1660
|
+
return true;
|
|
1661
|
+
}
|
|
1662
|
+
return false;
|
|
1663
|
+
}
|
|
1378
1664
|
function swiftCodeScan(source) {
|
|
1379
1665
|
const starts = /* @__PURE__ */ new Set();
|
|
1380
1666
|
const tokens = [];
|
|
@@ -1457,7 +1743,7 @@ function swiftCodeScan(source) {
|
|
|
1457
1743
|
else top.parens--;
|
|
1458
1744
|
i++;
|
|
1459
1745
|
} else {
|
|
1460
|
-
const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("NSClassFromString", i) ? "NSClassFromString" : null;
|
|
1746
|
+
const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("func", i) ? "func" : source.startsWith("UIApplicationMain", i) ? "UIApplicationMain" : source.startsWith("NSClassFromString", i) ? "NSClassFromString" : null;
|
|
1461
1747
|
if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
|
|
1462
1748
|
tokens.push(i);
|
|
1463
1749
|
i += keyword.length;
|
|
@@ -1683,10 +1969,16 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
1683
1969
|
plugin
|
|
1684
1970
|
])
|
|
1685
1971
|
],
|
|
1686
|
-
{
|
|
1972
|
+
{
|
|
1973
|
+
env: BUILD_ENV,
|
|
1974
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
1975
|
+
timeout: options.timeoutMs
|
|
1976
|
+
}
|
|
1687
1977
|
);
|
|
1688
1978
|
} catch (error) {
|
|
1689
|
-
throw new Error(projectDiagnostic(outputOf(error), layout), {
|
|
1979
|
+
throw new Error(projectDiagnostic(outputOf(error), layout), {
|
|
1980
|
+
cause: error
|
|
1981
|
+
});
|
|
1690
1982
|
}
|
|
1691
1983
|
return {
|
|
1692
1984
|
hash,
|
|
@@ -2760,6 +3052,7 @@ async function compileSwiftProject(submit, work, origin, signal) {
|
|
|
2760
3052
|
// src/xcode-project.ts
|
|
2761
3053
|
var import_node_fs8 = __toESM(require("node:fs"), 1);
|
|
2762
3054
|
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
3055
|
+
var import_plist = __toESM(require_plist(), 1);
|
|
2763
3056
|
function parseOpenStepPlist(text) {
|
|
2764
3057
|
let i = 0;
|
|
2765
3058
|
const fail = (message) => {
|
|
@@ -2980,6 +3273,62 @@ function readXcodeAppTarget(xcodeproj, targetName) {
|
|
|
2980
3273
|
const moduleName = c99Identifier(
|
|
2981
3274
|
settings.PRODUCT_MODULE_NAME && !settings.PRODUCT_MODULE_NAME.includes("$(") ? settings.PRODUCT_MODULE_NAME : productName
|
|
2982
3275
|
);
|
|
3276
|
+
const variables = {
|
|
3277
|
+
...settings,
|
|
3278
|
+
EXECUTABLE_NAME: settings.EXECUTABLE_NAME ?? productName,
|
|
3279
|
+
DEVELOPMENT_LANGUAGE: settings.DEVELOPMENT_LANGUAGE ?? str(project.developmentRegion) ?? "en",
|
|
3280
|
+
TARGET_NAME: name,
|
|
3281
|
+
PRODUCT_NAME: productName,
|
|
3282
|
+
PRODUCT_MODULE_NAME: moduleName,
|
|
3283
|
+
SRCROOT: projectDir,
|
|
3284
|
+
SOURCE_ROOT: projectDir
|
|
3285
|
+
};
|
|
3286
|
+
const expand = (value) => {
|
|
3287
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3288
|
+
while (/\$[({][A-Za-z_][A-Za-z0-9_]*[)}]/.test(value)) {
|
|
3289
|
+
if (seen.has(value)) throw new Error(`${name} has cyclic Info.plist build settings`);
|
|
3290
|
+
seen.add(value);
|
|
3291
|
+
value = value.replace(
|
|
3292
|
+
/\$[({]([A-Za-z_][A-Za-z0-9_]*)[)}]/g,
|
|
3293
|
+
(match, key) => {
|
|
3294
|
+
const replacement = Object.entries(variables).find(
|
|
3295
|
+
([name2]) => name2 === key
|
|
3296
|
+
)?.[1];
|
|
3297
|
+
if (replacement === void 0)
|
|
3298
|
+
throw new Error(`${name} Info.plist has unresolved setting ${match}`);
|
|
3299
|
+
return replacement;
|
|
3300
|
+
}
|
|
3301
|
+
);
|
|
3302
|
+
}
|
|
3303
|
+
return value;
|
|
3304
|
+
};
|
|
3305
|
+
const expandValue = (value) => {
|
|
3306
|
+
if (typeof value === "string") return expand(value);
|
|
3307
|
+
if (Array.isArray(value)) return value.map(expandValue);
|
|
3308
|
+
if (typeof value === "object" && !(value instanceof Date) && !Buffer.isBuffer(value)) {
|
|
3309
|
+
return Object.fromEntries(
|
|
3310
|
+
Object.entries(value).map(([key, value2]) => [key, expandValue(value2)])
|
|
3311
|
+
);
|
|
3312
|
+
}
|
|
3313
|
+
return value;
|
|
3314
|
+
};
|
|
3315
|
+
const infoPlistFile = settings.INFOPLIST_FILE ? import_node_path9.default.resolve(projectDir, expand(settings.INFOPLIST_FILE)) : null;
|
|
3316
|
+
const sourceInfo = infoPlistFile ? import_plist.default.parse(import_node_fs8.default.readFileSync(infoPlistFile, "utf8")) : {};
|
|
3317
|
+
if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
|
|
3318
|
+
throw new Error(`${name} Info.plist must contain a dictionary`);
|
|
3319
|
+
}
|
|
3320
|
+
const info = {};
|
|
3321
|
+
for (const [key, value] of Object.entries(sourceInfo)) info[key] = expandValue(value);
|
|
3322
|
+
for (const [key, value] of Object.entries(settings)) {
|
|
3323
|
+
if (!key.startsWith("INFOPLIST_KEY_") || key.endsWith("_Generation")) continue;
|
|
3324
|
+
info[key.slice("INFOPLIST_KEY_".length)] = value === "YES" ? true : value === "NO" ? false : expand(value);
|
|
3325
|
+
}
|
|
3326
|
+
if (settings.INFOPLIST_KEY_UIApplicationSceneManifest_Generation === "YES" && info.UIApplicationSceneManifest === void 0) {
|
|
3327
|
+
info.UIApplicationSceneManifest = {
|
|
3328
|
+
UIApplicationSupportsMultipleScenes: true,
|
|
3329
|
+
UISceneConfigurations: {}
|
|
3330
|
+
};
|
|
3331
|
+
}
|
|
2983
3332
|
const sources = /* @__PURE__ */ new Set();
|
|
2984
3333
|
const resources = /* @__PURE__ */ new Set();
|
|
2985
3334
|
const addResource = (file) => {
|
|
@@ -3083,7 +3432,10 @@ function readXcodeAppTarget(xcodeproj, targetName) {
|
|
|
3083
3432
|
if (!dependency || !product) continue;
|
|
3084
3433
|
const reference = object(str(dependency.package));
|
|
3085
3434
|
if (reference?.isa === "XCRemoteSwiftPackageReference") {
|
|
3086
|
-
remoteProducts.push({
|
|
3435
|
+
remoteProducts.push({
|
|
3436
|
+
product,
|
|
3437
|
+
repositoryURL: str(reference.repositoryURL) ?? ""
|
|
3438
|
+
});
|
|
3087
3439
|
} else if (reference?.isa === "XCLocalSwiftPackageReference") {
|
|
3088
3440
|
localPackages.add(import_node_path9.default.resolve(projectDir, str(reference.relativePath) ?? ""));
|
|
3089
3441
|
} else if (localProducts.has(product)) {
|
|
@@ -3124,6 +3476,8 @@ function readXcodeAppTarget(xcodeproj, targetName) {
|
|
|
3124
3476
|
moduleName,
|
|
3125
3477
|
sources: [...sources].sort(),
|
|
3126
3478
|
resources: [...resources].sort(),
|
|
3479
|
+
infoPlist: import_plist.default.build(info),
|
|
3480
|
+
infoPlistFile,
|
|
3127
3481
|
languageMode: swiftVersion >= 6 ? 6 : 5,
|
|
3128
3482
|
mainActorIsolation: settings.SWIFT_DEFAULT_ACTOR_ISOLATION === "MainActor",
|
|
3129
3483
|
localPackages: [...localPackages].sort(),
|
|
@@ -3226,6 +3580,7 @@ function xcodeLayout(root) {
|
|
|
3226
3580
|
if (!registered) return null;
|
|
3227
3581
|
const app = readXcodeAppTarget(registered.xcodeproj, registered.target);
|
|
3228
3582
|
const files = /* @__PURE__ */ new Set([app.pbxproj, ...app.sources, ...app.resources]);
|
|
3583
|
+
if (app.infoPlistFile) files.add(app.infoPlistFile);
|
|
3229
3584
|
const targets = [];
|
|
3230
3585
|
for (const dir of app.localPackages) {
|
|
3231
3586
|
const manifest = import_node_path10.default.join(dir, "Package.swift");
|
|
@@ -3253,7 +3608,12 @@ function xcodeLayout(root) {
|
|
|
3253
3608
|
});
|
|
3254
3609
|
for (const file of target.files) files.add(file);
|
|
3255
3610
|
}
|
|
3256
|
-
return {
|
|
3611
|
+
return {
|
|
3612
|
+
app,
|
|
3613
|
+
targets,
|
|
3614
|
+
unavailable: remote.unavailable,
|
|
3615
|
+
files: [...files].sort()
|
|
3616
|
+
};
|
|
3257
3617
|
}
|
|
3258
3618
|
function xcodeManifest(layout) {
|
|
3259
3619
|
const settings = (mode, mainActor) => `swiftSettings: [.swiftLanguageMode(.v${mode})${mainActor ? ", .defaultIsolation(MainActor.self)" : ""}]`;
|
|
@@ -3440,6 +3800,18 @@ function buildSwiftBundleFiles(packagePath, hosted) {
|
|
|
3440
3800
|
const files = {};
|
|
3441
3801
|
const watched = [];
|
|
3442
3802
|
let total = 0;
|
|
3803
|
+
const xcode = xcodeLayout(packagePath);
|
|
3804
|
+
if (xcode) {
|
|
3805
|
+
const bytes = Buffer.from(xcode.app.infoPlist);
|
|
3806
|
+
if (bytes.length > limits.resourceBytes || bytes.length > limits.resourceTotalBytes)
|
|
3807
|
+
throw new Error("swift launch Info.plist exceeds bundle resource limits");
|
|
3808
|
+
files["Info.plist"] = bytes.toString("base64");
|
|
3809
|
+
total += bytes.length;
|
|
3810
|
+
if (xcode.app.infoPlistFile)
|
|
3811
|
+
watched.push(
|
|
3812
|
+
import_node_path10.default.relative(packagePath, xcode.app.infoPlistFile).split(import_node_path10.default.sep).join("/")
|
|
3813
|
+
);
|
|
3814
|
+
}
|
|
3443
3815
|
for (const { base, file } of enumerateBundleJson(relative)) {
|
|
3444
3816
|
watched.push(file);
|
|
3445
3817
|
const disk = import_node_path10.default.join(packagePath, ...file.split("/"));
|
|
@@ -3813,14 +4185,15 @@ function swiftPackageWatchFiles(packagePath, moduleRoot) {
|
|
|
3813
4185
|
async function swiftPackageMetadata(packagePath, packageName, moduleRoot, origin, hosted) {
|
|
3814
4186
|
packagePath = import_node_fs9.default.realpathSync(packagePath);
|
|
3815
4187
|
const mains = sourceFiles(packagePath).filter(
|
|
3816
|
-
(file) =>
|
|
4188
|
+
(file) => swiftApplicationEntry(
|
|
4189
|
+
file,
|
|
3817
4190
|
readPackageFile(packagePath, file, MAX_SWIFT_COMPILE_SOURCE_BYTES).toString("utf8")
|
|
3818
4191
|
)
|
|
3819
4192
|
);
|
|
3820
4193
|
const native = nativeSourceDescriptor(packagePath);
|
|
3821
4194
|
if (mains.length > 1 || mains.length === 0 && !native) {
|
|
3822
4195
|
throw new Error(
|
|
3823
|
-
`swift package ${packageName} needs exactly one
|
|
4196
|
+
`swift package ${packageName} needs exactly one application entry source or generated native modules; found ${mains.length}`
|
|
3824
4197
|
);
|
|
3825
4198
|
}
|
|
3826
4199
|
const project = projectFor(packagePath, hosted);
|
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.746 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -41,7 +41,6 @@ var import_fs2 = __toESM(require("fs"), 1);
|
|
|
41
41
|
var import_node_crypto2 = require("node:crypto");
|
|
42
42
|
var import_node_module = require("node:module");
|
|
43
43
|
var import_path2 = __toESM(require("path"), 1);
|
|
44
|
-
var import_vxrn = require("vxrn");
|
|
45
44
|
var import_ws = require("ws");
|
|
46
45
|
|
|
47
46
|
// src/simulator-route.ts
|
|
@@ -875,8 +874,9 @@ function rnxPlugin(options = {}) {
|
|
|
875
874
|
config() {
|
|
876
875
|
return { optimizeDeps: { include: ["use-latest-callback"] } };
|
|
877
876
|
},
|
|
878
|
-
configureServer(server) {
|
|
877
|
+
async configureServer(server) {
|
|
879
878
|
if (options.enabled === false) return;
|
|
879
|
+
const { swiftPackageDirectories } = await import("vxrn");
|
|
880
880
|
let swiftPackages;
|
|
881
881
|
let swiftModuleRoot;
|
|
882
882
|
const moduleRootFor = () => {
|
|
@@ -894,7 +894,7 @@ function rnxPlugin(options = {}) {
|
|
|
894
894
|
};
|
|
895
895
|
const activeSwiftPackages = /* @__PURE__ */ new Set();
|
|
896
896
|
const packageMap = () => {
|
|
897
|
-
swiftPackages ??=
|
|
897
|
+
swiftPackages ??= swiftPackageDirectories(server.config.root);
|
|
898
898
|
return swiftPackages;
|
|
899
899
|
};
|
|
900
900
|
const wsOptions = server.config.server.ws;
|