docula 1.11.1 → 1.12.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 CHANGED
@@ -45,10 +45,63 @@
45
45
  - [Caching](https://docula.org/docs/caching)
46
46
  - [Cookie Auth](https://docula.org/docs/cookie-auth)
47
47
  - [Robots & Sitemap](https://docula.org/docs/robots-and-sitemap)
48
+ - [Standalone Binary](#standalone-binary)
48
49
  - [Open Source Examples](#open-source-examples)
49
50
  - [Code of Conduct and Contributing](#code-of-conduct-and-contributing)
50
51
  - [License - MIT](#license)
51
52
 
53
+ # Standalone Binary
54
+
55
+ You can build Docula as a standalone binary that runs without Node.js installed. This uses [Node.js Single Executable Applications (SEA)](https://nodejs.org/api/single-executable-applications.html) to embed the runtime and all dependencies into a single executable.
56
+
57
+ ## Building the Binary
58
+
59
+ Requires Node.js >= 20 to build (the resulting binary does not need Node.js to run).
60
+
61
+ ```bash
62
+ pnpm install
63
+ pnpm build:binary
64
+ ```
65
+
66
+ This produces a platform-specific binary at `dist/docula` (or `dist/docula.exe` on Windows).
67
+
68
+ ## What the Build Does
69
+
70
+ 1. Embeds all built-in templates (modern, classic) into the bundle as base64
71
+ 2. Bundles all source code and dependencies into a single CJS file via [tsdown](https://tsdown.dev/)
72
+ 3. Uses tsdown's built-in `exe` option to create a Node.js SEA binary (blob generation, injection, and code signing are handled automatically)
73
+
74
+ ## Testing the Binary
75
+
76
+ After building, test it locally:
77
+
78
+ ```bash
79
+ # Show help
80
+ ./dist/docula help
81
+
82
+ # Show version
83
+ ./dist/docula version
84
+
85
+ # Initialize a new project
86
+ ./dist/docula init -s ./my-site
87
+
88
+ # Build a site
89
+ ./dist/docula build -s ./my-site -o ./my-site/dist
90
+ ```
91
+
92
+ ## Cross-Platform Binaries
93
+
94
+ Node.js SEA cannot cross-compile — the binary matches the OS and architecture it was built on. The CI workflow (`.github/workflows/build-binaries.yaml`) builds for all platforms using a matrix strategy:
95
+
96
+ | Platform | Runner | Artifact |
97
+ |---|---|---|
98
+ | Linux x64 | `ubuntu-latest` | `docula-linux-x64` |
99
+ | macOS ARM64 | `macos-latest` | `docula-macos-arm64` |
100
+ | macOS x64 | `macos-13` | `docula-macos-x64` |
101
+ | Windows x64 | `windows-latest` | `docula-windows-x64` |
102
+
103
+ Binaries are uploaded as build artifacts on every run and attached to GitHub releases automatically.
104
+
52
105
  # Open Source Examples
53
106
 
54
107
  See Docula in action with these open source projects that use it for their documentation: