Add unified build script and improve test validation#6
Merged
Conversation
The script had two versions concatenated: one using $DIST_DIR with main.ts, another creating an inline entry.ts wrapper with $BUILD_DIR. This caused duplicate variable declarations, orphaned compile flags after echo "Done.", and a script that could not execute. Resolved by keeping the Deno installation check, using the existing main.ts entry point (the proper Deno-native implementation), and including all necessary permissions (--allow-sys, --node-modules-dir=auto). https://claude.ai/code/session_01PuRnKkrSs3UDHo5VifnCs4
run-test.js now validates the guide output against the expected solar guide structure (entities, paths, operations, actions, metrics) matching the SOLAR_GUIDE assertions from the main test suite. This closes the gap where cmd experiments only tested output equivalence across runtimes but not correctness of the output itself. build-and-test.sh checks correctness.json for both the Node.js reference and each runtime executable, failing the build if the guide structure doesn't match expectations. https://claude.ai/code/session_01PuRnKkrSs3UDHo5VifnCs4
The correctness.json has "ok": true (with space after colon) but the grep pattern expected "ok":true (no space). Updated to "ok": *[a-z]* to handle both formats. https://claude.ai/code/session_01PuRnKkrSs3UDHo5VifnCs4
- Bundle with esbuild before deno compile (same as Node SEA) so all CommonJS require() calls are resolved into a single file - Auto-detect DENO_CERT from system CA bundle for environments with custom certificates - Add --no-check to skip type-checking the esbuild bundle - Add --unstable-detect-cjs for Deno 2.x CommonJS compatibility All three executables now pass: 19 PASS, 0 FAIL, 0 SKIP. https://claude.ai/code/session_01PuRnKkrSs3UDHo5VifnCs4
cmd/build.sh <target> [os-arch] builds standalone executables for bun, deno, node-sea, or all three. Supports cross-compilation via os-arch argument (linux-x64, linux-arm64, darwin-x64, darwin-arm64, windows-x64). Defaults to current platform when os-arch is omitted. https://claude.ai/code/session_01PuRnKkrSs3UDHo5VifnCs4
Drop Node 18/20/22 matrix entries, replace with 24.x and latest. Bump actions/checkout and actions/setup-node to v4. Simplify test step to just `npm test`. https://claude.ai/code/session_01PuRnKkrSs3UDHo5VifnCs4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a unified build system for creating standalone executables of voxgig-apidef across multiple runtimes (Bun, Deno, Node.js SEA) and platforms, along with enhanced test validation to ensure correctness of generated API definitions.
Key Changes
New unified build script (
cmd/build.sh): Single entry point for building standalone executables with support for:Enhanced test validation (
cmd/test/run-test.js):validateGuide()function that checks generated API guide structure against expected schemacorrectness.jsonfor external comparisonImproved test comparison (
cmd/test/build-and-test.sh):Refactored Deno build script (
cmd/deno/build.sh):Documentation (
cmd/README.md): New guide documenting build targets, platforms, usage examples, and prerequisitesBuild output organization: Added
cmd/build/to.gitignorefor generated executablesDependency update: Updated
aontupeer dependency from>=0.36.0to^0.37.0Implementation Details
exe_name,verify_exe,report) to standardize output naming and verification across targetshttps://claude.ai/code/session_01PuRnKkrSs3UDHo5VifnCs4