Skip to content

Commit fbf5345

Browse files
authored
docs: improve dev docs for extension (#4217)
1 parent f3715be commit fbf5345

1 file changed

Lines changed: 63 additions & 7 deletions

File tree

docs/development.md

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,103 @@
11
# Contribute to development
2-
SQLMesh is licensed under [Apache 2.0](https://github.com/TobikoData/sqlmesh/blob/main/LICENSE). We encourage community contribution and would love for you to get involved.
2+
3+
SQLMesh is licensed under [Apache 2.0](https://github.com/TobikoData/sqlmesh/blob/main/LICENSE). We encourage community contribution and would love for you to get involved. The following document outlines the process to contribute to SQLMesh.
34

45
## Prerequisites
6+
7+
Before you begin, ensure you have the following installed on your machine. Exactly how to install these is dependent on your operating system.
8+
59
* Docker
610
* Docker Compose V2
711
* OpenJDK >= 11
812
* Python >= 3.9 < 3.13
913

10-
## Commands reference
14+
## Virtual environment setup
15+
16+
We do recommend using a virtual environment to develop SQLMesh.
17+
18+
```bash
19+
python -m venv .venv
20+
source .venv/bin/activate
21+
```
22+
23+
Once you have activated your virtual environment, you can install the dependencies by running the following command.
1124

12-
Install dev dependencies:
1325
```bash
1426
make install-dev
1527
```
28+
29+
Optionally, you can use pre-commit to automatically run linters/formatters:
30+
31+
```bash
32+
make install-pre-commit
33+
```
34+
35+
## Python development
36+
1637
Run linters and formatters:
38+
1739
```bash
1840
make style
1941
```
42+
2043
Run faster tests for quicker local feedback:
44+
2145
```bash
2246
make fast-test
2347
```
48+
2449
Run more comprehensive tests that run on each commit:
50+
2551
```bash
2652
make slow-test
2753
```
28-
Install docs dependencies:
54+
55+
## Documentation
56+
57+
In order to run the documentation server, you will need to install the dependencies by running the following command.
58+
2959
```bash
3060
make install-doc
3161
```
32-
Run docs server:
62+
63+
Once you have installed the dependencies, you can run the documentation server by running the following command.
64+
3365
```bash
3466
make docs-serve
3567
```
68+
3669
Run docs tests:
70+
3771
```bash
3872
make doc-test
3973
```
74+
75+
## UI development
76+
77+
In addition to the Python development, you can also develop the UI.
78+
79+
The UI is built using React and Typescript. To run the UI, you will need to install the dependencies by running the following command.
80+
81+
```bash
82+
npm install
83+
```
84+
4085
Run ide:
86+
4187
```bash
4288
make ui-up
4389
```
44-
(Optional) Use pre-commit to automatically run linters/formatters:
90+
91+
## Developing the VSCode extension
92+
93+
Similar to UI development, you can also develop the VSCode extension. To do so, make sure you have the dependencies installed by running the following command inside the `vscode/extension` directory.
94+
4595
```bash
46-
make install-pre-commit
96+
npm install
97+
```
98+
99+
Once that is done, developing the VSCode extension is most easily done by launching the `Run Extensions` debug task from a Visual Studio Code workspace opened at the root of the SQLMesh repository. By default, the VSCode extension will run the SQLMesh server locally and open a new Visual Studio Code window that allows you to try out the SQLMesh IDE. It opens the `examples/sushi` project by default. To set up Visual Studio Code to run the `Run Extensions` debug task, you can run the following command which will copy the `launch.json` and `tasks.json` files to the `.vscode` directory.
100+
101+
```bash
102+
make vscode_settings
47103
```

0 commit comments

Comments
 (0)