peachsim 0.1.1673 → 0.1.1684
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/commands/control.ts +13 -1
- package/cli/commands/coverage-swift.ts +83 -27
- package/cli/commands/coverage.ts +219 -20
- package/cli/commands/detect.ts +10 -6
- package/cli/commands/inspect/core.ts +2 -0
- package/cli/commands/inspect/settling.ts +37 -4
- package/cli/commands/inspect/wait-ready.ts +7 -0
- package/cli/outbound-endpoints.ts +12 -0
- package/detox/index.ts +11 -1
- package/detox/jest-environment.cjs +14 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +3299 -1665
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +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/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +43 -8
- package/dist-lib/detox/jest-environment.cjs +14 -0
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +2432 -1128
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +2908 -1601
- package/dist-lib/host/fetch-proxy-handler.cjs +22 -6
- 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 +1941 -742
- 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 +6215 -4283
- package/dist-lib/native-app-identity-project.cjs +31 -6
- package/dist-lib/native-app-identity-project.mjs +31 -6
- 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/public-origins-lib-esm.json +24 -23
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +134 -78
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +2 -2
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +39 -5
- package/dist-lib/sdk.mjs +39 -5
- package/dist-lib/skills.cjs +3637 -2168
- package/dist-lib/swift-compile.cjs +496 -352
- package/dist-lib/swift-compile.mjs +494 -350
- package/dist-lib/swift-package.cjs +58 -9
- package/dist-lib/swift-package.mjs +57 -9
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +26 -11
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +2443 -1134
- package/dist-lib/vite.cjs +1907 -763
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/canvaskit-api.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +9 -1
- package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +11 -3
- package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +6 -0
- package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +2 -0
- package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +10 -1
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +69 -2
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +44 -4
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFComposeAssistantViewController.h +29 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeControllerDeferredAction.h +14 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +162 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailDraft.h +24 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController+UPI.h +31 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +169 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MessageUI.h +13 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Modules/module.modulemap +11 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +10 -0
- package/sdk/ios/usr/include/_ctype.h +388 -0
- package/sdk/ios/usr/include/_inttypes.h +296 -0
- package/sdk/ios/usr/include/_locale.h +83 -0
- package/sdk/ios/usr/include/_locale_posix2008.h +65 -0
- package/sdk/ios/usr/include/_time.h +207 -0
- package/sdk/ios/usr/include/arm/param.h +151 -0
- package/sdk/ios/usr/include/ctype.h +70 -0
- package/sdk/ios/usr/include/dispatch/dispatch.h +72 -6
- package/sdk/ios/usr/include/dlfcn.h +1 -2
- package/sdk/ios/usr/include/inttypes.h +35 -0
- package/sdk/ios/usr/include/locale.h +59 -0
- package/sdk/ios/usr/include/machine/param.h +42 -0
- package/sdk/ios/usr/include/net/if.h +1 -2
- package/sdk/ios/usr/include/peach/pthread.h +4 -4
- package/sdk/ios/usr/include/pthread/qos.h +304 -0
- package/sdk/ios/usr/include/runetype.h +118 -0
- package/sdk/ios/usr/include/setjmp.h +99 -0
- package/sdk/ios/usr/include/sys/_types/_clock_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_ct_rune_t.h +33 -0
- package/sdk/ios/usr/include/sys/_types/_fd_clr.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_copy.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_def.h +121 -0
- package/sdk/ios/usr/include/sys/_types/_fd_isset.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_set.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_setsize.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_zero.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_rune_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_time_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_wint_t.h +33 -0
- package/sdk/ios/usr/include/sys/cdefs.h +5 -0
- package/sdk/ios/usr/include/sys/param.h +235 -0
- package/sdk/ios/usr/include/sys/proc.h +1 -0
- package/sdk/ios/usr/include/sys/qos.h +151 -12
- package/sdk/ios/usr/include/time.h +67 -2
- package/sdk/ios/wasm/include/__typedef_sigset_t.h +7 -0
- package/sdk/ios/wasm/include/fcntl.h +11 -0
- package/sdk/ios/wasm/include/mach/machine/boolean.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/exception.h +5 -0
- package/sdk/ios/wasm/include/mach/machine/kern_return.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/processor_info.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/rpc.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/thread_state.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/thread_status.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/vm_param.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/vm_types.h +18 -0
- package/sdk/ios/wasm/include/machine/_types.h +153 -0
- package/sdk/ios/wasm/include/machine/endian.h +2 -0
- package/sdk/ios/wasm/include/machine/limits.h +2 -0
- package/sdk/ios/wasm/include/machine/types.h +30 -0
- package/sdk/ios/wasm/include/poll.h +8 -0
- package/sdk/ios/wasm/include/pthread.h +50 -0
- package/sdk/ios/wasm/include/signal.h +72 -0
- package/sdk/ios/wasm/include/stdlib.h +3 -0
- package/sdk/ios/wasm/include/string.h +10 -0
- package/sdk/ios/wasm/include/sys/_pthread/_pthread_attr_t.h +7 -0
- package/sdk/ios/wasm/include/sys/_pthread/_pthread_t.h +7 -0
- package/sdk/ios/wasm/include/sys/mman.h +122 -0
- package/sdk/ios/wasm/include/sys/select.h +37 -0
- package/sdk/ios/wasm/include/sys/signal.h +259 -0
- package/sdk/ios/wasm/include/sys/socket.h +8 -0
- package/sdk/ios/wasm/include/sys/types.h +14 -0
- package/sdk/ios/wasm/include/sys/ucontext.h +1 -0
- package/sdk/ios/wasm/include/sys/uio.h +11 -0
- package/sdk/ios/wasm/include/sys/wait.h +89 -0
- package/sdk/ios/wasm/include/time.h +8 -0
- package/sdk/ios/wasm/include/unistd.h +17 -0
- package/src/bridge-contract.ts +2 -0
- package/src/chromium-admission.ts +10 -5
- package/src/device-catalog.ts +4 -4
- package/src/host/fetch-proxy-handler.ts +20 -0
- package/src/host/rolldown-bundle-forward.ts +4 -1
- package/src/metro-plugin.ts +5 -2
- package/src/nitro-adapter.lock.json +6 -6
- package/src/nitro-compile.ts +63 -2
- package/src/numbered-lock.ts +72 -0
- package/src/react-native-coverage/capability-reference-resolution.ts +62 -5
- package/src/react-native-coverage/capability-source-references.ts +50 -13
- package/src/react-native-coverage/native-source-credit.ts +126 -0
- package/src/react-native-coverage/native-source-ranges-file.ts +38 -0
- package/src/react-native-coverage/native-surface.ts +49 -0
- package/src/react-native-coverage/verified-reach.ts +22 -2
- package/src/runtime-assets.ts +17 -0
- package/src/swift-compile.ts +84 -47
- package/src/swift-coverage/indexing.ts +17 -1
- package/src/swift-coverage/sdk.ts +71 -0
- package/src/swift-coverage/source.ts +74 -2
- package/src/swift-coverage/types.ts +6 -0
- package/src/swift-distribution.lock.json +12 -12
- package/src/swift-host.ts +133 -14
- package/src/swift-objc-compile.ts +11 -22
- package/src/swift-objc-metadata.ts +2 -8
- package/src/swift-objc-platform.ts +53 -0
- package/src/swift-objc-standin.ts +49 -0
- package/src/swift-package-manifest.ts +48 -3
- package/src/swift-package.ts +85 -12
- package/src/swift-packages.ts +157 -44
- package/src/swift-source-pods.ts +288 -0
- package/src/swift-standins.ts +4 -1
- package/src/swift-toolchain.ts +32 -10
- package/src/vite-plugin-one.ts +5 -4
- package/src/worker-system-chunks.ts +7 -1
- package/src/xcode-project.ts +40 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1684 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -27,6 +27,7 @@ __export(swift_package_exports, {
|
|
|
27
27
|
SWIFT_NATIVE_SOURCE_EXTENSIONS: () => SWIFT_NATIVE_SOURCE_EXTENSIONS,
|
|
28
28
|
clangMacroSetting: () => clangMacroSetting,
|
|
29
29
|
isSwiftManifestFile: () => isSwiftManifestFile,
|
|
30
|
+
manifestCalls: () => manifestCalls,
|
|
30
31
|
swiftImplicitResourcePaths: () => swiftImplicitResourcePaths,
|
|
31
32
|
swiftManifestCxxLanguageStandard: () => swiftManifestCxxLanguageStandard,
|
|
32
33
|
swiftManifestTargets: () => swiftManifestTargets,
|
|
@@ -159,14 +160,23 @@ function swiftTargetModuleName(name) {
|
|
|
159
160
|
return name.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
|
|
160
161
|
}
|
|
161
162
|
function swiftPackageIdentity(url) {
|
|
162
|
-
|
|
163
|
+
const path = url.endsWith("/") ? url.slice(0, -1) : url;
|
|
164
|
+
return (path.split("/").pop() ?? path).replace(/\.git$/, "").toLowerCase();
|
|
163
165
|
}
|
|
164
166
|
function clangMacroSetting(macro) {
|
|
165
167
|
const [name, ...value] = macro.split("=");
|
|
166
168
|
return value.length === 0 ? `.define(${JSON.stringify(name)})` : `.define(${JSON.stringify(name)}, to: ${JSON.stringify(value.join("="))})`;
|
|
167
169
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
+
var swiftEscapes = {
|
|
171
|
+
"\\": "\\",
|
|
172
|
+
'"': '"',
|
|
173
|
+
"'": "'",
|
|
174
|
+
n: "\n",
|
|
175
|
+
r: "\r",
|
|
176
|
+
t: " "
|
|
177
|
+
};
|
|
178
|
+
function settingsBlocks(call, tool) {
|
|
179
|
+
const bodies = [];
|
|
170
180
|
for (const open of call.matchAll(new RegExp(`\\b${tool}Settings\\s*:\\s*\\[`, "g"))) {
|
|
171
181
|
let depth = 1;
|
|
172
182
|
let index = open.index + open[0].length;
|
|
@@ -179,11 +189,43 @@ function settingDefines(call, tool) {
|
|
|
179
189
|
} else if (char === "[") depth++;
|
|
180
190
|
else if (char === "]") depth--;
|
|
181
191
|
}
|
|
182
|
-
|
|
192
|
+
bodies.push(call.slice(start, index - 1));
|
|
193
|
+
}
|
|
194
|
+
return bodies;
|
|
195
|
+
}
|
|
196
|
+
function settingFeatures(call, setting) {
|
|
197
|
+
const found = [];
|
|
198
|
+
for (const body of settingsBlocks(call, "swift")) {
|
|
199
|
+
if (setting === ".unsafeFlags") {
|
|
200
|
+
for (const list of body.matchAll(/\.unsafeFlags\(\s*\[([^\]]*)\]/g))
|
|
201
|
+
for (const match of list[1].matchAll(/"((?:[^"\\]|\\.)*)"/g))
|
|
202
|
+
found.push(JSON.parse(`"${match[1]}"`));
|
|
203
|
+
} else {
|
|
204
|
+
const name = "([A-Za-z_][A-Za-z0-9_]*(?:=[A-Za-z_][A-Za-z0-9_.-]*)?)";
|
|
205
|
+
const pattern = setting === ".enableExperimentalFeature" ? new RegExp(`\\.enableExperimentalFeature\\(\\s*"${name}"\\s*\\)`, "g") : new RegExp(`\\.enableUpcomingFeature\\(\\s*"${name}"\\s*\\)`, "g");
|
|
206
|
+
for (const match of body.matchAll(pattern)) found.push(match[1]);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return found;
|
|
210
|
+
}
|
|
211
|
+
function settingDefines(call, tool) {
|
|
212
|
+
const defines = [];
|
|
213
|
+
for (const body of settingsBlocks(call, tool)) {
|
|
183
214
|
for (const match of body.matchAll(
|
|
184
|
-
/\.define\(\s*"([A-Za-z_][A-Za-z0-9_]*)"\s*(?:,\s*to:\s*"([^"]*)"\s*)?\)/g
|
|
185
|
-
))
|
|
186
|
-
|
|
215
|
+
/\.define\(\s*"([A-Za-z_][A-Za-z0-9_]*)"\s*(?:,\s*to:\s*"((?:[^"\\]|\\.)*)"\s*)?\)/g
|
|
216
|
+
)) {
|
|
217
|
+
const name = match[1];
|
|
218
|
+
defines.push(
|
|
219
|
+
match[2] === void 0 ? name : `${name}=${match[2].replace(/\\(.)/g, (_, escape) => {
|
|
220
|
+
const value = swiftEscapes[escape];
|
|
221
|
+
if (value === void 0)
|
|
222
|
+
throw new Error(
|
|
223
|
+
`Unsupported escape \\${escape} in the value of macro ${name}`
|
|
224
|
+
);
|
|
225
|
+
return value;
|
|
226
|
+
})}`
|
|
227
|
+
);
|
|
228
|
+
}
|
|
187
229
|
}
|
|
188
230
|
return defines;
|
|
189
231
|
}
|
|
@@ -215,6 +257,9 @@ function swiftManifestTargets(manifest, resourcePaths = []) {
|
|
|
215
257
|
call.replace(/"(?:\\.|[^"\\])*"/g, "")
|
|
216
258
|
);
|
|
217
259
|
const defines = settingDefines(call, "swift").map((define) => define.split("=")[0]);
|
|
260
|
+
const experimentalFeatures = settingFeatures(call, ".enableExperimentalFeature");
|
|
261
|
+
const upcomingFeatures = settingFeatures(call, ".enableUpcomingFeature");
|
|
262
|
+
const swiftFlags = settingFeatures(call, ".unsafeFlags");
|
|
218
263
|
const cDefines = settingDefines(call, "c");
|
|
219
264
|
const cxxDefines = settingDefines(call, "cxx");
|
|
220
265
|
const linkedLibraries = [...call.matchAll(/\.linkedLibrary\(\s*"([^"]+)"\s*\)/g)].map(
|
|
@@ -259,6 +304,9 @@ function swiftManifestTargets(manifest, resourcePaths = []) {
|
|
|
259
304
|
mainActorIsolation,
|
|
260
305
|
...cxxInterop ? { cxxInterop: true } : {},
|
|
261
306
|
...defines.length === 0 ? {} : { defines },
|
|
307
|
+
...experimentalFeatures.length === 0 ? {} : { experimentalFeatures },
|
|
308
|
+
...upcomingFeatures.length === 0 ? {} : { upcomingFeatures },
|
|
309
|
+
...swiftFlags.length === 0 ? {} : { swiftFlags },
|
|
262
310
|
...cDefines.length === 0 ? {} : { cDefines },
|
|
263
311
|
...cxxDefines.length === 0 ? {} : { cxxDefines },
|
|
264
312
|
...linkedLibraries.length === 0 ? {} : { linkedLibraries },
|
|
@@ -394,7 +442,7 @@ function swiftMetalSourceFiles(files) {
|
|
|
394
442
|
}
|
|
395
443
|
function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
396
444
|
const targets = swiftManifestTargets(manifest, resourcePaths);
|
|
397
|
-
return targets.length === 1 && targets[0].executable && targets[0].path === "." && targets[0].languageMode === 5 && !targets[0].mainActorIsolation && !targets[0].defines?.length && !targets[0].linkedLibraries?.length && !targets[0].cxxInterop && !swiftManifestCxxLanguageStandard(manifest) ? [] : targets;
|
|
445
|
+
return targets.length === 1 && targets[0].executable && targets[0].path === "." && targets[0].languageMode === 5 && !targets[0].mainActorIsolation && !targets[0].defines?.length && !targets[0].experimentalFeatures?.length && !targets[0].upcomingFeatures?.length && !targets[0].swiftFlags?.length && !targets[0].linkedLibraries?.length && !targets[0].cxxInterop && !swiftManifestCxxLanguageStandard(manifest) ? [] : targets;
|
|
398
446
|
}
|
|
399
447
|
// Annotate the CommonJS export names for ESM import in node:
|
|
400
448
|
0 && (module.exports = {
|
|
@@ -403,6 +451,7 @@ function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
|
403
451
|
SWIFT_NATIVE_SOURCE_EXTENSIONS,
|
|
404
452
|
clangMacroSetting,
|
|
405
453
|
isSwiftManifestFile,
|
|
454
|
+
manifestCalls,
|
|
406
455
|
swiftImplicitResourcePaths,
|
|
407
456
|
swiftManifestCxxLanguageStandard,
|
|
408
457
|
swiftManifestTargets,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1684 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/swift-package.ts
|
|
4
4
|
function isSwiftManifestFile(file) {
|
|
@@ -119,14 +119,23 @@ function swiftTargetModuleName(name) {
|
|
|
119
119
|
return name.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
|
|
120
120
|
}
|
|
121
121
|
function swiftPackageIdentity(url) {
|
|
122
|
-
|
|
122
|
+
const path = url.endsWith("/") ? url.slice(0, -1) : url;
|
|
123
|
+
return (path.split("/").pop() ?? path).replace(/\.git$/, "").toLowerCase();
|
|
123
124
|
}
|
|
124
125
|
function clangMacroSetting(macro) {
|
|
125
126
|
const [name, ...value] = macro.split("=");
|
|
126
127
|
return value.length === 0 ? `.define(${JSON.stringify(name)})` : `.define(${JSON.stringify(name)}, to: ${JSON.stringify(value.join("="))})`;
|
|
127
128
|
}
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
var swiftEscapes = {
|
|
130
|
+
"\\": "\\",
|
|
131
|
+
'"': '"',
|
|
132
|
+
"'": "'",
|
|
133
|
+
n: "\n",
|
|
134
|
+
r: "\r",
|
|
135
|
+
t: " "
|
|
136
|
+
};
|
|
137
|
+
function settingsBlocks(call, tool) {
|
|
138
|
+
const bodies = [];
|
|
130
139
|
for (const open of call.matchAll(new RegExp(`\\b${tool}Settings\\s*:\\s*\\[`, "g"))) {
|
|
131
140
|
let depth = 1;
|
|
132
141
|
let index = open.index + open[0].length;
|
|
@@ -139,11 +148,43 @@ function settingDefines(call, tool) {
|
|
|
139
148
|
} else if (char === "[") depth++;
|
|
140
149
|
else if (char === "]") depth--;
|
|
141
150
|
}
|
|
142
|
-
|
|
151
|
+
bodies.push(call.slice(start, index - 1));
|
|
152
|
+
}
|
|
153
|
+
return bodies;
|
|
154
|
+
}
|
|
155
|
+
function settingFeatures(call, setting) {
|
|
156
|
+
const found = [];
|
|
157
|
+
for (const body of settingsBlocks(call, "swift")) {
|
|
158
|
+
if (setting === ".unsafeFlags") {
|
|
159
|
+
for (const list of body.matchAll(/\.unsafeFlags\(\s*\[([^\]]*)\]/g))
|
|
160
|
+
for (const match of list[1].matchAll(/"((?:[^"\\]|\\.)*)"/g))
|
|
161
|
+
found.push(JSON.parse(`"${match[1]}"`));
|
|
162
|
+
} else {
|
|
163
|
+
const name = "([A-Za-z_][A-Za-z0-9_]*(?:=[A-Za-z_][A-Za-z0-9_.-]*)?)";
|
|
164
|
+
const pattern = setting === ".enableExperimentalFeature" ? new RegExp(`\\.enableExperimentalFeature\\(\\s*"${name}"\\s*\\)`, "g") : new RegExp(`\\.enableUpcomingFeature\\(\\s*"${name}"\\s*\\)`, "g");
|
|
165
|
+
for (const match of body.matchAll(pattern)) found.push(match[1]);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return found;
|
|
169
|
+
}
|
|
170
|
+
function settingDefines(call, tool) {
|
|
171
|
+
const defines = [];
|
|
172
|
+
for (const body of settingsBlocks(call, tool)) {
|
|
143
173
|
for (const match of body.matchAll(
|
|
144
|
-
/\.define\(\s*"([A-Za-z_][A-Za-z0-9_]*)"\s*(?:,\s*to:\s*"([^"]*)"\s*)?\)/g
|
|
145
|
-
))
|
|
146
|
-
|
|
174
|
+
/\.define\(\s*"([A-Za-z_][A-Za-z0-9_]*)"\s*(?:,\s*to:\s*"((?:[^"\\]|\\.)*)"\s*)?\)/g
|
|
175
|
+
)) {
|
|
176
|
+
const name = match[1];
|
|
177
|
+
defines.push(
|
|
178
|
+
match[2] === void 0 ? name : `${name}=${match[2].replace(/\\(.)/g, (_, escape) => {
|
|
179
|
+
const value = swiftEscapes[escape];
|
|
180
|
+
if (value === void 0)
|
|
181
|
+
throw new Error(
|
|
182
|
+
`Unsupported escape \\${escape} in the value of macro ${name}`
|
|
183
|
+
);
|
|
184
|
+
return value;
|
|
185
|
+
})}`
|
|
186
|
+
);
|
|
187
|
+
}
|
|
147
188
|
}
|
|
148
189
|
return defines;
|
|
149
190
|
}
|
|
@@ -175,6 +216,9 @@ function swiftManifestTargets(manifest, resourcePaths = []) {
|
|
|
175
216
|
call.replace(/"(?:\\.|[^"\\])*"/g, "")
|
|
176
217
|
);
|
|
177
218
|
const defines = settingDefines(call, "swift").map((define) => define.split("=")[0]);
|
|
219
|
+
const experimentalFeatures = settingFeatures(call, ".enableExperimentalFeature");
|
|
220
|
+
const upcomingFeatures = settingFeatures(call, ".enableUpcomingFeature");
|
|
221
|
+
const swiftFlags = settingFeatures(call, ".unsafeFlags");
|
|
178
222
|
const cDefines = settingDefines(call, "c");
|
|
179
223
|
const cxxDefines = settingDefines(call, "cxx");
|
|
180
224
|
const linkedLibraries = [...call.matchAll(/\.linkedLibrary\(\s*"([^"]+)"\s*\)/g)].map(
|
|
@@ -219,6 +263,9 @@ function swiftManifestTargets(manifest, resourcePaths = []) {
|
|
|
219
263
|
mainActorIsolation,
|
|
220
264
|
...cxxInterop ? { cxxInterop: true } : {},
|
|
221
265
|
...defines.length === 0 ? {} : { defines },
|
|
266
|
+
...experimentalFeatures.length === 0 ? {} : { experimentalFeatures },
|
|
267
|
+
...upcomingFeatures.length === 0 ? {} : { upcomingFeatures },
|
|
268
|
+
...swiftFlags.length === 0 ? {} : { swiftFlags },
|
|
222
269
|
...cDefines.length === 0 ? {} : { cDefines },
|
|
223
270
|
...cxxDefines.length === 0 ? {} : { cxxDefines },
|
|
224
271
|
...linkedLibraries.length === 0 ? {} : { linkedLibraries },
|
|
@@ -354,7 +401,7 @@ function swiftMetalSourceFiles(files) {
|
|
|
354
401
|
}
|
|
355
402
|
function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
356
403
|
const targets = swiftManifestTargets(manifest, resourcePaths);
|
|
357
|
-
return targets.length === 1 && targets[0].executable && targets[0].path === "." && targets[0].languageMode === 5 && !targets[0].mainActorIsolation && !targets[0].defines?.length && !targets[0].linkedLibraries?.length && !targets[0].cxxInterop && !swiftManifestCxxLanguageStandard(manifest) ? [] : targets;
|
|
404
|
+
return targets.length === 1 && targets[0].executable && targets[0].path === "." && targets[0].languageMode === 5 && !targets[0].mainActorIsolation && !targets[0].defines?.length && !targets[0].experimentalFeatures?.length && !targets[0].upcomingFeatures?.length && !targets[0].swiftFlags?.length && !targets[0].linkedLibraries?.length && !targets[0].cxxInterop && !swiftManifestCxxLanguageStandard(manifest) ? [] : targets;
|
|
358
405
|
}
|
|
359
406
|
export {
|
|
360
407
|
OBJC_RESOURCE_ACCESSOR_BODY,
|
|
@@ -362,6 +409,7 @@ export {
|
|
|
362
409
|
SWIFT_NATIVE_SOURCE_EXTENSIONS,
|
|
363
410
|
clangMacroSetting,
|
|
364
411
|
isSwiftManifestFile,
|
|
412
|
+
manifestCalls,
|
|
365
413
|
swiftImplicitResourcePaths,
|
|
366
414
|
swiftManifestCxxLanguageStandard,
|
|
367
415
|
swiftManifestTargets,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1684 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1684 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -39,6 +39,7 @@ __export(swift_toolchain_exports, {
|
|
|
39
39
|
peachsimPackageRoot: () => peachsimPackageRoot,
|
|
40
40
|
sourceSwiftCheckout: () => sourceSwiftCheckout,
|
|
41
41
|
swiftCompiler: () => swiftCompiler,
|
|
42
|
+
swiftCompilerAdmissible: () => swiftCompilerAdmissible,
|
|
42
43
|
swiftCompilerInstallSteps: () => swiftCompilerInstallSteps,
|
|
43
44
|
swiftCompilerRelease: () => swiftCompilerRelease,
|
|
44
45
|
swiftEnvironment: () => swiftEnvironment,
|
|
@@ -83,20 +84,20 @@ function swiftSdkOptions() {
|
|
|
83
84
|
}
|
|
84
85
|
return [];
|
|
85
86
|
}
|
|
86
|
-
var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-
|
|
87
|
-
var SWIFT_HOST_COMPILER_ID = "
|
|
87
|
+
var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-8be2e4a7a393b003";
|
|
88
|
+
var SWIFT_HOST_COMPILER_ID = "8be2e4a7a393b003";
|
|
88
89
|
var compilerArchives = {
|
|
89
90
|
"darwin-arm64": {
|
|
90
|
-
checksum: "
|
|
91
|
-
manifest: "
|
|
91
|
+
checksum: "88d69b7ac912962adaadce9fdb2c57fe07cd19e4d8158088e0acbd247496ca6d",
|
|
92
|
+
manifest: "70d5e2be8c959eb5dd1d9b576e6c209e1f58bfb9089f90c38c2d7e087759f0b3"
|
|
92
93
|
},
|
|
93
94
|
"linux-x64": {
|
|
94
|
-
checksum: "
|
|
95
|
-
manifest: "
|
|
95
|
+
checksum: "7c42ded03742d16816e64f8ae8fca478aaaff450d22ab3d698daf78c010854b2",
|
|
96
|
+
manifest: "90cfb09c5a0ba8c119066787cf47244a45bf3cda68dce94c6b1a16337b9b91bd"
|
|
96
97
|
},
|
|
97
98
|
"linux-arm64": {
|
|
98
|
-
checksum: "
|
|
99
|
-
manifest: "
|
|
99
|
+
checksum: "f9f1d96fb1a6325d3bb30ab12a75fc06e4e8535aab58a91581e03f3d91f68fa6",
|
|
100
|
+
manifest: "f988181dce795f6c8a6d4a8d86f7b61768f23a743b4e7bea76e64862ef328ad6"
|
|
100
101
|
}
|
|
101
102
|
};
|
|
102
103
|
function swiftHostCompilerArchive(release, host = `${process.platform}-${process.arch}`) {
|
|
@@ -295,7 +296,9 @@ function verifySwiftSdk(swift, sdk) {
|
|
|
295
296
|
function installSwiftSdkArchive(swift, sdk, archive) {
|
|
296
297
|
validateSwiftSdkIdentity(sdk);
|
|
297
298
|
const staging = import_node_fs.default.realpathSync(
|
|
298
|
-
import_node_fs.default.mkdtempSync(
|
|
299
|
+
import_node_fs.default.mkdtempSync(
|
|
300
|
+
import_node_path.default.join(scratch?.directory ?? import_node_os.default.tmpdir(), "peach-sdk-verification-")
|
|
301
|
+
)
|
|
299
302
|
);
|
|
300
303
|
try {
|
|
301
304
|
if (swiftFileChecksum(archive) !== sdk.wasmSdkChecksum)
|
|
@@ -371,7 +374,9 @@ function installSwiftWasmSdk(release, sdk) {
|
|
|
371
374
|
} catch {
|
|
372
375
|
}
|
|
373
376
|
const swift = import_node_path.default.join(swiftCompiler(release), "swift");
|
|
374
|
-
const staging = import_node_fs.default.mkdtempSync(
|
|
377
|
+
const staging = import_node_fs.default.mkdtempSync(
|
|
378
|
+
import_node_path.default.join(scratch?.directory ?? import_node_os.default.tmpdir(), "builder-swift-sdk-")
|
|
379
|
+
);
|
|
375
380
|
const archive = import_node_path.default.join(staging, "sdk.artifactbundle.tar.gz");
|
|
376
381
|
try {
|
|
377
382
|
if (sdk.wasmSdkUrl.startsWith("file:"))
|
|
@@ -433,6 +438,15 @@ function swiftCompiler(release) {
|
|
|
433
438
|
verifiedCompilers.set(release, bin);
|
|
434
439
|
return bin;
|
|
435
440
|
}
|
|
441
|
+
function swiftCompilerAdmissible(release) {
|
|
442
|
+
try {
|
|
443
|
+
swiftCompiler(release);
|
|
444
|
+
} catch (error) {
|
|
445
|
+
if (!release.includes("-custom-") || import_node_fs.default.existsSync(import_node_path.default.resolve(swiftToolchainBin(release), "../..")))
|
|
446
|
+
throw error;
|
|
447
|
+
swiftHostCompilerArchive(release);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
436
450
|
function swiftSdkInstallStep(release, wasmSdk) {
|
|
437
451
|
return `install the pinned SDK:
|
|
438
452
|
${swiftSdkInstallCommand(release, wasmSdk)}`;
|
|
@@ -502,6 +516,7 @@ function swiftCompilerInstall(release) {
|
|
|
502
516
|
peachsimPackageRoot,
|
|
503
517
|
sourceSwiftCheckout,
|
|
504
518
|
swiftCompiler,
|
|
519
|
+
swiftCompilerAdmissible,
|
|
505
520
|
swiftCompilerInstallSteps,
|
|
506
521
|
swiftCompilerRelease,
|
|
507
522
|
swiftEnvironment,
|
package/dist-lib/swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1684 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|