@@ -15,18 +15,24 @@ flowchart TD
15
15
subgraph BUILTIN_CMDS ["Built-in commands"]
16
16
direction LR
17
17
BLD[scarb build]
18
- CLN[scarb clean]
18
+ CHK[scarb check]
19
+ UPD[scarb update]
20
+ FTH[scarb fetch]
19
21
FMT[scarb fmt]
20
- RUN[scarb run]
22
+ CLN[scarb clean]
23
+ CAC[scarb cache]
21
24
NEW[scarb init/new]
22
25
UPD[scarb add/rm/update]
26
+ PUB[scarb package/publish]
23
27
MET[scarb metadata]
24
28
CMD[scarb commands]
25
29
MAN[scarb manifest-path]
26
30
end
27
31
subgraph EXT_CMDS ["External subcommands system"]
28
32
direction LR
29
33
CAIRO_LS["Cairo Language Server"]
34
+ CAIRO_RUN["scarb run"]
35
+ SCARB_DOC["scarb doc"]
30
36
SNFORGE["scarb test\n(can redirect to either snforge,\ncairo-test or other runner)"]
31
37
end
32
38
```
@@ -74,12 +80,14 @@ classDiagram
74
80
- compilers
75
81
}
76
82
class CairoPluginRepository {
77
- - compiler macro plugins
83
+ - built-in compiler macro plugins
78
84
}
79
85
class StarknetContractCompiler {
80
86
}
81
87
class LibCompiler {
82
88
}
89
+ class TestCompiler {
90
+ }
83
91
class Workspace~'c~ {
84
92
+ members() Iter~Package~
85
93
}
@@ -107,10 +115,12 @@ classDiagram
107
115
+ String name
108
116
+ VersionReq
109
117
+ SourceId
118
+ + DepKind
110
119
}
111
120
class Target {
112
121
+ TargetKind
113
122
+ String name
123
+ + Optional group_id
114
124
+ BTreeMap<String, *> params
115
125
}
116
126
class CompilationUnit {
@@ -144,6 +154,7 @@ classDiagram
144
154
CompilationUnit ..> Target : is created from
145
155
CodegenRepository *-- StarknetContractCompiler
146
156
CodegenRepository *-- LibCompiler
157
+ CodegenRepository *-- TestCompiler
147
158
```
148
159
149
160
### Sources and the internal registry
@@ -158,15 +169,15 @@ classDiagram
158
169
}
159
170
class PathSource
160
171
class GitSource
161
- class StandardLibSource
162
- class RegistrySource {
163
- <<Future>>
172
+ class RegistrySource
173
+ class StandardLibSource {
174
+ /embedded/
164
175
}
165
176
166
177
PathSource ..|> Source
167
178
GitSource ..|> Source
168
- StandardLibSource ..|> Source
169
179
RegistrySource ..|> Source
180
+ StandardLibSource ..|> Source
170
181
```
171
182
172
183
A _ source_ is an object that finds and downloads remote packages based on names and versions.
@@ -176,10 +187,9 @@ There are various `Source` implementation for different methods of downloading p
176
187
1 . ` PathSource ` simply provides an ability to operate on packages from local file system.
177
188
2 . ` GitSource ` downloads packages from Git repositories.
178
189
3 . ` RegistrySource ` downloads packages from package registries.
190
+ 4 . ` StandardLibSource ` unpacks packages embedded into the Scarb binary itself.
179
191
4 . And more...
180
192
181
- ** CURRENTLY ONLY PATH AND GIT SOURCES ARE IMPLEMENTED.**
182
-
183
193
The ` Registry ` object gathers all ` Source ` objects in a single mapping, and provides a unified interface for querying
184
194
_ any_ package, no matter of its source.
185
195
@@ -202,9 +212,7 @@ internally.
202
212
203
213
### Lockfile
204
214
205
- ** THIS IS NOT IMPLEMENTED YET.**
206
-
207
- TODO(mkaput): Write this section.
215
+ See Scarb documentation.
208
216
209
217
## Scarb Compiler
210
218
@@ -274,10 +282,11 @@ Plugins appropriate to be used for building a specific package are applied to th
274
282
When using Scarb as a library, Cairo plugins can be defined with configuration builder.
275
283
If not specified otherwise, Scarb comes with predefined StarkNet Cairo plugin, that can be used for StarkNet contracts
276
284
compilation.
277
- In the future, Scarb will also provide a way to define Cairo plugins as package dependencies.
278
285
279
- ** The mechanism for requiring Cairo plugins as package dependencies or compiling them in Scarb runtime is not implemented yet. **
286
+ ### Procedural Macros
280
287
288
+ Procedural macros provide a mechanism for defining custom macros as package dependencies.
289
+ The package with macro source code definition will be pulled and compiled by Scarb.
281
290
Please see [ the design document] ( design/01-proc-macro.md ) for more information.
282
291
283
292
### RootDatabase management within the compiler
0 commit comments