Add build subcommand: DSL spec to v2-map JSON file

Reads the DSL file, parses to AST, loads all --atlas-dir paths into
a registry, runs the builder, and writes pretty-printed JSON. The
output filename's basename becomes the map id when the DSL has no
'id' directive. Parser and builder errors are surfaced as
'<file>:<line>: <message>'. Also reorders the duplicate-atlas warning
so the atlas_id appears before the word 'duplicate'.
This commit is contained in:
Axel Meyer
2026-05-23 16:50:42 +02:00
parent 7adcb407fa
commit f516e2acda
4 changed files with 195 additions and 2 deletions

View File

@@ -32,6 +32,7 @@ function run(argv, { out, err }) {
const handlers = {
encode: require('./commands/encode'),
decode: require('./commands/decode'),
build: require('./commands/build'),
};
const handler = handlers[head];
if (!handler) {