mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-20 09:30:59 +03:00
meta-edit v1.3: positional TS-attr insert, modify-ts, JSON combo example
- add-ts-attribute now respects >> after / << before positioning - Add modify-ts inline operation for TS properties (synonym, fillChecking, etc.) - Add JSON combo example (create + edit TS in one definition) to SKILL.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
484ee44387
commit
fff77d97ca
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: meta-edit
|
name: meta-edit
|
||||||
description: Точечное редактирование объекта метаданных 1С (добавление/удаление/модификация реквизитов, реквизитов внутри ТЧ, ТЧ, измерений, ресурсов, значений перечислений, свойств объекта, владельцев, движений, ввода по строке)
|
description: Точечное редактирование объекта метаданных 1С (добавление/удаление/модификация реквизитов, реквизитов внутри ТЧ, свойств ТЧ, ТЧ, измерений, ресурсов, значений перечислений, свойств объекта, владельцев, движений, ввода по строке)
|
||||||
argument-hint: <ObjectPath> -Operation <op> -Value "<val>" | -DefinitionFile <json> [-NoValidate]
|
argument-hint: <ObjectPath> -Operation <op> -Value "<val>" | -DefinitionFile <json> [-NoValidate]
|
||||||
allowed-tools:
|
allowed-tools:
|
||||||
- Bash
|
- Bash
|
||||||
@@ -89,6 +89,22 @@ Shorthand-формат: `Имя: Тип | флаги`
|
|||||||
|
|
||||||
Batch через `;;` — можно указать разные ТЧ: `"Товары.А: Строка(50) ;; Услуги.Б: Число(10)"`.
|
Batch через `;;` — можно указать разные ТЧ: `"Товары.А: Строка(50) ;; Услуги.Б: Число(10)"`.
|
||||||
|
|
||||||
|
Позиционная вставка в ТЧ: `>> after` / `<< before` работает так же, как и для обычных реквизитов:
|
||||||
|
```powershell
|
||||||
|
-Operation add-ts-attribute -Value "Товары.Скидка: Число(15,2) >> after Цена"
|
||||||
|
```
|
||||||
|
|
||||||
|
### modify-ts
|
||||||
|
|
||||||
|
Изменение свойств **самой табличной части** (Synonym, FillChecking, Use и др.):
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
-Operation modify-ts -Value "Товары: synonym=Товарный состав"
|
||||||
|
-Operation modify-ts -Value "Товары: fillChecking=ShowError"
|
||||||
|
```
|
||||||
|
|
||||||
|
Формат аналогичен `modify-attribute`: `ИмяТЧ: ключ=значение, ключ=значение`.
|
||||||
|
|
||||||
### add-enumValue / add-form / add-template / add-command
|
### add-enumValue / add-form / add-template / add-command
|
||||||
|
|
||||||
Просто имена (batch через `;;`):
|
Просто имена (batch через `;;`):
|
||||||
@@ -227,6 +243,21 @@ Batch через `;;` — можно указать разные ТЧ: `"Тов
|
|||||||
|
|
||||||
Все три операции можно указать в одном JSON-файле. Для сложных сценариев (ТЧ с реквизитами + удаление + модификация) используйте JSON DSL.
|
Все три операции можно указать в одном JSON-файле. Для сложных сценариев (ТЧ с реквизитами + удаление + модификация) используйте JSON DSL.
|
||||||
|
|
||||||
|
Пример: создать новую ТЧ и одновременно отредактировать реквизиты существующей ТЧ:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"add": { "tabularSections": [{ "name": "НоваяТЧ", "attrs": ["Имя: Строка(100)"] }] },
|
||||||
|
"modify": {
|
||||||
|
"tabularSections": {
|
||||||
|
"СуществующаяТЧ": {
|
||||||
|
"add": ["НовыйРекв: Число(15,2)"],
|
||||||
|
"remove": ["СтарыйРекв"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Синонимы ключей (case-insensitive)
|
### Синонимы ключей (case-insensitive)
|
||||||
|
|
||||||
**Операции:** `add`/`добавить`, `remove`/`удалить`, `modify`/`изменить`
|
**Операции:** `add`/`добавить`, `remove`/`удалить`, `modify`/`изменить`
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# meta-edit v1.2 — Edit existing 1C metadata object XML (inline mode + complex properties + TS attribute ops)
|
# meta-edit v1.3 — Edit existing 1C metadata object XML (inline mode + complex properties + TS attribute ops + modify-ts)
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
param(
|
param(
|
||||||
[string]$DefinitionFile,
|
[string]$DefinitionFile,
|
||||||
@@ -14,7 +14,7 @@ param(
|
|||||||
"remove-attribute", "remove-ts", "remove-dimension", "remove-resource",
|
"remove-attribute", "remove-ts", "remove-dimension", "remove-resource",
|
||||||
"remove-enumValue", "remove-column", "remove-form", "remove-template", "remove-command",
|
"remove-enumValue", "remove-column", "remove-form", "remove-template", "remove-command",
|
||||||
"remove-owner", "remove-registerRecord", "remove-basedOn", "remove-inputByString",
|
"remove-owner", "remove-registerRecord", "remove-basedOn", "remove-inputByString",
|
||||||
"add-ts-attribute", "remove-ts-attribute", "modify-ts-attribute",
|
"add-ts-attribute", "remove-ts-attribute", "modify-ts-attribute", "modify-ts",
|
||||||
"modify-attribute", "modify-dimension", "modify-resource",
|
"modify-attribute", "modify-dimension", "modify-resource",
|
||||||
"modify-enumValue", "modify-column",
|
"modify-enumValue", "modify-column",
|
||||||
"modify-property",
|
"modify-property",
|
||||||
@@ -1818,8 +1818,12 @@ function Modify-ChildElements($modifyDef, [string]$childType) {
|
|||||||
$tsAttrIndent = Get-ChildIndent $tsChildObjEl
|
$tsAttrIndent = Get-ChildIndent $tsChildObjEl
|
||||||
$fragmentXml = Build-AttributeFragment $parsed "tabular" $tsAttrIndent
|
$fragmentXml = Build-AttributeFragment $parsed "tabular" $tsAttrIndent
|
||||||
$nodes = Import-Fragment $fragmentXml
|
$nodes = Import-Fragment $fragmentXml
|
||||||
|
$savedCO = $script:childObjectsEl
|
||||||
|
$script:childObjectsEl = $tsChildObjEl
|
||||||
|
$refNode = Find-InsertionPoint "Attribute" $parsed
|
||||||
|
$script:childObjectsEl = $savedCO
|
||||||
foreach ($node in $nodes) {
|
foreach ($node in $nodes) {
|
||||||
Insert-BeforeElement $tsChildObjEl $node $null $tsAttrIndent
|
Insert-BeforeElement $tsChildObjEl $node $refNode $tsAttrIndent
|
||||||
}
|
}
|
||||||
Info "Added attribute to TS '$elemName': $($parsed.name)"
|
Info "Added attribute to TS '$elemName': $($parsed.name)"
|
||||||
$script:addCount++
|
$script:addCount++
|
||||||
|
|||||||
Reference in New Issue
Block a user