Usage
Project🔗
A project is a directory containing a .manala.yaml
manifest.
Manifest🔗
A project manifest file is made of two parts:
- a config block (recipe, repository) handled by a fixed
manala
map key - some custom variables values
1 2 3 4 5 6 7 |
|
Repository🔗
A repository is just a directory where all first level directories are recipes.
Recipe🔗
A recipe is a directory containing a .manala.yaml
manifest. Its name is, in fact, its directory name.
Manifest🔗
A recipe manifest file is made of two parts:
- a config block (description, project manifest template, files to sync,...) handled by a fixed
manala
map key - some variables serving two purposes:
- provide default values
- scaffold validation schema
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Validation🔗
As seen before, a validation schema is scaffolded from custom variables provided in recipe manifest file, using JSON Schema.
1 2 3 4 |
|
generate:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Note
additionalProperties
default value depends on the number of the relating object properties. An empty object
(zero properties) will lead to a default true
, meaning that all properties are left to the discretion of the end
user. Conversely, one or more properties will lead to a default false
.
Warning
Only objects and arrays are auto scaffolded
Custom validation schema could be provided using doc annotation
1 2 3 4 5 6 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Some custom formats are also provided for the win:
go-repo
file-path
domain
Options🔗
Recipe options could be provided using doc annotation. They will be prompted to user during a project initialization.
1 2 3 4 5 |
|
Option fields type are guessed by schema details. For instance, an enum
will generate a drop-down select, and a
string type
will generate a text input.
In case of an enum
, choices ares available from left to right, first one will be default.
Content🔗
Recipes support three kind of files:
Regular
Regular files or directories are synchronised as is, respecting their permissions.
Template
Template files must ends with .tmpl
extension.
Functions are supplied by the built-in Go text/template package and the Sprig template function library.
Additionally, following functions are provided:
* toYaml
: serialize variables as yaml
Dist
Dist files must ends with .dist
extension.
They are synchronized only ONCE, when the destination file does not exist in the project.