Deno Toolchain
Relevant source files
The following files were used as context for generating this wiki page:
OpenHWP operates on a unified Deno toolchain, which serves as the exclusive environment for development, execution, and distribution. This single-toolchain approach eliminates the need for auxiliary environments like Node.js, Bun, or Mise, consolidating all project workflows within the Deno ecosystem.
The toolchain leverages deno desktop to bridge the gap between web technologies and native desktop applications. By utilizing Deno's built-in capabilities, the project manages dependencies, formatting, linting, testing, and cross-platform compilation through a consistent interface.
Sources: CONTRIBUTING.md:13-15, README.en.md:15, README.md:15
Core Environment and Requirements
The toolchain requires Deno version 2.9.0 or later. This specific version is mandatory because it introduced the deno desktop runtime, which is critical for the application's shell and rendering capabilities.
Development Utilities
The toolchain provides several built-in commands used as the baseline for the project's quality assurance:
| Command | Purpose |
|---|---|
deno install | Caches dependencies declared in deno.json. |
deno lint | Performs static analysis to find problematic patterns. |
deno fmt --check | Verifies code adheres to the project's formatting standards. |
deno test | Executes the test suite. |
deno task dev | Initiates the development environment. |
Sources: CONTRIBUTING.md:13-15, CONTRIBUTING.md:20-22, CONTRIBUTING.md:26-28, README.en.md:46-48, orca.yaml:14-17
Architecture and Execution Flow
The toolchain manages a "thin desktop shell" that separates the document engine from the platform-specific implementation. It uses Deno.serve() to provide content to a native window's webview.
The diagram shows how the Deno toolchain initiates the server and native shell, which then hosts the WebAssembly-based document engine.
Sources: README.en.md:15-22, README.md:15-22
Rendering Backend
The toolchain is configured to use the Chromium Embedded Framework (CEF) as its rendering backend. This is achieved by setting "backend": "cef" in the project configuration. This ensures:
- Identical rendering behavior across macOS, Windows, and Linux.
- Access to modern Web APIs, such as the File System Access API.
- Secure context execution from
localhost.
Sources: README.en.md:18-20, README.en.md:36-38, README.md:18-20
Distribution and Build Pipeline
The toolchain handles the transformation of source code into standalone binaries and platform-specific installers.
Build Process
The sequence demonstrates the progression from a source file (main.ts) to platform-specific installers via the toolchain.
Sources: README.en.md:50-56, README.md:50-56
Packaging Roadmap
The toolchain is intended to be integrated into CI for automated packaging, including signing and notarization for various formats:
- macOS:
.dmg - Windows:
.msi - Linux:
.deb,.AppImage,.rpm
Sources: README.en.md:65-66, README.md:65-66
Integration with Worktree Tools
The toolchain is designed to work with worktree management scripts (e.g., Orca). Upon worktree creation, a setup script ensures the environment is ready by installing dependencies once the deno.json configuration is present.
scripts:
setup: |
set -e
bunx @pleaseai/worktreeinclude "$ORCA_ROOT_PATH" "$ORCA_WORKTREE_PATH"
[ -f deno.json ] && deno install || true
Sources: orca.yaml:13-17
Summary
The Deno Toolchain in OpenHWP provides a streamlined, single-binary environment for the entire application lifecycle. By leveraging Deno 2.9.0's desktop features and the CEF backend, it maintains architectural separation between the native platform shell and the rhwp document engine, while providing standardized development and build workflows across all supported operating systems.