Add standalone binary validation harness - #479
Conversation
Extract the release-workflow smoke checks into a reusable TypeScript harness that covers version, help, a JSON-config build, TypeScript config rejection, download variables, and init. Co-authored-by: Jared Wray <me@jaredwray.com>
tsdown's exe wrapper does not always report Node SEA, so treat registered embedded templates as standalone mode. The harness now passes cwd-relative paths because Docula joins CLI paths with path.join(cwd, value), which mangles absolute /tmp paths. Co-authored-by: Jared Wray <me@jaredwray.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #479 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 18
Lines 2760 2760
Branches 845 846 +1
=========================================
Hits 2760 2760 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 4e3485d. Configure here.
| fs.writeFileSync( | ||
| path.join(dir, "README.md"), | ||
| "# Binary Smoke\n\nHello from the binary harness.\n", | ||
| ); |
There was a problem hiding this comment.
Smoke build check is inconclusive
Medium Severity
The build smoke check looks for SMOKE_SITE_TITLE in index.html, but the smoke README.md heading uses that same string. A rendered README alone satisfies the assertion, so a binary that skips JSON config loading can still pass the build check and give false confidence in the release harness.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 4e3485d. Configure here.


Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Test infrastructure for standalone binaries, plus a SEA-detection fix the harness uncovered.
The release workflow previously inlined a three-line smoke check. This extracts that into a reusable harness (
pnpm test:binary) that validates a built or downloaded binary:versionmatchespackage.jsonhelpprints usagebuildof a JSON-only smoke site writesindex.html,robots.txt, andsitemap.xmldownload variableswritesvariables.cssfrom the embedded templatesinit --javascriptscaffolds config, logo, and faviconThe
build-binariesworkflow now runspnpm test:binaryinstead of the inline script. Unit tests cover the harness with a mocked runner so regularpnpm testdoes not need a SEA binary.While running the harness against a locally built
dist/docula, two issues showed up and are fixed here:exewrapper does not always makesea.isSea()return true.isSEA()now also treats registered embedded templates (set bysea-entry) as standalone mode, so JSON-only config enforcement and embedded templates work.-s/-owithpath.join(cwd, value), which turns/tmp/siteinto$cwd/tmp/site. The harness passes cwd-relative paths.Validated with
pnpm test(866 tests, 100% coverage) andpnpm test:binary -- ./dist/docula(6 passed) on a Node 26 SEA build.