diff --git a/.gitignore b/.gitignore index 2a71a95..ef88c8c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ venv/ # Локальные dev-артефакты *.log + +# Сгенерированные каркасы плагинов (just new-plugin) +/plugins/ diff --git a/justfile b/justfile index ce4ee69..64b632e 100644 --- a/justfile +++ b/justfile @@ -28,3 +28,32 @@ test-integration: # полный локальный гейт ci: lint test deny + +# --- плагины (F02/F03) --- + +# валидировать манифест плагина +validate-manifest path: + cargo run -q -p shturman-manifest-validator -- {{path}} + +# сгенерировать каркас плагина в plugins/ и проверить валидатором +new-plugin name: + #!/usr/bin/env bash + set -euo pipefail + dest="plugins/{{name}}" + [ -e "$dest" ] && { echo "уже существует: $dest"; exit 1; } + mkdir -p "$dest" + cp -R templates/plugin/. "$dest/" + for f in $(find "$dest" -type f); do + tmp=$(mktemp); sed "s/__NAME__/{{name}}/g" "$f" > "$tmp" && mv "$tmp" "$f" + done + echo "создан плагин: $dest" + cargo run -q -p shturman-manifest-validator -- "$dest/manifest.yaml" + +# dev-запуск плагина (каркас; полноценно — с App-Host, v3) +plugin-dev-run path: + @echo "plugin-dev-run {{path}}: нужен App-Host (приходит в v3). Пока — валидация манифеста:" + cargo run -q -p shturman-manifest-validator -- {{path}}/manifest.yaml + +# Vehicle Simulator (плейсхолдер; домен E, v2) +sim: + @echo "Vehicle Simulator — v2 (домен E): vcan + ELM327-emu; каркас в sim/." diff --git a/templates/plugin/README.md b/templates/plugin/README.md new file mode 100644 index 0000000..ef9a314 --- /dev/null +++ b/templates/plugin/README.md @@ -0,0 +1,6 @@ +# Плагин __NAME__ + +Сгенерирован `just new-plugin __NAME__`. Манифест — `manifest.yaml`. + +Проверка: `just validate-manifest plugins/__NAME__/manifest.yaml`. +Запуск в dev (появится с App-Host, v3): `just plugin-dev-run plugins/__NAME__`. diff --git a/templates/plugin/locales/ru.yaml b/templates/plugin/locales/ru.yaml new file mode 100644 index 0000000..23cb172 --- /dev/null +++ b/templates/plugin/locales/ru.yaml @@ -0,0 +1,4 @@ +# Русские строки плагина (ru обязателен; i18n-ready — другие локали добавляются рядом). +name: "__NAME__" +tiles: + main: "__NAME__" diff --git a/templates/plugin/manifest.yaml b/templates/plugin/manifest.yaml new file mode 100644 index 0000000..4f26be9 --- /dev/null +++ b/templates/plugin/manifest.yaml @@ -0,0 +1,11 @@ +plugin: + id: dev.example.__NAME__ + name: "__NAME__" + version: 0.1.0 + shturman_api: "1" +capabilities: + ui_tiles: 1 +extension_points: + tiles: + - id: main + title: "__NAME__"