Closed ritz078 closed 5 years ago
or maybe just commit your generated pkg
folder too so that some exploring can have a look?
Sure, if it is of interest I could probably just publish the generated npm package to npm. I want to avoid committing it to the repo as it contains the binary webassembly file.
What kind of problems did you have trying to build the project?
It was an issue with the rustup version. I had to update it to nightly build to make it work. A npm package will be great. I want to use it on https://transform.tools/ . I can provide the link to your npm package there in case anyone wants to use it programatically.
Hmm, checked now, and seems I am building on stable myself, but I see the CI on this repo is incorrectly configured so that the wasm module is not built on CI, so I'm not too confident in how reliably that part builds.
What kind of interface would you need to use it the way you want? At the moment the wasm module is very much in an MVP stage, so the exposed function just returns a string no matter what happens (the exposed function).
I just need the generated pkg
folder. I have been able to build it and just copied the pkg folder. Everything is working great.
I think the function returning a string is good enough. If there is an error, I can catch it via try/catch
. So the API doesn't seem to have any issue. btw thanks for this. It has helped me close multiple issues on my repo relating to rust.
It also automatically creates a package.json file, so I guess you need nothing more to publish it. Let me know if you need any help on that.
Cool, if that's all you need I'll just let what is there now be the initial version of the npm package. And if I change the interface I'll leave the current function around for backwards compatibility.
So there is a npm package here now: https://www.npmjs.com/package/json_typegen_wasm
FYI: I ended up re-publishing (which was then 0.3.3) the wasm module, as compiled with
[profile.release]
lto = true
opt-level = "s"
the wasm module is ~200KB smaller, which is quite a bit.
That's awesome. Thanks a lot for this. ❤️
I tried building on my own but it keeps breaking. will you like to distribute such a build that can be directly consumed using JS?