Skip to content

vanya build

Usage

Terminal window
vanya build [OPTIONS] <FILES>... -o <OUTPUT_DIR>

Description

Transpiles vanya files to the target language specified by the plugin. Generates:

  • Test files in the target language
  • Source maps (.vanyamap) for debugging

Arguments

ArgumentDescription
<FILES>One or more .vanya files to build

Options

OptionDescription
-o, --output <DIR>Output directory (required)
--config <PATH>Path to config file

Exit codes

CodeMeaning
0Build successful
1Build failed (validation or generation error)

Output structure

out/
├── test_login.py # Generated test
├── test_login.py.vanyamap # Source map
├── test_checkout.py
└── test_checkout.py.vanyamap

Examples

Terminal window
# Build to out/ directory
vanya build tests/*.vanya -o out/
# Build with custom config
vanya build --config ./prod.toml tests/*.vanya -o out/

Source maps

Source maps allow tools to map generated code back to the original vanya source. The format is JSON:

{
"source": "login.vanya",
"lines": [
null,
null,
{ "start": 100, "end": 150 },
{ "start": 100, "end": 150 }
]
}

Each index in the lines array corresponds to a generated line number (0-indexed). The value is either null (for generated preamble code with no source) or a span object with start and end byte offsets into the original .vanya file.