$ show tw93/Pake
Pake is a CLI tool that packages any webpage or local web build into a lightweight native desktop application (~5MB) using Tauri (Rust) and the system WebView. It supports macOS, Windows, and Linux, producing installers in dmg/app, msi, deb/AppImage/rpm/zst formats. The architecture is a dual-language system: a TypeScript CLI (Commander.js) orchestrates the build process, generating Tauri configuration files, handling icon conversion, and managing platform-specific builders (MacBuilder, WinBuilder, LinuxBuilder) via a base builder pattern. The Rust Tauri runtime provides the desktop shell with webview injection scripts for features like find-in-page, fullscreen polyfill, style injection, clipboard bridging, and auth/popup routing. The project includes extensive unit and integration tests, a GitHub Action for CI/CD, and machine-readable JSON output for agent integration. It is not a data or research project; it is a pure application packaging tool.
The LLM identified 4 files worth highlighting for reuse:
Abstract base class for platform-specific builders (MacBuilder, WinBuilder, LinuxBuilder). Defines a template method for the build lifecycle: environment checks, package manager detection, build command construction, artifact copying, and error handling. The pattern is isolated and can be extracted to build any multi-platform CLI tool that needs per-platform build logic with shared orchestration.
Creates a private temporary workspace for each build, copying inputs and symlinking node_modules. Implements file-based cache locking with dead-owner detection and a cancellation signal. This pattern is reusable for any build tool that needs isolated, clean staging directories and concurrent build safety.
Provides functions for machine-readable JSON output (enableMachineMode, printJsonResult) and structured error reporting with exit codes and hints. All log output goes to stderr, stdout carries exactly one JSON result. This pattern is reusable for any CLI tool that needs to be consumed by other programs or AI agents.
Injects custom CSS into the webview using adoptedStyleSheets (constructable stylesheets) when CSP blocks style elements, with a fallback to creating a <style> element. Preserves DOM order and supports site-specific CSS hacks. This pattern is reusable for any webview injection scenario where CSP compliance is required.