peachsim 0.1.715 → 0.1.716
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/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 +63 -21
- 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 +64 -21
- package/dist-lib/swift-compile.cjs +56 -21
- package/dist-lib/swift-compile.mjs +56 -21
- package/dist-lib/swift-package.cjs +27 -5
- package/dist-lib/swift-package.mjs +26 -5
- 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 +63 -21
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/swift-compile.ts +43 -20
- package/src/swift-host.ts +9 -0
- package/src/swift-package.ts +42 -5
- package/src/swift-submit.ts +4 -0
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.716 | (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;
|
|
@@ -21360,7 +21360,15 @@ var init_swift_icu = __esm({
|
|
|
21360
21360
|
});
|
|
21361
21361
|
|
|
21362
21362
|
// src/swift-package.ts
|
|
21363
|
-
function
|
|
21363
|
+
function swiftImplicitResourcePaths(paths) {
|
|
21364
|
+
return paths.filter(
|
|
21365
|
+
(file) => !file.endsWith(".swift") && (/\.(xcassets|xcstrings|nib|xib|storyboard|xcdatamodeld|xcdatamodel|xcmappingmodel|metal|xcprivacy)(?:\/|$)/.test(
|
|
21366
|
+
file
|
|
21367
|
+
) || /(?:^|\/)[^/]+\.lproj\/[^/]+$/.test(file))
|
|
21368
|
+
).sort();
|
|
21369
|
+
}
|
|
21370
|
+
function swiftManifestTargets(manifest, resourcePaths = []) {
|
|
21371
|
+
const implicitResources = swiftImplicitResourcePaths(resourcePaths);
|
|
21364
21372
|
const code = manifest.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "");
|
|
21365
21373
|
const targets = [];
|
|
21366
21374
|
const pattern = /\.(executableTarget|target)\s*\(/g;
|
|
@@ -21403,7 +21411,19 @@ function swiftManifestTargets(manifest) {
|
|
|
21403
21411
|
/\.swiftLanguageMode\(\s*\.v(\d+)\s*\)/.exec(call)?.[1] ?? "5"
|
|
21404
21412
|
);
|
|
21405
21413
|
const mainActorIsolation = /\.defaultIsolation\(\s*MainActor\.self\s*\)/.test(call);
|
|
21406
|
-
const
|
|
21414
|
+
const excluded = [
|
|
21415
|
+
...(/\bexclude\s*:\s*\[([^\]]*)\]/.exec(flat)?.[1] ?? "").matchAll(/"([^"]+)"/g)
|
|
21416
|
+
].map((match2) => match2[1].replace(/^\.\//, "").replace(/\/+$/, ""));
|
|
21417
|
+
const prefix = targetPath === "." ? "" : `${targetPath}/`;
|
|
21418
|
+
const resources = /\bresources\s*:/.test(flat) || implicitResources.some((file) => {
|
|
21419
|
+
if (!file.startsWith(prefix)) return false;
|
|
21420
|
+
const relative2 = file.slice(prefix.length);
|
|
21421
|
+
if (excluded.some(
|
|
21422
|
+
(exclude) => relative2 === exclude || relative2.startsWith(`${exclude}/`)
|
|
21423
|
+
))
|
|
21424
|
+
return false;
|
|
21425
|
+
return true;
|
|
21426
|
+
});
|
|
21407
21427
|
targets.push({
|
|
21408
21428
|
name: name2,
|
|
21409
21429
|
path: targetPath,
|
|
@@ -21415,8 +21435,8 @@ function swiftManifestTargets(manifest) {
|
|
|
21415
21435
|
}
|
|
21416
21436
|
return targets;
|
|
21417
21437
|
}
|
|
21418
|
-
function swiftPackagePartition(manifest) {
|
|
21419
|
-
const targets = swiftManifestTargets(manifest);
|
|
21438
|
+
function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
21439
|
+
const targets = swiftManifestTargets(manifest, resourcePaths);
|
|
21420
21440
|
return targets.length === 1 && targets[0].executable && targets[0].path === "." ? [] : targets;
|
|
21421
21441
|
}
|
|
21422
21442
|
var init_swift_package = __esm({
|
|
@@ -21513,7 +21533,7 @@ function swiftModuleDigest(root) {
|
|
|
21513
21533
|
}
|
|
21514
21534
|
function compileTargets(input) {
|
|
21515
21535
|
const manifest = input.files["Package.swift"];
|
|
21516
|
-
return manifest === void 0 ? [] : swiftPackagePartition(manifest);
|
|
21536
|
+
return manifest === void 0 ? [] : swiftPackagePartition(manifest, input.resourcePaths);
|
|
21517
21537
|
}
|
|
21518
21538
|
function withNativeSourceGlue(input, glue) {
|
|
21519
21539
|
const targets = compileTargets(input);
|
|
@@ -21554,7 +21574,7 @@ function swiftTargetDependencies(files, targets) {
|
|
|
21554
21574
|
}
|
|
21555
21575
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
21556
21576
|
const hash = (0, import_node_crypto3.createHash)("sha256");
|
|
21557
|
-
hash.update(`swift-compile/
|
|
21577
|
+
hash.update(`swift-compile/v13
|
|
21558
21578
|
${release}
|
|
21559
21579
|
`);
|
|
21560
21580
|
if (input.oneModule) hash.update("one-module\n");
|
|
@@ -21576,6 +21596,10 @@ ${release}
|
|
|
21576
21596
|
hash.update((0, import_node_crypto3.createHash)("sha256").update(image.file).digest());
|
|
21577
21597
|
hash.update((0, import_node_crypto3.createHash)("sha256").update(image.data).digest());
|
|
21578
21598
|
}
|
|
21599
|
+
for (const file of [...new Set(input.resourcePaths ?? [])].sort()) {
|
|
21600
|
+
hash.update("resource-path\n");
|
|
21601
|
+
hash.update((0, import_node_crypto3.createHash)("sha256").update(file).digest());
|
|
21602
|
+
}
|
|
21579
21603
|
const targets = compileTargets(input);
|
|
21580
21604
|
if (targets.length > 0) {
|
|
21581
21605
|
hash.update(`swift-multi/v${MULTI_MANIFEST_VERSION}
|
|
@@ -22006,6 +22030,10 @@ function swiftCodeScan(source) {
|
|
|
22006
22030
|
return { lineStarts: starts, tokens };
|
|
22007
22031
|
}
|
|
22008
22032
|
function writeSwiftProject(layout, input, moduleRoot) {
|
|
22033
|
+
const resourceTargets = swiftManifestTargets(
|
|
22034
|
+
input.files["Package.swift"] ?? "",
|
|
22035
|
+
input.resourcePaths
|
|
22036
|
+
);
|
|
22009
22037
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
22010
22038
|
const targets = distribution && compileTargets(input).length === 0 ? [
|
|
22011
22039
|
{
|
|
@@ -22024,8 +22052,14 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
22024
22052
|
if (!distribution) {
|
|
22025
22053
|
modulePlan.update((0, import_node_fs7.readFileSync)(import_node_path7.default.join(moduleRoot, "Package.swift")));
|
|
22026
22054
|
}
|
|
22055
|
+
const resourcePlan = (0, import_node_crypto3.createHash)("sha256").update(
|
|
22056
|
+
JSON.stringify(
|
|
22057
|
+
resourceTargets.filter((target) => target.resources).map((target) => [target.name, target.path])
|
|
22058
|
+
)
|
|
22059
|
+
).digest("hex").slice(0, 16);
|
|
22027
22060
|
const moduleFiles = `
|
|
22028
22061
|
// sootsim-swift files ${modulePlan.digest("hex").slice(0, 16)}
|
|
22062
|
+
// resource accessors ${resourcePlan}
|
|
22029
22063
|
`;
|
|
22030
22064
|
if (targets.length === 0) {
|
|
22031
22065
|
for (const [file, contents] of Object.entries(input.files)) {
|
|
@@ -22078,20 +22112,6 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
22078
22112
|
if (file === "Package.swift") continue;
|
|
22079
22113
|
files.set(import_node_path7.default.join(base, file), compiledSource(file, contents));
|
|
22080
22114
|
}
|
|
22081
|
-
for (const target of targets) {
|
|
22082
|
-
if (!target.resources) continue;
|
|
22083
|
-
files.set(
|
|
22084
|
-
import_node_path7.default.join(layout.root, target.path, "ResourceBundleAccessor.generated.swift"),
|
|
22085
|
-
[
|
|
22086
|
-
"import Foundation",
|
|
22087
|
-
"",
|
|
22088
|
-
"extension Foundation.Bundle {",
|
|
22089
|
-
" static let module: Bundle = Bundle.main",
|
|
22090
|
-
"}",
|
|
22091
|
-
""
|
|
22092
|
-
].join("\n")
|
|
22093
|
-
);
|
|
22094
|
-
}
|
|
22095
22115
|
files.set(
|
|
22096
22116
|
import_node_path7.default.join(layout.root, "Package.swift"),
|
|
22097
22117
|
emitSwiftPackageManifest({
|
|
@@ -22107,6 +22127,21 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
22107
22127
|
}) + moduleFiles
|
|
22108
22128
|
);
|
|
22109
22129
|
}
|
|
22130
|
+
for (const target of resourceTargets) {
|
|
22131
|
+
if (!target.resources) continue;
|
|
22132
|
+
const directory = layout.multi ? import_node_path7.default.join(layout.root, target.path) : layout.sources;
|
|
22133
|
+
files.set(
|
|
22134
|
+
import_node_path7.default.join(directory, "ResourceBundleAccessor.generated.swift"),
|
|
22135
|
+
[
|
|
22136
|
+
"import Foundation",
|
|
22137
|
+
"",
|
|
22138
|
+
"extension Foundation.Bundle {",
|
|
22139
|
+
" static let module: Bundle = Bundle.main",
|
|
22140
|
+
"}",
|
|
22141
|
+
""
|
|
22142
|
+
].join("\n")
|
|
22143
|
+
);
|
|
22144
|
+
}
|
|
22110
22145
|
syncSwiftTree(layout.root, files);
|
|
22111
22146
|
}
|
|
22112
22147
|
function streamText(value) {
|
|
@@ -23832,6 +23867,11 @@ function packageSnapshot(project) {
|
|
|
23832
23867
|
const native = nativeSourceDescriptor(project.packagePath);
|
|
23833
23868
|
return {
|
|
23834
23869
|
files,
|
|
23870
|
+
resourcePaths: swiftImplicitResourcePaths(
|
|
23871
|
+
resourceCandidateFiles(project.packagePath).map(
|
|
23872
|
+
(file) => import_node_path13.default.relative(project.packagePath, file).split(import_node_path13.default.sep).join(import_node_path13.default.posix.sep)
|
|
23873
|
+
)
|
|
23874
|
+
),
|
|
23835
23875
|
resources: buildSwiftResourceTable(project, ""),
|
|
23836
23876
|
bundleFiles: buildSwiftBundleFiles(project.packagePath),
|
|
23837
23877
|
native,
|
|
@@ -23847,6 +23887,7 @@ function packageSnapshot(project) {
|
|
|
23847
23887
|
function snapshotCompileInput(snapshot, entry) {
|
|
23848
23888
|
const input = {
|
|
23849
23889
|
files: snapshot.files,
|
|
23890
|
+
resourcePaths: snapshot.resourcePaths,
|
|
23850
23891
|
resources: snapshot.bundleFiles.files,
|
|
23851
23892
|
images: snapshot.resources.images,
|
|
23852
23893
|
entry,
|
|
@@ -23922,6 +23963,7 @@ async function compileRemote(packagePath, entry, snapshot, hosted) {
|
|
|
23922
23963
|
submit,
|
|
23923
23964
|
{
|
|
23924
23965
|
files: snapshot.files,
|
|
23966
|
+
resourcePaths: snapshot.resourcePaths,
|
|
23925
23967
|
resources: snapshot.bundleFiles.files,
|
|
23926
23968
|
images: snapshot.resources.images,
|
|
23927
23969
|
entry,
|
|
@@ -24062,6 +24104,7 @@ var init_swift_host = __esm({
|
|
|
24062
24104
|
init_backend_origin();
|
|
24063
24105
|
init_swift_compile();
|
|
24064
24106
|
init_swift_distribution();
|
|
24107
|
+
init_swift_package();
|
|
24065
24108
|
init_swift_submit();
|
|
24066
24109
|
ARTIFACT_PATH = "/__peach/swift/";
|
|
24067
24110
|
RESOURCE_PATH = "/__peach/swift-res/";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.716 | (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;
|
|
@@ -192,7 +192,15 @@ function icuSegment(object) {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
// src/swift-package.ts
|
|
195
|
-
function
|
|
195
|
+
function swiftImplicitResourcePaths(paths) {
|
|
196
|
+
return paths.filter(
|
|
197
|
+
(file) => !file.endsWith(".swift") && (/\.(xcassets|xcstrings|nib|xib|storyboard|xcdatamodeld|xcdatamodel|xcmappingmodel|metal|xcprivacy)(?:\/|$)/.test(
|
|
198
|
+
file
|
|
199
|
+
) || /(?:^|\/)[^/]+\.lproj\/[^/]+$/.test(file))
|
|
200
|
+
).sort();
|
|
201
|
+
}
|
|
202
|
+
function swiftManifestTargets(manifest, resourcePaths = []) {
|
|
203
|
+
const implicitResources = swiftImplicitResourcePaths(resourcePaths);
|
|
196
204
|
const code = manifest.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "");
|
|
197
205
|
const targets = [];
|
|
198
206
|
const pattern = /\.(executableTarget|target)\s*\(/g;
|
|
@@ -235,7 +243,19 @@ function swiftManifestTargets(manifest) {
|
|
|
235
243
|
/\.swiftLanguageMode\(\s*\.v(\d+)\s*\)/.exec(call)?.[1] ?? "5"
|
|
236
244
|
);
|
|
237
245
|
const mainActorIsolation = /\.defaultIsolation\(\s*MainActor\.self\s*\)/.test(call);
|
|
238
|
-
const
|
|
246
|
+
const excluded = [
|
|
247
|
+
...(/\bexclude\s*:\s*\[([^\]]*)\]/.exec(flat)?.[1] ?? "").matchAll(/"([^"]+)"/g)
|
|
248
|
+
].map((match2) => match2[1].replace(/^\.\//, "").replace(/\/+$/, ""));
|
|
249
|
+
const prefix = targetPath === "." ? "" : `${targetPath}/`;
|
|
250
|
+
const resources = /\bresources\s*:/.test(flat) || implicitResources.some((file) => {
|
|
251
|
+
if (!file.startsWith(prefix)) return false;
|
|
252
|
+
const relative = file.slice(prefix.length);
|
|
253
|
+
if (excluded.some(
|
|
254
|
+
(exclude) => relative === exclude || relative.startsWith(`${exclude}/`)
|
|
255
|
+
))
|
|
256
|
+
return false;
|
|
257
|
+
return true;
|
|
258
|
+
});
|
|
239
259
|
targets.push({
|
|
240
260
|
name,
|
|
241
261
|
path: targetPath,
|
|
@@ -247,8 +267,8 @@ function swiftManifestTargets(manifest) {
|
|
|
247
267
|
}
|
|
248
268
|
return targets;
|
|
249
269
|
}
|
|
250
|
-
function swiftPackagePartition(manifest) {
|
|
251
|
-
const targets = swiftManifestTargets(manifest);
|
|
270
|
+
function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
271
|
+
const targets = swiftManifestTargets(manifest, resourcePaths);
|
|
252
272
|
return targets.length === 1 && targets[0].executable && targets[0].path === "." ? [] : targets;
|
|
253
273
|
}
|
|
254
274
|
|
|
@@ -350,7 +370,7 @@ function swiftModuleDigest(root) {
|
|
|
350
370
|
}
|
|
351
371
|
function compileTargets(input) {
|
|
352
372
|
const manifest = input.files["Package.swift"];
|
|
353
|
-
return manifest === void 0 ? [] : swiftPackagePartition(manifest);
|
|
373
|
+
return manifest === void 0 ? [] : swiftPackagePartition(manifest, input.resourcePaths);
|
|
354
374
|
}
|
|
355
375
|
function withNativeSourceGlue(input, glue) {
|
|
356
376
|
const targets = compileTargets(input);
|
|
@@ -415,7 +435,7 @@ var ONE_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "One"'
|
|
|
415
435
|
var MULTI_MANIFEST_VERSION = 10;
|
|
416
436
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
417
437
|
const hash = (0, import_node_crypto2.createHash)("sha256");
|
|
418
|
-
hash.update(`swift-compile/
|
|
438
|
+
hash.update(`swift-compile/v13
|
|
419
439
|
${release}
|
|
420
440
|
`);
|
|
421
441
|
if (input.oneModule) hash.update("one-module\n");
|
|
@@ -437,6 +457,10 @@ ${release}
|
|
|
437
457
|
hash.update((0, import_node_crypto2.createHash)("sha256").update(image.file).digest());
|
|
438
458
|
hash.update((0, import_node_crypto2.createHash)("sha256").update(image.data).digest());
|
|
439
459
|
}
|
|
460
|
+
for (const file of [...new Set(input.resourcePaths ?? [])].sort()) {
|
|
461
|
+
hash.update("resource-path\n");
|
|
462
|
+
hash.update((0, import_node_crypto2.createHash)("sha256").update(file).digest());
|
|
463
|
+
}
|
|
440
464
|
const targets = compileTargets(input);
|
|
441
465
|
if (targets.length > 0) {
|
|
442
466
|
hash.update(`swift-multi/v${MULTI_MANIFEST_VERSION}
|
|
@@ -905,6 +929,10 @@ function prepareSwiftDependency(source, destination) {
|
|
|
905
929
|
copy(source, destination, true);
|
|
906
930
|
}
|
|
907
931
|
function writeSwiftProject(layout, input, moduleRoot) {
|
|
932
|
+
const resourceTargets = swiftManifestTargets(
|
|
933
|
+
input.files["Package.swift"] ?? "",
|
|
934
|
+
input.resourcePaths
|
|
935
|
+
);
|
|
908
936
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
909
937
|
const targets = distribution && compileTargets(input).length === 0 ? [
|
|
910
938
|
{
|
|
@@ -923,8 +951,14 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
923
951
|
if (!distribution) {
|
|
924
952
|
modulePlan.update((0, import_node_fs2.readFileSync)(import_node_path2.default.join(moduleRoot, "Package.swift")));
|
|
925
953
|
}
|
|
954
|
+
const resourcePlan = (0, import_node_crypto2.createHash)("sha256").update(
|
|
955
|
+
JSON.stringify(
|
|
956
|
+
resourceTargets.filter((target) => target.resources).map((target) => [target.name, target.path])
|
|
957
|
+
)
|
|
958
|
+
).digest("hex").slice(0, 16);
|
|
926
959
|
const moduleFiles = `
|
|
927
960
|
// sootsim-swift files ${modulePlan.digest("hex").slice(0, 16)}
|
|
961
|
+
// resource accessors ${resourcePlan}
|
|
928
962
|
`;
|
|
929
963
|
if (targets.length === 0) {
|
|
930
964
|
for (const [file, contents] of Object.entries(input.files)) {
|
|
@@ -977,20 +1011,6 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
977
1011
|
if (file === "Package.swift") continue;
|
|
978
1012
|
files.set(import_node_path2.default.join(base, file), compiledSource(file, contents));
|
|
979
1013
|
}
|
|
980
|
-
for (const target of targets) {
|
|
981
|
-
if (!target.resources) continue;
|
|
982
|
-
files.set(
|
|
983
|
-
import_node_path2.default.join(layout.root, target.path, "ResourceBundleAccessor.generated.swift"),
|
|
984
|
-
[
|
|
985
|
-
"import Foundation",
|
|
986
|
-
"",
|
|
987
|
-
"extension Foundation.Bundle {",
|
|
988
|
-
" static let module: Bundle = Bundle.main",
|
|
989
|
-
"}",
|
|
990
|
-
""
|
|
991
|
-
].join("\n")
|
|
992
|
-
);
|
|
993
|
-
}
|
|
994
1014
|
files.set(
|
|
995
1015
|
import_node_path2.default.join(layout.root, "Package.swift"),
|
|
996
1016
|
emitSwiftPackageManifest({
|
|
@@ -1006,6 +1026,21 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
1006
1026
|
}) + moduleFiles
|
|
1007
1027
|
);
|
|
1008
1028
|
}
|
|
1029
|
+
for (const target of resourceTargets) {
|
|
1030
|
+
if (!target.resources) continue;
|
|
1031
|
+
const directory = layout.multi ? import_node_path2.default.join(layout.root, target.path) : layout.sources;
|
|
1032
|
+
files.set(
|
|
1033
|
+
import_node_path2.default.join(directory, "ResourceBundleAccessor.generated.swift"),
|
|
1034
|
+
[
|
|
1035
|
+
"import Foundation",
|
|
1036
|
+
"",
|
|
1037
|
+
"extension Foundation.Bundle {",
|
|
1038
|
+
" static let module: Bundle = Bundle.main",
|
|
1039
|
+
"}",
|
|
1040
|
+
""
|
|
1041
|
+
].join("\n")
|
|
1042
|
+
);
|
|
1043
|
+
}
|
|
1009
1044
|
syncSwiftTree(layout.root, files);
|
|
1010
1045
|
}
|
|
1011
1046
|
function streamText(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.716 | (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";
|
|
@@ -152,7 +152,15 @@ function icuSegment(object) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
// src/swift-package.ts
|
|
155
|
-
function
|
|
155
|
+
function swiftImplicitResourcePaths(paths) {
|
|
156
|
+
return paths.filter(
|
|
157
|
+
(file) => !file.endsWith(".swift") && (/\.(xcassets|xcstrings|nib|xib|storyboard|xcdatamodeld|xcdatamodel|xcmappingmodel|metal|xcprivacy)(?:\/|$)/.test(
|
|
158
|
+
file
|
|
159
|
+
) || /(?:^|\/)[^/]+\.lproj\/[^/]+$/.test(file))
|
|
160
|
+
).sort();
|
|
161
|
+
}
|
|
162
|
+
function swiftManifestTargets(manifest, resourcePaths = []) {
|
|
163
|
+
const implicitResources = swiftImplicitResourcePaths(resourcePaths);
|
|
156
164
|
const code = manifest.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "");
|
|
157
165
|
const targets = [];
|
|
158
166
|
const pattern = /\.(executableTarget|target)\s*\(/g;
|
|
@@ -195,7 +203,19 @@ function swiftManifestTargets(manifest) {
|
|
|
195
203
|
/\.swiftLanguageMode\(\s*\.v(\d+)\s*\)/.exec(call)?.[1] ?? "5"
|
|
196
204
|
);
|
|
197
205
|
const mainActorIsolation = /\.defaultIsolation\(\s*MainActor\.self\s*\)/.test(call);
|
|
198
|
-
const
|
|
206
|
+
const excluded = [
|
|
207
|
+
...(/\bexclude\s*:\s*\[([^\]]*)\]/.exec(flat)?.[1] ?? "").matchAll(/"([^"]+)"/g)
|
|
208
|
+
].map((match2) => match2[1].replace(/^\.\//, "").replace(/\/+$/, ""));
|
|
209
|
+
const prefix = targetPath === "." ? "" : `${targetPath}/`;
|
|
210
|
+
const resources = /\bresources\s*:/.test(flat) || implicitResources.some((file) => {
|
|
211
|
+
if (!file.startsWith(prefix)) return false;
|
|
212
|
+
const relative = file.slice(prefix.length);
|
|
213
|
+
if (excluded.some(
|
|
214
|
+
(exclude) => relative === exclude || relative.startsWith(`${exclude}/`)
|
|
215
|
+
))
|
|
216
|
+
return false;
|
|
217
|
+
return true;
|
|
218
|
+
});
|
|
199
219
|
targets.push({
|
|
200
220
|
name,
|
|
201
221
|
path: targetPath,
|
|
@@ -207,8 +227,8 @@ function swiftManifestTargets(manifest) {
|
|
|
207
227
|
}
|
|
208
228
|
return targets;
|
|
209
229
|
}
|
|
210
|
-
function swiftPackagePartition(manifest) {
|
|
211
|
-
const targets = swiftManifestTargets(manifest);
|
|
230
|
+
function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
231
|
+
const targets = swiftManifestTargets(manifest, resourcePaths);
|
|
212
232
|
return targets.length === 1 && targets[0].executable && targets[0].path === "." ? [] : targets;
|
|
213
233
|
}
|
|
214
234
|
|
|
@@ -310,7 +330,7 @@ function swiftModuleDigest(root) {
|
|
|
310
330
|
}
|
|
311
331
|
function compileTargets(input) {
|
|
312
332
|
const manifest = input.files["Package.swift"];
|
|
313
|
-
return manifest === void 0 ? [] : swiftPackagePartition(manifest);
|
|
333
|
+
return manifest === void 0 ? [] : swiftPackagePartition(manifest, input.resourcePaths);
|
|
314
334
|
}
|
|
315
335
|
function withNativeSourceGlue(input, glue) {
|
|
316
336
|
const targets = compileTargets(input);
|
|
@@ -375,7 +395,7 @@ var ONE_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "One"'
|
|
|
375
395
|
var MULTI_MANIFEST_VERSION = 10;
|
|
376
396
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
377
397
|
const hash = createHash2("sha256");
|
|
378
|
-
hash.update(`swift-compile/
|
|
398
|
+
hash.update(`swift-compile/v13
|
|
379
399
|
${release}
|
|
380
400
|
`);
|
|
381
401
|
if (input.oneModule) hash.update("one-module\n");
|
|
@@ -397,6 +417,10 @@ ${release}
|
|
|
397
417
|
hash.update(createHash2("sha256").update(image.file).digest());
|
|
398
418
|
hash.update(createHash2("sha256").update(image.data).digest());
|
|
399
419
|
}
|
|
420
|
+
for (const file of [...new Set(input.resourcePaths ?? [])].sort()) {
|
|
421
|
+
hash.update("resource-path\n");
|
|
422
|
+
hash.update(createHash2("sha256").update(file).digest());
|
|
423
|
+
}
|
|
400
424
|
const targets = compileTargets(input);
|
|
401
425
|
if (targets.length > 0) {
|
|
402
426
|
hash.update(`swift-multi/v${MULTI_MANIFEST_VERSION}
|
|
@@ -865,6 +889,10 @@ function prepareSwiftDependency(source, destination) {
|
|
|
865
889
|
copy(source, destination, true);
|
|
866
890
|
}
|
|
867
891
|
function writeSwiftProject(layout, input, moduleRoot) {
|
|
892
|
+
const resourceTargets = swiftManifestTargets(
|
|
893
|
+
input.files["Package.swift"] ?? "",
|
|
894
|
+
input.resourcePaths
|
|
895
|
+
);
|
|
868
896
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
869
897
|
const targets = distribution && compileTargets(input).length === 0 ? [
|
|
870
898
|
{
|
|
@@ -883,8 +911,14 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
883
911
|
if (!distribution) {
|
|
884
912
|
modulePlan.update(readFileSync2(path2.join(moduleRoot, "Package.swift")));
|
|
885
913
|
}
|
|
914
|
+
const resourcePlan = createHash2("sha256").update(
|
|
915
|
+
JSON.stringify(
|
|
916
|
+
resourceTargets.filter((target) => target.resources).map((target) => [target.name, target.path])
|
|
917
|
+
)
|
|
918
|
+
).digest("hex").slice(0, 16);
|
|
886
919
|
const moduleFiles = `
|
|
887
920
|
// sootsim-swift files ${modulePlan.digest("hex").slice(0, 16)}
|
|
921
|
+
// resource accessors ${resourcePlan}
|
|
888
922
|
`;
|
|
889
923
|
if (targets.length === 0) {
|
|
890
924
|
for (const [file, contents] of Object.entries(input.files)) {
|
|
@@ -937,20 +971,6 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
937
971
|
if (file === "Package.swift") continue;
|
|
938
972
|
files.set(path2.join(base, file), compiledSource(file, contents));
|
|
939
973
|
}
|
|
940
|
-
for (const target of targets) {
|
|
941
|
-
if (!target.resources) continue;
|
|
942
|
-
files.set(
|
|
943
|
-
path2.join(layout.root, target.path, "ResourceBundleAccessor.generated.swift"),
|
|
944
|
-
[
|
|
945
|
-
"import Foundation",
|
|
946
|
-
"",
|
|
947
|
-
"extension Foundation.Bundle {",
|
|
948
|
-
" static let module: Bundle = Bundle.main",
|
|
949
|
-
"}",
|
|
950
|
-
""
|
|
951
|
-
].join("\n")
|
|
952
|
-
);
|
|
953
|
-
}
|
|
954
974
|
files.set(
|
|
955
975
|
path2.join(layout.root, "Package.swift"),
|
|
956
976
|
emitSwiftPackageManifest({
|
|
@@ -966,6 +986,21 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
966
986
|
}) + moduleFiles
|
|
967
987
|
);
|
|
968
988
|
}
|
|
989
|
+
for (const target of resourceTargets) {
|
|
990
|
+
if (!target.resources) continue;
|
|
991
|
+
const directory = layout.multi ? path2.join(layout.root, target.path) : layout.sources;
|
|
992
|
+
files.set(
|
|
993
|
+
path2.join(directory, "ResourceBundleAccessor.generated.swift"),
|
|
994
|
+
[
|
|
995
|
+
"import Foundation",
|
|
996
|
+
"",
|
|
997
|
+
"extension Foundation.Bundle {",
|
|
998
|
+
" static let module: Bundle = Bundle.main",
|
|
999
|
+
"}",
|
|
1000
|
+
""
|
|
1001
|
+
].join("\n")
|
|
1002
|
+
);
|
|
1003
|
+
}
|
|
969
1004
|
syncSwiftTree(layout.root, files);
|
|
970
1005
|
}
|
|
971
1006
|
function streamText(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.716 | (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;
|
|
@@ -23,6 +23,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
23
23
|
var swift_package_exports = {};
|
|
24
24
|
__export(swift_package_exports, {
|
|
25
25
|
isSwiftManifestFile: () => isSwiftManifestFile,
|
|
26
|
+
swiftImplicitResourcePaths: () => swiftImplicitResourcePaths,
|
|
26
27
|
swiftManifestTargets: () => swiftManifestTargets,
|
|
27
28
|
swiftPackagePartition: () => swiftPackagePartition
|
|
28
29
|
});
|
|
@@ -31,7 +32,15 @@ function isSwiftManifestFile(file) {
|
|
|
31
32
|
const segments = file.split("/");
|
|
32
33
|
return segments[segments.length - 1] === "Package.swift";
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function swiftImplicitResourcePaths(paths) {
|
|
36
|
+
return paths.filter(
|
|
37
|
+
(file) => !file.endsWith(".swift") && (/\.(xcassets|xcstrings|nib|xib|storyboard|xcdatamodeld|xcdatamodel|xcmappingmodel|metal|xcprivacy)(?:\/|$)/.test(
|
|
38
|
+
file
|
|
39
|
+
) || /(?:^|\/)[^/]+\.lproj\/[^/]+$/.test(file))
|
|
40
|
+
).sort();
|
|
41
|
+
}
|
|
42
|
+
function swiftManifestTargets(manifest, resourcePaths = []) {
|
|
43
|
+
const implicitResources = swiftImplicitResourcePaths(resourcePaths);
|
|
35
44
|
const code = manifest.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "");
|
|
36
45
|
const targets = [];
|
|
37
46
|
const pattern = /\.(executableTarget|target)\s*\(/g;
|
|
@@ -74,7 +83,19 @@ function swiftManifestTargets(manifest) {
|
|
|
74
83
|
/\.swiftLanguageMode\(\s*\.v(\d+)\s*\)/.exec(call)?.[1] ?? "5"
|
|
75
84
|
);
|
|
76
85
|
const mainActorIsolation = /\.defaultIsolation\(\s*MainActor\.self\s*\)/.test(call);
|
|
77
|
-
const
|
|
86
|
+
const excluded = [
|
|
87
|
+
...(/\bexclude\s*:\s*\[([^\]]*)\]/.exec(flat)?.[1] ?? "").matchAll(/"([^"]+)"/g)
|
|
88
|
+
].map((match2) => match2[1].replace(/^\.\//, "").replace(/\/+$/, ""));
|
|
89
|
+
const prefix = targetPath === "." ? "" : `${targetPath}/`;
|
|
90
|
+
const resources = /\bresources\s*:/.test(flat) || implicitResources.some((file) => {
|
|
91
|
+
if (!file.startsWith(prefix)) return false;
|
|
92
|
+
const relative = file.slice(prefix.length);
|
|
93
|
+
if (excluded.some(
|
|
94
|
+
(exclude) => relative === exclude || relative.startsWith(`${exclude}/`)
|
|
95
|
+
))
|
|
96
|
+
return false;
|
|
97
|
+
return true;
|
|
98
|
+
});
|
|
78
99
|
targets.push({
|
|
79
100
|
name,
|
|
80
101
|
path: targetPath,
|
|
@@ -86,13 +107,14 @@ function swiftManifestTargets(manifest) {
|
|
|
86
107
|
}
|
|
87
108
|
return targets;
|
|
88
109
|
}
|
|
89
|
-
function swiftPackagePartition(manifest) {
|
|
90
|
-
const targets = swiftManifestTargets(manifest);
|
|
110
|
+
function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
111
|
+
const targets = swiftManifestTargets(manifest, resourcePaths);
|
|
91
112
|
return targets.length === 1 && targets[0].executable && targets[0].path === "." ? [] : targets;
|
|
92
113
|
}
|
|
93
114
|
// Annotate the CommonJS export names for ESM import in node:
|
|
94
115
|
0 && (module.exports = {
|
|
95
116
|
isSwiftManifestFile,
|
|
117
|
+
swiftImplicitResourcePaths,
|
|
96
118
|
swiftManifestTargets,
|
|
97
119
|
swiftPackagePartition
|
|
98
120
|
});
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.716 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/swift-package.ts
|
|
4
4
|
function isSwiftManifestFile(file) {
|
|
5
5
|
const segments = file.split("/");
|
|
6
6
|
return segments[segments.length - 1] === "Package.swift";
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function swiftImplicitResourcePaths(paths) {
|
|
9
|
+
return paths.filter(
|
|
10
|
+
(file) => !file.endsWith(".swift") && (/\.(xcassets|xcstrings|nib|xib|storyboard|xcdatamodeld|xcdatamodel|xcmappingmodel|metal|xcprivacy)(?:\/|$)/.test(
|
|
11
|
+
file
|
|
12
|
+
) || /(?:^|\/)[^/]+\.lproj\/[^/]+$/.test(file))
|
|
13
|
+
).sort();
|
|
14
|
+
}
|
|
15
|
+
function swiftManifestTargets(manifest, resourcePaths = []) {
|
|
16
|
+
const implicitResources = swiftImplicitResourcePaths(resourcePaths);
|
|
9
17
|
const code = manifest.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "");
|
|
10
18
|
const targets = [];
|
|
11
19
|
const pattern = /\.(executableTarget|target)\s*\(/g;
|
|
@@ -48,7 +56,19 @@ function swiftManifestTargets(manifest) {
|
|
|
48
56
|
/\.swiftLanguageMode\(\s*\.v(\d+)\s*\)/.exec(call)?.[1] ?? "5"
|
|
49
57
|
);
|
|
50
58
|
const mainActorIsolation = /\.defaultIsolation\(\s*MainActor\.self\s*\)/.test(call);
|
|
51
|
-
const
|
|
59
|
+
const excluded = [
|
|
60
|
+
...(/\bexclude\s*:\s*\[([^\]]*)\]/.exec(flat)?.[1] ?? "").matchAll(/"([^"]+)"/g)
|
|
61
|
+
].map((match2) => match2[1].replace(/^\.\//, "").replace(/\/+$/, ""));
|
|
62
|
+
const prefix = targetPath === "." ? "" : `${targetPath}/`;
|
|
63
|
+
const resources = /\bresources\s*:/.test(flat) || implicitResources.some((file) => {
|
|
64
|
+
if (!file.startsWith(prefix)) return false;
|
|
65
|
+
const relative = file.slice(prefix.length);
|
|
66
|
+
if (excluded.some(
|
|
67
|
+
(exclude) => relative === exclude || relative.startsWith(`${exclude}/`)
|
|
68
|
+
))
|
|
69
|
+
return false;
|
|
70
|
+
return true;
|
|
71
|
+
});
|
|
52
72
|
targets.push({
|
|
53
73
|
name,
|
|
54
74
|
path: targetPath,
|
|
@@ -60,12 +80,13 @@ function swiftManifestTargets(manifest) {
|
|
|
60
80
|
}
|
|
61
81
|
return targets;
|
|
62
82
|
}
|
|
63
|
-
function swiftPackagePartition(manifest) {
|
|
64
|
-
const targets = swiftManifestTargets(manifest);
|
|
83
|
+
function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
84
|
+
const targets = swiftManifestTargets(manifest, resourcePaths);
|
|
65
85
|
return targets.length === 1 && targets[0].executable && targets[0].path === "." ? [] : targets;
|
|
66
86
|
}
|
|
67
87
|
export {
|
|
68
88
|
isSwiftManifestFile,
|
|
89
|
+
swiftImplicitResourcePaths,
|
|
69
90
|
swiftManifestTargets,
|
|
70
91
|
swiftPackagePartition
|
|
71
92
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.716 | (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.716 | (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.716 | (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;
|