Skip to content

feat(js-host-api): add npm publishing workflow#36

Merged
simongdavies merged 7 commits intomainfrom
feat/npm-publish
Apr 8, 2026
Merged

feat(js-host-api): add npm publishing workflow#36
simongdavies merged 7 commits intomainfrom
feat/npm-publish

Conversation

@simongdavies
Copy link
Copy Markdown
Member

Summary

Adds cross-platform npm publishing for @hyperlight/js-host-api.

Changes

  • npm-publish.yml - New workflow that builds native binaries on Linux/Windows and publishes to npmjs.com
  • CreateRelease.yml - Calls npm-publish after creating GitHub release
  • package.json - Added napi targets and optionalDependencies for platform packages
  • npm/ - Platform-specific package.json files for Linux and Windows
  • .npmignore - Controls what gets published (includes generated index.js/index.d.ts)
  • README.md - Added publishing documentation

Usage

  • Manual: Actions → "Publish npm packages" → Run workflow (with optional dry-run)
  • Automatic: Triggers after CreateRelease on release/vX.Y.Z branches

Setup Required

Add NPM_TOKEN secret (npm access token with publish permissions for @hyperlight scope)

@simongdavies simongdavies added the kind/enhancement New feature or improvement label Mar 3, 2026
jprendes
jprendes previously approved these changes Mar 4, 2026
Copy link
Copy Markdown
Contributor

@jprendes jprendes left a comment

Choose a reason for hiding this comment

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

LGTM, it would be great if we could test it in a local repo before publishing to npm, to make sure that it works as expected. There is a lot of nodejs magic in here :-)

Comment thread .github/workflows/npm-publish.yml
Comment thread src/js-host-api/package.json
Comment thread src/js-host-api/package.json
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

Adds an npm publishing pipeline for @hyperlight/js-host-api, including platform-specific binary sub-packages and documentation, and wires publishing into the release workflow.

Changes:

  • Introduces a new GitHub Actions workflow to build Linux/Windows N-API binaries and publish main + platform npm packages.
  • Updates @hyperlight/js-host-api metadata and adds platform package manifests under src/js-host-api/npm/.
  • Adds .npmignore rules and README documentation describing the publishing process.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/js-host-api/package.json Adds repository metadata, napi targets, and optionalDependencies for platform packages.
src/js-host-api/package-lock.json Updates lockfile to reflect new optional dependencies (currently incomplete vs package.json).
src/js-host-api/npm/win32-x64-msvc/package.json New Windows platform package manifest for the .node binary.
src/js-host-api/npm/linux-x64-musl/package.json New Linux musl platform package manifest for the .node binary.
src/js-host-api/npm/linux-x64-gnu/package.json New Linux glibc platform package manifest for the .node binary.
src/js-host-api/README.md Documents automated/manual npm publishing and platform selection behavior.
src/js-host-api/.npmignore Adds publish-time include/exclude rules (currently missing an exclusion for npm/).
.github/workflows/npm-publish.yml New workflow to build artifacts and publish npm packages (contains a critical input reference issue).
.github/workflows/CreateRelease.yml Calls the npm publish workflow after creating a GitHub release and passes the derived version.
Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/js-host-api/package-lock.json Outdated
Comment thread src/js-host-api/.npmignore
Comment thread .github/workflows/npm-publish.yml Outdated
Comment thread .github/workflows/npm-publish.yml
Comment thread src/js-host-api/README.md
Comment thread src/js-host-api/README.md
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

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/js-host-api/package-lock.json
Comment thread .github/workflows/npm-publish.yml
Comment thread .github/workflows/npm-publish.yml Outdated
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

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/npm-publish.yml Outdated
Comment thread .github/workflows/npm-publish.yml Outdated
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

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/npm-publish.yml Outdated
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

Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/npm-publish.yml Outdated
Comment thread .github/workflows/CreateRelease.yml
Comment thread src/js-host-api/package.json Outdated
Comment thread src/js-host-api/.npmignore
Comment thread .github/workflows/npm-publish.yml Outdated
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

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/js-host-api/README.md
ludfjig
ludfjig previously approved these changes Apr 7, 2026
Copy link
Copy Markdown
Contributor

@ludfjig ludfjig left a comment

Choose a reason for hiding this comment

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

I think looks good

Comment thread src/js-host-api/npm/linux-x64-gnu/package.json Outdated
@simongdavies simongdavies force-pushed the feat/npm-publish branch 2 times, most recently from 0e4ae8c to b6ce831 Compare April 7, 2026 18:49
ludfjig
ludfjig previously approved these changes Apr 7, 2026
- Add npm-publish.yml workflow for cross-platform builds (Linux/Windows x64)
- Add platform-specific npm packages for native binaries
- Integrate npm publish into CreateRelease workflow
- Add .npmignore to control published files
- Update README with publishing documentation

Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
ludfjig
ludfjig previously approved these changes Apr 7, 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

Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/js-host-api/test-pack.sh Outdated
Comment thread src/js-host-api/test-pack.sh Outdated
Comment thread .github/workflows/npm-publish.yml Outdated
Comment thread src/js-host-api/.npmignore
Comment thread src/js-host-api/package.json
Comment thread src/js-host-api/test-pack.sh Outdated
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

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/npm-publish.yml Outdated
Comment thread src/js-host-api/test-pack.sh
Comment thread src/js-host-api/test-pack.sh Outdated
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
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

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • src/js-host-api/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/npm-publish.yml
Comment thread .github/workflows/npm-publish.yml Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@simongdavies simongdavies merged commit ad92d57 into main Apr 8, 2026
18 checks passed
@simongdavies simongdavies deleted the feat/npm-publish branch April 9, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants