Skip to main content

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"
}
}
FieldDescription
nameProject name; used as the package name when publishing to Mods Space
versionSemantic version number
authorAuthor name (falls back to the logged-in username if omitted at publish time)
descriptionMod description, shown on the Mods Space portal
tagsArray of tags (up to 20), used for portal search and filtering
homepageProject homepage link
licenseOpen-source license
dependenciesProject dependencies (maintained automatically by alia add)
compiler.langOptional default target language; when not declared, every build falls back to js and prints a notice
compiler.outDirBuild 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 file build/js/main.js
  • nodejs: build/nodejs/ contains package.json, main.js, runtime.js, and dependency modules
  • rs: build/rs/ contains Cargo.toml and src/ (main.rs, runtime.rs)