|
4 | 4 |
|
5 | 5 | ## Getting Started |
6 | 6 |
|
7 | | -- **Contribute**: [Tutorial](https://specs.anoma.net/latest/tutorial/index.html) |
8 | | -- **Markdown**: Uses [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/reference/) |
| 7 | +Welcome to the Anoma Specs repository! This project uses [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/reference/) for documentation and is designed for easy contribution and local development. |
9 | 8 |
|
10 | | -### Setup |
| 9 | +- **Latest Specs**: [https://specs.anoma.net/latest/](https://specs.anoma.net/latest/) |
11 | 10 |
|
12 | | -1. **Prerequisites**: |
| 11 | +--- |
13 | 12 |
|
14 | | - - `uv`: Install via: |
| 13 | +## Quick Start |
15 | 14 |
|
16 | | - ```bash |
17 | | - # macOS/Linux |
18 | | - curl -LsSf https://astral.sh/uv/install.sh | sh |
19 | | - # Windows |
20 | | - powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" |
21 | | - ``` |
22 | | - - `graphviz` for local deployment, |
| 15 | +### 1. Prerequisites |
23 | 16 |
|
24 | | - - `juvix` for local deployment, |
25 | | - |
26 | | - ```bash |
27 | | - curl --proto '=https' --tlsv1.2 -sSfL https://get.juvix.org | sh |
28 | | - ``` |
29 | | - - `just` for local development (although you can use `uv run` for most commands) |
30 | | - |
31 | | -2. **Setup Commands**: |
| 17 | +Make sure you have the following tools installed: |
32 | 18 |
|
| 19 | +- **uv** (Python package/dependency manager) |
| 20 | + - macOS/Linux: |
33 | 21 | ```bash |
34 | | - just setup-repo |
| 22 | + curl -LsSf https://astral.sh/uv/install.sh | sh |
35 | 23 | ``` |
| 24 | + - Windows: |
| 25 | + ```powershell |
| 26 | + powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" |
| 27 | + ``` |
| 28 | + - Or via Homebrew: |
| 29 | + ```bash |
| 30 | + brew install uv |
| 31 | + ``` |
| 32 | + |
| 33 | +- **graphviz** (for local documentation deployment) |
| 34 | + |
| 35 | +- **juvix** (for typechecking and specs development) |
| 36 | + ```bash |
| 37 | + curl --proto '=https' --tlsv1.2 -sSfL https://get.juvix.org | sh |
| 38 | + ``` |
| 39 | + |
| 40 | +- **just** (a simple command runner, replacement for Make) |
| 41 | + - Install via your [package manager](https://github.com/casey/just?tab=readme-ov-file#cross-platform). |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +### 2. Installation |
| 46 | + |
| 47 | +Choose one of the following: |
| 48 | + |
| 49 | +- With **uv**: |
| 50 | + ```bash |
| 51 | + uv sync |
| 52 | + ``` |
| 53 | +- With **just**: |
| 54 | + ```bash |
| 55 | + just sync |
| 56 | + ``` |
| 57 | +- With **pip**: |
| 58 | + ```bash |
| 59 | + pip install -r requirements.txt |
| 60 | + ``` |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +### 3. Common Commands |
| 65 | + |
| 66 | +You can use either `just` or `uv run` for most tasks. Below are the most common commands: |
| 67 | + |
| 68 | +#### Dependency Management |
| 69 | + |
| 70 | +| Task | Command | Command (just) | |
| 71 | +|-----------------------------|------------------------------------------------|---------------------| |
| 72 | +| Synchronize dependencies | `uv sync` | `just sync` | |
| 73 | +| Run all pre-commit checks | `uv run pre-commit -- run --all-files` | `just check` | |
| 74 | +| Typecheck the code | `juvix typecheck docs/everything.juvix.md` | `just juvix-check` | |
| 75 | + |
| 76 | +#### Development Tools |
| 77 | + |
| 78 | +- **Install pre-commit hooks** (for specs writers only): |
| 79 | + ```bash |
| 80 | + uv run pre-commit -- install --install-hooks |
| 81 | + ``` |
| 82 | + or |
| 83 | + ```bash |
| 84 | + just install-hooks |
| 85 | + ``` |
| 86 | + |
| 87 | +- **Install development tools**: |
| 88 | + ```bash |
| 89 | + uv tool install pre-commit |
| 90 | + uv tool install commitizen |
| 91 | + ``` |
| 92 | + or |
| 93 | + ```bash |
| 94 | + just install-tools |
| 95 | + ``` |
| 96 | + |
| 97 | +#### Documentation |
| 98 | + |
| 99 | +| Task | Command | Command (just) | |
| 100 | +|-----------------------------|------------------------------------------------|---------------------| |
| 101 | +| Build documentation | `uv run mkdocs build --config-file mkdocs.yml` | `just build` | |
| 102 | +| Serve documentation locally | `uv run mkdocs serve --config-file mkdocs.yml` | `just serve` | |
| 103 | + |
| 104 | +#### Git Operations |
| 105 | + |
| 106 | +| Task | Command | Command (just) | |
| 107 | +|-----------------------------|------------------------------------------------|---------------------| |
| 108 | +| Commit using commitizen | `uv run cz commit` | `just commit` | |
| 109 | +| Commit skipping hooks | `git commit --no-verify -m "<msg>"` | `just commit-skip` | |
| 110 | +| Amend commit (skip hooks) | `git commit --amend --no-verify` | `just commit-amend` | |
| 111 | +| Amend using commitizen | `uv run cz commit --amend` | `just cz-amend` | |
| 112 | + |
| 113 | +If you have installed the pre-commit hooks (which is recommended), but need to |
| 114 | +make a commit or push changes without running the hooks (for example, when |
| 115 | +working on a branch or PR), you can use the `--no-verify` flag as shown in the |
| 116 | +table above. The Commitizen is a tool to help you write better commit messages. |
| 117 | + |
| 118 | +--- |
| 119 | + |
| 120 | +### 4. Short Reference |
| 121 | + |
| 122 | +- **Install**: `uv sync` or `pip install -r requirements.txt` |
| 123 | +- **Build**: `just build` or `uv run mkdocs build` |
| 124 | +- **Serve Locally**: `just serve` or `uv run mkdocs serve` |
36 | 125 |
|
37 | | -### Documentation |
| 126 | +--- |
38 | 127 |
|
39 | | -- **Build**: `just build` |
40 | | -- **Serve Locally**: `just serve` |
| 128 | +## Development with Nix |
41 | 129 |
|
42 | | -### Development with Nix |
| 130 | +If you use [Nix](https://nixos.org/download/): |
43 | 131 |
|
44 | 132 | 1. **Install Nix**: [Download](https://nixos.org/download/) |
45 | 133 | 2. **Enable Flakes**: [Guide](https://nixos.wiki/wiki/flakes) |
46 | | -3. **Enter Shell**: `nix develop` |
| 134 | +3. **Enter Development Shell**: |
| 135 | + ```bash |
| 136 | + nix develop |
| 137 | + ``` |
47 | 138 |
|
48 | 139 | <!-- --8<-- [end:all]-- --> |
0 commit comments