Add standalone executable packaging and test infrastructure#4
Merged
Conversation
… and Deno Created cmd/ folder with build scripts and results for three approaches: - cmd/node-sea/: Node.js Single Executable Application (PASS - 121MB, version works) - cmd/bun/: Bun compile with cross-compilation (PASS - all 5 OS/arch targets, 60-112MB) - cmd/deno/: Deno compile (NOT TESTED - Deno unavailable in env, scripts prepared) - cmd/RESULTS.md: Detailed comparison and recommendation https://claude.ai/code/session_01SYcmojUbs1ef1UgkFeSZyE
- cmd/test/run-test.js: Programmatic test runner using ApiDef.makeBuild() that exercises the full pipeline (parse, guide, transformers, builders, generate) with solar test data - cmd/test/build-and-test.sh: Master script that generates Node.js reference output, then builds and tests Bun and Node SEA executables, comparing all output files (jsonic, json, manifest) for exact match - cmd/test/solar/ and cmd/test/def/: Independent copy of test fixtures - Polyfills require.main.paths for Bun (missing) and Node SEA (wrong location) - Copies model/*.jsonic to work dir node_modules for SEA require.resolve compat Results: Bun 5/5 PASS, Node SEA 5/5 PASS, Deno SKIP (not installed) All 11 .jsonic files, guide.json, and apimodel.json match exactly between Node.js reference, Bun executable, and Node SEA executable. https://claude.ai/code/session_01SYcmojUbs1ef1UgkFeSZyE
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 adds comprehensive infrastructure for packaging the
@voxgig/apidefCLI as standalone executables across multiple platforms and runtimes, along with a complete test suite to validate the packaging approaches.Key Changes
Standalone Executable Packaging
cmd/node-sea/build.shthat bundles the CLI with esbuild and injects it into the Node.js binary using postject, producing a 121 MB executablecmd/bun/build.shandcmd/bun/entry.jsfor building standalone executables with Bun's--compileflag, supporting cross-compilation to 6 platform targetscmd/deno/build.shandcmd/deno/entry.tsfor Deno-compatible packaging with built-in cross-compilation supportTest Infrastructure
cmd/test/build-and-test.sh): Orchestrates building and testing all three executable approaches, comparing output against a Node.js reference implementationcmd/test/run-test.js): Programmatically exercises the ApiDef pipeline using the Solar System API test fixture, handling require.main.paths resolution for standalone executablescmd/test/def/)Test Data & Expected Output
Documentation
Notable Implementation Details
require.main.pathsresolution, which may be undefined or incorrect in bundled contexts, enabling aontu to resolve@"@voxgig/apidef/model/*.jsonic"includes--targetsupporthttps://claude.ai/code/session_01SYcmojUbs1ef1UgkFeSZyE