You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Build WASM from ghostty-org/ghostty submodule with patches
Major architectural change to build WASM from source instead of committing
the binary to the repository.
Changes:
- Add ghostty-org/ghostty as root-level submodule (pinned to 0f64b9a8e)
- Add patches/ghostty-wasm-api.patch (33KB, 1006 lines)
- Exposes 16 C API functions for terminal integration
- Based on coder/ghostty fork commit bfd067d
- Rewrite scripts/build-wasm.sh:
- Initialize submodule if needed
- Apply patch, build WASM with Zig, revert patch
- Keeps submodule clean for easy updates
- Update CI workflow:
- Add Zig 0.15.2 installation to test and build jobs
- Build WASM before running tests/build
- Add WASM size check (512KB limit)
- Update package.json:
- Add build:wasm script
- Integrate WASM build into main build process
- Update .gitignore:
- Ignore ghostty-vt.wasm (built locally and in CI)
- Ignore ghostty/zig-out/ and ghostty/zig-cache/
- Remove committed ghostty-vt.wasm binary (404KB)
- Update README.md and INSTALL.md with new build instructions
Benefits:
- Transparent build process (exact Ghostty version + patches visible)
- Easier to update upstream Ghostty
- Smaller git history (no binary commits)
- WASM still included in npm package (built during prepublishOnly)
Build time: ~20 seconds for WASM, adds ~30 seconds to CI test/build jobs
Copy file name to clipboardExpand all lines: INSTALL.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,18 @@ ws.onmessage = (event) => {
91
91
92
92
## WASM File Handling
93
93
94
-
The library requires the `ghostty-vt.wasm` file at runtime. Most bundlers handle this automatically.
94
+
The library requires the `ghostty-vt.wasm` file at runtime. When installing from npm, the WASM is pre-built and included. When installing from git, it's built during `postinstall`.
95
+
96
+
### Local Development
97
+
98
+
After cloning:
99
+
100
+
```bash
101
+
git submodule update --init --recursive
102
+
./scripts/build-wasm.sh
103
+
```
104
+
105
+
The WASM file is generated locally and gitignored.
0 commit comments