diff --git a/.claude/skills/meta-compile/scripts/meta-compile.ps1 b/.claude/skills/meta-compile/scripts/meta-compile.ps1 index 96c1881b..4f3a6ed4 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.ps1 +++ b/.claude/skills/meta-compile/scripts/meta-compile.ps1 @@ -1,4 +1,4 @@ -# meta-compile v1.4 — Compile 1C metadata object from JSON +# meta-compile v1.5 — Compile 1C metadata object from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)] @@ -2827,8 +2827,8 @@ if (-not (Test-Path $typeDir)) { New-Item -ItemType Directory -Path $typeDir -Force | Out-Null } if ($objType -notin $typesNoSubDir) { - if (-not (Test-Path $extDir)) { - New-Item -ItemType Directory -Path $extDir -Force | Out-Null + if (-not (Test-Path $objSubDir)) { + New-Item -ItemType Directory -Path $objSubDir -Force | Out-Null } } @@ -2838,6 +2838,13 @@ $enc = New-Object System.Text.UTF8Encoding($true) # Module files $modulesCreated = @() +# Helper: create Ext/ only when needed (avoids empty Ext/ for Constant, Enum, etc.) +function Ensure-ExtDir { + if (-not (Test-Path $extDir)) { + New-Item -ItemType Directory -Path $extDir -Force | Out-Null + } +} + # Types with ObjectModule.bsl $typesWithObjectModule = @("Catalog","Document","Report","DataProcessor","ExchangePlan", "ChartOfAccounts","ChartOfCharacteristicTypes","ChartOfCalculationTypes", @@ -2845,13 +2852,16 @@ $typesWithObjectModule = @("Catalog","Document","Report","DataProcessor","Exchan # Types with RecordSetModule.bsl $typesWithRecordSetModule = @("InformationRegister","AccumulationRegister","AccountingRegister","CalculationRegister") # Types with ManagerModule.bsl -$typesWithManagerModule = @("Report","DataProcessor") +$typesWithManagerModule = @("Report","DataProcessor","Constant","Enum") +# Types with ValueManagerModule.bsl +$typesWithValueManagerModule = @("Constant") # Types with Module.bsl (general) $typesWithModule = @("CommonModule","HTTPService","WebService") if ($objType -in $typesWithObjectModule) { $modulePath = Join-Path $extDir "ObjectModule.bsl" if (-not (Test-Path $modulePath)) { + Ensure-ExtDir [System.IO.File]::WriteAllText($modulePath, "", $enc) $modulesCreated += $modulePath } @@ -2859,6 +2869,15 @@ if ($objType -in $typesWithObjectModule) { if ($objType -in $typesWithManagerModule) { $modulePath = Join-Path $extDir "ManagerModule.bsl" if (-not (Test-Path $modulePath)) { + Ensure-ExtDir + [System.IO.File]::WriteAllText($modulePath, "", $enc) + $modulesCreated += $modulePath + } +} +if ($objType -in $typesWithValueManagerModule) { + $modulePath = Join-Path $extDir "ValueManagerModule.bsl" + if (-not (Test-Path $modulePath)) { + Ensure-ExtDir [System.IO.File]::WriteAllText($modulePath, "", $enc) $modulesCreated += $modulePath } @@ -2866,6 +2885,7 @@ if ($objType -in $typesWithManagerModule) { if ($objType -in $typesWithRecordSetModule) { $modulePath = Join-Path $extDir "RecordSetModule.bsl" if (-not (Test-Path $modulePath)) { + Ensure-ExtDir [System.IO.File]::WriteAllText($modulePath, "", $enc) $modulesCreated += $modulePath } @@ -2873,6 +2893,7 @@ if ($objType -in $typesWithRecordSetModule) { if ($objType -in $typesWithModule) { $modulePath = Join-Path $extDir "Module.bsl" if (-not (Test-Path $modulePath)) { + Ensure-ExtDir [System.IO.File]::WriteAllText($modulePath, "", $enc) $modulesCreated += $modulePath } @@ -2882,6 +2903,7 @@ if ($objType -in $typesWithModule) { if ($objType -eq "ExchangePlan") { $contentPath = Join-Path $extDir "Content.xml" if (-not (Test-Path $contentPath)) { + Ensure-ExtDir $contentXml = "`r`n`r`n" [System.IO.File]::WriteAllText($contentPath, $contentXml, $enc) $modulesCreated += $contentPath @@ -2890,6 +2912,7 @@ if ($objType -eq "ExchangePlan") { if ($objType -eq "BusinessProcess") { $flowchartPath = Join-Path $extDir "Flowchart.xml" if (-not (Test-Path $flowchartPath)) { + Ensure-ExtDir $flowchartXml = "`r`n`r`n" [System.IO.File]::WriteAllText($flowchartPath, $flowchartXml, $enc) $modulesCreated += $flowchartPath diff --git a/.claude/skills/meta-compile/scripts/meta-compile.py b/.claude/skills/meta-compile/scripts/meta-compile.py index bfb79135..3adbb1b9 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.py +++ b/.claude/skills/meta-compile/scripts/meta-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# meta-compile v1.4 — Compile 1C metadata object from JSON +# meta-compile v1.5 — Compile 1C metadata object from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -2463,7 +2463,7 @@ ext_dir = os.path.join(obj_sub_dir, 'Ext') os.makedirs(type_dir, exist_ok=True) if obj_type not in types_no_sub_dir: - os.makedirs(ext_dir, exist_ok=True) + os.makedirs(obj_sub_dir, exist_ok=True) write_utf8_bom(main_xml_path, metadata_xml) @@ -2478,30 +2478,45 @@ types_with_object_module = [ types_with_record_set_module = [ 'InformationRegister', 'AccumulationRegister', 'AccountingRegister', 'CalculationRegister', ] -types_with_manager_module = ['Report', 'DataProcessor'] +types_with_manager_module = ['Report', 'DataProcessor', 'Constant', 'Enum'] +types_with_value_manager_module = ['Constant'] types_with_module = ['CommonModule', 'HTTPService', 'WebService'] +def ensure_ext_dir(): + os.makedirs(ext_dir, exist_ok=True) + if obj_type in types_with_object_module: module_path = os.path.join(ext_dir, 'ObjectModule.bsl') if not os.path.isfile(module_path): + ensure_ext_dir() write_utf8_bom(module_path, '') modules_created.append(module_path) if obj_type in types_with_manager_module: module_path = os.path.join(ext_dir, 'ManagerModule.bsl') if not os.path.isfile(module_path): + ensure_ext_dir() + write_utf8_bom(module_path, '') + modules_created.append(module_path) + +if obj_type in types_with_value_manager_module: + module_path = os.path.join(ext_dir, 'ValueManagerModule.bsl') + if not os.path.isfile(module_path): + ensure_ext_dir() write_utf8_bom(module_path, '') modules_created.append(module_path) if obj_type in types_with_record_set_module: module_path = os.path.join(ext_dir, 'RecordSetModule.bsl') if not os.path.isfile(module_path): + ensure_ext_dir() write_utf8_bom(module_path, '') modules_created.append(module_path) if obj_type in types_with_module: module_path = os.path.join(ext_dir, 'Module.bsl') if not os.path.isfile(module_path): + ensure_ext_dir() write_utf8_bom(module_path, '') modules_created.append(module_path) @@ -2509,6 +2524,7 @@ if obj_type in types_with_module: if obj_type == 'ExchangePlan': content_path = os.path.join(ext_dir, 'Content.xml') if not os.path.isfile(content_path): + ensure_ext_dir() content_xml = '\r\n\r\n' write_utf8_bom(content_path, content_xml) modules_created.append(content_path) @@ -2516,6 +2532,7 @@ if obj_type == 'ExchangePlan': if obj_type == 'BusinessProcess': flowchart_path = os.path.join(ext_dir, 'Flowchart.xml') if not os.path.isfile(flowchart_path): + ensure_ext_dir() flowchart_xml = '\r\n\r\n' write_utf8_bom(flowchart_path, flowchart_xml) modules_created.append(flowchart_path)