tree-sitter / tree-sitter-cli

CLI tool for creating and testing tree-sitter parsers
MIT License
45 stars 15 forks source link

Add build subcommand #44

Closed maxbrunsfeld closed 5 years ago

maxbrunsfeld commented 6 years ago

Fixes https://github.com/tree-sitter/tree-sitter-cli/issues/43

This PR adds a tree-sitter build subcommand. It behaves like tree-sitter generate && node-gyp build. It will also run node-gyp configure if you have not built yet.

I haven't added node-gyp as an actual dependency for now, since it's an optional convenience. I just added an error message that suggests installing it if you try to run tree-sitter build without it.

/cc @superlou @Aerijo

Aerijo commented 6 years ago

it's an optional convenience

Is the alternative running compliation commands manually? Or is there some other (more modern; less deprecated) workflow that can be automated?

maxbrunsfeld commented 5 years ago

Well, installing node-gyp explicitly is optional, since it's bundled as part of npm. I guess I was trying to include only the minimal dependencies.

But on second thought, that's probably not a worthwhile concern. This whole CLI is only installed by people who are developing parsers, so it probably just makes sense to add an explicit dependency on node-gyp, for everyone's convenience.