|
3 | 3 | Scarb is the project management tool for the [Cairo] language.
|
4 | 4 | Scarb manages your dependencies, compiles your projects and works as an extensible platform assisting in development.
|
5 | 5 |
|
6 |
| -## Getting started |
| 6 | +## Documentation |
7 | 7 |
|
8 |
| -### Installation |
| 8 | +All information about Scarb is available on project's [website](https://docs.swmansion.com/scarb/). |
9 | 9 |
|
10 |
| -Binary archives for all major platforms (Linux, macOS, Windows) are published on our [GitHub releases] page. |
11 |
| -Simply download suitable one, extract, and move the `scarb` executable to a directory reachable by your `PATH`. |
12 |
| -In the future, an automated installer is planned to be created. |
13 |
| - |
14 |
| -### Creating new project |
15 |
| - |
16 |
| -```shell |
17 |
| -$ scarb new project/directory |
18 |
| -``` |
19 |
| - |
20 |
| -_**Also:** There is `scarb init` which runs in current directory instead of creating new one._ |
21 |
| - |
22 |
| -### Compiling |
23 |
| - |
24 |
| -```shell |
25 |
| -$ scarb build |
26 |
| -``` |
27 |
| - |
28 |
| -Built artifacts will be written to `target/release` directory. |
29 |
| - |
30 |
| -_**Also:** `scarb clean` cleans `target` directory._ |
31 |
| - |
32 |
| -#### Building CASM |
33 |
| - |
34 |
| -Add following to `Scarb.toml`: |
35 |
| - |
36 |
| -```toml |
37 |
| -[lib] |
38 |
| -casm = true |
39 |
| -``` |
40 |
| - |
41 |
| -_**Also:** Adding `sierra = false` will stop building Sierra code._ |
42 |
| - |
43 |
| -#### Building StarkNet contracts |
44 |
| - |
45 |
| -Add following to `Scarb.toml`: |
46 |
| - |
47 |
| -```toml |
48 |
| -[[target.starknet-contract]] |
49 |
| -``` |
50 |
| - |
51 |
| -**Note:** Ensure there is no `[lib]` section, they are conflicting |
52 |
| -until https://github.com/software-mansion/scarb/issues/63 will be done. |
53 |
| - |
54 |
| -### Adding dependencies |
55 |
| - |
56 |
| -**Note:** This is identical to Cargo. |
57 |
| - |
58 |
| -#### In manifest |
59 |
| - |
60 |
| -```toml |
61 |
| -[dependencies] |
62 |
| -quaireaux = { path = "path/to/quaireaux" } |
63 |
| -quaireaux = { git = "https://github.com/keep-starknet-strange/quaireaux.git" } |
64 |
| -``` |
65 |
| - |
66 |
| -_**Also:** You can add `version` field to specify package version, but this will do more harm than good currently, Scarb |
67 |
| -lacks proper version solution algorithm yet._ |
68 |
| - |
69 |
| -_**Also:** You can add `branch`, `tag` and `rev` fields to Git dependencies._ |
70 |
| - |
71 |
| -_**Also:** You can use `ssh://` URLs, Scarb uses local `git` installation for all network operations._ |
72 |
| - |
73 |
| -#### Via `scarb add` |
74 |
| - |
75 |
| -```shell |
76 |
| -$ scarb add quaireaux --path path/to/quaireaux |
77 |
| -$ scarb add quaireaux --git https://github.com/keep-starknet-strange/quaireaux.git |
78 |
| -``` |
79 |
| - |
80 |
| -_**Also: ** You can specify package version like this: `[email protected]`, but see remarks in previous section. _ |
81 |
| - |
82 |
| -_**Also:** `--git` supports `--branch`, `--tag` and `--rev` arguments._ |
83 |
| - |
84 |
| -_**Also:** `scarb rm` removes a dependency._ |
85 |
| - |
86 |
| -### Formatting |
87 |
| - |
88 |
| -```shell |
89 |
| -# Format Cairo code: |
90 |
| -$ scarb fmt |
91 |
| - |
92 |
| -# Check formatting in CI: |
93 |
| -$ scarb fmt -c |
94 |
| -``` |
| 10 | +* [Installation](https://docs.swmansion.com/scarb/download) |
| 11 | +* [Cheat sheet](https://docs.swmansion.com/scarb/docs/cheatsheet) |
| 12 | +* [Documentation](https://docs.swmansion.com/scarb/docs) |
95 | 13 |
|
96 | 14 | ## Changelog and roadmap
|
97 | 15 |
|
|
0 commit comments