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

Publish compiler as npm package #77

Open
bhelx opened this issue May 17, 2024 · 2 comments
Open

Publish compiler as npm package #77

bhelx opened this issue May 17, 2024 · 2 comments

Comments

@bhelx
Copy link
Contributor

bhelx commented May 17, 2024

It might make sense to publish the whole package to npm and have the compiler published as a bin since that's how most people will be managing their other dependencies. We can also add it to the templates. There may be some trickiness around getting wasm-merge in place. Leaving this open for discussion and ideas on how to implement.

@Phault
Copy link
Contributor

Phault commented May 18, 2024

Seems fairly feasible to package it up. While I think it would be unwise to use this dependency due to its outdated dependencies, it can serve as a great reference either way: binary-install example. Someone also went through the trouble of rewriting it without axios: simple-binary-install.

Apparently binaryen npm package already contains wasm-merge and wasm-opt bins, and I can confirm extism-js works just fine with them. So this is just a matter of adding it as a peerDep.

Edit: Once again I've been duped by npm's hoisting behavior. Seems there's a bit more to it, on top of adding it as peerDep, as binaries of transient deps aren't hoisted.

So wasm-merge won't automatically become available for the plugin developer to directly call, unless they add it as a dep themselves. I believe it would be available to the extism-js binary that we'll bundle though, so it should be a non-issue.

Phault added a commit to Phault/proto that referenced this issue May 18, 2024
extism-js can get the same treatment, if extism/js-pdk#77 lands.
@ubiquitous-dev
Copy link
Contributor

This would be really awesome to see, it would make the process of using the pdk super streamlined for node devs. Also, it unlocks npx flows where you could execute a build without even having to install it locally, which is really great for quick-starting.

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

No branches or pull requests

3 participants