Framework
Features

JSON Schemas

The framework ships JSON Schema files for the JSON it reads — strings and icons — so your editor validates and autocompletes those files as you type them.

Not to be confused with the Schema JSON in Database — that one describes your tables. These validate the config files as you edit them.

The schemas

They live in the package's schemas/ directory, one per kind of file:

SchemaValidates
strings.schema.jsonThe translation files in nls.
icons.schema.jsonThe icon mapping read by ./framework icons.

Setting them up

Point your editor at them by file pattern. In VS Code that is the json.schemas setting — the paths resolve inside vendor, so they update with the package:

.vscode/settings.json
{
    "json.schemas": [
        {
            "fileMatch": [ "/nls/*.json" ],
            "url": "./vendor/frameworkdevar/framework/schemas/strings.schema.json"
        },
        {
            "fileMatch": [ "/icons/*.jsonc" ],
            "url": "./vendor/frameworkdevar/framework/schemas/icons.schema.json"
        }
    ]
}

Any editor with JSON Schema support works the same way — PhpStorm maps schemas to file patterns under its JSON Schema settings, and editors driven by a language server read the same mapping.

What they enforce

The schemas are strict: each sets additionalProperties: false, so a key that does not match the expected pattern is flagged rather than silently ignored at build time.

Strings

Keys are UPPER_SNAKE_CASE and hold a plain string, with two special prefixes: SELECT_… keys hold an object of options (this is what enum labels read through), and DATE_… keys may be a string, an array or an object of formats.

Icons

Icons are grouped in lowercase folders, and each icon's value says where it comes from — an icon set, a name in that set and any properties, checked against a pattern so a stray character is caught as you write it:

{
    "actions": {
        "add":    "google add_circle fill",
        "delete": "google delete w300 s24",
        "star":   "fontAwesome star",
        "logo":   "custom"
    }
}

The set is deliberately open — any name you use for a source is accepted, since the framework only counts them into the filters of the preview page. Hovering a value in the editor spells the three parts out, since that explanation is carried in the schema's description.

The file is the one place these schemas expect a .jsonc extension: the mapping is read with its // comments stripped, so it carries its own syntax at the top.