Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 19d315b

Browse files
author
Hendrik van Antwerpen
authored
Merge pull request #133 from github/init-project-command
Add command to initialize new project
2 parents c10642b + 22e4a50 commit 19d315b

File tree

5 files changed

+474
-1
lines changed

5 files changed

+474
-1
lines changed

tree-sitter-stack-graphs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
#### Added
1313

1414
- Builtins can be explicitly supplied using the `--builtins` flag. If the given path does not have a file extension, the file extension of the language is implicitly added.
15+
- A new `init` command can be used to generate new tree-sitter-stack-graphs projects for NPM distributed Tree-sitter grammars.
1516

1617
#### Changed
1718

tree-sitter-stack-graphs/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ name = "tree-sitter-stack-graphs"
2222
required-features = ["cli"]
2323

2424
[features]
25-
cli = ["clap", "colored", "env_logger", "stack-graphs/json", "tree-sitter-config", "walkdir"]
25+
cli = ["clap", "colored", "dialoguer", "env_logger", "indoc", "stack-graphs/json", "tree-sitter-config", "walkdir"]
2626

2727
[dependencies]
2828
anyhow = "1.0"
2929
clap = { version = "3", optional = true, features=["derive"] }
3030
colored = { version = "2.0", optional = true }
3131
controlled-option = ">=0.4"
32+
dialoguer = { version = "0.10", optional = true }
3233
env_logger = { version = "0.9", optional = true }
34+
indoc = { version = "1.0", optional = true }
3335
itertools = "0.10"
3436
lazy_static = "1.4"
3537
log = "0.4"

tree-sitter-stack-graphs/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The `tree-sitter-stack-graphs` crate lets you create stack graphs using the
66
[tree-sitter]: https://tree-sitter.github.io/
77

88
- [API documentation](https://docs.rs/tree-sitter-stack-graphs/)
9+
- [Examples](https://github.com/github/stack-graphs/blob/main/tree-sitter-stack-graphs/examples/)
910
- [Release notes](https://github.com/github/stack-graphs/blob/main/tree-sitter-stack-graphs/CHANGELOG.md)
1011

1112
## Usage
@@ -32,6 +33,14 @@ $ cargo install --features cli tree-sitter-stack-graphs
3233
$ tree-sitter-stack-graphs --help
3334
```
3435

36+
Alternatively, the program can be invoked via NPM as follows:
37+
38+
``` sh
39+
$ npx tree-sitter-stack-graphs
40+
```
41+
42+
Check out our [examples](https://github.com/github/stack-graphs/blob/main/tree-sitter-stack-graphs/examples/) for more details on how to work with the CLI.
43+
3544
## Development
3645

3746
The project is written in Rust, and requires a recent version installed.

0 commit comments

Comments
 (0)