Juvix project¶
A juvix project is a collection of juvix modules plus some extra metadata
gathered in a juvix.yaml
file. The most convenient way to create a juvix
project is to run the command juvix init
.
A project is rooted in a directory. The root is set by creating a juvix.yaml
,
which contains the following fields:
- name: The name of the project. The name must not be empty and cannot
exceed 100 characters. Lower case letters, digits and hyphen
-
are acceptable characters. The first letter must not be a hyphen. Summarizing, it must match the following regexp:[a-z0-9][a-z0-9-]{0,99}
. - version (optional): The version of the project. It must follow the SemVer specification. If ommited the version will be assumed to be 0.0.0.
- dependencies (optional): The dependencies of the project given as a list. Each dependency is given as relative (or absolute) path to the root of another juvix project. If the field is ommited, it will be assumed to contain the Juvix standard library as a dependency.
The example juvix.yaml
for the project may look like this:
name: my-project
version: 0.0.0
dependencies:
- deps/stdlib/
- deps/containers
- deps/test
As intuition would tell, a juvix module belongs to a juvix project if it is placed in the subtree hanging from the root directory. This rule has two exceptions:
- Modules in a hidden (or hanging from a hidden) directory are not part of the
project. E.g., if the root of a project is
dir
, then the moduledir/.d/Lib.juvix
does not belong to the project rooted indir
. - A
juvix.yaml
file shadows otherjuvix.yaml
files in parent directories. E.g. if the root of a project isdir
and the filesdir/juvix.yaml
anddir/nested/juvix.yaml
exist, then the moduledir/nested/Lib.juvix
would belong to the project indir/nested
.
Module naming convention¶
Modules that belong to a project must follow a naming convention. See the documentation for modules.