Project Structure
A standard Alia project consists of the following parts:
my-app/
├── config.json # project configuration
├── README.md # mod description (optional, shown on the Mods Space portal "Description" tab)
├── docs/ # documentation directory (optional, shown on the Mods Space portal "Docs" tab)
├── mods/ # installed modules (downloaded by alia add)
├── lib.alia # library API entry point (optional)
├── main.alia # run entry point
└── .gitignore # ignores build/ and mods/ (generated automatically by create/init)
You can generate this skeleton with a single command using alia create my-app or alia init.
config.json
config.json declares the project metadata and compilation configuration:
{
"name": "my-app",
"version": "1.0.0",
"author": "alice",
"description": "Sample application",
"tags": ["http", "tools"],
"homepage": "https://example.com",
"license": "MIT",
"dependencies": {
"demo-lib": "1.1.0"
},
"compiler": {
"outDir": "build"
}
}
| Field | Description |
|---|---|
name | Project name; used as the package name when publishing to Mods Space |
version | Semantic version number |
author | Author name (falls back to the logged-in username if omitted at publish time) |
description | Mod description, shown on the Mods Space portal |
tags | Array of tags (up to 20), used for portal search and filtering |
homepage | Project homepage link |
license | Open-source license |
dependencies | Project dependencies (maintained automatically by alia add) |
compiler.lang | Optional default target language; when not declared, every build falls back to js and prints a notice |
compiler.outDir | Build output root directory (default build); artifacts are written per language to <outDir>/<lang>/ |
The optional display fields (author/description/tags/homepage) are written to the Mods Space metadata registry at publish time for portal display.
Build and Run
alia build --lang:js # compile to build/js/
alia run --lang:rs # compile and run
alia clean # clean the entire build/
alia check # type check
alia start # run main.alia in interpreted mode
The build preserves existing artifacts and caches, overwriting only the compiled output; only alia clean cleans them up (--lang:<value> can clean a single language directory).
Target language resolution priority: CLI --lang:<value> > compiler.lang in config.json > default js (a notice is printed when not explicitly declared).
The output structure of alia build varies with the target language:
js: a single filebuild/js/main.jsnodejs:build/nodejs/containspackage.json,main.js,runtime.js, and dependency modulesrs:build/rs/containsCargo.tomlandsrc/(main.rs,runtime.rs)