Skip to content

Commit be96e71

Browse files
authored
Strip down xtask to what we actually use (#360)
I think this makes it much easier for us to understand, and lets us drop some heavy workspace dependencies (ureq, ring, rustls)
1 parent dd38833 commit be96e71

38 files changed

+273
-8967
lines changed

Cargo.lock

Lines changed: 0 additions & 123 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ memchr = "2.7.4"
6767
path-absolutize = "3.1.1"
6868
proc-macro2 = "1.0.86"
6969
proc-macro-error = "1.0.4"
70-
quote = "1.0.14"
70+
quote = "1.0.37"
7171
rustc-hash = "2.1.0"
7272
schemars = "0.8.21"
7373
serde = "1.0.215"

justfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ test-insta:
2828
test-quick:
2929
cargo test --package air_r_formatter --test quick_test -- quick_test --exact --show-output --ignored
3030

31-
# Creates a new crate
32-
new-crate name:
33-
cargo new --lib crates/{{snakecase(name)}}
34-
cargo run -p xtask_codegen -- new-crate --name={{snakecase(name)}}
35-
3631
install-vscode:
3732
cd editors/code && rm -rf *.vsix && vsce package && code --install-extension *.vsix
3833

xtask/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# xtask
22

3-
This directory contains Rust scripts for code generation, running coverage tests and benchmark etc.
3+
This directory contains Rust scripts for code generation.
44

5-
Please checkout their respective READMEs for usage instructions.
6-
7-
This `xtask` crate contains common utilities for working with these scripts.
8-
For example, running `rustfmt` and getting the project root.
5+
Check the `justfile` for usage.

xtask/codegen/Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ anyhow = { workspace = true }
99
bpaf = { version = "0.9.15", features = ["derive"] }
1010
git2 = { version = "0.19.0", default-features = false }
1111
proc-macro2 = { workspace = true, features = ["span-locations"] }
12-
quote = "1.0.37"
13-
serde_json = "1.0.113"
14-
ureq = "2.10.1"
15-
walkdir = "2.5.0"
12+
quote = { workspace = true }
13+
serde_json = { workspace = true }
1614
xtask = { path = '../', version = "0.0" }
17-
1815
biome_string_case = { workspace = true }
1916
biome_ungrammar = { workspace = true }
2017
schemars = { workspace = true }

xtask/codegen/README.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,11 @@
33
This crate contains local commands used to auto-generate source code.
44

55
## `cargo codegen grammar`
6-
This command transforms the `*.ungram` files into the `biome_*_syntax` and `biome_*_factory` crates.
6+
7+
This command transforms the `*.ungram` files into the `air_*_syntax` and `air_*_factory` crates.
78

89
The project uses a fork of [`ungrammar`](https://github.com/rust-analyzer/ungrammar) to define the syntax of the language.
910

1011
`ungrammar` uses a DSL to define and parse the grammar of a language.
1112

1213
Once the library parses the DSL files, some custom logic generates the AST APIs.
13-
14-
## Create a new language
15-
16-
17-
## `cargo codegen test`
18-
This command extracts inline comment tests inside `biome_js_parser` into the directory `biome_js_parser/test_data/`.
19-
20-
A usual workflow would be:
21-
```bash
22-
# (modify inline comment tests inside the parser)
23-
cargo codegen test
24-
cargo test parser # for checking failed tests
25-
UPDATE_EXPECT=1 cargo test parser # for committing the changes
26-
```
27-
28-
## `cargo codegen unicode`
29-
This command downloads unicode data from unicode.org and writes it `crates/biome_js_lexer/src/tables.rs`.
30-
Use this command when unicode support has changed.

0 commit comments

Comments
 (0)