What is the best way to handle distribution of a tree-sitter package?

#1

Hey, I have a grammar package that I just recently updated to use tree-sitter and it’s come to my attention that some users may not have the development environment required to compile a native module.

Specifically, a user posted an issue that node-gyp failed because python was not installed on their machine.

I was wondering what is the best way to handle distribution of a tree-sitter package that will reliably work on linux, mac, and windows?

Thank you

0 Likes

#2

Look into using the prebuild module. You can find an example of it on the repo for Ruby at least.

Basically it will set up CI to upload builds to GitHub on a release, and set the installer to first try to find a compatible build if possible. I found setting it up, specifically the credentials, a little finicky to get right, but it’s worth doing.

2 Likes

#3

Awesome, thank you very much. I believe prebuild is what I’m looking for and the Ruby repo shows how it can be used.

0 Likes