@swiftbrowser/cli 0.1.0 → 0.3.0
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 +340 -65
- package/dist/assetSymbols.d.ts +25 -0
- package/dist/assetSymbols.js +218 -0
- package/dist/assetSymbols.js.map +1 -0
- package/dist/build.d.ts +27 -2
- package/dist/build.js +71 -14
- package/dist/build.js.map +1 -1
- package/dist/buildSettings.d.ts +15 -0
- package/dist/buildSettings.js +74 -0
- package/dist/buildSettings.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +66 -11
- package/dist/cli.js.map +1 -1
- package/dist/commands/build.js +6 -5
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/check.js +2 -2
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/dev.d.ts +5 -2
- package/dist/commands/dev.js +19 -13
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/init.d.ts +18 -0
- package/dist/commands/init.js +59 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/kit.d.ts +3 -0
- package/dist/commands/kit.js +21 -0
- package/dist/commands/kit.js.map +1 -0
- package/dist/commands/shared.d.ts +28 -4
- package/dist/commands/shared.js +106 -11
- package/dist/commands/shared.js.map +1 -1
- package/dist/commands/test.d.ts +22 -0
- package/dist/commands/test.js +95 -0
- package/dist/commands/test.js.map +1 -0
- package/dist/compat.d.ts +44 -6
- package/dist/compat.js +64 -36
- package/dist/compat.js.map +1 -1
- package/dist/config.d.ts +48 -10
- package/dist/config.js +64 -8
- package/dist/config.js.map +1 -1
- package/dist/coreml.d.ts +194 -0
- package/dist/coreml.js +626 -0
- package/dist/coreml.js.map +1 -0
- package/dist/icu.d.ts +17 -4
- package/dist/icu.js +32 -18
- package/dist/icu.js.map +1 -1
- package/dist/kit.d.ts +133 -0
- package/dist/kit.js +403 -0
- package/dist/kit.js.map +1 -0
- package/dist/objc.d.ts +31 -0
- package/dist/objc.js +319 -0
- package/dist/objc.js.map +1 -0
- package/dist/packagePatches.d.ts +24 -0
- package/dist/packagePatches.js +107 -0
- package/dist/packagePatches.js.map +1 -0
- package/dist/packages.d.ts +59 -0
- package/dist/packages.js +149 -0
- package/dist/packages.js.map +1 -0
- package/dist/project.d.ts +97 -4
- package/dist/project.js +157 -20
- package/dist/project.js.map +1 -1
- package/dist/protobuf.d.ts +62 -0
- package/dist/protobuf.js +233 -0
- package/dist/protobuf.js.map +1 -0
- package/dist/stage.d.ts +175 -28
- package/dist/stage.js +551 -85
- package/dist/stage.js.map +1 -1
- package/dist/strings.d.ts +44 -0
- package/dist/strings.js +386 -0
- package/dist/strings.js.map +1 -0
- package/dist/template.d.ts +39 -0
- package/dist/template.js +678 -0
- package/dist/template.js.map +1 -0
- package/dist/testRunner.d.ts +1 -0
- package/dist/testRunner.js +44 -0
- package/dist/testRunner.js.map +1 -0
- package/dist/threadStacks.d.ts +14 -0
- package/dist/threadStacks.js +78 -0
- package/dist/threadStacks.js.map +1 -0
- package/dist/toolchain.d.ts +7 -1
- package/dist/toolchain.js +8 -2
- package/dist/toolchain.js.map +1 -1
- package/dist/urlSchemes.d.ts +11 -0
- package/dist/urlSchemes.js +58 -0
- package/dist/urlSchemes.js.map +1 -0
- package/dist/vendor.d.ts +109 -0
- package/dist/vendor.js +440 -0
- package/dist/vendor.js.map +1 -0
- package/dist/wasm.d.ts +28 -0
- package/dist/wasm.js +84 -0
- package/dist/wasm.js.map +1 -0
- package/package.json +7 -6
package/dist/vendor.js
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
// Swift packages that import SwiftUI (or another module the shim provides).
|
|
2
|
+
//
|
|
3
|
+
// SwiftPM builds a package dependency as its manifest says, and no manifest
|
|
4
|
+
// says to depend on SwiftBrowser: on iOS, `import SwiftUI` finds the system
|
|
5
|
+
// framework. So a package that imports one of the shim's modules is copied
|
|
6
|
+
// into the staging package (`Packages/<identity>/`) and built from there:
|
|
7
|
+
//
|
|
8
|
+
// - its sources get the same adjustments as the app's (`transformSource`);
|
|
9
|
+
// - each target that imports a shim module gets the generated alias file
|
|
10
|
+
// (`fullFoundationSource`), as the app module does;
|
|
11
|
+
// - its manifest keeps everything it declares, with a few lines appended that
|
|
12
|
+
// add the SwiftBrowser package and, to those targets, the shim products and
|
|
13
|
+
// the `SWIFTBROWSER` define.
|
|
14
|
+
//
|
|
15
|
+
// A package that depends on a copied one is copied too, unchanged but for
|
|
16
|
+
// its manifest, which points that dependency at the copy. The staging
|
|
17
|
+
// manifest depends on every copy by path (a transitive one as well: should a
|
|
18
|
+
// manifest be too old to repoint, SwiftPM lets the root's declaration take
|
|
19
|
+
// the place of the URL, with a warning).
|
|
20
|
+
//
|
|
21
|
+
// Which packages there are, at which versions and where SwiftPM checked them
|
|
22
|
+
// out, comes from resolving the project's dependencies in a package of their
|
|
23
|
+
// own (`Packages/.resolve/`), with `swift package show-dependencies`.
|
|
24
|
+
import { createHash } from 'node:crypto';
|
|
25
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
26
|
+
import path from 'node:path';
|
|
27
|
+
import { ASSET_SYMBOLS_FILE, assetSymbolsSource, declaredStaticMembers, targetCatalogs } from './assetSymbols.js';
|
|
28
|
+
import { run } from './build.js';
|
|
29
|
+
import { LINKED_FRAMEWORKS, importsOf } from './compat.js';
|
|
30
|
+
import { CliError } from './log.js';
|
|
31
|
+
import { optionalRequirementNames } from './objc.js';
|
|
32
|
+
import { PACKAGE_PATCHES, applyPatch, checkPatch } from './packagePatches.js';
|
|
33
|
+
import { PACKAGE_STAND_INS, planPackages } from './packages.js';
|
|
34
|
+
import { FULL_FOUNDATION_FILE, declaredTypeNames, featuresOf, fullFoundationSource, stagingDir, transformSource, importsDispatch, importsObjectiveC, usesObjC, usesPosixMutex } from './stage.js';
|
|
35
|
+
import { toolchainEnv } from './toolchain.js';
|
|
36
|
+
/** Modules the SwiftBrowser package provides in place of Apple's: a package importing one is built against the shim. */
|
|
37
|
+
export const SHIM_MODULES = new Set(['SwiftUI', 'Charts', 'SwiftData', 'FoundationBridge', ...LINKED_FRAMEWORKS]);
|
|
38
|
+
/** The packages of a `show-dependencies --format json` tree, root excluded, each once. */
|
|
39
|
+
export function packageNodes(tree) {
|
|
40
|
+
const out = new Map();
|
|
41
|
+
const visit = (node) => {
|
|
42
|
+
for (const child of node['dependencies'] ?? []) {
|
|
43
|
+
const identity = String(child['identity']);
|
|
44
|
+
if (!out.has(identity)) {
|
|
45
|
+
out.set(identity, {
|
|
46
|
+
identity,
|
|
47
|
+
name: String(child['name']),
|
|
48
|
+
url: String(child['url']),
|
|
49
|
+
version: String(child['version']),
|
|
50
|
+
path: String(child['path']),
|
|
51
|
+
dependencies: (child['dependencies'] ?? []).map((d) => String(d['identity'])),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
visit(child);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
visit(tree);
|
|
58
|
+
return [...out.values()];
|
|
59
|
+
}
|
|
60
|
+
/** The Package.swift that only resolves the app's package dependencies. */
|
|
61
|
+
export function resolveManifest(plans) {
|
|
62
|
+
const dependencies = plans.flatMap((plan) => (plan.kind === 'dependency' ? [plan] : []));
|
|
63
|
+
const products = dependencies.flatMap((plan) => plan.package.products.map((p) => `.product(name: ${JSON.stringify(p)}, package: ${JSON.stringify(plan.identity)})`));
|
|
64
|
+
return `// swift-tools-version: 6.0
|
|
65
|
+
// Generated by @swiftbrowser/cli: resolves the app's package dependencies, so
|
|
66
|
+
// the ones that import SwiftUI can be built against the shim (vendor.ts).
|
|
67
|
+
import PackageDescription
|
|
68
|
+
|
|
69
|
+
let package = Package(
|
|
70
|
+
name: "Resolve",
|
|
71
|
+
dependencies: [
|
|
72
|
+
${dependencies.map((plan) => plan.declaration).join(',\n ')},
|
|
73
|
+
],
|
|
74
|
+
targets: [
|
|
75
|
+
.target(name: "Resolve", dependencies: [
|
|
76
|
+
${products.join(',\n ')},
|
|
77
|
+
], path: "Sources"),
|
|
78
|
+
]
|
|
79
|
+
)
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The package that takes a stand-in's place for the packages that depend on
|
|
84
|
+
* it: a library per product, each forwarding to SwiftBrowser's module of the
|
|
85
|
+
* same name, through a target of its own (`_<Product>StandIn`, empty).
|
|
86
|
+
*/
|
|
87
|
+
export function redirectManifest(name, products, reason, swiftPackagePath) {
|
|
88
|
+
const target = (product) => `_${product}StandIn`;
|
|
89
|
+
return `// swift-tools-version: 5.9
|
|
90
|
+
// Generated by @swiftbrowser/cli: SwiftBrowser stands in for ${name} (${reason}).
|
|
91
|
+
// Each product forwards to SwiftBrowser's module of the same name (vendor.ts).
|
|
92
|
+
import PackageDescription
|
|
93
|
+
|
|
94
|
+
let package = Package(
|
|
95
|
+
name: ${JSON.stringify(name)},
|
|
96
|
+
products: [
|
|
97
|
+
${products.map((p) => ` .library(name: ${JSON.stringify(p)}, targets: [${JSON.stringify(target(p))}]),`).join('\n')}
|
|
98
|
+
],
|
|
99
|
+
dependencies: [.package(name: "SwiftBrowser", path: ${JSON.stringify(swiftPackagePath)})],
|
|
100
|
+
targets: [
|
|
101
|
+
${products.map((p) => ` .target(name: ${JSON.stringify(target(p))}, dependencies: [.product(name: ${JSON.stringify(p)}, package: "SwiftBrowser")], path: ${JSON.stringify(`Sources/${target(p)}`)}),`).join('\n')}
|
|
102
|
+
]
|
|
103
|
+
)
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
/** `// swift-tools-version: 5.9` → [5, 9]; [5, 0] when the line is missing or unreadable. */
|
|
107
|
+
export function toolsVersion(manifest) {
|
|
108
|
+
const match = /^\/\/\s*swift-tools-version\s*:\s*(\d+)(?:\.(\d+))?/.exec(manifest);
|
|
109
|
+
return match ? [Number(match[1]), Number(match[2] ?? 0)] : [5, 0];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The lines appended to a copied package's manifest: the SwiftBrowser package,
|
|
113
|
+
* the shim products and `SWIFTBROWSER` for `targets`, and its dependencies on
|
|
114
|
+
* other copied packages (`copies`, identity → folder) pointed at the copies.
|
|
115
|
+
* Reading a dependency's location (`Package.Dependency.kind`) takes tools
|
|
116
|
+
* version 5.6; an older manifest keeps its URLs, and the staging manifest's
|
|
117
|
+
* declaration of the copy takes their place (with a warning from SwiftPM).
|
|
118
|
+
*/
|
|
119
|
+
export function manifestPatch(targets, swiftPackagePath, copies = new Map(), tools = [6, 0]) {
|
|
120
|
+
const lines = ['', '', '// Added by @swiftbrowser/cli to build this package in the browser (vendor.ts).'];
|
|
121
|
+
if (targets.length > 0) {
|
|
122
|
+
const entries = targets.map((t) => ` ${JSON.stringify(t.name)}: [${t.modules.map((m) => JSON.stringify(m)).join(', ')}],`);
|
|
123
|
+
lines.push('// These targets import SwiftUI (or another module SwiftBrowser provides),', '// so they build against its shim.', `package.dependencies.append(.package(name: "SwiftBrowser", path: ${JSON.stringify(swiftPackagePath)}))`, 'let _swiftBrowserProducts: [String: [String]] = [', ...entries, ']', 'for target in package.targets {', ' guard let products = _swiftBrowserProducts[target.name] else { continue }', ' target.dependencies += products.map { .product(name: $0, package: "SwiftBrowser") }', ' target.swiftSettings = (target.swiftSettings ?? []) + [.define("SWIFTBROWSER")]', '}');
|
|
124
|
+
}
|
|
125
|
+
lines.push('// The browser build is one module: a dynamic library (Backyard Birds\'s', '// packages are) would link the shim products into each library.', 'package.products = package.products.map { product in', ' guard let library = product as? Product.Library, library.type == .dynamic else { return product }', ' return .library(name: library.name, targets: library.targets)', '}');
|
|
126
|
+
const [major, minor] = tools;
|
|
127
|
+
if (copies.size > 0 && (major > 5 || (major === 5 && minor >= 6))) {
|
|
128
|
+
const entries = [...copies].map(([identity, dir]) => ` ${JSON.stringify(identity)}: ${JSON.stringify(dir)},`);
|
|
129
|
+
lines.push('// Packages it depends on that are built against the shim too, from their copies.', 'let _swiftBrowserCopies: [String: String] = [', ...entries, ']', 'package.dependencies = package.dependencies.map { dependency in', ' guard case .sourceControl(let name, let location, _) = dependency.kind else { return dependency }', ' var identity = String(location.split(separator: "/").last ?? "")', ' if identity.hasSuffix(".git") { identity.removeLast(4) }', ' guard let copy = _swiftBrowserCopies[identity.lowercased()] else { return dependency }',
|
|
130
|
+
// A path names the package after the copy's (lowercased) folder; a
|
|
131
|
+
// target that lists the product by itself ("SwiftSoup") finds it by
|
|
132
|
+
// the package's name, so the copy keeps the URL's.
|
|
133
|
+
' return .package(name: name ?? identity, path: copy)', '}');
|
|
134
|
+
}
|
|
135
|
+
return `${lines.join('\n')}\n`;
|
|
136
|
+
}
|
|
137
|
+
/** The shim products a target needs for its imports: the app's set (stage.ts), minus what only apps use. */
|
|
138
|
+
export function targetProducts(features) {
|
|
139
|
+
return [...new Set(['SwiftUI', 'Charts', 'FoundationBridge', 'os', ...(features.swiftData ? ['SwiftData'] : []), ...features.frameworks])];
|
|
140
|
+
}
|
|
141
|
+
/** The manifests of a package: Package.swift and its version-specific variants. */
|
|
142
|
+
function manifestFiles(dir) {
|
|
143
|
+
return readdirSync(dir).filter((name) => /^Package(@swift-[\d.]+)?\.swift$/.test(name));
|
|
144
|
+
}
|
|
145
|
+
/** Swift sources under `dir`, recursively. */
|
|
146
|
+
function swiftFiles(dir, out = []) {
|
|
147
|
+
if (!existsSync(dir))
|
|
148
|
+
return out;
|
|
149
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
150
|
+
const full = path.join(dir, entry.name);
|
|
151
|
+
if (entry.isDirectory()) {
|
|
152
|
+
if (!entry.name.startsWith('.'))
|
|
153
|
+
swiftFiles(full, out);
|
|
154
|
+
}
|
|
155
|
+
else if (entry.name.endsWith('.swift')) {
|
|
156
|
+
out.push(full);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return out;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Whether a package's sources import a shim module: a quick scan before
|
|
163
|
+
* asking SwiftPM. The sources are the folders SwiftPM looks in by default
|
|
164
|
+
* (`Sources`, `Source`, `src`, `srcs`) when the package has one, else the
|
|
165
|
+
* whole package; manifests and tests never count, nor a demo app beside the
|
|
166
|
+
* library.
|
|
167
|
+
*/
|
|
168
|
+
export function importsShim(dir) {
|
|
169
|
+
const roots = ['Sources', 'Source', 'src', 'srcs'].map((name) => path.join(dir, name)).filter((root) => existsSync(root));
|
|
170
|
+
const files = roots.length > 0 ? roots.flatMap((root) => swiftFiles(root)) : swiftFiles(dir);
|
|
171
|
+
for (const file of files) {
|
|
172
|
+
const relative = path.relative(dir, file);
|
|
173
|
+
if (!relative.includes(path.sep) && /^Package(@swift-[\d.]+)?\.swift$/.test(relative))
|
|
174
|
+
continue;
|
|
175
|
+
if (relative.split(path.sep).some((part) => part === 'Tests' || part === '.build'))
|
|
176
|
+
continue;
|
|
177
|
+
const text = readFileSync(file, 'utf8');
|
|
178
|
+
// Selectors and `@objc` need the bridge too (stage.ts, rewriteObjC), and
|
|
179
|
+
// so do POSIX mutexes (FoundationBridge/Locks.swift) and Dispatch.
|
|
180
|
+
if (importsOf(text).some((module) => SHIM_MODULES.has(module)) || usesObjC(text) || usesPosixMutex(text) || importsDispatch(text) || importsObjectiveC(text))
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* `Bundle.module` on the bridge's `Bundle`. SwiftPM's generated accessor
|
|
187
|
+
* declares `module` on Foundation's `Bundle` (for a target with resources),
|
|
188
|
+
* but in a staged target `Bundle` is the bridge's (the alias file), so
|
|
189
|
+
* `Bundle.module` and `bundle: .module` would find nothing. This one is the
|
|
190
|
+
* folder SwiftPM names the target's resources (`<package>_<target>.bundle`)
|
|
191
|
+
* inside the app's bundle, or the app's bundle when there is none.
|
|
192
|
+
*/
|
|
193
|
+
export function moduleBundleSource(bundleName) {
|
|
194
|
+
return `
|
|
195
|
+
extension FoundationBridge.Bundle {
|
|
196
|
+
/// The resources of this package target (\`${bundleName}.bundle\` in the app's bundle).
|
|
197
|
+
static var module: FoundationBridge.Bundle {
|
|
198
|
+
let main = FoundationBridge.Bundle.main
|
|
199
|
+
return FoundationBridge.Bundle(path: main.bundlePath + "/${bundleName}.bundle").flatMap { Foundation.FileManager.default.fileExists(atPath: $0.bundlePath) ? $0 : nil } ?? main
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
`;
|
|
203
|
+
}
|
|
204
|
+
/** Where SwiftPM looks for a target's sources when the manifest gives no path. */
|
|
205
|
+
function targetDir(packageDir, target) {
|
|
206
|
+
if (target.path)
|
|
207
|
+
return path.join(packageDir, target.path);
|
|
208
|
+
for (const parent of ['Sources', 'Source', 'src', 'srcs']) {
|
|
209
|
+
const candidate = path.join(packageDir, parent, target.name);
|
|
210
|
+
if (existsSync(candidate))
|
|
211
|
+
return candidate;
|
|
212
|
+
}
|
|
213
|
+
return undefined;
|
|
214
|
+
}
|
|
215
|
+
function writeIfChanged(file, content) {
|
|
216
|
+
const bytes = typeof content === 'string' ? Buffer.from(content) : content;
|
|
217
|
+
if (existsSync(file) && readFileSync(file).equals(bytes))
|
|
218
|
+
return;
|
|
219
|
+
mkdirSync(path.dirname(file), { recursive: true });
|
|
220
|
+
writeFileSync(file, bytes);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Copies `from` into `to` (dot folders and `.build` left out), adjusting Swift
|
|
224
|
+
* sources (those under a `bridged` folder as sources of a module built against
|
|
225
|
+
* the bridge) after `patch`'s edits; removes what `from` no longer has.
|
|
226
|
+
*/
|
|
227
|
+
function copyPackage(from, to, bridged = [], patch) {
|
|
228
|
+
const kept = new Set();
|
|
229
|
+
// Optional requirements are called in other files than the protocol's.
|
|
230
|
+
const optionalRequirements = optionalRequirementNames(swiftFiles(from).map((file) => readFileSync(file, 'utf8')));
|
|
231
|
+
const walk = (dir) => {
|
|
232
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
233
|
+
if (entry.name.startsWith('.'))
|
|
234
|
+
continue;
|
|
235
|
+
const full = path.join(dir, entry.name);
|
|
236
|
+
const target = path.join(to, path.relative(from, full));
|
|
237
|
+
if (entry.isDirectory()) {
|
|
238
|
+
walk(full);
|
|
239
|
+
}
|
|
240
|
+
else if (entry.isFile()) {
|
|
241
|
+
const isManifest = dir === from && /^Package(@swift-[\d.]+)?\.swift$/.test(entry.name);
|
|
242
|
+
const inBridged = bridged.some((dir) => full.startsWith(dir + path.sep));
|
|
243
|
+
const content = entry.name.endsWith('.swift') && !isManifest
|
|
244
|
+
? transformSource(applyPatch(patch, path.relative(from, full), readFileSync(full, 'utf8')), { bridged: inBridged, optionalRequirements }).text
|
|
245
|
+
: readFileSync(full);
|
|
246
|
+
writeIfChanged(target, content);
|
|
247
|
+
kept.add(target);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
walk(from);
|
|
252
|
+
return kept;
|
|
253
|
+
}
|
|
254
|
+
function removeStale(dir, keep) {
|
|
255
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
256
|
+
if (entry.name === '.build')
|
|
257
|
+
continue;
|
|
258
|
+
const full = path.join(dir, entry.name);
|
|
259
|
+
if (entry.isDirectory()) {
|
|
260
|
+
removeStale(full, keep);
|
|
261
|
+
if (readdirSync(full).length === 0)
|
|
262
|
+
rmSync(full, { recursive: true });
|
|
263
|
+
}
|
|
264
|
+
else if (!keep.has(full)) {
|
|
265
|
+
rmSync(full, { force: true });
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/** Where the copies live, and the package that resolves the originals. */
|
|
270
|
+
export function vendorDir(app) {
|
|
271
|
+
return path.join(stagingDir(app), 'Packages');
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Resolves the app's package dependencies and copies the ones that import a
|
|
275
|
+
* shim module, and the ones that depend on those, into the staging package.
|
|
276
|
+
* Packages that are plain Swift all the way down are left to SwiftPM, as
|
|
277
|
+
* before. Returns the copies by identity; empty, without running SwiftPM,
|
|
278
|
+
* when the app has no packages to fetch.
|
|
279
|
+
*/
|
|
280
|
+
export async function vendorPackages(app, toolchain, swiftPackagePath) {
|
|
281
|
+
const vendored = new Map();
|
|
282
|
+
const plans = planPackages(app.packages);
|
|
283
|
+
if (!plans.some((plan) => plan.kind === 'dependency'))
|
|
284
|
+
return vendored;
|
|
285
|
+
const root = vendorDir(app);
|
|
286
|
+
const resolveDir = path.join(root, '.resolve');
|
|
287
|
+
writeIfChanged(path.join(resolveDir, 'Package.swift'), resolveManifest(plans));
|
|
288
|
+
writeIfChanged(path.join(resolveDir, 'Sources', 'Resolve.swift'), '// Nothing to build: the package only resolves dependencies.\n');
|
|
289
|
+
const treeFile = path.join(resolveDir, 'dependencies.json');
|
|
290
|
+
const env = toolchainEnv(toolchain);
|
|
291
|
+
const shown = await run(toolchain.swift, ['package', 'show-dependencies', '--format', 'json', '--output-path', treeFile], { cwd: resolveDir, env });
|
|
292
|
+
if (shown.status !== 0 || !existsSync(treeFile)) {
|
|
293
|
+
throw new CliError(`could not resolve the app's Swift packages:\n${shown.output.trim()}`);
|
|
294
|
+
}
|
|
295
|
+
const nodes = packageNodes(JSON.parse(readFileSync(treeFile, 'utf8')));
|
|
296
|
+
// The packages that import a shim module, and every package that depends on
|
|
297
|
+
// one of them (so that it depends on the copy).
|
|
298
|
+
// A package SwiftBrowser stands in for counts as copied: its "copy" is a redirect.
|
|
299
|
+
const copied = new Set(nodes.filter((node) => PACKAGE_STAND_INS[node.identity] || PACKAGE_PATCHES[node.identity] || (existsSync(node.path) && importsShim(node.path))).map((node) => node.identity));
|
|
300
|
+
for (let grew = true; grew;) {
|
|
301
|
+
grew = false;
|
|
302
|
+
for (const node of nodes) {
|
|
303
|
+
if (!copied.has(node.identity) && node.dependencies.some((identity) => copied.has(identity))) {
|
|
304
|
+
copied.add(node.identity);
|
|
305
|
+
grew = true;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
const copyDir = (identity) => path.join(root, identity);
|
|
310
|
+
const keep = new Set([path.join(root, '.resolve')]);
|
|
311
|
+
for (const node of nodes) {
|
|
312
|
+
if (!copied.has(node.identity))
|
|
313
|
+
continue;
|
|
314
|
+
const dir = copyDir(node.identity);
|
|
315
|
+
const standIn = PACKAGE_STAND_INS[node.identity];
|
|
316
|
+
if (standIn) {
|
|
317
|
+
const files = new Set([path.join(dir, 'Package.swift')]);
|
|
318
|
+
writeIfChanged(path.join(dir, 'Package.swift'), redirectManifest(node.name, standIn.products, standIn.reason, swiftPackagePath));
|
|
319
|
+
for (const product of standIn.products) {
|
|
320
|
+
const file = path.join(dir, 'Sources', `_${product}StandIn`, `_${product}StandIn.swift`);
|
|
321
|
+
writeIfChanged(file, `// Empty: the product forwards to SwiftBrowser's ${product} module.\n`);
|
|
322
|
+
files.add(file);
|
|
323
|
+
}
|
|
324
|
+
removeStale(dir, files);
|
|
325
|
+
keep.add(dir);
|
|
326
|
+
vendored.set(node.identity, { identity: node.identity, name: node.name, source: node.path, local: false, version: node.version, dir, targets: [], standIn: standIn.reason, modules: [...standIn.products] });
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
const targets = [];
|
|
330
|
+
const moduleNames = [];
|
|
331
|
+
const cache = path.join(dir, TARGETS_CACHE);
|
|
332
|
+
// The targets built against the shim, found in the original sources
|
|
333
|
+
// first: their copies are adjusted as bridged modules.
|
|
334
|
+
const shimTargets = [];
|
|
335
|
+
mkdirSync(dir, { recursive: true });
|
|
336
|
+
for (const target of await dumpTargets(node.path, cache, toolchain)) {
|
|
337
|
+
if (target.type !== 'regular' && target.type !== 'executable')
|
|
338
|
+
continue;
|
|
339
|
+
moduleNames.push(target.name);
|
|
340
|
+
const sourceDir = targetDir(node.path, target);
|
|
341
|
+
if (!sourceDir)
|
|
342
|
+
continue;
|
|
343
|
+
const texts = swiftFiles(sourceDir).map((file) => readFileSync(file, 'utf8'));
|
|
344
|
+
const modules = new Set(texts.flatMap((text) => importsOf(text)).filter((module) => SHIM_MODULES.has(module)));
|
|
345
|
+
const uses = [
|
|
346
|
+
...(texts.some(usesObjC) ? ['Objective-C selectors'] : []),
|
|
347
|
+
...(texts.some(usesPosixMutex) ? ['POSIX mutexes'] : []),
|
|
348
|
+
...(texts.some(importsDispatch) ? ['Dispatch'] : []),
|
|
349
|
+
...(texts.some(importsObjectiveC) ? ['Objective-C associated objects'] : []),
|
|
350
|
+
];
|
|
351
|
+
if (modules.size === 0 && uses.length === 0)
|
|
352
|
+
continue;
|
|
353
|
+
targets.push({ name: target.name, imports: [...modules].sort(), modules: targetProducts(featuresOf(texts)), ...(uses.length > 0 ? { uses } : {}) });
|
|
354
|
+
shimTargets.push({ name: target.name, sourceDir, texts });
|
|
355
|
+
}
|
|
356
|
+
// SwiftBrowser's edits, checked against this version before anything is copied.
|
|
357
|
+
const patch = PACKAGE_PATCHES[node.identity];
|
|
358
|
+
if (patch)
|
|
359
|
+
checkPatch(node.identity, node.version, node.path, patch);
|
|
360
|
+
const files = copyPackage(node.path, dir, shimTargets.map((target) => target.sourceDir), patch);
|
|
361
|
+
files.add(cache);
|
|
362
|
+
const catalogs = [];
|
|
363
|
+
for (const { name, sourceDir, texts } of shimTargets) {
|
|
364
|
+
const aliases = path.join(dir, path.relative(node.path, sourceDir), FULL_FOUNDATION_FILE);
|
|
365
|
+
writeIfChanged(aliases, fullFoundationSource(featuresOf(texts), declaredTypeNames(texts)) + moduleBundleSource(`${node.identity}_${name}`));
|
|
366
|
+
files.add(aliases);
|
|
367
|
+
// Packages get the resource members only (Backyard Birds' declare their own `Color` members).
|
|
368
|
+
const targetCatalogList = targetCatalogs(sourceDir);
|
|
369
|
+
catalogs.push(...targetCatalogList);
|
|
370
|
+
const symbols = assetSymbolsSource(targetCatalogList, { declared: declaredStaticMembers(texts) });
|
|
371
|
+
if (symbols) {
|
|
372
|
+
const file = path.join(dir, path.relative(node.path, sourceDir), ASSET_SYMBOLS_FILE);
|
|
373
|
+
writeIfChanged(file, symbols);
|
|
374
|
+
files.add(file);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
const copies = new Map(node.dependencies.filter((identity) => copied.has(identity)).map((identity) => [identity, copyDir(identity)]));
|
|
378
|
+
for (const manifest of manifestFiles(node.path)) {
|
|
379
|
+
const text = readFileSync(path.join(node.path, manifest), 'utf8');
|
|
380
|
+
writeIfChanged(path.join(dir, manifest), text + manifestPatch(targets, swiftPackagePath, copies, toolsVersion(text)));
|
|
381
|
+
}
|
|
382
|
+
removeStale(dir, files);
|
|
383
|
+
keep.add(dir);
|
|
384
|
+
vendored.set(node.identity, {
|
|
385
|
+
identity: node.identity,
|
|
386
|
+
name: node.name,
|
|
387
|
+
source: node.path,
|
|
388
|
+
local: !node.path.startsWith(`${resolveDir}${path.sep}`),
|
|
389
|
+
version: node.version,
|
|
390
|
+
dir,
|
|
391
|
+
targets,
|
|
392
|
+
modules: moduleNames,
|
|
393
|
+
...(patch ? { patched: patch.edits.length } : {}),
|
|
394
|
+
...(catalogs.length > 0 ? { catalogs } : {}),
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
// Copies of packages the app no longer uses.
|
|
398
|
+
for (const entry of readdirSync(root)) {
|
|
399
|
+
const full = path.join(root, entry);
|
|
400
|
+
if (!keep.has(full))
|
|
401
|
+
rmSync(full, { recursive: true, force: true });
|
|
402
|
+
}
|
|
403
|
+
return vendored;
|
|
404
|
+
}
|
|
405
|
+
/** Next to a copy: its targets, keyed by the manifests they were read from. */
|
|
406
|
+
const TARGETS_CACHE = '.swiftbrowser-targets.json';
|
|
407
|
+
/**
|
|
408
|
+
* The targets of a package's manifest. Evaluating a manifest takes a moment,
|
|
409
|
+
* so the result is kept in `cache` (in the copy, never in the user's folder)
|
|
410
|
+
* with a hash of the manifests it came from.
|
|
411
|
+
*/
|
|
412
|
+
async function dumpTargets(packageDir, cache, toolchain) {
|
|
413
|
+
const hash = createHash('sha256');
|
|
414
|
+
for (const manifest of manifestFiles(packageDir).sort())
|
|
415
|
+
hash.update(manifest).update(readFileSync(path.join(packageDir, manifest)));
|
|
416
|
+
hash.update(toolchain.version);
|
|
417
|
+
const key = hash.digest('hex');
|
|
418
|
+
if (existsSync(cache)) {
|
|
419
|
+
try {
|
|
420
|
+
const cached = JSON.parse(readFileSync(cache, 'utf8'));
|
|
421
|
+
if (cached.key === key)
|
|
422
|
+
return cached.targets;
|
|
423
|
+
}
|
|
424
|
+
catch {
|
|
425
|
+
// Unreadable: read the manifest again.
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
// The scratch path keeps SwiftPM's caches out of the package's folder (it may be the user's).
|
|
429
|
+
const scratch = path.join(path.dirname(cache), '.build');
|
|
430
|
+
const dumped = await run(toolchain.swift, ['package', 'dump-package', '--package-path', packageDir, '--scratch-path', scratch], { cwd: path.dirname(cache), env: toolchainEnv(toolchain) });
|
|
431
|
+
if (dumped.status !== 0)
|
|
432
|
+
throw new CliError(`could not read the manifest of ${packageDir}:\n${dumped.output.trim()}`);
|
|
433
|
+
// stderr is interleaved; the JSON is the object from the first `{` at the start of a line.
|
|
434
|
+
const start = dumped.output.search(/^\{/m);
|
|
435
|
+
const manifest = JSON.parse(dumped.output.slice(start));
|
|
436
|
+
const targets = manifest.targets.map((t) => ({ name: t.name, type: t.type, path: t.path ?? null }));
|
|
437
|
+
writeIfChanged(cache, JSON.stringify({ key, targets }));
|
|
438
|
+
return targets;
|
|
439
|
+
}
|
|
440
|
+
//# sourceMappingURL=vendor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendor.js","sourceRoot":"","sources":["../src/vendor.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,0EAA0E;AAC1E,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,sDAAsD;AACtD,8EAA8E;AAC9E,8EAA8E;AAC9E,+BAA+B;AAC/B,EAAE;AACF,0EAA0E;AAC1E,sEAAsE;AACt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C,SAAS,CAAC,KAAK,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC5L,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,QAAQ,CAAC,kCAAkC,UAAU,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACtH,2FAA2F;IAC3F,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAgC,CAAC;IACvF,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IACpG,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACxD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/wasm.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface WasmSection {
|
|
2
|
+
id: number;
|
|
3
|
+
/** For a custom section (id 0), its name; otherwise null. */
|
|
4
|
+
name: string | null;
|
|
5
|
+
/** The whole section, header included. */
|
|
6
|
+
bytes: Buffer;
|
|
7
|
+
/** For a custom section, the payload after the name. */
|
|
8
|
+
payload: Buffer;
|
|
9
|
+
}
|
|
10
|
+
/** Splits a module into its sections (the 8-byte header is not among them). */
|
|
11
|
+
export declare function wasmSections(module: Buffer): WasmSection[];
|
|
12
|
+
/** The payload of the custom section called `name`, or null. */
|
|
13
|
+
export declare function customSection(module: Buffer, name: string): Buffer | null;
|
|
14
|
+
/** A complete custom section: id 0, size, name, payload. */
|
|
15
|
+
export declare function encodeCustomSection(name: string, payload: Buffer): Buffer;
|
|
16
|
+
/**
|
|
17
|
+
* The module without the custom sections named in `drop`, with `add` appended
|
|
18
|
+
* (an existing custom section of the same name is replaced).
|
|
19
|
+
*/
|
|
20
|
+
export declare function rewriteCustomSections(module: Buffer, edits: {
|
|
21
|
+
drop?: readonly string[];
|
|
22
|
+
add?: readonly {
|
|
23
|
+
name: string;
|
|
24
|
+
payload: Buffer;
|
|
25
|
+
}[];
|
|
26
|
+
}): Buffer;
|
|
27
|
+
/** The autolink record the Swift driver leaves in every linked module. */
|
|
28
|
+
export declare const AUTOLINK_SECTION = ".swift1_autolink_entries";
|
package/dist/wasm.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Reading and rewriting a wasm module's custom sections, after wasm-opt.
|
|
2
|
+
//
|
|
3
|
+
// One edit before the module ships (see build.ts): `.swift1_autolink_entries`
|
|
4
|
+
// goes. It is the Swift driver's autolink record, 108 kB of library names the
|
|
5
|
+
// linker already consumed, and wasm-opt's `--strip-debug` keeps it (it is not
|
|
6
|
+
// debug info). Only the custom sections are touched; the module is otherwise
|
|
7
|
+
// copied.
|
|
8
|
+
const MAGIC = 0x6d736100;
|
|
9
|
+
const VERSION = 1;
|
|
10
|
+
function readLeb(buf, pos) {
|
|
11
|
+
let result = 0;
|
|
12
|
+
let shift = 0;
|
|
13
|
+
let byte;
|
|
14
|
+
do {
|
|
15
|
+
byte = buf[pos.at++];
|
|
16
|
+
result += (byte & 0x7f) * 2 ** shift;
|
|
17
|
+
shift += 7;
|
|
18
|
+
} while (byte & 0x80);
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
function leb(value) {
|
|
22
|
+
const bytes = [];
|
|
23
|
+
do {
|
|
24
|
+
let byte = value & 0x7f;
|
|
25
|
+
value = Math.floor(value / 128);
|
|
26
|
+
if (value !== 0)
|
|
27
|
+
byte |= 0x80;
|
|
28
|
+
bytes.push(byte);
|
|
29
|
+
} while (value !== 0);
|
|
30
|
+
return Buffer.from(bytes);
|
|
31
|
+
}
|
|
32
|
+
/** Splits a module into its sections (the 8-byte header is not among them). */
|
|
33
|
+
export function wasmSections(module) {
|
|
34
|
+
if (module.length < 8 || module.readUInt32LE(0) !== MAGIC || module.readUInt32LE(4) !== VERSION) {
|
|
35
|
+
throw new Error('not a wasm module');
|
|
36
|
+
}
|
|
37
|
+
const sections = [];
|
|
38
|
+
const pos = { at: 8 };
|
|
39
|
+
while (pos.at < module.length) {
|
|
40
|
+
const start = pos.at;
|
|
41
|
+
const id = module[pos.at++];
|
|
42
|
+
const size = readLeb(module, pos);
|
|
43
|
+
const contentStart = pos.at;
|
|
44
|
+
const end = contentStart + size;
|
|
45
|
+
if (end > module.length)
|
|
46
|
+
throw new Error(`section ${id} at ${start} runs past the end of the module`);
|
|
47
|
+
let name = null;
|
|
48
|
+
let payload = module.subarray(contentStart, end);
|
|
49
|
+
if (id === 0) {
|
|
50
|
+
const nameLength = readLeb(module, pos);
|
|
51
|
+
name = module.subarray(pos.at, pos.at + nameLength).toString('utf8');
|
|
52
|
+
payload = module.subarray(pos.at + nameLength, end);
|
|
53
|
+
}
|
|
54
|
+
sections.push({ id, name, bytes: module.subarray(start, end), payload });
|
|
55
|
+
pos.at = end;
|
|
56
|
+
}
|
|
57
|
+
return sections;
|
|
58
|
+
}
|
|
59
|
+
/** The payload of the custom section called `name`, or null. */
|
|
60
|
+
export function customSection(module, name) {
|
|
61
|
+
return wasmSections(module).find((s) => s.id === 0 && s.name === name)?.payload ?? null;
|
|
62
|
+
}
|
|
63
|
+
/** A complete custom section: id 0, size, name, payload. */
|
|
64
|
+
export function encodeCustomSection(name, payload) {
|
|
65
|
+
const nameBytes = Buffer.from(name, 'utf8');
|
|
66
|
+
const content = Buffer.concat([leb(nameBytes.length), nameBytes, payload]);
|
|
67
|
+
return Buffer.concat([Buffer.from([0]), leb(content.length), content]);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The module without the custom sections named in `drop`, with `add` appended
|
|
71
|
+
* (an existing custom section of the same name is replaced).
|
|
72
|
+
*/
|
|
73
|
+
export function rewriteCustomSections(module, edits) {
|
|
74
|
+
const drop = new Set([...(edits.drop ?? []), ...(edits.add ?? []).map((a) => a.name)]);
|
|
75
|
+
const kept = wasmSections(module).filter((s) => !(s.id === 0 && s.name !== null && drop.has(s.name)));
|
|
76
|
+
return Buffer.concat([
|
|
77
|
+
module.subarray(0, 8),
|
|
78
|
+
...kept.map((s) => s.bytes),
|
|
79
|
+
...(edits.add ?? []).map((a) => encodeCustomSection(a.name, a.payload)),
|
|
80
|
+
]);
|
|
81
|
+
}
|
|
82
|
+
/** The autolink record the Swift driver leaves in every linked module. */
|
|
83
|
+
export const AUTOLINK_SECTION = '.swift1_autolink_entries';
|
|
84
|
+
//# sourceMappingURL=wasm.js.map
|
package/dist/wasm.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wasm.js","sourceRoot":"","sources":["../src/wasm.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,UAAU;AAEV,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,OAAO,GAAG,CAAC,CAAC;AAElB,SAAS,OAAO,CAAC,GAAW,EAAE,GAAmB;IAC/C,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,IAAY,CAAC;IACjB,GAAG,CAAC;QACF,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,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,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;KACxE,CAAC,CAAC;AACL,CAAC;AAED,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swiftbrowser/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Run an iOS SwiftUI app in the browser: doctor, check, dev and build for an Xcode project or a folder of Swift sources.",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Run an iOS SwiftUI app in the browser: init, doctor, check, dev and build for an Xcode project or a folder of Swift sources.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/noya-app/SwiftBrowser.git",
|
|
8
8
|
"directory": "packages/cli"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
@@ -22,9 +22,10 @@
|
|
|
22
22
|
"build": "tsc -p tsconfig.build.json"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@swiftbrowser/
|
|
26
|
-
"@swiftbrowser/
|
|
27
|
-
"@swiftbrowser/
|
|
25
|
+
"@swiftbrowser/kit": "0.3.0",
|
|
26
|
+
"@swiftbrowser/swift": "0.3.0",
|
|
27
|
+
"@swiftbrowser/web": "0.3.0",
|
|
28
|
+
"@swiftbrowser/xcodeproj": "0.3.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@types/node": "^26.6.4",
|