feat(install)!: generate from json instead of requiring node

Problem: Many parsers require node/npm to evaluate the `grammar.js`
before being able to generate a parser from it.

Solution: Generate from `grammar.json` instead, which is fully resolved.
Drops `node` and `npm` as (optional) requirements for nvim-treesitter.

Note that this requires parsers to commit the generated json iff the
grammar requires evaluation (which is currently the case for all tracked
languages).
This commit is contained in:
Christian Clason 2024-04-18 09:44:38 +02:00
parent 8f8cf7144d
commit 5a38df5627
10 changed files with 502 additions and 484 deletions

View file

@ -15,8 +15,8 @@ table.sort(sorted_parsers, function(a, b)
end)
local generated_text = [[
Language | Tier | Queries | CLI | NPM | Maintainer
-------- |:----:|:-------:|:---:|:---:| ----------
Language | Tier | Queries | CLI | Maintainer
-------- |:----:|:-------:|:---:| ----------
]]
local footnotes = ''
@ -59,12 +59,7 @@ for _, v in ipairs(sorted_parsers) do
-- CLI
generated_text = generated_text
.. (p.install_info and p.install_info.requires_generate_from_grammar and '' or '')
.. ' | '
-- NPM
generated_text = generated_text
.. (p.install_info and p.install_info.generate_requires_npm and '' or '')
.. (p.install_info and p.install_info.generate and '' or '')
.. ' | '
-- Maintainer