1. The module tries to call the native binary as a function.
Only `node-gyp-build` returns a function, so the call is moved there.
2. `node-types.json` is imported with outdated syntax.
Use import attributes which require Node 18.
3. The test does not properly catch import errors.
This is solved by moving the import inside the assertion.
Currently, including a tree-sitter parser as a dependency in a zig
project and running `zig build test` on the project will fetch the
zig-tree-sitter dependency declared by the parser. This is a problem
because (a) consumers may not want this dependency for whatever reason
and (b) due to how often Zig breaks everything and how scarcely most
tree-sitter parsers are updated, the zig-tree-sitter version pinned
by the parser module will often be outdated and broken.
The workaround I used was taken from https://ziggit.dev/t/11234
This makes it possible to run `make` or `cmake --build` in grammar
repos where `grammar.json` hasn't been included, and still get the parser
compilation to work.
* Move all rust crates (except lib) into crates dir, w/o nesting
* Remove stale path from .gitattributes
* Rename lib.rs files for easier navigation
* Rename mod.rs file for easier navigation
* Fix emscripten-version path
* Fix fixtures dir paths
* Use the default rustfmt settings
* Don't use nightly on CI