holochain / holochain-cmd

Developer Command Line Tools for Holochain
GNU General Public License v3.0
36 stars 4 forks source link

WASM 2 JSON #78

Closed lucksus closed 6 years ago

lucksus commented 6 years ago

Use ribosome::dna_run() (from core) to get JSON from __hdk_get_json_definition() from WASM and include that in the output.

This almost works as expected! But not quite. The output is on the wrong level..

To test this, build hc this branch and point the Zome's Cargo.toml to a holohchain-rust that has these changes merged in: https://github.com/holochain/holochain-rust/pull/549/files.

You should see the JSON printed on screen and it should appear in the bundle.json output.

It is on the wrong level because fn bundle_recurse(&self, path: &PathBuf) -> DefaultResult<Object> is recursive (doh!) and the level on which we get the WASM from the build process is to deep in the tree for attaching the whole zome JSON.

lucksus commented 6 years ago

Tried to finish this tonight but really have to sleep now. @sphinxc0re, @Connoropolous, @maackle, someone, please fix the tree-level problem 🙏 then we can get rid of redundant JSON code in our DNA source :)

Connoropolous commented 6 years ago

@lucksus fixed the recursive tree problem :) now the JSON just needs some minor tweaks. It's slightly different than core expects in a DNA file

Connoropolous commented 6 years ago

Oh, I think this just answered my question in the other PR. Nice!