holochain / hdk-assemblyscript

The Holochain Developer Kit for Assemblyscript
41 stars 2 forks source link

WIP: running a transform #5

Closed Connoropolous closed 5 years ago

Connoropolous commented 5 years ago

looks totally possible to include a pre-processing transformation... assemblyscript has a very nice hook in to the parser, with afterParse

You use --transform in the CLI command

addressing #2

Relevant source code lines... https://github.com/AssemblyScript/assemblyscript/blob/658ab23ea6379d4da6ee162687415e39e115274b/cli/asc.js#L393 https://github.com/AssemblyScript/assemblyscript/blob/658ab23ea6379d4da6ee162687415e39e115274b/cli/asc.js#L210-L227

Connoropolous commented 5 years ago

@willemolding wanna pair on this (sync or async)?

To make this work , you'll need to clear both node_modules directories out, at the root and for the appSpec. Then re-install the node modules for the root, the hdk-assemblyscript itself. It will work fine with that. Then you can just work between the zome-functions-transform file, and the main index file of the appSpec.

willemolding commented 5 years ago

Decorators are now working for @zome_function! Only string/void is supported for parameters and return type at the moment until we sort out the JSON stuff. Happy for this to be merged to master after review

Connoropolous commented 5 years ago

nevermind I see you made updates to the readme outside the branch. Rad.