feat(devtools): scaffolding (just new-plugin) + just-таргеты
templates/plugin (валидный манифест+locales+README); new-plugin генерит и валидирует; validate-manifest / plugin-dev-run (каркас, App-Host v3) / sim (плейсхолдер v2). plugins/ — в .gitignore. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Alexander <akotenev2003@gmail.com>
This commit is contained in:
@@ -18,3 +18,6 @@ venv/
|
||||
|
||||
# Локальные dev-артефакты
|
||||
*.log
|
||||
|
||||
# Сгенерированные каркасы плагинов (just new-plugin)
|
||||
/plugins/
|
||||
|
||||
@@ -28,3 +28,32 @@ test-integration:
|
||||
|
||||
# полный локальный гейт
|
||||
ci: lint test deny
|
||||
|
||||
# --- плагины (F02/F03) ---
|
||||
|
||||
# валидировать манифест плагина
|
||||
validate-manifest path:
|
||||
cargo run -q -p shturman-manifest-validator -- {{path}}
|
||||
|
||||
# сгенерировать каркас плагина в plugins/<name> и проверить валидатором
|
||||
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/."
|
||||
|
||||
@@ -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__`.
|
||||
@@ -0,0 +1,4 @@
|
||||
# Русские строки плагина (ru обязателен; i18n-ready — другие локали добавляются рядом).
|
||||
name: "__NAME__"
|
||||
tiles:
|
||||
main: "__NAME__"
|
||||
@@ -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__"
|
||||
Reference in New Issue
Block a user