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

Add convenience WASM builds and publish to npm #12

Open
novusnota opened this issue Apr 1, 2024 · 3 comments
Open

Add convenience WASM builds and publish to npm #12

novusnota opened this issue Apr 1, 2024 · 3 comments
Assignees
Labels
ci/cd & packaging NPM, Crates, etc.

Comments

@novusnota
Copy link
Member

novusnota commented Apr 1, 2024

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 novusnota added the has dependency Depends on another issue, PR or updates in another repo/project label Apr 1, 2024
@novusnota novusnota self-assigned this Apr 1, 2024
@novusnota novusnota added ci/cd & packaging NPM, Crates, etc. and removed has dependency Depends on another issue, PR or updates in another repo/project labels Apr 4, 2024
@novusnota
Copy link
Member Author

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
Copy link

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
Copy link
Member Author

novusnota commented Jun 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd & packaging NPM, Crates, etc.
Projects
None yet
Development

No branches or pull requests

2 participants