Generate VDL Intermediate Representation (IR) as JSON.
vdl-plugin-meta exports your VDL schema IR into a JSON file so your apps can inspect schema structure at runtime.
Use it when you want reflection-like capabilities such as:
- build dynamic forms from schema fields
- inspect RPCs, inputs, and outputs
- power schema explorers and internal tooling
- validate or transform data using schema metadata
In your vdl.config.vdl:
const config = {
version 1
plugins [
{
src "varavelio/vdl-plugin-meta@v1.0.1"
schema "./schema.vdl"
outDir "./gen"
options {
outFile "vdl-meta.json"
includePositions "false"
}
}
]
}
Then run:
vdl generateThe plugin writes one JSON file inside your outDir.
The plugin writes one JSON file containing the VDL IR. The output structure strictly follows the VDL Intermediate Representation (IR) schema.
-
outFile- Output JSON filename.
- Default:
vdl-meta.json.
-
includePositions- Include source code position metadata (
position) from parsed schema nodes. - Default:
false. - Set to
"true"only if your tooling needs file/line/column information.
- Include source code position metadata (
Example with custom file name and positions enabled:
const config = {
version 1
plugins [
{
src "varavelio/vdl-plugin-meta@v1.0.1"
schema "./schema.vdl"
outDir "./gen"
options {
outFile "schema.json"
includePositions "true"
}
}
]
}
includePositions can significantly increase output size. Keep it disabled unless you need source-level diagnostics. The generated JSON may include schema file paths when positions are enabled.
This plugin is released under the MIT License. See LICENSE.
