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/skills.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;
|
|
@@ -19468,9 +19468,9 @@ var require_parse = __commonJS({
|
|
|
19468
19468
|
doc.documentElement.nodeName === "plist",
|
|
19469
19469
|
"malformed document. First element should be <plist>"
|
|
19470
19470
|
);
|
|
19471
|
-
var
|
|
19472
|
-
if (
|
|
19473
|
-
return
|
|
19471
|
+
var plist3 = parsePlistXML(doc.documentElement);
|
|
19472
|
+
if (plist3.length == 1) plist3 = plist3[0];
|
|
19473
|
+
return plist3;
|
|
19474
19474
|
}
|
|
19475
19475
|
function parsePlistXML(node) {
|
|
19476
19476
|
var i, new_obj, key, val, new_arr, res, counter, type;
|
|
@@ -21901,7 +21901,9 @@ function swiftModuleInputFiles(root) {
|
|
|
21901
21901
|
"toolchain.json"
|
|
21902
21902
|
];
|
|
21903
21903
|
const walk2 = (dir) => {
|
|
21904
|
-
for (const entry of (0, import_node_fs7.readdirSync)(import_node_path7.default.join(root, dir), {
|
|
21904
|
+
for (const entry of (0, import_node_fs7.readdirSync)(import_node_path7.default.join(root, dir), {
|
|
21905
|
+
withFileTypes: true
|
|
21906
|
+
})) {
|
|
21905
21907
|
const relative3 = `${dir}/${entry.name}`;
|
|
21906
21908
|
if (entry.isDirectory()) walk2(relative3);
|
|
21907
21909
|
else if (/\.(swift|c|cpp|h)$/.test(entry.name)) files.push(relative3);
|
|
@@ -22680,9 +22682,14 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
|
|
|
22680
22682
|
const reusableBodies = [];
|
|
22681
22683
|
let depth = 0;
|
|
22682
22684
|
let opensReusableBody = false;
|
|
22685
|
+
const sceneLifecycleBodies = /* @__PURE__ */ new Set();
|
|
22683
22686
|
for (const at of tokens) {
|
|
22684
22687
|
const rest = conditioned.slice(at, at + 400);
|
|
22685
22688
|
if (rest.startsWith("{")) {
|
|
22689
|
+
if (sceneLifecycleBodies.has(at)) {
|
|
22690
|
+
out += conditioned.slice(copied, at + 1) + " public var _peachUsesSceneLifecycle: Bool { true };";
|
|
22691
|
+
copied = at + 1;
|
|
22692
|
+
}
|
|
22686
22693
|
depth++;
|
|
22687
22694
|
if (opensReusableBody) reusableBodies.push(depth);
|
|
22688
22695
|
opensReusableBody = false;
|
|
@@ -22718,12 +22725,33 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
|
|
|
22718
22725
|
opensReusableBody = true;
|
|
22719
22726
|
}
|
|
22720
22727
|
const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
|
|
22728
|
+
const delegateClass = DELEGATE_CLASS.exec(rest);
|
|
22729
|
+
if (delegateClass && /\bUIApplicationDelegate\b/.test(delegateClass[0])) {
|
|
22730
|
+
const body = at + delegateClass[0].lastIndexOf("{");
|
|
22731
|
+
let bodyDepth = 0;
|
|
22732
|
+
for (const token of tokens) {
|
|
22733
|
+
if (token < body) continue;
|
|
22734
|
+
if (conditioned[token] === "{") bodyDepth++;
|
|
22735
|
+
else if (conditioned[token] === "}" && --bodyDepth === 0) break;
|
|
22736
|
+
else if (bodyDepth === 1 && /^func\s+application\s*\([^{}]*\bconfigurationForConnecting\s+/.test(
|
|
22737
|
+
conditioned.slice(token, token + 600)
|
|
22738
|
+
)) {
|
|
22739
|
+
sceneLifecycleBodies.add(body);
|
|
22740
|
+
break;
|
|
22741
|
+
}
|
|
22742
|
+
}
|
|
22743
|
+
}
|
|
22721
22744
|
if (DELEGATE_CLASS.test(rest) && !/\b(?:final|open)\b/.test(modifiers)) {
|
|
22722
22745
|
out += `${conditioned.slice(copied, at)}final `;
|
|
22723
22746
|
copied = at;
|
|
22724
22747
|
}
|
|
22725
22748
|
continue;
|
|
22726
22749
|
}
|
|
22750
|
+
if (/^@UIApplicationMain\b/.test(rest)) {
|
|
22751
|
+
out += conditioned.slice(copied, at) + "@main".padEnd("@UIApplicationMain".length);
|
|
22752
|
+
copied = at + "@UIApplicationMain".length;
|
|
22753
|
+
continue;
|
|
22754
|
+
}
|
|
22727
22755
|
const selector = SELECTOR.exec(rest);
|
|
22728
22756
|
const match = selector ?? OBJC_ATTRIBUTE.exec(rest);
|
|
22729
22757
|
if (!match) continue;
|
|
@@ -22822,7 +22850,7 @@ function swiftCodeScan(source) {
|
|
|
22822
22850
|
else top.parens--;
|
|
22823
22851
|
i++;
|
|
22824
22852
|
} else {
|
|
22825
|
-
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;
|
|
22853
|
+
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;
|
|
22826
22854
|
if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
|
|
22827
22855
|
tokens.push(i);
|
|
22828
22856
|
i += keyword.length;
|
|
@@ -23044,10 +23072,16 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
23044
23072
|
plugin
|
|
23045
23073
|
])
|
|
23046
23074
|
],
|
|
23047
|
-
{
|
|
23075
|
+
{
|
|
23076
|
+
env: BUILD_ENV,
|
|
23077
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
23078
|
+
timeout: options.timeoutMs
|
|
23079
|
+
}
|
|
23048
23080
|
);
|
|
23049
23081
|
} catch (error) {
|
|
23050
|
-
throw new Error(projectDiagnostic(outputOf(error), layout), {
|
|
23082
|
+
throw new Error(projectDiagnostic(outputOf(error), layout), {
|
|
23083
|
+
cause: error
|
|
23084
|
+
});
|
|
23051
23085
|
}
|
|
23052
23086
|
return {
|
|
23053
23087
|
hash,
|
|
@@ -23072,7 +23106,10 @@ var init_swift_compile = __esm({
|
|
|
23072
23106
|
run2 = (0, import_node_util2.promisify)(import_node_child_process4.execFile);
|
|
23073
23107
|
WASM_TRIPLE = "wasm32-unknown-wasip1";
|
|
23074
23108
|
cores = import_node_os2.default.availableParallelism();
|
|
23075
|
-
BUILD_ENV = {
|
|
23109
|
+
BUILD_ENV = {
|
|
23110
|
+
...process.env,
|
|
23111
|
+
BINARYEN_CORES: String(Math.min(4, cores))
|
|
23112
|
+
};
|
|
23076
23113
|
BUILD_JOBS = String(Math.max(1, Math.floor(cores / 2)));
|
|
23077
23114
|
linkedModuleDigests = /* @__PURE__ */ new Map();
|
|
23078
23115
|
OPTIONAL_FRAMEWORK_DEPENDENCIES = {
|
|
@@ -24821,6 +24858,62 @@ function readXcodeAppTarget(xcodeproj, targetName) {
|
|
|
24821
24858
|
const moduleName = c99Identifier(
|
|
24822
24859
|
settings.PRODUCT_MODULE_NAME && !settings.PRODUCT_MODULE_NAME.includes("$(") ? settings.PRODUCT_MODULE_NAME : productName
|
|
24823
24860
|
);
|
|
24861
|
+
const variables = {
|
|
24862
|
+
...settings,
|
|
24863
|
+
EXECUTABLE_NAME: settings.EXECUTABLE_NAME ?? productName,
|
|
24864
|
+
DEVELOPMENT_LANGUAGE: settings.DEVELOPMENT_LANGUAGE ?? str(project.developmentRegion) ?? "en",
|
|
24865
|
+
TARGET_NAME: name2,
|
|
24866
|
+
PRODUCT_NAME: productName,
|
|
24867
|
+
PRODUCT_MODULE_NAME: moduleName,
|
|
24868
|
+
SRCROOT: projectDir,
|
|
24869
|
+
SOURCE_ROOT: projectDir
|
|
24870
|
+
};
|
|
24871
|
+
const expand = (value) => {
|
|
24872
|
+
const seen = /* @__PURE__ */ new Set();
|
|
24873
|
+
while (/\$[({][A-Za-z_][A-Za-z0-9_]*[)}]/.test(value)) {
|
|
24874
|
+
if (seen.has(value)) throw new Error(`${name2} has cyclic Info.plist build settings`);
|
|
24875
|
+
seen.add(value);
|
|
24876
|
+
value = value.replace(
|
|
24877
|
+
/\$[({]([A-Za-z_][A-Za-z0-9_]*)[)}]/g,
|
|
24878
|
+
(match, key) => {
|
|
24879
|
+
const replacement = Object.entries(variables).find(
|
|
24880
|
+
([name3]) => name3 === key
|
|
24881
|
+
)?.[1];
|
|
24882
|
+
if (replacement === void 0)
|
|
24883
|
+
throw new Error(`${name2} Info.plist has unresolved setting ${match}`);
|
|
24884
|
+
return replacement;
|
|
24885
|
+
}
|
|
24886
|
+
);
|
|
24887
|
+
}
|
|
24888
|
+
return value;
|
|
24889
|
+
};
|
|
24890
|
+
const expandValue = (value) => {
|
|
24891
|
+
if (typeof value === "string") return expand(value);
|
|
24892
|
+
if (Array.isArray(value)) return value.map(expandValue);
|
|
24893
|
+
if (typeof value === "object" && !(value instanceof Date) && !Buffer.isBuffer(value)) {
|
|
24894
|
+
return Object.fromEntries(
|
|
24895
|
+
Object.entries(value).map(([key, value2]) => [key, expandValue(value2)])
|
|
24896
|
+
);
|
|
24897
|
+
}
|
|
24898
|
+
return value;
|
|
24899
|
+
};
|
|
24900
|
+
const infoPlistFile = settings.INFOPLIST_FILE ? import_node_path14.default.resolve(projectDir, expand(settings.INFOPLIST_FILE)) : null;
|
|
24901
|
+
const sourceInfo = infoPlistFile ? import_plist3.default.parse(import_node_fs14.default.readFileSync(infoPlistFile, "utf8")) : {};
|
|
24902
|
+
if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
|
|
24903
|
+
throw new Error(`${name2} Info.plist must contain a dictionary`);
|
|
24904
|
+
}
|
|
24905
|
+
const info = {};
|
|
24906
|
+
for (const [key, value] of Object.entries(sourceInfo)) info[key] = expandValue(value);
|
|
24907
|
+
for (const [key, value] of Object.entries(settings)) {
|
|
24908
|
+
if (!key.startsWith("INFOPLIST_KEY_") || key.endsWith("_Generation")) continue;
|
|
24909
|
+
info[key.slice("INFOPLIST_KEY_".length)] = value === "YES" ? true : value === "NO" ? false : expand(value);
|
|
24910
|
+
}
|
|
24911
|
+
if (settings.INFOPLIST_KEY_UIApplicationSceneManifest_Generation === "YES" && info.UIApplicationSceneManifest === void 0) {
|
|
24912
|
+
info.UIApplicationSceneManifest = {
|
|
24913
|
+
UIApplicationSupportsMultipleScenes: true,
|
|
24914
|
+
UISceneConfigurations: {}
|
|
24915
|
+
};
|
|
24916
|
+
}
|
|
24824
24917
|
const sources = /* @__PURE__ */ new Set();
|
|
24825
24918
|
const resources = /* @__PURE__ */ new Set();
|
|
24826
24919
|
const addResource = (file) => {
|
|
@@ -24924,7 +25017,10 @@ function readXcodeAppTarget(xcodeproj, targetName) {
|
|
|
24924
25017
|
if (!dependency || !product) continue;
|
|
24925
25018
|
const reference = object(str(dependency.package));
|
|
24926
25019
|
if (reference?.isa === "XCRemoteSwiftPackageReference") {
|
|
24927
|
-
remoteProducts.push({
|
|
25020
|
+
remoteProducts.push({
|
|
25021
|
+
product,
|
|
25022
|
+
repositoryURL: str(reference.repositoryURL) ?? ""
|
|
25023
|
+
});
|
|
24928
25024
|
} else if (reference?.isa === "XCLocalSwiftPackageReference") {
|
|
24929
25025
|
localPackages.add(import_node_path14.default.resolve(projectDir, str(reference.relativePath) ?? ""));
|
|
24930
25026
|
} else if (localProducts.has(product)) {
|
|
@@ -24965,6 +25061,8 @@ function readXcodeAppTarget(xcodeproj, targetName) {
|
|
|
24965
25061
|
moduleName,
|
|
24966
25062
|
sources: [...sources].sort(),
|
|
24967
25063
|
resources: [...resources].sort(),
|
|
25064
|
+
infoPlist: import_plist3.default.build(info),
|
|
25065
|
+
infoPlistFile,
|
|
24968
25066
|
languageMode: swiftVersion >= 6 ? 6 : 5,
|
|
24969
25067
|
mainActorIsolation: settings.SWIFT_DEFAULT_ACTOR_ISOLATION === "MainActor",
|
|
24970
25068
|
localPackages: [...localPackages].sort(),
|
|
@@ -24974,12 +25072,13 @@ function readXcodeAppTarget(xcodeproj, targetName) {
|
|
|
24974
25072
|
appTargets: appTargetNames
|
|
24975
25073
|
};
|
|
24976
25074
|
}
|
|
24977
|
-
var import_node_fs14, import_node_path14, isDict, str, list, APPLICATION, NEVER_MEMBER, BUNDLE_DIR, parsed;
|
|
25075
|
+
var import_node_fs14, import_node_path14, import_plist3, isDict, str, list, APPLICATION, NEVER_MEMBER, BUNDLE_DIR, parsed;
|
|
24978
25076
|
var init_xcode_project = __esm({
|
|
24979
25077
|
"src/xcode-project.ts"() {
|
|
24980
25078
|
"use strict";
|
|
24981
25079
|
import_node_fs14 = __toESM(require("node:fs"), 1);
|
|
24982
25080
|
import_node_path14 = __toESM(require("node:path"), 1);
|
|
25081
|
+
import_plist3 = __toESM(require_plist(), 1);
|
|
24983
25082
|
init_swift_package();
|
|
24984
25083
|
isDict = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24985
25084
|
str = (value) => typeof value === "string" ? value : void 0;
|
|
@@ -25061,6 +25160,7 @@ function xcodeLayout(root) {
|
|
|
25061
25160
|
if (!registered) return null;
|
|
25062
25161
|
const app = readXcodeAppTarget(registered.xcodeproj, registered.target);
|
|
25063
25162
|
const files = /* @__PURE__ */ new Set([app.pbxproj, ...app.sources, ...app.resources]);
|
|
25163
|
+
if (app.infoPlistFile) files.add(app.infoPlistFile);
|
|
25064
25164
|
const targets = [];
|
|
25065
25165
|
for (const dir of app.localPackages) {
|
|
25066
25166
|
const manifest = import_node_path15.default.join(dir, "Package.swift");
|
|
@@ -25088,7 +25188,12 @@ function xcodeLayout(root) {
|
|
|
25088
25188
|
});
|
|
25089
25189
|
for (const file of target.files) files.add(file);
|
|
25090
25190
|
}
|
|
25091
|
-
return {
|
|
25191
|
+
return {
|
|
25192
|
+
app,
|
|
25193
|
+
targets,
|
|
25194
|
+
unavailable: remote.unavailable,
|
|
25195
|
+
files: [...files].sort()
|
|
25196
|
+
};
|
|
25092
25197
|
}
|
|
25093
25198
|
function xcodeManifest(layout) {
|
|
25094
25199
|
const settings = (mode, mainActor) => `swiftSettings: [.swiftLanguageMode(.v${mode})${mainActor ? ", .defaultIsolation(MainActor.self)" : ""}]`;
|
|
@@ -25248,6 +25353,18 @@ function buildSwiftBundleFiles(packagePath, hosted) {
|
|
|
25248
25353
|
const files = {};
|
|
25249
25354
|
const watched = [];
|
|
25250
25355
|
let total = 0;
|
|
25356
|
+
const xcode = xcodeLayout(packagePath);
|
|
25357
|
+
if (xcode) {
|
|
25358
|
+
const bytes = Buffer.from(xcode.app.infoPlist);
|
|
25359
|
+
if (bytes.length > limits.resourceBytes || bytes.length > limits.resourceTotalBytes)
|
|
25360
|
+
throw new Error("swift launch Info.plist exceeds bundle resource limits");
|
|
25361
|
+
files["Info.plist"] = bytes.toString("base64");
|
|
25362
|
+
total += bytes.length;
|
|
25363
|
+
if (xcode.app.infoPlistFile)
|
|
25364
|
+
watched.push(
|
|
25365
|
+
import_node_path15.default.relative(packagePath, xcode.app.infoPlistFile).split(import_node_path15.default.sep).join("/")
|
|
25366
|
+
);
|
|
25367
|
+
}
|
|
25251
25368
|
for (const { base, file } of enumerateBundleJson(relative3)) {
|
|
25252
25369
|
watched.push(file);
|
|
25253
25370
|
const disk = import_node_path15.default.join(packagePath, ...file.split("/"));
|
|
@@ -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,6 +41,7 @@ __export(swift_compile_exports, {
|
|
|
41
41
|
missingSwiftModules: () => missingSwiftModules,
|
|
42
42
|
objcExtensionMemberIndex: () => objcExtensionMemberIndex,
|
|
43
43
|
prepareSwiftDependency: () => prepareSwiftDependency,
|
|
44
|
+
swiftApplicationEntry: () => swiftApplicationEntry,
|
|
44
45
|
swiftArtifactHash: () => swiftArtifactHash,
|
|
45
46
|
swiftAvailableModules: () => swiftAvailableModules,
|
|
46
47
|
swiftDistributionAt: () => swiftDistributionAt,
|
|
@@ -305,7 +306,10 @@ function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
|
305
306
|
var run2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
|
|
306
307
|
var WASM_TRIPLE = "wasm32-unknown-wasip1";
|
|
307
308
|
var cores = import_node_os.default.availableParallelism();
|
|
308
|
-
var BUILD_ENV = {
|
|
309
|
+
var BUILD_ENV = {
|
|
310
|
+
...process.env,
|
|
311
|
+
BINARYEN_CORES: String(Math.min(4, cores))
|
|
312
|
+
};
|
|
309
313
|
var BUILD_JOBS = String(Math.max(1, Math.floor(cores / 2)));
|
|
310
314
|
function swiftDistributionAt(root) {
|
|
311
315
|
const file = import_node_path2.default.join(root, SWIFT_DISTRIBUTION_MANIFEST);
|
|
@@ -330,7 +334,9 @@ function swiftModuleInputFiles(root) {
|
|
|
330
334
|
"toolchain.json"
|
|
331
335
|
];
|
|
332
336
|
const walk = (dir) => {
|
|
333
|
-
for (const entry of (0, import_node_fs2.readdirSync)(import_node_path2.default.join(root, dir), {
|
|
337
|
+
for (const entry of (0, import_node_fs2.readdirSync)(import_node_path2.default.join(root, dir), {
|
|
338
|
+
withFileTypes: true
|
|
339
|
+
})) {
|
|
334
340
|
const relative = `${dir}/${entry.name}`;
|
|
335
341
|
if (entry.isDirectory()) walk(relative);
|
|
336
342
|
else if (/\.(swift|c|cpp|h)$/.test(entry.name)) files.push(relative);
|
|
@@ -1163,9 +1169,14 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
|
|
|
1163
1169
|
const reusableBodies = [];
|
|
1164
1170
|
let depth = 0;
|
|
1165
1171
|
let opensReusableBody = false;
|
|
1172
|
+
const sceneLifecycleBodies = /* @__PURE__ */ new Set();
|
|
1166
1173
|
for (const at of tokens) {
|
|
1167
1174
|
const rest = conditioned.slice(at, at + 400);
|
|
1168
1175
|
if (rest.startsWith("{")) {
|
|
1176
|
+
if (sceneLifecycleBodies.has(at)) {
|
|
1177
|
+
out += conditioned.slice(copied, at + 1) + " public var _peachUsesSceneLifecycle: Bool { true };";
|
|
1178
|
+
copied = at + 1;
|
|
1179
|
+
}
|
|
1169
1180
|
depth++;
|
|
1170
1181
|
if (opensReusableBody) reusableBodies.push(depth);
|
|
1171
1182
|
opensReusableBody = false;
|
|
@@ -1201,12 +1212,33 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
|
|
|
1201
1212
|
opensReusableBody = true;
|
|
1202
1213
|
}
|
|
1203
1214
|
const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
|
|
1215
|
+
const delegateClass = DELEGATE_CLASS.exec(rest);
|
|
1216
|
+
if (delegateClass && /\bUIApplicationDelegate\b/.test(delegateClass[0])) {
|
|
1217
|
+
const body = at + delegateClass[0].lastIndexOf("{");
|
|
1218
|
+
let bodyDepth = 0;
|
|
1219
|
+
for (const token of tokens) {
|
|
1220
|
+
if (token < body) continue;
|
|
1221
|
+
if (conditioned[token] === "{") bodyDepth++;
|
|
1222
|
+
else if (conditioned[token] === "}" && --bodyDepth === 0) break;
|
|
1223
|
+
else if (bodyDepth === 1 && /^func\s+application\s*\([^{}]*\bconfigurationForConnecting\s+/.test(
|
|
1224
|
+
conditioned.slice(token, token + 600)
|
|
1225
|
+
)) {
|
|
1226
|
+
sceneLifecycleBodies.add(body);
|
|
1227
|
+
break;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1204
1231
|
if (DELEGATE_CLASS.test(rest) && !/\b(?:final|open)\b/.test(modifiers)) {
|
|
1205
1232
|
out += `${conditioned.slice(copied, at)}final `;
|
|
1206
1233
|
copied = at;
|
|
1207
1234
|
}
|
|
1208
1235
|
continue;
|
|
1209
1236
|
}
|
|
1237
|
+
if (/^@UIApplicationMain\b/.test(rest)) {
|
|
1238
|
+
out += conditioned.slice(copied, at) + "@main".padEnd("@UIApplicationMain".length);
|
|
1239
|
+
copied = at + "@UIApplicationMain".length;
|
|
1240
|
+
continue;
|
|
1241
|
+
}
|
|
1210
1242
|
const selector = SELECTOR.exec(rest);
|
|
1211
1243
|
const match = selector ?? OBJC_ATTRIBUTE.exec(rest);
|
|
1212
1244
|
if (!match) continue;
|
|
@@ -1223,6 +1255,19 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
|
|
|
1223
1255
|
}
|
|
1224
1256
|
return lowerAnyObjectDoubleValue(out + conditioned.slice(copied));
|
|
1225
1257
|
}
|
|
1258
|
+
function swiftApplicationEntry(file, source) {
|
|
1259
|
+
const { tokens } = swiftCodeScan(source);
|
|
1260
|
+
let depth = 0;
|
|
1261
|
+
for (const at of tokens) {
|
|
1262
|
+
if (source[at] === "{") depth++;
|
|
1263
|
+
else if (source[at] === "}") depth--;
|
|
1264
|
+
else if (depth === 0 && /^@(?:main|UIApplicationMain)\b/.test(source.slice(at)))
|
|
1265
|
+
return true;
|
|
1266
|
+
else if (depth === 0 && import_node_path2.default.basename(file) === "main.swift" && /^UIApplicationMain\s*\(/.test(source.slice(at)))
|
|
1267
|
+
return true;
|
|
1268
|
+
}
|
|
1269
|
+
return false;
|
|
1270
|
+
}
|
|
1226
1271
|
function swiftCodeScan(source) {
|
|
1227
1272
|
const starts = /* @__PURE__ */ new Set();
|
|
1228
1273
|
const tokens = [];
|
|
@@ -1305,7 +1350,7 @@ function swiftCodeScan(source) {
|
|
|
1305
1350
|
else top.parens--;
|
|
1306
1351
|
i++;
|
|
1307
1352
|
} else {
|
|
1308
|
-
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;
|
|
1353
|
+
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;
|
|
1309
1354
|
if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
|
|
1310
1355
|
tokens.push(i);
|
|
1311
1356
|
i += keyword.length;
|
|
@@ -1564,10 +1609,16 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
1564
1609
|
plugin
|
|
1565
1610
|
])
|
|
1566
1611
|
],
|
|
1567
|
-
{
|
|
1612
|
+
{
|
|
1613
|
+
env: BUILD_ENV,
|
|
1614
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
1615
|
+
timeout: options.timeoutMs
|
|
1616
|
+
}
|
|
1568
1617
|
);
|
|
1569
1618
|
} catch (error) {
|
|
1570
|
-
throw new Error(projectDiagnostic(outputOf(error), layout), {
|
|
1619
|
+
throw new Error(projectDiagnostic(outputOf(error), layout), {
|
|
1620
|
+
cause: error
|
|
1621
|
+
});
|
|
1571
1622
|
}
|
|
1572
1623
|
return {
|
|
1573
1624
|
hash,
|
|
@@ -1587,6 +1638,7 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
1587
1638
|
missingSwiftModules,
|
|
1588
1639
|
objcExtensionMemberIndex,
|
|
1589
1640
|
prepareSwiftDependency,
|
|
1641
|
+
swiftApplicationEntry,
|
|
1590
1642
|
swiftArtifactHash,
|
|
1591
1643
|
swiftAvailableModules,
|
|
1592
1644
|
swiftDistributionAt,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.746 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/swift-compile.ts
|
|
4
4
|
import { execFile as execFile2, execFileSync } from "node:child_process";
|
|
@@ -259,7 +259,10 @@ function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
|
259
259
|
var run2 = promisify2(execFile2);
|
|
260
260
|
var WASM_TRIPLE = "wasm32-unknown-wasip1";
|
|
261
261
|
var cores = os.availableParallelism();
|
|
262
|
-
var BUILD_ENV = {
|
|
262
|
+
var BUILD_ENV = {
|
|
263
|
+
...process.env,
|
|
264
|
+
BINARYEN_CORES: String(Math.min(4, cores))
|
|
265
|
+
};
|
|
263
266
|
var BUILD_JOBS = String(Math.max(1, Math.floor(cores / 2)));
|
|
264
267
|
function swiftDistributionAt(root) {
|
|
265
268
|
const file = path2.join(root, SWIFT_DISTRIBUTION_MANIFEST);
|
|
@@ -284,7 +287,9 @@ function swiftModuleInputFiles(root) {
|
|
|
284
287
|
"toolchain.json"
|
|
285
288
|
];
|
|
286
289
|
const walk = (dir) => {
|
|
287
|
-
for (const entry of readdirSync(path2.join(root, dir), {
|
|
290
|
+
for (const entry of readdirSync(path2.join(root, dir), {
|
|
291
|
+
withFileTypes: true
|
|
292
|
+
})) {
|
|
288
293
|
const relative = `${dir}/${entry.name}`;
|
|
289
294
|
if (entry.isDirectory()) walk(relative);
|
|
290
295
|
else if (/\.(swift|c|cpp|h)$/.test(entry.name)) files.push(relative);
|
|
@@ -1117,9 +1122,14 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
|
|
|
1117
1122
|
const reusableBodies = [];
|
|
1118
1123
|
let depth = 0;
|
|
1119
1124
|
let opensReusableBody = false;
|
|
1125
|
+
const sceneLifecycleBodies = /* @__PURE__ */ new Set();
|
|
1120
1126
|
for (const at of tokens) {
|
|
1121
1127
|
const rest = conditioned.slice(at, at + 400);
|
|
1122
1128
|
if (rest.startsWith("{")) {
|
|
1129
|
+
if (sceneLifecycleBodies.has(at)) {
|
|
1130
|
+
out += conditioned.slice(copied, at + 1) + " public var _peachUsesSceneLifecycle: Bool { true };";
|
|
1131
|
+
copied = at + 1;
|
|
1132
|
+
}
|
|
1123
1133
|
depth++;
|
|
1124
1134
|
if (opensReusableBody) reusableBodies.push(depth);
|
|
1125
1135
|
opensReusableBody = false;
|
|
@@ -1155,12 +1165,33 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
|
|
|
1155
1165
|
opensReusableBody = true;
|
|
1156
1166
|
}
|
|
1157
1167
|
const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
|
|
1168
|
+
const delegateClass = DELEGATE_CLASS.exec(rest);
|
|
1169
|
+
if (delegateClass && /\bUIApplicationDelegate\b/.test(delegateClass[0])) {
|
|
1170
|
+
const body = at + delegateClass[0].lastIndexOf("{");
|
|
1171
|
+
let bodyDepth = 0;
|
|
1172
|
+
for (const token of tokens) {
|
|
1173
|
+
if (token < body) continue;
|
|
1174
|
+
if (conditioned[token] === "{") bodyDepth++;
|
|
1175
|
+
else if (conditioned[token] === "}" && --bodyDepth === 0) break;
|
|
1176
|
+
else if (bodyDepth === 1 && /^func\s+application\s*\([^{}]*\bconfigurationForConnecting\s+/.test(
|
|
1177
|
+
conditioned.slice(token, token + 600)
|
|
1178
|
+
)) {
|
|
1179
|
+
sceneLifecycleBodies.add(body);
|
|
1180
|
+
break;
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1158
1184
|
if (DELEGATE_CLASS.test(rest) && !/\b(?:final|open)\b/.test(modifiers)) {
|
|
1159
1185
|
out += `${conditioned.slice(copied, at)}final `;
|
|
1160
1186
|
copied = at;
|
|
1161
1187
|
}
|
|
1162
1188
|
continue;
|
|
1163
1189
|
}
|
|
1190
|
+
if (/^@UIApplicationMain\b/.test(rest)) {
|
|
1191
|
+
out += conditioned.slice(copied, at) + "@main".padEnd("@UIApplicationMain".length);
|
|
1192
|
+
copied = at + "@UIApplicationMain".length;
|
|
1193
|
+
continue;
|
|
1194
|
+
}
|
|
1164
1195
|
const selector = SELECTOR.exec(rest);
|
|
1165
1196
|
const match = selector ?? OBJC_ATTRIBUTE.exec(rest);
|
|
1166
1197
|
if (!match) continue;
|
|
@@ -1177,6 +1208,19 @@ function swiftSourceAsIOS(original, extraObjCExtensions) {
|
|
|
1177
1208
|
}
|
|
1178
1209
|
return lowerAnyObjectDoubleValue(out + conditioned.slice(copied));
|
|
1179
1210
|
}
|
|
1211
|
+
function swiftApplicationEntry(file, source) {
|
|
1212
|
+
const { tokens } = swiftCodeScan(source);
|
|
1213
|
+
let depth = 0;
|
|
1214
|
+
for (const at of tokens) {
|
|
1215
|
+
if (source[at] === "{") depth++;
|
|
1216
|
+
else if (source[at] === "}") depth--;
|
|
1217
|
+
else if (depth === 0 && /^@(?:main|UIApplicationMain)\b/.test(source.slice(at)))
|
|
1218
|
+
return true;
|
|
1219
|
+
else if (depth === 0 && path2.basename(file) === "main.swift" && /^UIApplicationMain\s*\(/.test(source.slice(at)))
|
|
1220
|
+
return true;
|
|
1221
|
+
}
|
|
1222
|
+
return false;
|
|
1223
|
+
}
|
|
1180
1224
|
function swiftCodeScan(source) {
|
|
1181
1225
|
const starts = /* @__PURE__ */ new Set();
|
|
1182
1226
|
const tokens = [];
|
|
@@ -1259,7 +1303,7 @@ function swiftCodeScan(source) {
|
|
|
1259
1303
|
else top.parens--;
|
|
1260
1304
|
i++;
|
|
1261
1305
|
} else {
|
|
1262
|
-
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;
|
|
1306
|
+
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;
|
|
1263
1307
|
if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
|
|
1264
1308
|
tokens.push(i);
|
|
1265
1309
|
i += keyword.length;
|
|
@@ -1518,10 +1562,16 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
1518
1562
|
plugin
|
|
1519
1563
|
])
|
|
1520
1564
|
],
|
|
1521
|
-
{
|
|
1565
|
+
{
|
|
1566
|
+
env: BUILD_ENV,
|
|
1567
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
1568
|
+
timeout: options.timeoutMs
|
|
1569
|
+
}
|
|
1522
1570
|
);
|
|
1523
1571
|
} catch (error) {
|
|
1524
|
-
throw new Error(projectDiagnostic(outputOf(error), layout), {
|
|
1572
|
+
throw new Error(projectDiagnostic(outputOf(error), layout), {
|
|
1573
|
+
cause: error
|
|
1574
|
+
});
|
|
1525
1575
|
}
|
|
1526
1576
|
return {
|
|
1527
1577
|
hash,
|
|
@@ -1540,6 +1590,7 @@ export {
|
|
|
1540
1590
|
missingSwiftModules,
|
|
1541
1591
|
objcExtensionMemberIndex,
|
|
1542
1592
|
prepareSwiftDependency,
|
|
1593
|
+
swiftApplicationEntry,
|
|
1543
1594
|
swiftArtifactHash,
|
|
1544
1595
|
swiftAvailableModules,
|
|
1545
1596
|
swiftDistributionAt,
|
|
@@ -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 __defProp = Object.defineProperty;
|
|
@@ -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 __defProp = Object.defineProperty;
|
|
@@ -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;
|
package/dist-lib/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 __defProp = Object.defineProperty;
|