Skip to content

Commit

Permalink
TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Mar 13, 2023
1 parent 98c491e commit ccd9d10
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- run: |
cargo build \
--bin ${NAME}-rust \
--bin ${NAME}-typescript \
--locked \
--release \
--target=x86_64-unknown-linux-musl
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ jobs:
run: |
cargo build \
--bin ${NAME}-rust \
--bin ${NAME}-typescript \
--locked \
--release \
--target=x86_64-unknown-linux-musl
cp target/x86_64-unknown-linux-musl/release/tree-splicer-rust .
cp target/x86_64-unknown-linux-musl/release/tree-splicer-{rust,typescript} .
- uses: ncipollo/release-action@v1
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
artifacts: "tree-splicer-rust"
artifacts: "tree-splicer-rust,tree-splicer-typescript"
artifactErrorsFailBuild: true
body: "See [CHANGELOG.md](https://github.com/langston-barrett/tree-splicer/blob/main/doc/CHANGELOG.md)."
draft: true
Expand All @@ -46,7 +47,7 @@ jobs:
# Only push on actual release tags
PUSH: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
for pkg in tree-splicer{,-rust}; do
for pkg in tree-splicer{,-rust,-typescript}; do
if [[ ${PUSH} == true ]]; then
cargo publish --token ${CRATES_IO_TOKEN} -p "${pkg}"
else
Expand Down
19 changes: 19 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"crates/tree-splicer",
"crates/tree-splicer-rust",
"crates/tree-splicer-typescript",
]

# https://nnethercote.github.io/perf-book/build-configuration.html
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ maximal coverage and bug-finding through complete, hand-written grammars and
complex techniques like coverage-based feedback, tree-splicer aims to achieve
maximal ease-of-use by using off-the-shelf tree-sitter grammars and not
requiring any instrumentation (nor even source code) for the target.
In short, tree-splicer wants to be the [Radamsa][radamsa] of grammar-based
fuzzing.

tree-sitter grammars are resistant to syntax errors. Therefore, tree-splicer
can even mutate syntactically-invalid inputs! You can also use tree-splicer
Expand Down Expand Up @@ -86,6 +88,11 @@ fn x(x: usize) -> () {
}
```

## Supported languages

- Rust
- TypeScript

## Installation

### From a release
Expand Down Expand Up @@ -125,5 +132,6 @@ You can find binaries in `target/release`. Run tests with `cargo test`.

[cargo]: https://doc.rust-lang.org/cargo/
[crates-io]: https://crates.io/
[radamsa]: https://gitlab.com/akihe/radamsa
[releases]: https://github.com/langston-barrett/tree-splicer/releases
[rustup]: https://rustup.rs/
1 change: 1 addition & 0 deletions crates/tree-splicer-typescript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
16 changes: 16 additions & 0 deletions crates/tree-splicer-typescript/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "tree-splicer-typescript"
description = "Simple grammar-based TypeScript program generator"
version = "0.1.0"
keywords = ["black-box", "fuzzer", "grammar-based", "typescript"]
edition = "2021"
authors = ["Langston Barrett <langston.barrett@gmail.com>"]
license = "MIT"
readme = "../../README.md"
homepage = "https://github.com/langston-barrett/tree-splicer"
repository = "https://github.com/langston-barrett/tree-splicer"

[dependencies]
anyhow = "1"
tree-splicer = { version = "0.1.0", path = "../tree-splicer", features = ["cli"] }
tree-sitter-typescript = "0.20"
5 changes: 5 additions & 0 deletions crates/tree-splicer-typescript/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use anyhow::Result;

fn main() -> Result<()> {
tree_splicer::cli::main(tree_sitter_typescript::language_typescript())
}

0 comments on commit ccd9d10

Please sign in to comment.