-
Notifications
You must be signed in to change notification settings - Fork 18
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
Conversation
This file contains 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
I also added unit tests (also on CI) and it works! |
publish CI is now ready: https://github.com/crabnebula-dev/cargo-packager/actions/runs/6897523113/job/18766089074 |
amr-crabnebula
approved these changes
Nov 17, 2023
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.
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 thepackage
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.