You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a rewrite of the core of the [Codegen SDK](https://github.com/codegen-sh/codegen) in Rust.
4
+
5
+
## Goals
6
+
7
+
- Support more languages
8
+
- Faster parse and execute time
9
+
- More memory efficient
10
+
- Incremental compilation
11
+
12
+
## Structure
13
+
14
+
-`codegen-sdk-common`: A crate that contains the common code for the SDK.
15
+
-`codegen-sdk-cst`: Definitions and utilities for the CST.
16
+
-`codegen-sdk-ast`: Definitions and utilities for the AST.
17
+
-`codegen-sdk-cst-generator`: A crate that generates the CST for the SDK.
18
+
-`codegen-sdk-ast-generator`: A crate that generates the AST and queries for the SDK. This requires the ts_query CST language to be generated first.
19
+
-`languages/*`: A crate for each language that contains the language-specific code for the SDK. It's largely boilerplate, most of the work is done by the `codegen-sdk-ast-generator` and `codegen-sdk-cst-generator` crates. These are split out to make compiling the SDK faster.
20
+
-`codegen-sdk-analyzer`: A crate that contains the core logic for the Incremenetal computation and state management of the SDK.
21
+
-`src`: A base program that uses the SDK.
22
+
23
+
## Development
24
+
25
+
### Installing Rust
26
+
27
+
```bash
28
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
29
+
rustup toolchain install nightly
30
+
```
31
+
32
+
### Installing tools
33
+
34
+
```bash
35
+
cargo install cargo-binstall -y
36
+
cargo binstall cargo-nextest -y
37
+
cargo binstall cargo-insta -y
38
+
```
39
+
40
+
### Building the project
41
+
42
+
```bash
43
+
cargo build
44
+
```
45
+
46
+
### Running tests
47
+
48
+
```bash
49
+
cargo insta run --workspace --review
50
+
```
51
+
52
+
Some of the tests use snapshots managed by [Insta](https://insta.rs/docs/cli/).
0 commit comments