peachsim 0.1.2438 → 0.1.2439
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/README.md +30 -98
- package/cli/app-catalog.ts +4 -73
- package/cli/catalog/content.ts +1 -1
- package/cli/cloud-box-artifact.ts +26 -39
- package/cli/cloud-client.ts +69 -117
- package/cli/cloud-session.ts +2 -9
- package/cli/commands/box.ts +6 -6
- package/cli/commands/control.ts +4 -11
- package/cli/commands/flow.ts +5 -9
- package/cli/commands/kotlin.ts +2 -1
- package/cli/commands/platform.ts +21 -39
- package/cli/commands/record-three.ts +1 -1
- package/cli/commands/shell-url.ts +29 -23
- package/cli/dev-build-freshness.ts +4 -3
- package/cli/native-input.ts +2 -2
- package/cli/outbound-endpoints.ts +20 -45
- package/cli/remote-project-bundle.ts +8 -14
- package/cli/remote-simulators.ts +1 -1
- package/cli/send-to-box.ts +2 -1
- package/detox/jest-preset.cjs +1 -1
- package/detox/jest-transform.cjs +40 -2
- package/dist-lib/agent-daemon-client.cjs +34 -24
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +19 -17
- package/dist-lib/auth/shared-session.cjs +18 -16
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -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 +20 -583
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +17 -99
- package/dist-lib/bundle-channel.cjs +8718 -5552
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +13 -363
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +34 -155
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +26 -155
- package/dist-lib/config.cjs +1 -4
- package/dist-lib/config.mjs +11 -30
- package/dist-lib/detox/index.cjs +2554 -230
- package/dist-lib/detox/jest-preset.cjs +1 -1
- package/dist-lib/detox/jest-transform.cjs +40 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/acorn-FGE4PYDJ.mjs +50 -0
- package/dist-lib/esm-chunks/chunk-2EUHEBIJ.mjs +664 -0
- package/dist-lib/esm-chunks/chunk-2NPABFPN.mjs +5719 -0
- package/dist-lib/esm-chunks/chunk-4ZFNH7TU.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-5T4XBUJP.mjs +1353 -0
- package/dist-lib/esm-chunks/chunk-6VY6HTJC.mjs +18951 -0
- package/dist-lib/esm-chunks/chunk-7HANEMO4.mjs +188 -0
- package/dist-lib/esm-chunks/chunk-C3WBGYP6.mjs +186 -0
- package/dist-lib/esm-chunks/chunk-CVGDRROP.mjs +57 -0
- package/dist-lib/esm-chunks/chunk-DADGQELM.mjs +375 -0
- package/dist-lib/esm-chunks/chunk-DEGYKHN7.mjs +12 -0
- package/dist-lib/esm-chunks/chunk-HIDNO3RP.mjs +10992 -0
- package/dist-lib/esm-chunks/chunk-HSADZOVN.mjs +30 -0
- package/dist-lib/esm-chunks/chunk-IWJUYJQO.mjs +42 -0
- package/dist-lib/esm-chunks/chunk-JCKI3VZ6.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-KSQ5KM5Y.mjs +17 -0
- package/dist-lib/esm-chunks/chunk-KVTIDLBK.mjs +598 -0
- package/dist-lib/esm-chunks/chunk-MIQSRBVU.mjs +10 -0
- package/dist-lib/esm-chunks/chunk-YB27R6JG.mjs +115 -0
- package/dist-lib/esm-chunks/metro-layout-parser-MVUAXRUJ.mjs +58 -0
- package/dist-lib/expo-swift-bundle.cjs +7856 -4707
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +16 -165
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +15658 -11404
- package/dist-lib/host/fetch-proxy-handler.cjs +3927 -342
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -1
- package/dist-lib/host/replacement-module-handler.cjs +4 -4
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +9145 -32150
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +2 -2
- package/dist-lib/kotlin-host.cjs +260 -253
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +5 -13
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +5 -6
- package/dist-lib/metro-production-bundle.cjs +22 -3
- package/dist-lib/metro-production-bundle.mjs +26 -92
- package/dist-lib/native-app-identity-project.cjs +663 -451
- package/dist-lib/native-app-identity-project.mjs +509 -2318
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +27 -1340
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +5 -18
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -1
- package/dist-lib/plist.cjs +2 -2
- package/dist-lib/plist.mjs +5 -7
- package/dist-lib/profiles.cjs +2 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +246 -187
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +1059 -1238
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -1
- package/dist-lib/reap-browser.cjs +18 -7
- package/dist-lib/scripts/dev-server-scanner.cjs +6 -230
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +22 -78
- package/dist-lib/skills.cjs +21657 -17374
- package/dist-lib/swift-compile.cjs +1343 -1318
- package/dist-lib/swift-compile.mjs +68 -19013
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +35 -630
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +9 -24
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +18061 -0
- package/dist-lib/vendor/acorn.cjs +5699 -0
- package/dist-lib/vendor/bplist-parser.cjs +1589 -0
- package/dist-lib/vendor/ignore.cjs +455 -0
- package/dist-lib/vendor/magic-string.cjs +1693 -0
- package/dist-lib/vendor/plist.cjs +10978 -0
- package/dist-lib/vendor/smol-toml.cjs +768 -0
- package/dist-lib/vendor/stream-json.cjs +1997 -0
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +23593 -0
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +15750 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +11316 -0
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +482 -0
- package/dist-lib/vendor/sucrase.cjs +23593 -0
- package/dist-lib/vendor/terser.cjs +36874 -0
- package/dist-lib/vendor/valibot.cjs +6253 -0
- package/dist-lib/vendor/zod.cjs +23262 -0
- package/dist-lib/worklet-executable.cjs +3 -3
- package/dist-lib/worklet-executable.mjs +11 -16
- package/dist-types/packages/peach-engine/src/config.d.ts +1 -1
- package/kotlin/fork/NOTICE +3 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/kotlin/toolchain.json +6 -6
- package/package.json +17 -121
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +13 -223
- package/src/android-autolinking.ts +2 -2
- package/src/bundle-channel.mjs +3 -15
- package/src/cloud-contract.ts +3 -4
- package/src/config.ts +0 -5
- package/src/host/bridge-host.ts +19 -1
- package/src/host/server-scan-handler.ts +1 -9
- package/src/index.ts +0 -2
- package/src/kotlin-host.ts +1 -2
- package/src/kotlinDiscoveryContract.ts +1 -0
- package/src/metro-production-bundle.ts +28 -6
- package/src/native-seam-manifest.ts +0 -13
- package/src/one-native-app-catalog.ts +8 -27
- package/src/one-native-app-config.ts +95 -0
- package/src/one-native-source.ts +250 -0
- package/src/one-widget-metadata.ts +45 -126
- package/src/oneWidgetContract.ts +80 -117
- package/src/serverDiscoveryContract.ts +0 -1
- package/src/simulator-route.ts +8 -0
- package/src/vite-plugin.ts +2 -2
- package/src/xcode-project.ts +1 -1
- package/dist-lib/metro.cjs +0 -27984
- package/dist-lib/vite-swift.cjs +0 -43376
- package/dist-lib/vite.cjs +0 -21456
- package/src/androidAutolinkingContract.ts +0 -48
- package/src/androidRootModuleContract.ts +0 -39
- package/src/dev-server-open.ts +0 -92
- package/src/metro-plugin.ts +0 -578
- package/src/one-widget-discovery.ts +0 -23
- package/src/swift-vite-lifetime.ts +0 -42
- package/src/vite-plugin-one.ts +0 -746
- package/src/vite-plugin-swift.ts +0 -225
- package/src/vite.d.ts +0 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2439 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,633 +1,38 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"systemLibrary",
|
|
37
|
-
"macro",
|
|
38
|
-
"plugin",
|
|
39
|
-
"target",
|
|
40
|
-
"library",
|
|
41
|
-
"executable",
|
|
42
|
-
"package"
|
|
43
|
-
];
|
|
44
|
-
function manifestCalls(manifest, kinds) {
|
|
45
|
-
const code = manifest.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|[^:"])\/\/[^\n]*/g, "$1");
|
|
46
|
-
const calls = [];
|
|
47
|
-
const pattern = new RegExp(
|
|
48
|
-
`(?:\\.(${MANIFEST_DECLARATIONS.join("|")})|\\b(Package))\\s*\\(`,
|
|
49
|
-
"g"
|
|
50
|
-
);
|
|
51
|
-
let match;
|
|
52
|
-
while ((match = pattern.exec(code)) !== null) {
|
|
53
|
-
let depth = 1;
|
|
54
|
-
const start = pattern.lastIndex;
|
|
55
|
-
let i = start;
|
|
56
|
-
let inString = false;
|
|
57
|
-
let escaped = false;
|
|
58
|
-
let flat = "";
|
|
59
|
-
while (i < code.length && depth > 0) {
|
|
60
|
-
const ch = code[i];
|
|
61
|
-
if (inString) {
|
|
62
|
-
if (escaped) escaped = false;
|
|
63
|
-
else if (ch === "\\") escaped = true;
|
|
64
|
-
else if (ch === '"') inString = false;
|
|
65
|
-
if (depth === 1) flat += ch;
|
|
66
|
-
} else if (ch === '"') {
|
|
67
|
-
inString = true;
|
|
68
|
-
if (depth === 1) flat += ch;
|
|
69
|
-
} else if (ch === "(") {
|
|
70
|
-
depth++;
|
|
71
|
-
if (depth === 1) flat += ch;
|
|
72
|
-
} else if (ch === ")") {
|
|
73
|
-
depth--;
|
|
74
|
-
if (depth >= 1) flat += ch;
|
|
75
|
-
} else if (depth === 1) {
|
|
76
|
-
flat += ch;
|
|
77
|
-
}
|
|
78
|
-
i++;
|
|
79
|
-
}
|
|
80
|
-
const kind = match[1] ?? match[2];
|
|
81
|
-
if (kinds.includes(kind)) calls.push({ kind, flat, call: code.slice(start, i) });
|
|
82
|
-
else if (kind === "Package") {
|
|
83
|
-
calls.push(...manifestCalls(code.slice(start, i - 1), kinds));
|
|
84
|
-
}
|
|
85
|
-
pattern.lastIndex = i;
|
|
86
|
-
}
|
|
87
|
-
return calls;
|
|
88
|
-
}
|
|
89
|
-
function splitManifestArguments(source) {
|
|
90
|
-
const arguments_ = [];
|
|
91
|
-
let start = 0;
|
|
92
|
-
let parentheses = 0;
|
|
93
|
-
let brackets = 0;
|
|
94
|
-
let braces = 0;
|
|
95
|
-
let inString = false;
|
|
96
|
-
let escaped = false;
|
|
97
|
-
for (let index = 0; index < source.length; index++) {
|
|
98
|
-
const character = source[index];
|
|
99
|
-
if (inString) {
|
|
100
|
-
if (escaped) escaped = false;
|
|
101
|
-
else if (character === "\\") escaped = true;
|
|
102
|
-
else if (character === '"') inString = false;
|
|
103
|
-
} else if (character === '"') inString = true;
|
|
104
|
-
else if (character === "(") parentheses++;
|
|
105
|
-
else if (character === ")") parentheses--;
|
|
106
|
-
else if (character === "[") brackets++;
|
|
107
|
-
else if (character === "]") brackets--;
|
|
108
|
-
else if (character === "{") braces++;
|
|
109
|
-
else if (character === "}") braces--;
|
|
110
|
-
else if (character === "," && parentheses === 0 && brackets === 0 && braces === 0) {
|
|
111
|
-
arguments_.push(source.slice(start, index).trim());
|
|
112
|
-
start = index + 1;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
const final = source.slice(start).trim();
|
|
116
|
-
if (final) arguments_.push(final);
|
|
117
|
-
return arguments_;
|
|
118
|
-
}
|
|
119
|
-
function swiftManifestPackages(manifest) {
|
|
120
|
-
return new Map(
|
|
121
|
-
manifestCalls(manifest, ["package"]).flatMap(({ flat }) => {
|
|
122
|
-
const directory = /\bpath\s*:\s*"([^"]+)"/.exec(flat)?.[1];
|
|
123
|
-
if (!directory) return [];
|
|
124
|
-
const name = /\bname\s*:\s*"([^"]+)"/.exec(flat)?.[1] ?? directory.split("/").pop();
|
|
125
|
-
return [[name.toLowerCase(), directory]];
|
|
126
|
-
})
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
var SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS = [
|
|
130
|
-
".c",
|
|
131
|
-
".cc",
|
|
132
|
-
".cpp",
|
|
133
|
-
".cxx",
|
|
134
|
-
".m",
|
|
135
|
-
".mm"
|
|
136
|
-
];
|
|
137
|
-
function isSwiftNativeTranslationUnit(file) {
|
|
138
|
-
return SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS.some(
|
|
139
|
-
(extension) => file.endsWith(extension)
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
var SWIFT_STANDINS_DIR = "__standins__";
|
|
143
|
-
var SWIFT_NATIVE_SOURCE_EXTENSIONS = [
|
|
144
|
-
...SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS,
|
|
145
|
-
".s",
|
|
146
|
-
".S",
|
|
147
|
-
".h",
|
|
148
|
-
".hh",
|
|
149
|
-
".hpp",
|
|
150
|
-
".hxx",
|
|
151
|
-
".pch",
|
|
152
|
-
".inc",
|
|
153
|
-
".inl",
|
|
154
|
-
".ipp",
|
|
155
|
-
".def",
|
|
156
|
-
".modulemap"
|
|
157
|
-
];
|
|
158
|
-
function swiftNativeSupportFiles(files, targets) {
|
|
159
|
-
return Object.fromEntries(
|
|
160
|
-
Object.entries(files).filter(
|
|
161
|
-
([file]) => SWIFT_NATIVE_SOURCE_EXTENSIONS.some((extension) => file.endsWith(extension)) && (!isSwiftNativeTranslationUnit(file) || !targets.some(
|
|
162
|
-
(target) => target.path === "." || file.startsWith(`${target.path}/`)
|
|
163
|
-
))
|
|
164
|
-
)
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
function clangImportNames(text, isLocalHeader) {
|
|
168
|
-
return [
|
|
169
|
-
...text.matchAll(
|
|
170
|
-
/^\s*(?:#\s*(?:import|include)\s*<((\w+)\/[^>]+)>|@import\s+(\w+))/gm
|
|
171
|
-
)
|
|
172
|
-
].flatMap(
|
|
173
|
-
(match) => match[1] && isLocalHeader?.(match[1]) ? [] : [match[2] ?? match[3]]
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
function moduleMapTokens(text) {
|
|
177
|
-
return (text.match(/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"[^"]*"|[\w.*]+|[{}\[\]]/g) ?? []).filter((token) => !token.startsWith("/"));
|
|
178
|
-
}
|
|
179
|
-
function moduleMapName(text) {
|
|
180
|
-
const tokens = moduleMapTokens(text);
|
|
181
|
-
const index = tokens.findIndex(
|
|
182
|
-
(token, i) => token === "module" && tokens[i - 1] !== "extern"
|
|
183
|
-
);
|
|
184
|
-
return index < 0 ? void 0 : tokens[index + 1];
|
|
185
|
-
}
|
|
186
|
-
function moduleMapModules(text) {
|
|
187
|
-
const modules = [];
|
|
188
|
-
const token = /\/\*[\s\S]*?\*\/|\/\/[^\n]*|"[^"]*"|\{|\}|\bmodule\s+([\w.]+)/g;
|
|
189
|
-
let depth = 0;
|
|
190
|
-
let start = -1;
|
|
191
|
-
let name = "";
|
|
192
|
-
for (const match of text.matchAll(token)) {
|
|
193
|
-
if (match[0] === "{") depth++;
|
|
194
|
-
else if (match[0] === "}") {
|
|
195
|
-
depth--;
|
|
196
|
-
if (depth === 0 && start >= 0) {
|
|
197
|
-
modules.push({ name, text: text.slice(start, match.index + 1) });
|
|
198
|
-
start = -1;
|
|
199
|
-
}
|
|
200
|
-
} else if (match[1] !== void 0 && depth === 0) {
|
|
201
|
-
const before = text.slice(0, match.index).trimEnd();
|
|
202
|
-
if (/\bextern$/.test(before)) continue;
|
|
203
|
-
start = match.index;
|
|
204
|
-
name = match[1];
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return modules;
|
|
208
|
-
}
|
|
209
|
-
function swiftTargetModuleName(name) {
|
|
210
|
-
return name.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
|
|
211
|
-
}
|
|
212
|
-
function swiftPackageClangModuleMap(moduleName, umbrella) {
|
|
213
|
-
const escaped = umbrella.path.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
|
|
214
|
-
const declaration = umbrella.kind === "header" ? `umbrella header "${escaped}"` : `umbrella "${escaped}"`;
|
|
215
|
-
return `module ${moduleName} {
|
|
216
|
-
${declaration}
|
|
217
|
-
export *
|
|
218
|
-
}`;
|
|
219
|
-
}
|
|
220
|
-
function swiftPackageIdentity(url) {
|
|
221
|
-
const path = url.endsWith("/") ? url.slice(0, -1) : url;
|
|
222
|
-
return (path.split("/").pop() ?? path).replace(/\.git$/, "").toLowerCase();
|
|
223
|
-
}
|
|
224
|
-
var withoutGlogModuleMap = (flags) => flags.filter(
|
|
225
|
-
(flag) => !(flag.startsWith("-fmodule-map-file=") && flag.endsWith("/glog.modulemap"))
|
|
226
|
-
);
|
|
227
|
-
function clangSettingEntries(settings, tool) {
|
|
228
|
-
return (settings ?? []).flatMap(
|
|
229
|
-
(setting) => setting.tool !== tool ? [] : "headerSearchPath" in setting ? [`.headerSearchPath(${JSON.stringify(setting.headerSearchPath)})`] : [`.unsafeFlags(${JSON.stringify(withoutGlogModuleMap(setting.flags))})`]
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
function clangMacroSetting(macro) {
|
|
233
|
-
const [name, ...value] = macro.split("=");
|
|
234
|
-
return value.length === 0 ? `.define(${JSON.stringify(name)})` : `.define(${JSON.stringify(name)}, to: ${JSON.stringify(value.join("="))})`;
|
|
235
|
-
}
|
|
236
|
-
var swiftEscapes = {
|
|
237
|
-
"\\": "\\",
|
|
238
|
-
'"': '"',
|
|
239
|
-
"'": "'",
|
|
240
|
-
n: "\n",
|
|
241
|
-
r: "\r",
|
|
242
|
-
t: " "
|
|
243
|
-
};
|
|
244
|
-
function swiftStringValue(raw, context) {
|
|
245
|
-
return raw.replace(/\\(.)/g, (_, escape) => {
|
|
246
|
-
const value = swiftEscapes[escape];
|
|
247
|
-
if (value === void 0)
|
|
248
|
-
throw new Error(
|
|
249
|
-
`Unsupported ${escape === "(" ? "interpolation" : `escape \\${escape}`} in ${context}`
|
|
250
|
-
);
|
|
251
|
-
return value;
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
function bracketBody(text, openIndex) {
|
|
255
|
-
let depth = 1;
|
|
256
|
-
let index = openIndex;
|
|
257
|
-
for (; index < text.length && depth > 0; index++) {
|
|
258
|
-
const char = text[index];
|
|
259
|
-
if (char === '"') {
|
|
260
|
-
for (index++; index < text.length && text[index] !== '"'; index++)
|
|
261
|
-
if (text[index] === "\\") index++;
|
|
262
|
-
} else if (char === "[") depth++;
|
|
263
|
-
else if (char === "]") depth--;
|
|
264
|
-
}
|
|
265
|
-
return text.slice(openIndex, index - 1);
|
|
266
|
-
}
|
|
267
|
-
function settingsBlocks(call, tool) {
|
|
268
|
-
const bodies = [];
|
|
269
|
-
for (const open of call.matchAll(new RegExp(`\\b${tool}Settings\\s*:\\s*\\[`, "g")))
|
|
270
|
-
bodies.push(bracketBody(call, open.index + open[0].length));
|
|
271
|
-
return bodies;
|
|
272
|
-
}
|
|
273
|
-
function unsafeFlagsAt(body, start, encoded, target, readArguments) {
|
|
274
|
-
if (!encoded)
|
|
275
|
-
return [...bracketBody(body, start).matchAll(/"((?:[^"\\]|\\.)*)"/g)].map(
|
|
276
|
-
(match) => swiftStringValue(match[1], `unsafeFlags of target ${target} (${match[0]})`)
|
|
277
|
-
);
|
|
278
|
-
const literal = /^((?:[^"\\]|\\.)*)"/.exec(body.slice(start));
|
|
279
|
-
if (!literal) throw new Error(`Unterminated peachCompilerArguments of target ${target}`);
|
|
280
|
-
if (!readArguments)
|
|
281
|
-
throw new Error(`Missing compiler argument reader for target ${target}`);
|
|
282
|
-
const decoded = JSON.parse(
|
|
283
|
-
readArguments(
|
|
284
|
-
swiftStringValue(literal[1], `peachCompilerArguments of target ${target}`)
|
|
285
|
-
)
|
|
286
|
-
);
|
|
287
|
-
const flags = Array.isArray(decoded) ? decoded.filter((flag) => typeof flag === "string") : [];
|
|
288
|
-
if (!Array.isArray(decoded) || flags.length !== decoded.length)
|
|
289
|
-
throw new Error(`peachCompilerArguments of target ${target} is not a string array`);
|
|
290
|
-
return flags;
|
|
291
|
-
}
|
|
292
|
-
var unsafeFlagsOpen = /\.unsafeFlags\(\s*(?:(\[)|peachCompilerArguments\(\s*")/g;
|
|
293
|
-
function settingFeatures(call, setting, target, readArguments) {
|
|
294
|
-
const found = [];
|
|
295
|
-
for (const body of settingsBlocks(call, "swift")) {
|
|
296
|
-
if (setting === ".unsafeFlags") {
|
|
297
|
-
for (const open of body.matchAll(unsafeFlagsOpen))
|
|
298
|
-
found.push(
|
|
299
|
-
...unsafeFlagsAt(
|
|
300
|
-
body,
|
|
301
|
-
open.index + open[0].length,
|
|
302
|
-
open[1] === void 0,
|
|
303
|
-
target,
|
|
304
|
-
readArguments
|
|
305
|
-
)
|
|
306
|
-
);
|
|
307
|
-
} else {
|
|
308
|
-
const name = "([A-Za-z_][A-Za-z0-9_]*(?:=[A-Za-z_][A-Za-z0-9_.-]*)?)";
|
|
309
|
-
const pattern = setting === ".enableExperimentalFeature" ? new RegExp(`\\.enableExperimentalFeature\\(\\s*"${name}"\\s*\\)`, "g") : new RegExp(`\\.enableUpcomingFeature\\(\\s*"${name}"\\s*\\)`, "g");
|
|
310
|
-
for (const match of body.matchAll(pattern)) found.push(match[1]);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
return found;
|
|
314
|
-
}
|
|
315
|
-
function settingClang(call, target, readArguments) {
|
|
316
|
-
const found = [];
|
|
317
|
-
for (const tool of ["c", "cxx"])
|
|
318
|
-
for (const body of settingsBlocks(call, tool))
|
|
319
|
-
for (const match of body.matchAll(
|
|
320
|
-
/\.headerSearchPath\(\s*"((?:[^"\\]|\\.)*)"\s*\)|\.unsafeFlags\(\s*(?:(\[)|peachCompilerArguments\(\s*")/g
|
|
321
|
-
)) {
|
|
322
|
-
if (match[1] !== void 0) {
|
|
323
|
-
found.push({
|
|
324
|
-
tool,
|
|
325
|
-
headerSearchPath: swiftStringValue(
|
|
326
|
-
match[1],
|
|
327
|
-
`headerSearchPath of target ${target} (${match[0]})`
|
|
328
|
-
)
|
|
329
|
-
});
|
|
330
|
-
continue;
|
|
331
|
-
}
|
|
332
|
-
const open = match.index + match[0].length;
|
|
333
|
-
if (match[2] === void 0) {
|
|
334
|
-
found.push({
|
|
335
|
-
tool,
|
|
336
|
-
flags: unsafeFlagsAt(body, open, true, target, readArguments)
|
|
337
|
-
});
|
|
338
|
-
continue;
|
|
339
|
-
}
|
|
340
|
-
const list = bracketBody(body, open);
|
|
341
|
-
if (!/^\s*\)/.test(body.slice(open + list.length + 1))) continue;
|
|
342
|
-
found.push({ tool, flags: unsafeFlagsAt(body, open, false, target) });
|
|
343
|
-
}
|
|
344
|
-
return found;
|
|
345
|
-
}
|
|
346
|
-
function settingDefines(call, tool) {
|
|
347
|
-
const defines = [];
|
|
348
|
-
for (const body of settingsBlocks(call, tool)) {
|
|
349
|
-
for (const match of body.matchAll(
|
|
350
|
-
/\.define\(\s*"([A-Za-z_][A-Za-z0-9_]*)"\s*(?:,\s*to:\s*"((?:[^"\\]|\\.)*)"\s*)?\)/g
|
|
351
|
-
)) {
|
|
352
|
-
const name = match[1];
|
|
353
|
-
defines.push(
|
|
354
|
-
match[2] === void 0 ? name : `${name}=${swiftStringValue(match[2], `the value of macro ${name}`)}`
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return defines;
|
|
359
|
-
}
|
|
360
|
-
function swiftManifestDeclarations(manifest, resourcePaths = []) {
|
|
361
|
-
const implicitResources = swiftImplicitResourcePaths(resourcePaths);
|
|
362
|
-
const targets = [];
|
|
363
|
-
for (const declaration of manifestCalls(manifest, [
|
|
364
|
-
"executableTarget",
|
|
365
|
-
"target",
|
|
366
|
-
"systemLibrary"
|
|
367
|
-
])) {
|
|
368
|
-
const { kind, flat } = declaration;
|
|
369
|
-
const name = /\bname\s*:\s*"([^"]+)"/.exec(flat)?.[1];
|
|
370
|
-
if (!name) continue;
|
|
371
|
-
const rawPath = /\bpath\s*:\s*"([^"]*)"/.exec(flat)?.[1];
|
|
372
|
-
const targetPath = rawPath == null || rawPath === "" ? `Sources/${name}` : rawPath.replace(/^\.\//, "").replace(/\/+$/, "");
|
|
373
|
-
const exclude = /\bexclude\s*:\s*\[/.exec(flat);
|
|
374
|
-
const excluded = [
|
|
375
|
-
...(exclude ? bracketBody(flat, exclude.index + exclude[0].length) : "").matchAll(
|
|
376
|
-
/"([^"]+)"/g
|
|
377
|
-
)
|
|
378
|
-
].map((match) => match[1].replace(/^\.\//, "").replace(/\/+$/, ""));
|
|
379
|
-
const prefix = targetPath === "." ? "" : `${targetPath}/`;
|
|
380
|
-
const resources = /\bresources\s*:/.test(flat) || implicitResources.some((file) => {
|
|
381
|
-
if (!file.startsWith(prefix)) return false;
|
|
382
|
-
const relative = file.slice(prefix.length);
|
|
383
|
-
if (excluded.some(
|
|
384
|
-
(exclude2) => relative === exclude2 || relative.startsWith(`${exclude2}/`)
|
|
385
|
-
))
|
|
386
|
-
return false;
|
|
387
|
-
return true;
|
|
388
|
-
});
|
|
389
|
-
targets.push({
|
|
390
|
-
...declaration,
|
|
391
|
-
name,
|
|
392
|
-
path: targetPath,
|
|
393
|
-
executable: kind === "executableTarget",
|
|
394
|
-
resources,
|
|
395
|
-
exclude: excluded
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
return targets;
|
|
399
|
-
}
|
|
400
|
-
function swiftManifestTargets(manifest, resourcePaths = [], readArguments) {
|
|
401
|
-
const targets = [];
|
|
402
|
-
const packageCall = manifestCalls(manifest, ["Package"])[0];
|
|
403
|
-
const platformArgument = packageCall ? splitManifestArguments(packageCall.call.slice(0, -1)).find(
|
|
404
|
-
(argument) => /^platforms\s*:/.test(argument)
|
|
405
|
-
) : void 0;
|
|
406
|
-
const platformList = /^platforms\s*:\s*\[([\s\S]*)\]$/.exec(platformArgument ?? "")?.[1];
|
|
407
|
-
const iosPlatforms = [
|
|
408
|
-
...(platformList ?? "").matchAll(
|
|
409
|
-
/\.iOS\(\s*(?:"(\d+(?:\.\d+){0,2})"|\.v(\d+(?:_\d+){0,2}))\s*\)/g
|
|
410
|
-
)
|
|
411
|
-
];
|
|
412
|
-
const iosDeploymentTarget = iosPlatforms.length === 1 ? iosPlatforms[0][1] ?? iosPlatforms[0][2].replaceAll("_", ".") : void 0;
|
|
413
|
-
const declarations = swiftManifestDeclarations(manifest, resourcePaths);
|
|
414
|
-
const targetNames = new Set(declarations.map(({ name }) => name));
|
|
415
|
-
for (const {
|
|
416
|
-
kind,
|
|
417
|
-
flat,
|
|
418
|
-
call,
|
|
419
|
-
name,
|
|
420
|
-
path: targetPath,
|
|
421
|
-
executable,
|
|
422
|
-
resources,
|
|
423
|
-
exclude: excluded
|
|
424
|
-
} of declarations) {
|
|
425
|
-
const publicHeadersPath = /\bpublicHeadersPath\s*:\s*"([^"]*)"/.exec(flat)?.[1];
|
|
426
|
-
const languageMode = Number(
|
|
427
|
-
/\.swiftLanguageMode\(\s*\.v(\d+)\s*\)/.exec(call)?.[1] ?? "5"
|
|
428
|
-
);
|
|
429
|
-
const mainActorIsolation = /\.defaultIsolation\(\s*MainActor\.self\s*\)/.test(call);
|
|
430
|
-
const cxxInterop = /\.interoperabilityMode\(\s*\.Cxx\s*\)/.test(
|
|
431
|
-
call.replace(/"(?:\\.|[^"\\])*"/g, "")
|
|
432
|
-
);
|
|
433
|
-
const defines = settingDefines(call, "swift").map((define) => define.split("=")[0]);
|
|
434
|
-
const experimentalFeatures = settingFeatures(call, ".enableExperimentalFeature", name);
|
|
435
|
-
const upcomingFeatures = settingFeatures(call, ".enableUpcomingFeature", name);
|
|
436
|
-
const swiftFlags = settingFeatures(call, ".unsafeFlags", name, readArguments);
|
|
437
|
-
const cDefines = settingDefines(call, "c");
|
|
438
|
-
const cxxDefines = settingDefines(call, "cxx");
|
|
439
|
-
const clangSettings = settingClang(call, name, readArguments);
|
|
440
|
-
const linkedLibraries = [...call.matchAll(/\.linkedLibrary\(\s*"([^"]+)"\s*\)/g)].map(
|
|
441
|
-
(match) => match[1]
|
|
442
|
-
);
|
|
443
|
-
const targetArguments = splitManifestArguments(call.slice(0, -1));
|
|
444
|
-
const sourceArgument = targetArguments.find(
|
|
445
|
-
(argument) => /^sources\s*:/.test(argument)
|
|
446
|
-
);
|
|
447
|
-
const sourceList = sourceArgument?.replace(/^sources\s*:\s*/, "").trim();
|
|
448
|
-
if (sourceList && sourceList !== "nil" && !(sourceList.startsWith("[") && sourceList.endsWith("]")))
|
|
449
|
-
throw new Error(`Unsupported sources expression in target ${name}: ${sourceList}`);
|
|
450
|
-
const sources = sourceList?.startsWith("[") && sourceList.endsWith("]") ? splitManifestArguments(sourceList.slice(1, -1)).map((source) => {
|
|
451
|
-
const literal = /^"((?:[^"\\]|\\.)*)"$/.exec(source);
|
|
452
|
-
if (!literal)
|
|
453
|
-
throw new Error(
|
|
454
|
-
`Unsupported source expression in target ${name}: ${source}`
|
|
455
|
-
);
|
|
456
|
-
return swiftStringValue(literal[1], `a source of target ${name}`).replace(/^\.\//, "").replace(/\/+$/, "");
|
|
457
|
-
}) : void 0;
|
|
458
|
-
const dependencyArgument = targetArguments.find(
|
|
459
|
-
(argument) => /^dependencies\s*:/.test(argument)
|
|
460
|
-
);
|
|
461
|
-
const dependencyList = dependencyArgument?.replace(/^dependencies\s*:\s*/, "").trim();
|
|
462
|
-
const dependencies = [];
|
|
463
|
-
if (dependencyList?.startsWith("[") && dependencyList.endsWith("]")) {
|
|
464
|
-
for (const dependency of splitManifestArguments(dependencyList.slice(1, -1))) {
|
|
465
|
-
const product = /^\.product\s*\(\s*name\s*:\s*"([^"]+)"\s*,\s*package\s*:\s*"([^"]+)"\s*\)$/.exec(
|
|
466
|
-
dependency
|
|
467
|
-
);
|
|
468
|
-
if (product) {
|
|
469
|
-
dependencies.push({ kind: "product", name: product[1], package: product[2] });
|
|
470
|
-
continue;
|
|
471
|
-
}
|
|
472
|
-
const dependencyName = /^"([^"]+)"$/.exec(dependency)?.[1] ?? /^\.(?:target|byName)\s*\(\s*name\s*:\s*"([^"]+)"/.exec(dependency)?.[1];
|
|
473
|
-
if (dependencyName && targetNames.has(dependencyName))
|
|
474
|
-
dependencies.push({ kind: "target", name: dependencyName });
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
targets.push({
|
|
478
|
-
name,
|
|
479
|
-
path: targetPath,
|
|
480
|
-
executable,
|
|
481
|
-
...kind === "systemLibrary" ? { systemLibrary: true } : {},
|
|
482
|
-
...publicHeadersPath === void 0 ? {} : { publicHeadersPath },
|
|
483
|
-
languageMode,
|
|
484
|
-
...iosDeploymentTarget ? { iosDeploymentTarget } : {},
|
|
485
|
-
mainActorIsolation,
|
|
486
|
-
...cxxInterop ? { cxxInterop: true } : {},
|
|
487
|
-
...defines.length === 0 ? {} : { defines },
|
|
488
|
-
...experimentalFeatures.length === 0 ? {} : { experimentalFeatures },
|
|
489
|
-
...upcomingFeatures.length === 0 ? {} : { upcomingFeatures },
|
|
490
|
-
...swiftFlags.length === 0 ? {} : { swiftFlags },
|
|
491
|
-
...cDefines.length === 0 ? {} : { cDefines },
|
|
492
|
-
...cxxDefines.length === 0 ? {} : { cxxDefines },
|
|
493
|
-
...clangSettings.length === 0 ? {} : { clangSettings },
|
|
494
|
-
...linkedLibraries.length === 0 ? {} : { linkedLibraries },
|
|
495
|
-
resources,
|
|
496
|
-
...dependencyList?.startsWith("[") && dependencyList.endsWith("]") ? { dependencies } : {},
|
|
497
|
-
...sources === void 0 ? {} : { sources },
|
|
498
|
-
...excluded.length === 0 ? {} : { exclude: excluded }
|
|
499
|
-
});
|
|
500
|
-
}
|
|
501
|
-
return targets;
|
|
502
|
-
}
|
|
503
|
-
function swiftManifestCxxLanguageStandard(manifest) {
|
|
504
|
-
const declaration = manifestCalls(manifest, ["Package"])[0];
|
|
505
|
-
if (!declaration) return void 0;
|
|
506
|
-
const code = declaration.flat.replace(/"(?:\\.|[^"\\])*"/g, "");
|
|
507
|
-
return /\bcxxLanguageStandard\s*:\s*\.(\w+)/.exec(code)?.[1];
|
|
508
|
-
}
|
|
509
|
-
function swiftResourceBundles(files, resourcePaths = []) {
|
|
510
|
-
const manifest = files["Package.swift"] ?? "";
|
|
511
|
-
const targets = swiftManifestDeclarations(manifest, resourcePaths).filter(
|
|
512
|
-
(target) => target.resources
|
|
513
|
-
);
|
|
514
|
-
if (targets.length === 0) return [];
|
|
515
|
-
const declaration = manifestCalls(manifest, ["Package"])[0];
|
|
516
|
-
const packageName = declaration && /\bname\s*:\s*"([^"/\\]+)"/.exec(declaration.flat)?.[1];
|
|
517
|
-
if (!packageName)
|
|
518
|
-
throw new Error("swift resource bundles require the original package name");
|
|
519
|
-
return targets.map((target) => ({
|
|
520
|
-
target: target.name,
|
|
521
|
-
sourcePath: target.path,
|
|
522
|
-
path: `${packageName}_${target.name}.bundle`
|
|
523
|
-
}));
|
|
524
|
-
}
|
|
525
|
-
var OBJC_RESOURCE_ACCESSOR_HEADER = "resource_bundle_accessor.h";
|
|
526
|
-
var OBJC_RESOURCE_ACCESSOR_BODY = "resource_bundle_accessor.m";
|
|
527
|
-
function swiftObjCResourceBundleName(args) {
|
|
528
|
-
const { target, resources, usesBundleMacro } = args;
|
|
529
|
-
if (!resources) {
|
|
530
|
-
if (usesBundleMacro)
|
|
531
|
-
throw new Error(
|
|
532
|
-
`objective-c target ${target} uses SWIFTPM_MODULE_BUNDLE but declares no resources`
|
|
533
|
-
);
|
|
534
|
-
return void 0;
|
|
535
|
-
}
|
|
536
|
-
const bundle = args.bundles?.find((candidate) => candidate.target === target);
|
|
537
|
-
if (!bundle || bundle.sourcePath !== args.path || !bundle.path.endsWith(`_${target}.bundle`))
|
|
538
|
-
throw new Error(`swift resource target ${target} has no matching bundle assignment`);
|
|
539
|
-
return bundle.path.slice(0, -".bundle".length);
|
|
540
|
-
}
|
|
541
|
-
function swiftObjCResourceAccessor(bundleName) {
|
|
542
|
-
const accessorName = swiftTargetModuleName(bundleName.replace(/[^\x00-\x7f]/gu, "_"));
|
|
543
|
-
const symbol = `${accessorName}_SWIFTPM_MODULE_BUNDLE`;
|
|
544
|
-
const finder = `${accessorName}_SWIFTPM_MODULE_BUNDLER_FINDER`;
|
|
545
|
-
return {
|
|
546
|
-
header: [
|
|
547
|
-
"#ifdef __OBJC__",
|
|
548
|
-
"#import <Foundation/Foundation.h>",
|
|
549
|
-
"",
|
|
550
|
-
"__BEGIN_DECLS",
|
|
551
|
-
"",
|
|
552
|
-
`NSBundle* ${symbol}(void);`,
|
|
553
|
-
"",
|
|
554
|
-
`#define SWIFTPM_MODULE_BUNDLE ${symbol}()`,
|
|
555
|
-
"",
|
|
556
|
-
"__END_DECLS",
|
|
557
|
-
"#endif"
|
|
558
|
-
].join("\n"),
|
|
559
|
-
body: [
|
|
560
|
-
"#import <Foundation/Foundation.h>",
|
|
561
|
-
"",
|
|
562
|
-
"NS_ASSUME_NONNULL_BEGIN",
|
|
563
|
-
"",
|
|
564
|
-
`@interface ${finder} : NSObject`,
|
|
565
|
-
"@end",
|
|
566
|
-
"",
|
|
567
|
-
`@implementation ${finder}`,
|
|
568
|
-
"@end",
|
|
569
|
-
"",
|
|
570
|
-
`NSBundle* ${symbol}() {`,
|
|
571
|
-
` NSString *bundleName = @"${accessorName}";`,
|
|
572
|
-
"",
|
|
573
|
-
" NSArray<NSURL*> *candidates = @[",
|
|
574
|
-
" NSBundle.mainBundle.resourceURL,",
|
|
575
|
-
` [NSBundle bundleForClass:[${finder} class]].resourceURL,`,
|
|
576
|
-
" NSBundle.mainBundle.bundleURL",
|
|
577
|
-
" ];",
|
|
578
|
-
"",
|
|
579
|
-
" for (NSURL* candidate in candidates) {",
|
|
580
|
-
' NSURL *bundlePath = [candidate URLByAppendingPathComponent:[NSString stringWithFormat:@"%@.bundle", bundleName]];',
|
|
581
|
-
"",
|
|
582
|
-
" NSBundle *bundle = [NSBundle bundleWithURL:bundlePath];",
|
|
583
|
-
" if (bundle != nil) {",
|
|
584
|
-
" return bundle;",
|
|
585
|
-
" }",
|
|
586
|
-
" }",
|
|
587
|
-
"",
|
|
588
|
-
' @throw [[NSException alloc] initWithName:@"SwiftPMResourcesAccessor" reason:[NSString stringWithFormat:@"unable to find bundle named %@", bundleName] userInfo:nil];',
|
|
589
|
-
"}",
|
|
590
|
-
"",
|
|
591
|
-
"NS_ASSUME_NONNULL_END"
|
|
592
|
-
].join("\n")
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
function swiftResourceBundleForFile(bundles, file) {
|
|
596
|
-
let owner;
|
|
597
|
-
for (const bundle of bundles) {
|
|
598
|
-
const prefix = bundle.sourcePath === "." ? "" : `${bundle.sourcePath}/`;
|
|
599
|
-
if (file.startsWith(prefix) && (!owner || bundle.sourcePath.length > owner.sourcePath.length))
|
|
600
|
-
owner = bundle;
|
|
601
|
-
}
|
|
602
|
-
return owner;
|
|
603
|
-
}
|
|
604
|
-
function swiftResourceBundleInfoPlist(bundle) {
|
|
605
|
-
const name = bundle.path.split("/").pop().replace(/\.(bundle|framework)$/, "");
|
|
606
|
-
const escaped = name.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
607
|
-
return `<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>CFBundleName</key><string>${escaped}</string><key>CFBundlePackageType</key><string>${bundle.path.endsWith(".framework") ? "FMWK" : "BNDL"}</string></dict></plist>`;
|
|
608
|
-
}
|
|
609
|
-
function swiftMetalSourceFiles(files) {
|
|
610
|
-
const sources = Object.entries(files).filter(([file]) => file.endsWith(".metal"));
|
|
611
|
-
if (sources.length === 0) return {};
|
|
612
|
-
const targets = swiftManifestTargets(files["Package.swift"] ?? "");
|
|
613
|
-
return Object.fromEntries(
|
|
614
|
-
sources.filter(([file]) => {
|
|
615
|
-
if (targets.length === 0) return true;
|
|
616
|
-
return targets.some((target) => {
|
|
617
|
-
const prefix = target.path === "." ? "" : `${target.path}/`;
|
|
618
|
-
if (!file.startsWith(prefix)) return false;
|
|
619
|
-
const relative = file.slice(prefix.length);
|
|
620
|
-
return !(target.exclude ?? []).some(
|
|
621
|
-
(excluded) => relative === excluded || relative.startsWith(`${excluded}/`)
|
|
622
|
-
);
|
|
623
|
-
});
|
|
624
|
-
})
|
|
625
|
-
);
|
|
626
|
-
}
|
|
627
|
-
function swiftPackagePartition(manifest, resourcePaths = []) {
|
|
628
|
-
const targets = swiftManifestTargets(manifest, resourcePaths);
|
|
629
|
-
return targets.length === 1 && targets[0].executable && targets[0].path === "." && targets[0].languageMode === 5 && !targets[0].iosDeploymentTarget && !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;
|
|
630
|
-
}
|
|
1
|
+
/*! peach v0.1.2439 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
|
+
import {
|
|
3
|
+
OBJC_RESOURCE_ACCESSOR_BODY,
|
|
4
|
+
OBJC_RESOURCE_ACCESSOR_HEADER,
|
|
5
|
+
SWIFT_NATIVE_SOURCE_EXTENSIONS,
|
|
6
|
+
SWIFT_STANDINS_DIR,
|
|
7
|
+
clangImportNames,
|
|
8
|
+
clangMacroSetting,
|
|
9
|
+
clangSettingEntries,
|
|
10
|
+
isSwiftManifestFile,
|
|
11
|
+
isSwiftNativeTranslationUnit,
|
|
12
|
+
manifestCalls,
|
|
13
|
+
moduleMapModules,
|
|
14
|
+
moduleMapName,
|
|
15
|
+
moduleMapTokens,
|
|
16
|
+
swiftImplicitResourcePaths,
|
|
17
|
+
swiftManifestCxxLanguageStandard,
|
|
18
|
+
swiftManifestDeclarations,
|
|
19
|
+
swiftManifestPackages,
|
|
20
|
+
swiftManifestSettings,
|
|
21
|
+
swiftManifestTargets,
|
|
22
|
+
swiftMetalSourceFiles,
|
|
23
|
+
swiftNativeSupportFiles,
|
|
24
|
+
swiftObjCResourceAccessor,
|
|
25
|
+
swiftObjCResourceBundleName,
|
|
26
|
+
swiftPackageClangModuleMap,
|
|
27
|
+
swiftPackageIdentity,
|
|
28
|
+
swiftPackagePartition,
|
|
29
|
+
swiftResourceBundleForFile,
|
|
30
|
+
swiftResourceBundleInfoPlist,
|
|
31
|
+
swiftResourceBundles,
|
|
32
|
+
swiftTargetModuleName,
|
|
33
|
+
withoutGlogModuleMap
|
|
34
|
+
} from "./esm-chunks/chunk-2EUHEBIJ.mjs";
|
|
35
|
+
import "./esm-chunks/chunk-IWJUYJQO.mjs";
|
|
631
36
|
export {
|
|
632
37
|
OBJC_RESOURCE_ACCESSOR_BODY,
|
|
633
38
|
OBJC_RESOURCE_ACCESSOR_HEADER,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2439 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|