CI / changes (push) Successful in 8s
CI / commitlint (push) Has been skipped
CI / openapi (push) Has been cancelled
CI / web (push) Has been cancelled
CI / go (push) Has been cancelled
CI / bird2 (push) Has been cancelled
CI / release (push) Has been cancelled
- Enhanced documentation in AGENTS.md and web/README.md to clarify the mandatory steps for running `npm run check` and `npm run lint` before finalizing changes in the `web/**` directory. - Updated engineering rules in .cursor/rules/engineering.mdc to specify the necessity of both commands and the use of Prettier for formatting issues. - Added detailed instructions for handling linting failures and emphasized the importance of these checks in CI workflows.
44 lines
1.9 KiB
Markdown
44 lines
1.9 KiB
Markdown
# EvoBGP WebUI
|
|
|
|
SvelteKit-приложение панели управления EvoBGP. Запуск — [docs/quickstart.md](../docs/quickstart.md).
|
|
|
|
Разработка UI **обязательно** следует официальной документации [shadcn-svelte](https://shadcn-svelte.com/docs) и правилам репозитория [.cursor/rules/web-shadcn.mdc](../.cursor/rules/web-shadcn.mdc): максимум нативных компонентов из registry, установка только через CLI в `src/lib/ui/core/`.
|
|
|
|
## UI-архитектура
|
|
|
|
| Путь | Назначение |
|
|
| ------------------------ | ------------------------------------------------------------------- |
|
|
| `src/lib/ui/core/` | shadcn-svelte (только через `npx shadcn-svelte@latest add … -y -o`) |
|
|
| `src/lib/ui/app/` | Layout, PageHeader, toast (`notify`) |
|
|
| `src/lib/ui/patterns/` | FormField, AppDataTable, ConfirmDialog, EmptyState |
|
|
| `src/lib/components/ui/` | Re-export на `ui/core` (совместимость) |
|
|
|
|
Токены темы: `src/routes/layout.css`. Справочник: `src/lib/ui/app/tokens.md`.
|
|
|
|
## Разработка
|
|
|
|
```sh
|
|
npm install
|
|
npm run dev
|
|
npm run check
|
|
npm run lint # prettier --check; обязательно перед PR (CI job web)
|
|
```
|
|
|
|
Из корня репозитория (обе проверки как в CI):
|
|
|
|
```powershell
|
|
powershell -NoProfile -File scripts/lint-web.ps1
|
|
```
|
|
|
|
```sh
|
|
sh scripts/lint-web.sh
|
|
```
|
|
|
|
При падении `lint`: `npx prettier --write .` в каталоге `web/`, затем снова `check` + `lint`.
|
|
|
|
Добавление компонентов shadcn (из каталога `web/`):
|
|
|
|
```sh
|
|
npx shadcn-svelte@latest add <component> -y -o
|
|
```
|