diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index dbb4c6a1..149ed46f 100644 --- a/.claude/skills/form-compile/scripts/form-compile.ps1 +++ b/.claude/skills/form-compile/scripts/form-compile.ps1 @@ -1,4 +1,4 @@ -# form-compile v1.3 — Compile 1C managed form from JSON +# form-compile v1.4 — Compile 1C managed form from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)] @@ -260,14 +260,12 @@ function Emit-SingleType { # Fallback with validation if ($script:knownInvalidTypes.ContainsKey($typeStr)) { - Write-Warning "Type '$typeStr': $($script:knownInvalidTypes[$typeStr])" + throw "Invalid form attribute type '$typeStr': $($script:knownInvalidTypes[$typeStr])" } if ($typeStr.Contains('.')) { X "$indentcfg:$typeStr" } else { - if (-not $script:knownInvalidTypes.ContainsKey($typeStr)) { - Write-Warning "Unrecognized bare type '$typeStr' — will be emitted without namespace prefix" - } + Write-Warning "Unrecognized bare type '$typeStr' — will be emitted without namespace prefix" X "$indent$typeStr" } } diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index d5050bc0..16352658 100644 --- a/.claude/skills/form-compile/scripts/form-compile.py +++ b/.claude/skills/form-compile/scripts/form-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# form-compile v1.2 — Compile 1C managed form from JSON +# form-compile v1.4 — Compile 1C managed form from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import json @@ -330,12 +330,11 @@ def emit_single_type(lines, type_str, indent): # Fallback with validation if type_str in KNOWN_INVALID_TYPES: - print(f"WARNING: Type '{type_str}': {KNOWN_INVALID_TYPES[type_str]}", file=sys.stderr) + raise ValueError(f"Invalid form attribute type '{type_str}': {KNOWN_INVALID_TYPES[type_str]}") if '.' in type_str: lines.append(f'{indent}cfg:{type_str}') else: - if type_str not in KNOWN_INVALID_TYPES: - print(f"WARNING: Unrecognized bare type '{type_str}' — will be emitted without namespace prefix", file=sys.stderr) + print(f"WARNING: Unrecognized bare type '{type_str}' — will be emitted without namespace prefix", file=sys.stderr) lines.append(f'{indent}{type_str}') diff --git a/tests/skills/cases/form-compile/catalog-form.json b/tests/skills/cases/form-compile/catalog-form.json index 4fb48196..00531c04 100644 --- a/tests/skills/cases/form-compile/catalog-form.json +++ b/tests/skills/cases/form-compile/catalog-form.json @@ -16,7 +16,7 @@ "input": { "title": "Товар", "attributes": [ - { "name": "Объект", "type": "FormDataStructure", "main": true } + { "name": "Объект", "type": "CatalogObject.Товары", "main": true } ], "elements": [ { "input": "Наименование", "path": "Объект.Наименование", "title": "Наименование" }, diff --git a/tests/skills/cases/form-compile/snapshots/catalog-form/Catalogs/Товары/Forms/ФормаЭлемента/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/catalog-form/Catalogs/Товары/Forms/ФормаЭлемента/Ext/Form.xml index 2b323b2c..c170746a 100644 --- a/tests/skills/cases/form-compile/snapshots/catalog-form/Catalogs/Товары/Forms/ФормаЭлемента/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/catalog-form/Catalogs/Товары/Forms/ФормаЭлемента/Ext/Form.xml @@ -37,7 +37,7 @@ - FormDataStructure + cfg:CatalogObject.Товары true diff --git a/tests/skills/cases/form-info/overview.json b/tests/skills/cases/form-info/overview.json index 533a777e..98f4b92f 100644 --- a/tests/skills/cases/form-info/overview.json +++ b/tests/skills/cases/form-info/overview.json @@ -12,7 +12,7 @@ }, { "script": "form-compile/scripts/form-compile", - "input": { "title": "Тест", "attributes": [{ "name": "Объект", "type": "FormDataStructure", "main": true }], "elements": [{ "type": "InputField", "dataPath": "Объект.Наименование" }] }, + "input": { "title": "Тест", "attributes": [{ "name": "Объект", "type": "CatalogObject.Товары", "main": true }], "elements": [{ "type": "InputField", "dataPath": "Объект.Наименование" }] }, "args": { "-JsonPath": "{inputFile}", "-OutputPath": "{workDir}/Catalogs/Товары/Forms/Форма/Ext/Form.xml" } } ], diff --git a/tests/skills/cases/form-info/snapshots/overview/Catalogs/Товары/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-info/snapshots/overview/Catalogs/Товары/Forms/Форма/Ext/Form.xml index 57d6247e..2472f091 100644 --- a/tests/skills/cases/form-info/snapshots/overview/Catalogs/Товары/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-info/snapshots/overview/Catalogs/Товары/Forms/Форма/Ext/Form.xml @@ -15,7 +15,7 @@ - FormDataStructure + cfg:CatalogObject.Товары true