tact-lang / tree-sitter-tact

🌳 Tree-sitter grammar for the ⚡ Tact contract programming language
https://tact-lang.org
MIT License
18 stars 0 forks source link

Add convenience WASM builds and publish to npm #12

Open novusnota opened 8 months ago

novusnota commented 8 months ago

This can be done using tree-sitter-cli itself:

tree-sitter build --wasm

Examples in the docs: https://tree-sitter.github.io/tree-sitter/creating-parsers#command-build

novusnota commented 5 months ago

We'd also need to publish a Rust package with auto-generated bindings to tree-sitter-tact on crates.io. That's a requirement for adding Tree-sitter-enabled support for Tact on Github, see: https://github.com/github/code-navigation#tree-sitter-parser

Of course, all that needs to be done after Tact gets into Linguist.

enpitsuLin commented 5 months ago

Any update here? I made a prettier plugin for tact by installing the GitHub repo as a dependency package

but I think it needs to install tree-sitter-tact as its peer deps which should be from the npm package if published to npm.

So publishing to the registry(npm, crates) Is this still in the planning stages?


BTW I also found some problems with the parser during development, it will parse the comment node in function/struct/message to its empty *_body node, maybe I should open an issue?

novusnota commented 5 months ago

I also found some problems with the parser during development, it will parse the comment node in function/struct/message to its empty *_body node, maybe I should open an issue?

Please do, I'll take a look!

So publishing to the registry(npm, crates) Is this still in the planning stages?

Yes, it is. However, local builds with either Docker or Emscripten are quite easy to do. If you go the second route, those are the steps:

  1. (In Linux, macOS or WSL) Git clone, locally install and activate environment variables, see: Small official guide for Emscripten SDK
  2. Go into cloned tree-sitter-tact repo, update dependencies (npm i) and then simply execute npm run build-wasm