This repository was archived by the owner on Sep 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
languages/tree-sitter-stack-graphs-typescript Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ edition = "2018"
1111[[bin ]]
1212name = " tree-sitter-stack-graphs-typescript"
1313path = " rust/bin.rs"
14+ required-features = [" cli" ]
1415
1516[lib ]
1617path = " rust/lib.rs"
@@ -20,14 +21,19 @@ test = false
2021name = " test"
2122path = " rust/test.rs"
2223harness = false
24+ required-features = [" tree-sitter-stack-graphs/cli" ] # this should be *forced* for tests, but cargo does not support that
25+
26+ [features ]
27+ default = [" cli" ] # as long as the required features for test cannot be forced, we enable cli by default, to make sure tests are always run
28+ cli = [" anyhow" , " clap" , " tree-sitter-stack-graphs/cli" ]
2329
2430[dependencies ]
25- anyhow = " 1.0"
26- clap = " 3"
31+ anyhow = { version = " 1.0" , optional = true }
32+ clap = { version = " 3" , optional = true }
2733glob = " 0.3"
2834serde = { version = " 1.0" , features = [" derive" ] }
2935serde_json = " 1.0"
3036stack-graphs = { version = " 0.10" , path = " ../../stack-graphs" }
31- tree-sitter-stack-graphs = { version = " 0.6" , path = " ../../tree-sitter-stack-graphs" , features =[ " cli " ] }
37+ tree-sitter-stack-graphs = { version = " 0.6" , path = " ../../tree-sitter-stack-graphs" }
3238tree-sitter-typescript = { git = " https://github.com/tree-sitter/tree-sitter-typescript" , rev =" 082da44a5263599186dadafd2c974c19f3a73d28" }
3339tsconfig = " 0.1.0"
Original file line number Diff line number Diff line change @@ -78,21 +78,21 @@ extension for syntax highlighting.
7878Parse and test a single file by executing the following commands:
7979
8080``` sh
81- $ cargo run -- parse FILES...
82- $ cargo run -- test TESTFILES...
81+ $ cargo run --features cli -- parse FILES...
82+ $ cargo run --features cli -- test TESTFILES...
8383```
8484
8585Additional flags can be passed to these commands as well. For example, to generate
8686a visualization for the test, execute:
8787
8888``` sh
89- $ cargo run -- test -V TESTFILES...
89+ $ cargo run --features cli -- test -V TESTFILES...
9090```
9191
9292To generate the visualization regardless of test outcome, execute:
9393
9494``` sh
95- $ cargo run -- test -V --output-mode=always TESTFILES...
95+ $ cargo run --features cli -- test -V --output-mode=always TESTFILES...
9696```
9797
9898Go to https://crates.io/crates/tree-sitter-stack-graphs for links to examples and documentation.
You can’t perform that action at this time.
0 commit comments