add npm binary distribution#22
Open
iamalwaysuncomfortable wants to merge 1 commit into
Open
Conversation
Publish aleo-devnode to npm as @provablehq/aleo-devnode using the optionalDependencies pattern: a thin launcher package plus one prebuilt binary package per platform, gated by npm os/cpu fields. - npm/run.js: launcher shim that resolves the host's platform package and execs the binary, forwarding args and exit code - scripts/build-npm.mjs: assembles the launcher + 5 platform packages from the release build artifacts and stamps versions - release.yml: add aarch64-unknown-linux-gnu to the build matrix and a new npm job that publishes all packages on tag Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Motivation
Make
aleo-devnodeinstallable via npm (npm install -g @provablehq/aleo-devnode) so users don't have to grab the right binary from GitHub Releases and put it on their PATH manually. Rust binaries are compiled per platform, so this ships one prebuilt binary per platform and lets npm pick the matching one.What this does
Uses the
optionalDependenciespattern (same model as esbuild/biome/turbo):npm/run.js— a thin launcher shim. Detects the host'splatform/arch, resolves the matching platform package, and execs the real binary, forwarding argv, stdio, and the exit code.scripts/build-npm.mjs— single source of truth for the platform matrix. Assembles the@provablehq/aleo-devnodelauncher plus 5 platform packages (darwin-arm64,darwin-x64,linux-x64,linux-arm64,win32-x64) from the release build artifacts and stamps the version into each..github/workflows/release.yml— addsaarch64-unknown-linux-gnuto the build matrix (nativeubuntu-24.04-armrunner; existinglibclang-devstep covers it) and a newnpmjob that, on everyv*tag, downloads the built binaries and publishes all 6 packages (platform packages first, launcher last so its exact-pinnedoptionalDependenciesresolve).On install, users get an
aleo-devnodecommand on their PATH; npm downloads only the binary matching theiros/cpu.Test Plan
Verified locally with dummy binaries for all 5 targets:
package.jsons (rightos/cpu, exact-pinned optional deps).node_modules: the shim resolves the platform package, forwards args, and propagates the child exit code (7→7); a--no-optionalinstall fails with a clear message and exit 1.npm pack --dry-runships onlyrun.js,README.md,package.json.Follow-ups required before the first release
NPM_TOKENrepo secret (npm token with publish rights to the@provablehqscope); thenpmjob readssecrets.NPM_TOKEN.Apache-2.0(LICENSEconst inscripts/build-npm.mjs); change if incorrect.Related PRs
None
🤖 Generated with Claude Code