Skip to content

fix(release): reduce npm package size and harden smoke test#93

Merged
simongdavies merged 1 commit intomainfrom
fix/release-package-size-smoke
Apr 29, 2026
Merged

fix(release): reduce npm package size and harden smoke test#93
simongdavies merged 1 commit intomainfrom
fix/release-package-size-smoke

Conversation

@simongdavies
Copy link
Copy Markdown
Member

This pull request updates the build and release process for native addons and npm packaging, focusing on improving artifact handling, package size enforcement, and reliability of npm publish verification. The most significant changes streamline the build matrix for musl targets, enforce stricter packaging constraints, and simplify the binary build script.

Build and Packaging Improvements:

  • The musl build steps in .github/workflows/publish.yml now explicitly build native addons in release mode with stripping enabled, and remove glibc artifacts to ensure only musl binaries are uploaded for that matrix leg.
  • A new step enforces a maximum unpacked npm package size (300MB) and fails the workflow if exceeded, preventing accidental bloat.
  • After running tests, a new step rebuilds native addons in release mode to ensure production artifacts are packaged.

NPM Publish Verification:

  • The publish workflow's registry polling logic now checks both metadata and tarball availability (including shasum verification) before proceeding, improving reliability and removing a redundant separate tarball check step.

Build Script and Cross-Platform Artifacts:

  • The scripts/build-binary.js script is simplified to only copy platform-specific .node files into the correct package subdirectories, rather than duplicating them in the main lib directory.
  • The Justfile and package.json build scripts are updated to use the --strip flag for smaller, optimized native binaries in release builds.

Copilot AI review requested due to automatic review settings April 29, 2026 07:36
@simongdavies simongdavies added the bug Something isn't working label Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates HyperAgent’s release/publish pipeline to produce smaller, release-optimized native artifacts and to make post-publish verification more reliable (including registry propagation + tarball availability checks).

Changes:

  • Build native addons in release mode with stripping enabled (including explicit handling for musl-only artifact uploads).
  • Add an npm package unpacked-size guard (300MB) during packing to prevent accidental bloat.
  • Simplify the standalone binary build process to only place .node files in the appropriate package subdirectories, and harden the npm publish smoke-test polling to verify both metadata and tarball shasum.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/code-validator/guest/package.json Builds the guest N-API addon in release mode with stripping to reduce artifact size.
scripts/build-binary.js Stops duplicating .node files into the top-level lib/ directory; keeps them under the appropriate package directories for resolution.
Justfile Ensures release builds of native addons use --strip (including Windows path) to reduce output size.
.github/workflows/publish.yml Streamlines musl packaging, enforces max unpacked size, rebuilds release addons post-test, and strengthens smoke-test registry polling with tarball shasum verification.

@simongdavies simongdavies merged commit f3b4776 into main Apr 29, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants