Project Structure
When you run glistix new
, the compiler will generate a project which should conform to the following structure (largely based on Gleam's structure, which by itself is based on Erlang's project structure):
gleam.toml
contains all essential information regarding your project that the compiler should be aware of, including metadata (such as package name), your preferred target (defaults tonix
, can also bejavascript
orerlang
for compatibility with other Gleam projects), and also specifying your dependencies.src/
contains the source code of your package. This can contain both.gleam
files and also FFI files (.nix
for the Nix target). Apackagename.gleam
file with amain
public function with zero arguments is expected if your package is not a Gleam library (but rather made to be used within Nix). If present, you can check its output withgleam run
.test/
optionally contains apackagename_test.gleam
file containing a singlemain
function with zero arguments which is called when runninggleam test
. Use this withglistix_gleeunit
or some other test runner.priv/
is an optional folder for assets and other general files needed by your project and is not present by default. It is, however, symlinked tobuild/dev/<target>/<package>
upon build.external/
is an optional folder for external dependencies cloned locally as Git submodules (see "Overriding incompatible packages").
Additionally, some projects may opt into creating an output/
folder to cache build output for ease of use from Nix (see "Import a Gleam package in Nix").