tree-sitter-grammars / tree-sitter-hcl

HCL grammar for tree-sitter
https://tree-sitter-grammars.github.io/tree-sitter-hcl/
Apache License 2.0
96 stars 20 forks source link

Publish grammar to npm #55

Open szclentfort opened 3 months ago

szclentfort commented 3 months ago

Is your feature request related to a problem? Please describe. I would like to use the hcl grammar from a nodejs project. However, it is not published to NPM and I need to set up a full build chain to build the project locally, which I'd like to avoid

Describe the solution you'd like Have the package available from npmjs as tree-sitter-hcl

Describe alternatives you've considered Building the grammar locally

szclentfort commented 3 months ago

Notes on how I got this to run:

  1. Download release 1.1.0 from releases page
  2. Unpack release to ./vendor/tree-sitter-hcl-1.1.0/ in my project
  3. Run tree-sitter generate in vendor/tree-sitter-hcl-1.1.0/. This updates binding.gyp
  4. Update binding.gyp to include "src/scanner.css" in the sources-array
  5. Add "tree-sitter-hcl": "./vendor/tree-sitter-hcl-1.1.0/" to my dependencies in package.json
  6. Run npm i
MichaHoffmann commented 3 months ago

I think despite the name it's somewhat related to https://github.com/tree-sitter-grammars/tree-sitter-hcl/pull/52. We should have some actions to upload to npm and other package repositories. Cc @clason

clason commented 2 months ago

Yes. Upstream is working on it.

ObserverOfTime commented 2 months ago

We do have actions to upload to npm other package repositories.