Audience: Contributor
Load path, warn-only AJV, DbInit catalog sync, codegen scripts, and the extend-element checklist.
See also: Overview · Schema and editors · Troubleshooting
Training metadata on &def / props is consumed by AI tooling; it is not required to author page JSON.
File: server/main/src/service/schema.service.ts
$id URLs → files under server/main/src/schema/$RefParser; registers every element URL from element-schema-index.tsvalidateChildren(children) wraps { type: "page", children } against page.schema.jsonversion stamps before validateWarning: Write valid trees. Warn-only is not a license to invent types or keys (
additionalProperties: falseon most element schemas).
File: server/main/src/service/db-init.service.ts
On startup, upserts element rows for schemas whose URL contains /schema/html|ionic|lokakrt/ — not builder/.
Writes: category, sub_category, type, hint_field, definition JSON (name, props with editor options, default children, palette: false when set).
Does not sync allowed_child_elements from schema anyOf (column stays ["*"]).
After editing schemas, restart the API process so the catalog refreshes.
| Concern | Command / location |
|---|---|
| Angular element templates | Repo root: npm run generate:templates |
| Render metadata | &def.render → SchemaRenderDef (common/script/element-template/types.ts) — layoutWrapper, overlayChildren, chromeClassTokens, attr aliases, … |
| HTML import allow-list | Built from known schema types + attr-alias reverse map |
| AI training | Prop/element training metadata → schema catalog / variant services under server/main and mirrored in server/ai |
From repo-root CONTRIBUTING.md and this wiki:
server/main/src/schema/lokakrt.com/schema/{html\|ionic\|lokakrt\|builder}/<name>/schema.json with unique properties.type.constchildren.json + &def.children$refs; set &def editor metadatacd server/main && npm run schemas:page (or schemas:sync)npm run generate:templates when render / host mapping changesnpm run schemas:wiki-catalog to refresh CatalogAbstractEditorComponent + EDITOR_COMPONENT_LOADERS + EditorType in @lokakrt/dynamicserver/main)| Script | Purpose |
|---|---|
schemas:page |
Regenerate page.schema.json |
schemas:page:check |
CI drift check for page schema |
schemas:sync |
charts + standardize + fix children def + page schema |
schemas:wiki-catalog |
Regenerate wiki catalog.md |
schemas:wiki-catalog:check |
CI drift check for wiki catalog |
schemas:wiki-docs:check |
Frontmatter + internal link check for this section |
Root: generate:templates for canvas templates.
| Area | Path |
|---|---|
| Element schemas | server/main/src/schema/lokakrt.com/schema/ |
| Schema index | server/main/src/util/element-schema-index.ts |
| AJV service | server/main/src/service/schema.service.ts |
| DbInit | server/main/src/service/db-init.service.ts |
| Models | common/model/src/model/element-definition.model.ts, prop-definition.model.ts, value.model.ts, action.model.ts, block-definition.model.ts |
| Runtime element | common/projects/lokakrt/dynamic/src/lib/model/element.model.ts |
| Editor inference | common/projects/lokakrt/dynamic/src/lib/model/editor.model.ts |
| Editor registry | ui/main/src/app/dynamic/element-editors/editor/editor-registry.ts |
| Insert helper | ui/main/src/app/service/page-builder-insert.util.ts |
| Template codegen | common/script/element-template/ |