Clarigen relies on a Clarigen.toml
file at the root-level of your repository. That file determines which files to generate, where to put them, and more.
clarinet
The only mandatory configuration you need to set is clarinet
, which needs to point to your Clarinet.toml
file. For most projects, your Clarinet.toml
will also be at the root of your project. If you have a Clarinet project as a sub-directory, specify where the TOML file is.
types
The "types" output is for environments that utilize NPM (or yarn, pnpm, etc) packages. This mostly refers to Node.js or web projects.
types.output
Specify where you'd like the types file to be created.
To disable types generation, disable the output
field
types.outputs
If you want to export multiple generated types files (like for a monorepo), you can use the outputs
array. Note that if output
is present, then this is ignored.
types.after
The code generated for types is not formatted, so it'll fail any linting you have. Use this field to specify a script you want ran after code is generated.
docs
Clarigen can automatically generate contract documentation for you.
docs.output
Specify the folder where you'd like markdown files generated. A markdown file will be generated for each of your contracts, along with a README.md
file.
docs.exclude
By default, all contracts in Clarinet.toml
are included in your docs. If you want to exclude certain contracts (such as traits and test helpers), you can use the excludes
array.
Note that the values in excludes
should be your contract names - not files.
If you have a Clarinet.toml
like:
Then to exclude that contract, you'd do: