@swifttui/build 0.4.6 → 0.4.7
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 +18 -18
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@ compile a SwiftTUI app to `wasm32-wasi` and capture its scene manifest.**
|
|
|
9
9
|
`@swifttui/build` turns a SwiftTUI app into the two artifacts the browser needs:
|
|
10
10
|
an `app.wasm` and a `scene-manifest.json`. It drives the Swift toolchain, runs a
|
|
11
11
|
browser `WebAssembly.compile` validation pass, and packages the result. It
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
is separate from [`@swifttui/web`](https://www.npmjs.com/package/@swifttui/web),
|
|
13
|
+
the browser runtime. Thus, runtime imports do not include Swift processes, Node
|
|
14
|
+
filesystem APIs, or wasm packaging helpers.
|
|
15
15
|
|
|
16
16
|
- **Runtime counterpart:** [`@swifttui/web`](https://www.npmjs.com/package/@swifttui/web)
|
|
17
17
|
— mounts the artifacts this package produces.
|
|
@@ -20,18 +20,18 @@ Node filesystem APIs, or wasm packaging helpers.
|
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
declarations:
|
|
23
|
+
Install the ESM package from npm. The package includes a Node CLI and bundled
|
|
24
|
+
TypeScript declarations:
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
27
|
npm install --save-dev @swifttui/build
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
This exposes the `swifttui-web` CLI (`npx swifttui-web build --app <Exe>`) and a
|
|
31
|
-
programmatic ESM API. The package
|
|
32
|
-
runs on
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
programmatic ESM API. The package contains compiled JavaScript in `dist/`. The
|
|
32
|
+
binary runs on Node (`#!/usr/bin/env node`). You do not need Bun or a TypeScript
|
|
33
|
+
toolchain to use it. To compile a SwiftTUI app to wasm, install Swift 6.3.x and
|
|
34
|
+
the `swift-6.3.3-RELEASE_wasm` SDK.
|
|
35
35
|
|
|
36
36
|
## Use
|
|
37
37
|
|
|
@@ -71,21 +71,21 @@ Callers can override `swiftCommand`, `swiftSDK`, `configuration`,
|
|
|
71
71
|
|
|
72
72
|
> The WASI release flags (`-Osize` plus `-disable-llvm-merge-functions-pass`)
|
|
73
73
|
> keep the output under the browser `WebAssembly` API's 1000-parameter limit.
|
|
74
|
-
> The canonical command
|
|
75
|
-
>
|
|
74
|
+
> The canonical command is in this package. Use the CLI or API instead of a
|
|
75
|
+
> separate `swift build` command.
|
|
76
76
|
|
|
77
77
|
## Developing this package
|
|
78
78
|
|
|
79
|
-
>
|
|
80
|
-
>
|
|
79
|
+
> This section applies only to work **on** `@swifttui/build`. A project that
|
|
80
|
+
> uses the package needs only the `npm install --save-dev` command above.
|
|
81
81
|
|
|
82
|
-
Use Bun for the CLI, bundling, and tests
|
|
83
|
-
build
|
|
82
|
+
Use Bun for the CLI, bundling, and tests. Use `swiftly` Swift 6.3.3 for the wasm
|
|
83
|
+
build. Do not use bare `swift`.
|
|
84
84
|
|
|
85
85
|
- `bun test`
|
|
86
|
-
- `bun run build` —
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
- `bun run build` — Compile the publishable package to `dist/` with tsdown.
|
|
87
|
+
The output contains ESM `.js`, `.d.ts`, and the `swifttui-web` binary.
|
|
88
|
+
`prepublishOnly` runs this command during publication.
|
|
89
89
|
- `bun run build:manifest -- --app <AppExecutable>`
|
|
90
90
|
- `bun run build:wasm -- --app <AppExecutable>`
|
|
91
91
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swifttui/build",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@swifttui/web": "0.4.
|
|
42
|
+
"@swifttui/web": "0.4.7"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/bun": "1.3.13"
|