-
Notifications
You must be signed in to change notification settings - Fork 10
feat: export wasm file #27
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
Conversation
"queries/*", | ||
"src/**" | ||
"src/**", | ||
"*.wasm" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is anything besides the wasm file actually valuable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the VSCode extension (daivinhtran/biome-vscode#1), we don't need anything other than the wasm file. But I can't really speak for other use cases.
For example, the node binding is built and installed on node_modules/tree-sitter-gritql/prebuilds/darwin-arm64/tree-sitter-gritql.node
during an npm install. If we remove prebuilts/**
from this list, it excludes the node binding.
These are other examples we can use as guidance:
https://github.com/tree-sitter/tree-sitter-python/blob/26855eabccb19c6abf499fbc5b8dc7cc9ab8bc64/package.json#L26-L33
https://github.com/tree-sitter/tree-sitter-javascript/blob/58404d8cf191d69f2674a8fd507bd5776f46cb11/package.json#L26-L33
"parse": "tree-sitter parse", | ||
"test": "tree-sitter test", | ||
"wasm": "tree-sitter build-wasm", | ||
"wasm": "tree-sitter build --wasm", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the full history of why these scripts are written as they are. Some of them are redundant or incorrect.
I think we can simplify them to be similar to https://github.com/tree-sitter/tree-sitter-javascript/blob/58404d8cf191d69f2674a8fd507bd5776f46cb11/package.json#L54-L58 or any other official tree-sitter grammar repo.
But that's irrelevant and out-of-scope for this PR. We can address it separately.
It's a common practice example to export the wasm file to its rdeps.
My goal is to integrate
tree-sitter-gritql
parser into the Biome VSCode extension (source: biomejs/biome-vscode#795). The existing node binding doesn't work well on Electron evironment for VSCode extension.Source: https://github.com/tree-sitter/tree-sitter/tree/master/lib/binding_web#basic-usage
Related issue: #28. We'll need to publish an npm package with the wasm file in order for the wasm binding to fully work.