Open
Conversation
Add scripts for building standalone Single Executable Application binaries (macOS JS bundle + Linux SEA via Docker cross-build). - scripts/build_binary.js: full SEA packaging pipeline - sea/sea-launch.cjs: runtime asset extractor for SEA binaries - npm scripts: build:binary, apex, apex:linux, apex:all - .gitignore: exclude corp-specific distribution files Made-with: Cursor
Author
|
Fixes #2359 |
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
Add scripts for building standalone Single Executable Application (SEA) binaries, enabling qwen-code distribution without requiring Node.js installation on target machines.
What's included
scripts/build_binary.js— Full SEA packaging pipeline: reads esbuild bundle, generates manifest with SHA-256 integrity hashes, creates SEA blob vianode --experimental-sea-config, injects into Node binary via postject, handles macOS code signing and universal binary extractionsea/sea-launch.cjs— Runtime asset extractor for SEA binaries: extracts embedded assets to a secure temp directory with integrity verification, handles atomic directory creation via rename, supports cross-platform (macOS/Linux/Windows)build:binary,apex(macOS bundle copy),apex:linux(Docker cross-build),apex:allHow it works
macOS: The esbuild bundle (
dist/cli.js) already has a#!/usr/bin/env nodeshebang —npm run apexsimply copies it to.bin/apex. No SEA packaging needed, runs on system Node.Linux cross-build:
npm run apex:linuxuses Docker buildx to build a self-contained SEA binary for linux/amd64 inside a container, extracting just the binary. No Node.js required on the target machine.Test plan
npm run bundleproducesdist/cli.js(18MB)node scripts/build_binary.jscompletes successfully on macOS arm64npm run apexcopies bundle to.bin/apexwith correct shebangMade with Cursor