peachsim 0.1.726 → 0.1.728
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/outbound-endpoints.ts +7 -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 +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +178 -4
- 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 +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 +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +181 -5
- package/dist-lib/swift-compile.cjs +179 -3
- package/dist-lib/swift-compile.mjs +178 -3
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +178 -4
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/swift-compile.ts +214 -2
- package/src/swift-submit.ts +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.728 | (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;
|
package/dist-lib/sdk.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.728 | (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 __defProp = Object.defineProperty;
|
package/dist-lib/sdk.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.728 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.728 | (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;
|
|
@@ -4892,6 +4892,8 @@ var init_supported_native_packages = __esm({
|
|
|
4892
4892
|
// seam
|
|
4893
4893
|
"react-native-device-info",
|
|
4894
4894
|
// seam+coverage
|
|
4895
|
+
"react-native-document-picker",
|
|
4896
|
+
// seam
|
|
4895
4897
|
"react-native-ease",
|
|
4896
4898
|
// seam
|
|
4897
4899
|
"react-native-edge-fade",
|
|
@@ -5245,7 +5247,7 @@ var init_supported_native_packages = __esm({
|
|
|
5245
5247
|
"react-native-view-shot",
|
|
5246
5248
|
// seam
|
|
5247
5249
|
"react-native-vision-camera",
|
|
5248
|
-
//
|
|
5250
|
+
// seam
|
|
5249
5251
|
"react-native-vlc-media-player",
|
|
5250
5252
|
// seam
|
|
5251
5253
|
"react-native-vosk",
|
|
@@ -21843,7 +21845,7 @@ function swiftTargetDependencies(files, targets) {
|
|
|
21843
21845
|
}
|
|
21844
21846
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
21845
21847
|
const hash = (0, import_node_crypto3.createHash)("sha256");
|
|
21846
|
-
hash.update(`swift-compile/
|
|
21848
|
+
hash.update(`swift-compile/v14
|
|
21847
21849
|
${release}
|
|
21848
21850
|
`);
|
|
21849
21851
|
if (input.oneModule) hash.update("one-module\n");
|
|
@@ -22128,6 +22130,180 @@ function liftExtensionOverrides(source) {
|
|
|
22128
22130
|
out = out.slice(0, at) + insert + out.slice(at + remove);
|
|
22129
22131
|
return out;
|
|
22130
22132
|
}
|
|
22133
|
+
function lowerAnyObjectDoubleValue(source) {
|
|
22134
|
+
const masked = swiftCodeMask(source);
|
|
22135
|
+
const names = /* @__PURE__ */ new Set();
|
|
22136
|
+
const binding = /(?:\blet\b|\bvar\b)\s+([A-Za-z_]\w*)\s*=[^\n;{}]*?\bas[?!]?\s*AnyObject\??(?=\s*(?:[,;{]|\belse\b|$))/gm;
|
|
22137
|
+
const declared = /(?:\blet\b|\bvar\b)\s+([A-Za-z_]\w*)\s*:\s*AnyObject\b/g;
|
|
22138
|
+
const parameter = /[(,]\s*(?:[A-Za-z_]\w*\s+)?([A-Za-z_]\w*)\s*:\s*AnyObject\??(?=\s*[,)=])/g;
|
|
22139
|
+
for (const pattern of [binding, declared, parameter]) {
|
|
22140
|
+
pattern.lastIndex = 0;
|
|
22141
|
+
for (let found = pattern.exec(masked); found; found = pattern.exec(masked))
|
|
22142
|
+
names.add(found[1]);
|
|
22143
|
+
}
|
|
22144
|
+
const edits = [];
|
|
22145
|
+
const member = /\.\s*doubleValue\b/g;
|
|
22146
|
+
let hit;
|
|
22147
|
+
while ((hit = member.exec(masked)) !== null) {
|
|
22148
|
+
const memberEnd = hit.index + hit[0].length;
|
|
22149
|
+
let j = hit.index - 1;
|
|
22150
|
+
while (j >= 0 && /\s/.test(masked[j])) j--;
|
|
22151
|
+
if (masked[j] === "?" || masked[j] === "!") {
|
|
22152
|
+
j--;
|
|
22153
|
+
while (j >= 0 && /\s/.test(masked[j])) j--;
|
|
22154
|
+
}
|
|
22155
|
+
if (masked[j] === ")") {
|
|
22156
|
+
const close = j;
|
|
22157
|
+
let depth = 0;
|
|
22158
|
+
let open = -1;
|
|
22159
|
+
for (let k = close; k >= 0; k--) {
|
|
22160
|
+
if (masked[k] === ")") depth++;
|
|
22161
|
+
else if (masked[k] === "(" && --depth === 0) {
|
|
22162
|
+
open = k;
|
|
22163
|
+
break;
|
|
22164
|
+
}
|
|
22165
|
+
}
|
|
22166
|
+
if (open === -1) continue;
|
|
22167
|
+
const inner = masked.slice(open + 1, close);
|
|
22168
|
+
const cast = /^(?:\s*(?:try\b|await\b))*\s*([\s\S]*?)\bas[?!]?\s*AnyObject\??\s*$/.exec(inner);
|
|
22169
|
+
if (!cast) continue;
|
|
22170
|
+
const expression = source.slice(open + 1, open + 1 + cast[1].length).replace(/\s+$/, "");
|
|
22171
|
+
const hoisted = /^\s*((?:try\b\s*|await\s*)+)([\s\S]*)$/.exec(expression);
|
|
22172
|
+
edits.push([
|
|
22173
|
+
open,
|
|
22174
|
+
memberEnd - open,
|
|
22175
|
+
`${hoisted ? hoisted[1] : ""}_objcNumber(${hoisted ? hoisted[2] : expression})`
|
|
22176
|
+
]);
|
|
22177
|
+
continue;
|
|
22178
|
+
}
|
|
22179
|
+
const head = masked.slice(0, j + 1);
|
|
22180
|
+
const selfed = /(?:^|[^\w$])self\s*\.\s*([A-Za-z_]\w*)$/.exec(head);
|
|
22181
|
+
if (selfed) {
|
|
22182
|
+
if (!names.has(selfed[1])) continue;
|
|
22183
|
+
const receiver = selfed[0].replace(/^[^\w$]+/, "");
|
|
22184
|
+
edits.push([
|
|
22185
|
+
j + 1 - receiver.length,
|
|
22186
|
+
memberEnd - (j + 1 - receiver.length),
|
|
22187
|
+
`_objcNumber(${receiver})`
|
|
22188
|
+
]);
|
|
22189
|
+
continue;
|
|
22190
|
+
}
|
|
22191
|
+
const named = /([A-Za-z_]\w*)$/.exec(head);
|
|
22192
|
+
if (!named || !names.has(named[1])) continue;
|
|
22193
|
+
const nameStart = j + 1 - named[1].length;
|
|
22194
|
+
let before = nameStart - 1;
|
|
22195
|
+
while (before >= 0 && /\s/.test(masked[before])) before--;
|
|
22196
|
+
if (masked[before] === ".") continue;
|
|
22197
|
+
edits.push([nameStart, memberEnd - nameStart, `_objcNumber(${named[1]})`]);
|
|
22198
|
+
}
|
|
22199
|
+
let out = source;
|
|
22200
|
+
for (const [at, remove, insert] of edits.sort((a, b) => b[0] - a[0]))
|
|
22201
|
+
out = out.slice(0, at) + insert + out.slice(at + remove);
|
|
22202
|
+
return out;
|
|
22203
|
+
}
|
|
22204
|
+
function swiftCodeMask(source) {
|
|
22205
|
+
const chars = source.split("");
|
|
22206
|
+
const blank = (from, to) => {
|
|
22207
|
+
for (let i = Math.max(0, from); i < Math.min(to, chars.length); i++)
|
|
22208
|
+
if (chars[i] !== "\n") chars[i] = " ";
|
|
22209
|
+
};
|
|
22210
|
+
const hashesAt = (at) => {
|
|
22211
|
+
let end = at;
|
|
22212
|
+
while (source[end] === "#") end++;
|
|
22213
|
+
return end - at;
|
|
22214
|
+
};
|
|
22215
|
+
const scanString = (quote, hashes) => {
|
|
22216
|
+
const multiline = source.startsWith('"""', quote);
|
|
22217
|
+
let i = quote + (multiline ? 3 : 1);
|
|
22218
|
+
const keep = [];
|
|
22219
|
+
const quoteEnd = (at) => {
|
|
22220
|
+
const mark = multiline ? '"""' : '"';
|
|
22221
|
+
return source.startsWith(mark, at) && source.startsWith("#".repeat(hashes), at + mark.length);
|
|
22222
|
+
};
|
|
22223
|
+
while (i < chars.length) {
|
|
22224
|
+
if (source[i] === "\\" && source.startsWith("#".repeat(hashes), i + 1) && source[i + 1 + hashes] === "(") {
|
|
22225
|
+
const codeStart = i + 2 + hashes;
|
|
22226
|
+
const codeEnd = scanCode(codeStart, true);
|
|
22227
|
+
keep.push([codeStart, codeEnd]);
|
|
22228
|
+
i = codeEnd + 1;
|
|
22229
|
+
continue;
|
|
22230
|
+
}
|
|
22231
|
+
if (quoteEnd(i)) {
|
|
22232
|
+
const close = i + (multiline ? 3 : 1) + hashes;
|
|
22233
|
+
let cursor = quote - hashes;
|
|
22234
|
+
for (const [from, to] of [...keep, [close, close]])
|
|
22235
|
+
if (from > cursor) {
|
|
22236
|
+
blank(cursor, from);
|
|
22237
|
+
cursor = to;
|
|
22238
|
+
} else cursor = Math.max(cursor, to);
|
|
22239
|
+
return close;
|
|
22240
|
+
}
|
|
22241
|
+
i++;
|
|
22242
|
+
}
|
|
22243
|
+
blank(quote - hashes, chars.length);
|
|
22244
|
+
return chars.length;
|
|
22245
|
+
};
|
|
22246
|
+
const scanCode = (i, nested) => {
|
|
22247
|
+
let parens = 0;
|
|
22248
|
+
while (i < chars.length) {
|
|
22249
|
+
const char = source[i];
|
|
22250
|
+
if (char === "/" && source[i + 1] === "/") {
|
|
22251
|
+
const end = source.indexOf("\n", i);
|
|
22252
|
+
blank(i, end === -1 ? chars.length : end);
|
|
22253
|
+
i = end === -1 ? chars.length : end;
|
|
22254
|
+
continue;
|
|
22255
|
+
}
|
|
22256
|
+
if (char === "/" && source[i + 1] === "*") {
|
|
22257
|
+
let j = i + 2;
|
|
22258
|
+
let depth = 1;
|
|
22259
|
+
while (j < chars.length && depth > 0) {
|
|
22260
|
+
if (source.startsWith("/*", j)) {
|
|
22261
|
+
depth++;
|
|
22262
|
+
j += 2;
|
|
22263
|
+
} else if (source.startsWith("*/", j)) {
|
|
22264
|
+
depth--;
|
|
22265
|
+
j += 2;
|
|
22266
|
+
} else j++;
|
|
22267
|
+
}
|
|
22268
|
+
blank(i, j);
|
|
22269
|
+
i = j;
|
|
22270
|
+
continue;
|
|
22271
|
+
}
|
|
22272
|
+
if (char === "#") {
|
|
22273
|
+
const hashes = hashesAt(i);
|
|
22274
|
+
const at = i + hashes;
|
|
22275
|
+
if (source[at] === '"') {
|
|
22276
|
+
i = scanString(at, hashes);
|
|
22277
|
+
continue;
|
|
22278
|
+
}
|
|
22279
|
+
if (hashes > 0 && source[at] === "/") {
|
|
22280
|
+
const mark = "#".repeat(hashes);
|
|
22281
|
+
let j = at + 1;
|
|
22282
|
+
while (j < chars.length && !(source[j] === "/" && source.startsWith(mark, j + 1)))
|
|
22283
|
+
j++;
|
|
22284
|
+
blank(i, Math.min(chars.length, j + 1 + hashes));
|
|
22285
|
+
i = Math.min(chars.length, j + 1 + hashes);
|
|
22286
|
+
continue;
|
|
22287
|
+
}
|
|
22288
|
+
i++;
|
|
22289
|
+
continue;
|
|
22290
|
+
}
|
|
22291
|
+
if (char === '"') {
|
|
22292
|
+
i = scanString(i, 0);
|
|
22293
|
+
continue;
|
|
22294
|
+
}
|
|
22295
|
+
if (char === "(") parens++;
|
|
22296
|
+
else if (char === ")") {
|
|
22297
|
+
if (nested && parens === 0) return i;
|
|
22298
|
+
parens--;
|
|
22299
|
+
}
|
|
22300
|
+
i++;
|
|
22301
|
+
}
|
|
22302
|
+
return i;
|
|
22303
|
+
};
|
|
22304
|
+
scanCode(0, false);
|
|
22305
|
+
return chars.join("");
|
|
22306
|
+
}
|
|
22131
22307
|
function swiftSourceAsIOS(original) {
|
|
22132
22308
|
const source = liftExtensionOverrides(original);
|
|
22133
22309
|
const { lineStarts, tokens } = swiftCodeScan(source);
|
|
@@ -22202,7 +22378,7 @@ function swiftSourceAsIOS(original) {
|
|
|
22202
22378
|
out += conditioned.slice(copied, at) + replacement;
|
|
22203
22379
|
copied = at + match[0].length;
|
|
22204
22380
|
}
|
|
22205
|
-
return out + conditioned.slice(copied);
|
|
22381
|
+
return lowerAnyObjectDoubleValue(out + conditioned.slice(copied));
|
|
22206
22382
|
}
|
|
22207
22383
|
function swiftCodeScan(source) {
|
|
22208
22384
|
const starts = /* @__PURE__ */ new Set();
|
|
@@ -23858,7 +24034,7 @@ var init_swift_submit = __esm({
|
|
|
23858
24034
|
MAX_SWIFT_COMPILE_IMAGES = 128;
|
|
23859
24035
|
MAX_SWIFT_COMPILE_IMAGE_BYTES = 4 * 1024 * 1024;
|
|
23860
24036
|
MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES = 16 * 1024 * 1024;
|
|
23861
|
-
SWIFT_HOST_ABI =
|
|
24037
|
+
SWIFT_HOST_ABI = 21;
|
|
23862
24038
|
POLL_INTERVAL_MS = 1500;
|
|
23863
24039
|
}
|
|
23864
24040
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.728 | (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;
|
|
@@ -37,6 +37,7 @@ __export(swift_compile_exports, {
|
|
|
37
37
|
compileSwiftProjectUnit: () => compileSwiftProjectUnit,
|
|
38
38
|
compileTargets: () => compileTargets,
|
|
39
39
|
emitSwiftPackageManifest: () => emitSwiftPackageManifest,
|
|
40
|
+
lowerAnyObjectDoubleValue: () => lowerAnyObjectDoubleValue,
|
|
40
41
|
prepareSwiftDependency: () => prepareSwiftDependency,
|
|
41
42
|
swiftArtifactHash: () => swiftArtifactHash,
|
|
42
43
|
swiftDistributionAt: () => swiftDistributionAt,
|
|
@@ -436,7 +437,7 @@ var ONE_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "One"'
|
|
|
436
437
|
var MULTI_MANIFEST_VERSION = 10;
|
|
437
438
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
438
439
|
const hash = (0, import_node_crypto2.createHash)("sha256");
|
|
439
|
-
hash.update(`swift-compile/
|
|
440
|
+
hash.update(`swift-compile/v14
|
|
440
441
|
${release}
|
|
441
442
|
`);
|
|
442
443
|
if (input.oneModule) hash.update("one-module\n");
|
|
@@ -741,6 +742,180 @@ function liftExtensionOverrides(source) {
|
|
|
741
742
|
out = out.slice(0, at) + insert + out.slice(at + remove);
|
|
742
743
|
return out;
|
|
743
744
|
}
|
|
745
|
+
function lowerAnyObjectDoubleValue(source) {
|
|
746
|
+
const masked = swiftCodeMask(source);
|
|
747
|
+
const names = /* @__PURE__ */ new Set();
|
|
748
|
+
const binding = /(?:\blet\b|\bvar\b)\s+([A-Za-z_]\w*)\s*=[^\n;{}]*?\bas[?!]?\s*AnyObject\??(?=\s*(?:[,;{]|\belse\b|$))/gm;
|
|
749
|
+
const declared = /(?:\blet\b|\bvar\b)\s+([A-Za-z_]\w*)\s*:\s*AnyObject\b/g;
|
|
750
|
+
const parameter = /[(,]\s*(?:[A-Za-z_]\w*\s+)?([A-Za-z_]\w*)\s*:\s*AnyObject\??(?=\s*[,)=])/g;
|
|
751
|
+
for (const pattern of [binding, declared, parameter]) {
|
|
752
|
+
pattern.lastIndex = 0;
|
|
753
|
+
for (let found = pattern.exec(masked); found; found = pattern.exec(masked))
|
|
754
|
+
names.add(found[1]);
|
|
755
|
+
}
|
|
756
|
+
const edits = [];
|
|
757
|
+
const member = /\.\s*doubleValue\b/g;
|
|
758
|
+
let hit;
|
|
759
|
+
while ((hit = member.exec(masked)) !== null) {
|
|
760
|
+
const memberEnd = hit.index + hit[0].length;
|
|
761
|
+
let j = hit.index - 1;
|
|
762
|
+
while (j >= 0 && /\s/.test(masked[j])) j--;
|
|
763
|
+
if (masked[j] === "?" || masked[j] === "!") {
|
|
764
|
+
j--;
|
|
765
|
+
while (j >= 0 && /\s/.test(masked[j])) j--;
|
|
766
|
+
}
|
|
767
|
+
if (masked[j] === ")") {
|
|
768
|
+
const close = j;
|
|
769
|
+
let depth = 0;
|
|
770
|
+
let open = -1;
|
|
771
|
+
for (let k = close; k >= 0; k--) {
|
|
772
|
+
if (masked[k] === ")") depth++;
|
|
773
|
+
else if (masked[k] === "(" && --depth === 0) {
|
|
774
|
+
open = k;
|
|
775
|
+
break;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
if (open === -1) continue;
|
|
779
|
+
const inner = masked.slice(open + 1, close);
|
|
780
|
+
const cast = /^(?:\s*(?:try\b|await\b))*\s*([\s\S]*?)\bas[?!]?\s*AnyObject\??\s*$/.exec(inner);
|
|
781
|
+
if (!cast) continue;
|
|
782
|
+
const expression = source.slice(open + 1, open + 1 + cast[1].length).replace(/\s+$/, "");
|
|
783
|
+
const hoisted = /^\s*((?:try\b\s*|await\s*)+)([\s\S]*)$/.exec(expression);
|
|
784
|
+
edits.push([
|
|
785
|
+
open,
|
|
786
|
+
memberEnd - open,
|
|
787
|
+
`${hoisted ? hoisted[1] : ""}_objcNumber(${hoisted ? hoisted[2] : expression})`
|
|
788
|
+
]);
|
|
789
|
+
continue;
|
|
790
|
+
}
|
|
791
|
+
const head = masked.slice(0, j + 1);
|
|
792
|
+
const selfed = /(?:^|[^\w$])self\s*\.\s*([A-Za-z_]\w*)$/.exec(head);
|
|
793
|
+
if (selfed) {
|
|
794
|
+
if (!names.has(selfed[1])) continue;
|
|
795
|
+
const receiver = selfed[0].replace(/^[^\w$]+/, "");
|
|
796
|
+
edits.push([
|
|
797
|
+
j + 1 - receiver.length,
|
|
798
|
+
memberEnd - (j + 1 - receiver.length),
|
|
799
|
+
`_objcNumber(${receiver})`
|
|
800
|
+
]);
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
const named = /([A-Za-z_]\w*)$/.exec(head);
|
|
804
|
+
if (!named || !names.has(named[1])) continue;
|
|
805
|
+
const nameStart = j + 1 - named[1].length;
|
|
806
|
+
let before = nameStart - 1;
|
|
807
|
+
while (before >= 0 && /\s/.test(masked[before])) before--;
|
|
808
|
+
if (masked[before] === ".") continue;
|
|
809
|
+
edits.push([nameStart, memberEnd - nameStart, `_objcNumber(${named[1]})`]);
|
|
810
|
+
}
|
|
811
|
+
let out = source;
|
|
812
|
+
for (const [at, remove, insert] of edits.sort((a, b) => b[0] - a[0]))
|
|
813
|
+
out = out.slice(0, at) + insert + out.slice(at + remove);
|
|
814
|
+
return out;
|
|
815
|
+
}
|
|
816
|
+
function swiftCodeMask(source) {
|
|
817
|
+
const chars = source.split("");
|
|
818
|
+
const blank = (from, to) => {
|
|
819
|
+
for (let i = Math.max(0, from); i < Math.min(to, chars.length); i++)
|
|
820
|
+
if (chars[i] !== "\n") chars[i] = " ";
|
|
821
|
+
};
|
|
822
|
+
const hashesAt = (at) => {
|
|
823
|
+
let end = at;
|
|
824
|
+
while (source[end] === "#") end++;
|
|
825
|
+
return end - at;
|
|
826
|
+
};
|
|
827
|
+
const scanString = (quote, hashes) => {
|
|
828
|
+
const multiline = source.startsWith('"""', quote);
|
|
829
|
+
let i = quote + (multiline ? 3 : 1);
|
|
830
|
+
const keep = [];
|
|
831
|
+
const quoteEnd = (at) => {
|
|
832
|
+
const mark = multiline ? '"""' : '"';
|
|
833
|
+
return source.startsWith(mark, at) && source.startsWith("#".repeat(hashes), at + mark.length);
|
|
834
|
+
};
|
|
835
|
+
while (i < chars.length) {
|
|
836
|
+
if (source[i] === "\\" && source.startsWith("#".repeat(hashes), i + 1) && source[i + 1 + hashes] === "(") {
|
|
837
|
+
const codeStart = i + 2 + hashes;
|
|
838
|
+
const codeEnd = scanCode(codeStart, true);
|
|
839
|
+
keep.push([codeStart, codeEnd]);
|
|
840
|
+
i = codeEnd + 1;
|
|
841
|
+
continue;
|
|
842
|
+
}
|
|
843
|
+
if (quoteEnd(i)) {
|
|
844
|
+
const close = i + (multiline ? 3 : 1) + hashes;
|
|
845
|
+
let cursor = quote - hashes;
|
|
846
|
+
for (const [from, to] of [...keep, [close, close]])
|
|
847
|
+
if (from > cursor) {
|
|
848
|
+
blank(cursor, from);
|
|
849
|
+
cursor = to;
|
|
850
|
+
} else cursor = Math.max(cursor, to);
|
|
851
|
+
return close;
|
|
852
|
+
}
|
|
853
|
+
i++;
|
|
854
|
+
}
|
|
855
|
+
blank(quote - hashes, chars.length);
|
|
856
|
+
return chars.length;
|
|
857
|
+
};
|
|
858
|
+
const scanCode = (i, nested) => {
|
|
859
|
+
let parens = 0;
|
|
860
|
+
while (i < chars.length) {
|
|
861
|
+
const char = source[i];
|
|
862
|
+
if (char === "/" && source[i + 1] === "/") {
|
|
863
|
+
const end = source.indexOf("\n", i);
|
|
864
|
+
blank(i, end === -1 ? chars.length : end);
|
|
865
|
+
i = end === -1 ? chars.length : end;
|
|
866
|
+
continue;
|
|
867
|
+
}
|
|
868
|
+
if (char === "/" && source[i + 1] === "*") {
|
|
869
|
+
let j = i + 2;
|
|
870
|
+
let depth = 1;
|
|
871
|
+
while (j < chars.length && depth > 0) {
|
|
872
|
+
if (source.startsWith("/*", j)) {
|
|
873
|
+
depth++;
|
|
874
|
+
j += 2;
|
|
875
|
+
} else if (source.startsWith("*/", j)) {
|
|
876
|
+
depth--;
|
|
877
|
+
j += 2;
|
|
878
|
+
} else j++;
|
|
879
|
+
}
|
|
880
|
+
blank(i, j);
|
|
881
|
+
i = j;
|
|
882
|
+
continue;
|
|
883
|
+
}
|
|
884
|
+
if (char === "#") {
|
|
885
|
+
const hashes = hashesAt(i);
|
|
886
|
+
const at = i + hashes;
|
|
887
|
+
if (source[at] === '"') {
|
|
888
|
+
i = scanString(at, hashes);
|
|
889
|
+
continue;
|
|
890
|
+
}
|
|
891
|
+
if (hashes > 0 && source[at] === "/") {
|
|
892
|
+
const mark = "#".repeat(hashes);
|
|
893
|
+
let j = at + 1;
|
|
894
|
+
while (j < chars.length && !(source[j] === "/" && source.startsWith(mark, j + 1)))
|
|
895
|
+
j++;
|
|
896
|
+
blank(i, Math.min(chars.length, j + 1 + hashes));
|
|
897
|
+
i = Math.min(chars.length, j + 1 + hashes);
|
|
898
|
+
continue;
|
|
899
|
+
}
|
|
900
|
+
i++;
|
|
901
|
+
continue;
|
|
902
|
+
}
|
|
903
|
+
if (char === '"') {
|
|
904
|
+
i = scanString(i, 0);
|
|
905
|
+
continue;
|
|
906
|
+
}
|
|
907
|
+
if (char === "(") parens++;
|
|
908
|
+
else if (char === ")") {
|
|
909
|
+
if (nested && parens === 0) return i;
|
|
910
|
+
parens--;
|
|
911
|
+
}
|
|
912
|
+
i++;
|
|
913
|
+
}
|
|
914
|
+
return i;
|
|
915
|
+
};
|
|
916
|
+
scanCode(0, false);
|
|
917
|
+
return chars.join("");
|
|
918
|
+
}
|
|
744
919
|
function swiftSourceAsIOS(original) {
|
|
745
920
|
const source = liftExtensionOverrides(original);
|
|
746
921
|
const { lineStarts, tokens } = swiftCodeScan(source);
|
|
@@ -815,7 +990,7 @@ function swiftSourceAsIOS(original) {
|
|
|
815
990
|
out += conditioned.slice(copied, at) + replacement;
|
|
816
991
|
copied = at + match[0].length;
|
|
817
992
|
}
|
|
818
|
-
return out + conditioned.slice(copied);
|
|
993
|
+
return lowerAnyObjectDoubleValue(out + conditioned.slice(copied));
|
|
819
994
|
}
|
|
820
995
|
function swiftCodeScan(source) {
|
|
821
996
|
const starts = /* @__PURE__ */ new Set();
|
|
@@ -1155,6 +1330,7 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
1155
1330
|
compileSwiftProjectUnit,
|
|
1156
1331
|
compileTargets,
|
|
1157
1332
|
emitSwiftPackageManifest,
|
|
1333
|
+
lowerAnyObjectDoubleValue,
|
|
1158
1334
|
prepareSwiftDependency,
|
|
1159
1335
|
swiftArtifactHash,
|
|
1160
1336
|
swiftDistributionAt,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.728 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/swift-compile.ts
|
|
4
4
|
import { execFile as execFile2 } from "node:child_process";
|
|
@@ -396,7 +396,7 @@ var ONE_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "One"'
|
|
|
396
396
|
var MULTI_MANIFEST_VERSION = 10;
|
|
397
397
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
398
398
|
const hash = createHash2("sha256");
|
|
399
|
-
hash.update(`swift-compile/
|
|
399
|
+
hash.update(`swift-compile/v14
|
|
400
400
|
${release}
|
|
401
401
|
`);
|
|
402
402
|
if (input.oneModule) hash.update("one-module\n");
|
|
@@ -701,6 +701,180 @@ function liftExtensionOverrides(source) {
|
|
|
701
701
|
out = out.slice(0, at) + insert + out.slice(at + remove);
|
|
702
702
|
return out;
|
|
703
703
|
}
|
|
704
|
+
function lowerAnyObjectDoubleValue(source) {
|
|
705
|
+
const masked = swiftCodeMask(source);
|
|
706
|
+
const names = /* @__PURE__ */ new Set();
|
|
707
|
+
const binding = /(?:\blet\b|\bvar\b)\s+([A-Za-z_]\w*)\s*=[^\n;{}]*?\bas[?!]?\s*AnyObject\??(?=\s*(?:[,;{]|\belse\b|$))/gm;
|
|
708
|
+
const declared = /(?:\blet\b|\bvar\b)\s+([A-Za-z_]\w*)\s*:\s*AnyObject\b/g;
|
|
709
|
+
const parameter = /[(,]\s*(?:[A-Za-z_]\w*\s+)?([A-Za-z_]\w*)\s*:\s*AnyObject\??(?=\s*[,)=])/g;
|
|
710
|
+
for (const pattern of [binding, declared, parameter]) {
|
|
711
|
+
pattern.lastIndex = 0;
|
|
712
|
+
for (let found = pattern.exec(masked); found; found = pattern.exec(masked))
|
|
713
|
+
names.add(found[1]);
|
|
714
|
+
}
|
|
715
|
+
const edits = [];
|
|
716
|
+
const member = /\.\s*doubleValue\b/g;
|
|
717
|
+
let hit;
|
|
718
|
+
while ((hit = member.exec(masked)) !== null) {
|
|
719
|
+
const memberEnd = hit.index + hit[0].length;
|
|
720
|
+
let j = hit.index - 1;
|
|
721
|
+
while (j >= 0 && /\s/.test(masked[j])) j--;
|
|
722
|
+
if (masked[j] === "?" || masked[j] === "!") {
|
|
723
|
+
j--;
|
|
724
|
+
while (j >= 0 && /\s/.test(masked[j])) j--;
|
|
725
|
+
}
|
|
726
|
+
if (masked[j] === ")") {
|
|
727
|
+
const close = j;
|
|
728
|
+
let depth = 0;
|
|
729
|
+
let open = -1;
|
|
730
|
+
for (let k = close; k >= 0; k--) {
|
|
731
|
+
if (masked[k] === ")") depth++;
|
|
732
|
+
else if (masked[k] === "(" && --depth === 0) {
|
|
733
|
+
open = k;
|
|
734
|
+
break;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
if (open === -1) continue;
|
|
738
|
+
const inner = masked.slice(open + 1, close);
|
|
739
|
+
const cast = /^(?:\s*(?:try\b|await\b))*\s*([\s\S]*?)\bas[?!]?\s*AnyObject\??\s*$/.exec(inner);
|
|
740
|
+
if (!cast) continue;
|
|
741
|
+
const expression = source.slice(open + 1, open + 1 + cast[1].length).replace(/\s+$/, "");
|
|
742
|
+
const hoisted = /^\s*((?:try\b\s*|await\s*)+)([\s\S]*)$/.exec(expression);
|
|
743
|
+
edits.push([
|
|
744
|
+
open,
|
|
745
|
+
memberEnd - open,
|
|
746
|
+
`${hoisted ? hoisted[1] : ""}_objcNumber(${hoisted ? hoisted[2] : expression})`
|
|
747
|
+
]);
|
|
748
|
+
continue;
|
|
749
|
+
}
|
|
750
|
+
const head = masked.slice(0, j + 1);
|
|
751
|
+
const selfed = /(?:^|[^\w$])self\s*\.\s*([A-Za-z_]\w*)$/.exec(head);
|
|
752
|
+
if (selfed) {
|
|
753
|
+
if (!names.has(selfed[1])) continue;
|
|
754
|
+
const receiver = selfed[0].replace(/^[^\w$]+/, "");
|
|
755
|
+
edits.push([
|
|
756
|
+
j + 1 - receiver.length,
|
|
757
|
+
memberEnd - (j + 1 - receiver.length),
|
|
758
|
+
`_objcNumber(${receiver})`
|
|
759
|
+
]);
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
const named = /([A-Za-z_]\w*)$/.exec(head);
|
|
763
|
+
if (!named || !names.has(named[1])) continue;
|
|
764
|
+
const nameStart = j + 1 - named[1].length;
|
|
765
|
+
let before = nameStart - 1;
|
|
766
|
+
while (before >= 0 && /\s/.test(masked[before])) before--;
|
|
767
|
+
if (masked[before] === ".") continue;
|
|
768
|
+
edits.push([nameStart, memberEnd - nameStart, `_objcNumber(${named[1]})`]);
|
|
769
|
+
}
|
|
770
|
+
let out = source;
|
|
771
|
+
for (const [at, remove, insert] of edits.sort((a, b) => b[0] - a[0]))
|
|
772
|
+
out = out.slice(0, at) + insert + out.slice(at + remove);
|
|
773
|
+
return out;
|
|
774
|
+
}
|
|
775
|
+
function swiftCodeMask(source) {
|
|
776
|
+
const chars = source.split("");
|
|
777
|
+
const blank = (from, to) => {
|
|
778
|
+
for (let i = Math.max(0, from); i < Math.min(to, chars.length); i++)
|
|
779
|
+
if (chars[i] !== "\n") chars[i] = " ";
|
|
780
|
+
};
|
|
781
|
+
const hashesAt = (at) => {
|
|
782
|
+
let end = at;
|
|
783
|
+
while (source[end] === "#") end++;
|
|
784
|
+
return end - at;
|
|
785
|
+
};
|
|
786
|
+
const scanString = (quote, hashes) => {
|
|
787
|
+
const multiline = source.startsWith('"""', quote);
|
|
788
|
+
let i = quote + (multiline ? 3 : 1);
|
|
789
|
+
const keep = [];
|
|
790
|
+
const quoteEnd = (at) => {
|
|
791
|
+
const mark = multiline ? '"""' : '"';
|
|
792
|
+
return source.startsWith(mark, at) && source.startsWith("#".repeat(hashes), at + mark.length);
|
|
793
|
+
};
|
|
794
|
+
while (i < chars.length) {
|
|
795
|
+
if (source[i] === "\\" && source.startsWith("#".repeat(hashes), i + 1) && source[i + 1 + hashes] === "(") {
|
|
796
|
+
const codeStart = i + 2 + hashes;
|
|
797
|
+
const codeEnd = scanCode(codeStart, true);
|
|
798
|
+
keep.push([codeStart, codeEnd]);
|
|
799
|
+
i = codeEnd + 1;
|
|
800
|
+
continue;
|
|
801
|
+
}
|
|
802
|
+
if (quoteEnd(i)) {
|
|
803
|
+
const close = i + (multiline ? 3 : 1) + hashes;
|
|
804
|
+
let cursor = quote - hashes;
|
|
805
|
+
for (const [from, to] of [...keep, [close, close]])
|
|
806
|
+
if (from > cursor) {
|
|
807
|
+
blank(cursor, from);
|
|
808
|
+
cursor = to;
|
|
809
|
+
} else cursor = Math.max(cursor, to);
|
|
810
|
+
return close;
|
|
811
|
+
}
|
|
812
|
+
i++;
|
|
813
|
+
}
|
|
814
|
+
blank(quote - hashes, chars.length);
|
|
815
|
+
return chars.length;
|
|
816
|
+
};
|
|
817
|
+
const scanCode = (i, nested) => {
|
|
818
|
+
let parens = 0;
|
|
819
|
+
while (i < chars.length) {
|
|
820
|
+
const char = source[i];
|
|
821
|
+
if (char === "/" && source[i + 1] === "/") {
|
|
822
|
+
const end = source.indexOf("\n", i);
|
|
823
|
+
blank(i, end === -1 ? chars.length : end);
|
|
824
|
+
i = end === -1 ? chars.length : end;
|
|
825
|
+
continue;
|
|
826
|
+
}
|
|
827
|
+
if (char === "/" && source[i + 1] === "*") {
|
|
828
|
+
let j = i + 2;
|
|
829
|
+
let depth = 1;
|
|
830
|
+
while (j < chars.length && depth > 0) {
|
|
831
|
+
if (source.startsWith("/*", j)) {
|
|
832
|
+
depth++;
|
|
833
|
+
j += 2;
|
|
834
|
+
} else if (source.startsWith("*/", j)) {
|
|
835
|
+
depth--;
|
|
836
|
+
j += 2;
|
|
837
|
+
} else j++;
|
|
838
|
+
}
|
|
839
|
+
blank(i, j);
|
|
840
|
+
i = j;
|
|
841
|
+
continue;
|
|
842
|
+
}
|
|
843
|
+
if (char === "#") {
|
|
844
|
+
const hashes = hashesAt(i);
|
|
845
|
+
const at = i + hashes;
|
|
846
|
+
if (source[at] === '"') {
|
|
847
|
+
i = scanString(at, hashes);
|
|
848
|
+
continue;
|
|
849
|
+
}
|
|
850
|
+
if (hashes > 0 && source[at] === "/") {
|
|
851
|
+
const mark = "#".repeat(hashes);
|
|
852
|
+
let j = at + 1;
|
|
853
|
+
while (j < chars.length && !(source[j] === "/" && source.startsWith(mark, j + 1)))
|
|
854
|
+
j++;
|
|
855
|
+
blank(i, Math.min(chars.length, j + 1 + hashes));
|
|
856
|
+
i = Math.min(chars.length, j + 1 + hashes);
|
|
857
|
+
continue;
|
|
858
|
+
}
|
|
859
|
+
i++;
|
|
860
|
+
continue;
|
|
861
|
+
}
|
|
862
|
+
if (char === '"') {
|
|
863
|
+
i = scanString(i, 0);
|
|
864
|
+
continue;
|
|
865
|
+
}
|
|
866
|
+
if (char === "(") parens++;
|
|
867
|
+
else if (char === ")") {
|
|
868
|
+
if (nested && parens === 0) return i;
|
|
869
|
+
parens--;
|
|
870
|
+
}
|
|
871
|
+
i++;
|
|
872
|
+
}
|
|
873
|
+
return i;
|
|
874
|
+
};
|
|
875
|
+
scanCode(0, false);
|
|
876
|
+
return chars.join("");
|
|
877
|
+
}
|
|
704
878
|
function swiftSourceAsIOS(original) {
|
|
705
879
|
const source = liftExtensionOverrides(original);
|
|
706
880
|
const { lineStarts, tokens } = swiftCodeScan(source);
|
|
@@ -775,7 +949,7 @@ function swiftSourceAsIOS(original) {
|
|
|
775
949
|
out += conditioned.slice(copied, at) + replacement;
|
|
776
950
|
copied = at + match[0].length;
|
|
777
951
|
}
|
|
778
|
-
return out + conditioned.slice(copied);
|
|
952
|
+
return lowerAnyObjectDoubleValue(out + conditioned.slice(copied));
|
|
779
953
|
}
|
|
780
954
|
function swiftCodeScan(source) {
|
|
781
955
|
const starts = /* @__PURE__ */ new Set();
|
|
@@ -1114,6 +1288,7 @@ export {
|
|
|
1114
1288
|
compileSwiftProjectUnit,
|
|
1115
1289
|
compileTargets,
|
|
1116
1290
|
emitSwiftPackageManifest,
|
|
1291
|
+
lowerAnyObjectDoubleValue,
|
|
1117
1292
|
prepareSwiftDependency,
|
|
1118
1293
|
swiftArtifactHash,
|
|
1119
1294
|
swiftDistributionAt,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.728 | (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 __defProp = Object.defineProperty;
|