Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(packager): add Node.js bindings, ref #47 #58

Merged
merged 66 commits into from
Nov 17, 2023

Conversation

lucasfernog-crabnebula
Copy link
Member

This PR adds a Node.js binding to the packager using napi.rs. The NPM package is called @crabnebula/packager. It includes a CLI and a programatic interface to the package function, though the latter was not polished yet and we're focusing on the CLI for now.

The Node.js binding pulls the configuration from package.json > packager and comes with Electron support via a plugin that checks if Electron is a dependency, downloads the prebuilt Electron binary and adjust the configuration to work with it. It's been tested on macOS, Linux and Windows.

It does not close #47 yet because we might want to add compatibility layers with electron-build, electron-packager etc so it's easier for users.

What I didn't test yet is the CI workflow that comes with napi-rs for publishing it. That always take some time to figure out. It lives under .github/workflows/publish-packager-nodejs.yml.

We might want to come up with a better name for this project, as cargo-packager isn't a good name for a project that are also available for NPM in my opinion.

@lucasfernog-crabnebula
Copy link
Member Author

I also added unit tests (also on CI) and it works!

@lucasfernog-crabnebula
Copy link
Member Author

@amr-crabnebula amr-crabnebula merged commit ecde3fb into main Nov 17, 2023
16 checks passed
@amr-crabnebula amr-crabnebula deleted the feat/nodejs-binding branch November 17, 2023 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RAD-53] Node.js bindings
3 participants