Skip to content

Commit 6ddbbc6

Browse files
docs: adapt Cursor gitflow rules for Querya Desktop
1 parent 17a550b commit 6ddbbc6

2 files changed

Lines changed: 162 additions & 6 deletions

File tree

.cursor/rules/gitflow.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
description: Querya Desktop GitFlow, branching, commits, and PR workflow
3+
alwaysApply: true
4+
---
5+
6+
# Querya Desktop — agent workflow
7+
8+
Desktop SQL/NoSQL client (PostgreSQL, MySQL, Redis, MongoDB).
9+
Стек: **Flutter** (Dart 3.5+), **shadcn_flutter** (vendored в `third_party/`), локальный SQLite + OS secure storage для секретов.
10+
11+
Remote: `git@github.com:QueryaHub/Querya-Desktop.git`
12+
13+
## Sync with remote (always)
14+
15+
Before checkout, branch, push, or PR — and **after** merge to `dev`:
16+
17+
```bash
18+
git fetch --all --prune
19+
git checkout dev
20+
git pull --ff-only origin dev
21+
```
22+
23+
Before push on a feature branch: `git fetch origin`, then rebase or merge remote.
24+
25+
**Full checks** before PR (локально, как в CI):
26+
27+
```bash
28+
flutter pub get
29+
flutter analyze
30+
flutter test
31+
```
32+
33+
Опционально перед релизом / крупным UI-PR:
34+
35+
```bash
36+
flutter build linux --release # или windows / macos
37+
```
38+
39+
На Linux при `errno = 24` на analyze: `ulimit -n 8192` (см. [CONTRIBUTING.md](CONTRIBUTING.md)).
40+
41+
## Git branches
42+
43+
- **`main`**: production-ready; релизные теги (`X.Y.Z`) ставятся на коммиты, готовые к бинарникам.
44+
- **`dev`**: интеграция; **все feature PR → `dev`**.
45+
- **Feature**: `issue/<number>-<short-slug>` или `feat/<short-slug>` от актуального `dev`.
46+
47+
```bash
48+
git fetch --all --prune && git checkout dev && git pull --ff-only origin dev
49+
git checkout -b issue/38-querya-workbench-theme-models
50+
# или: git checkout -b feat/postgres-sql-workspace-toolbar
51+
```
52+
53+
Долгоживущие ветки по подсистемам (если согласовано с командой): `postgres-ench`, `mongo-ench`, `my_sql`, `design` — не создавать без необходимости; предпочитать короткие `issue/*` / `feat/*`.
54+
55+
**Hotfix** только по явному запросу: `hotfix/<short-slug>` от `main` → PR в `main`, затем back-merge в `dev`.
56+
57+
**Release**: версия в `pubspec.yaml`, тег на нужном коммите, workflow Release — см. [docs/tags-and-releases.md](docs/tags-and-releases.md), [docs/release-checklist.md](docs/release-checklist.md).
58+
59+
## Issue priority & roadmap
60+
61+
Живой roadmap: [docs/roadmap.md](docs/roadmap.md). Крупные темы (пример — epic **#37** theming): дочерние issues #38#60.
62+
63+
| Область | Фокус |
64+
|---------|--------|
65+
| Connections | Tree, new connection, drivers, secure storage |
66+
| PostgreSQL / MySQL | Browser, SQL workspace, grids, timeouts |
67+
| Redis / MongoDB | Explorer, keys/collections, document editor |
68+
| Theme / UI | `lib/core/theme/`, shadcn tokens, SQL editor (#37 epic) |
69+
| CI / release | `.github/workflows/`, Linux deps, signing (macOS) |
70+
71+
Один issue → одна ветка → один PR. Scope = issue only — без drive-by рефакторинга.
72+
73+
## GitHub labels & milestones
74+
75+
На **issues** и **PRs** через `gh`:
76+
77+
```bash
78+
gh issue edit 38 --add-label "theme,enhancement"
79+
gh pr create --base dev --label "theme,enhancement" \
80+
--body "Closes #38" --title "feat(theme): QueryaWorkbenchTheme models (#38)"
81+
```
82+
83+
Актуальные labels в репо: `bug`, `enhancement`, `documentation`, `theme`, `editor`, `epic`, …
84+
Для темизации: `theme`, `editor`, `epic` (см. epic [#37](https://github.com/QueryaHub/Querya-Desktop/issues/37)).
85+
86+
После merge: issue `CLOSED`; `git fetch` + `git pull --ff-only` на `dev`.
87+
88+
## Commits and PRs
89+
90+
- [Conventional Commits](https://www.conventionalcommits.org/): `feat`, `fix`, `perf`, `docs`, `test`, `ci`, `chore`, `refactor` + scope.
91+
- Scopes (примеры): `postgresql`, `mysql`, `mongodb`, `redis`, `connections`, `theme`, `editor`, `settings`, `ci`, `deps`, `ui`.
92+
- Атомарные коммиты; не коммитить без явной просьбы пользователя.
93+
- PR body: `Closes #N` когда применимо.
94+
- **Не коммитить:** `.env`, ключи, `credentials.json`, экспортированные connection secrets.
95+
96+
Примеры:
97+
98+
```
99+
feat(theme): add QueryaWorkbenchTheme and editor tokens
100+
fix(postgresql): pass right-clicked table into Open in SQL
101+
feat(mysql): SQL workspace statement timeout from settings
102+
test(connections): panel layout with in-memory secrets
103+
chore(release): bump version to 0.2.2+4
104+
```
105+
106+
## Layout & checks
107+
108+
| Area | Path |
109+
|------|------|
110+
| Entry | `lib/main.dart`, `lib/app/app.dart` |
111+
| Theme | `lib/core/theme/` |
112+
| DB / pools | `lib/core/database/` |
113+
| Storage / settings | `lib/core/storage/` |
114+
| Features | `lib/features/<db\|area>/` |
115+
| Shared UI | `lib/shared/widgets/` |
116+
| Vendored UI | `third_party/shadcn_flutter/` (override в `pubspec.yaml`) |
117+
| Tests | `test/` (mirror `lib/` where possible) |
118+
| Docs | `docs/` |
119+
| CI / release | `.github/workflows/` |
120+
121+
Зависимости: `pubspec.yaml`; lockfile **не** в git (см. `.gitignore`).
122+
123+
## Flutter conventions
124+
125+
- UI: **shadcn** `Theme.of(context).colorScheme`, не смешивать с Material без нужды (`material.` prefix где уже есть).
126+
- Патчи shadcn — только в `third_party/shadcn_flutter`, с комментарием в `pubspec.yaml` `dependency_overrides`.
127+
- Секреты: `flutter_secure_storage` / `connection_secrets_store` — без паролей в SQLite и логах ([docs/security.md](docs/security.md)).
128+
- SQL editor: пока `TextField` / `QueryEditorTab`; подсветка — по issues #47#50, не раздувать `TextField` ad hoc.
129+
- Новый код: `flutter analyze` clean, тесты для нетривиальной логики (парсеры, storage, SQL helpers).
130+
131+
## Out of scope (unless issue says otherwise)
132+
133+
- Backend-сервисы, облачный sync аккаунтов.
134+
- JDBC-драйверы (только встроенные Dart/native пути).
135+
- Полная VS Code theme compatibility в одном PR (см. epic #37, поэтапно).
136+
- Force-push на `main` / `dev` без явного запроса.

.gitignore

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,41 @@
44
build/
55
*.iml
66
pubspec.lock
7+
.flutter-plugins
8+
.flutter-plugins-dependencies
79

8-
# IDE
10+
# Generated (platform)
11+
**/flutter/ephemeral/
12+
**/Flutter/ephemeral/
13+
**/GeneratedPluginRegistrant.*
14+
linux/flutter/generated_*
15+
windows/flutter/generated_*
16+
macos/Flutter/ephemeral/
17+
18+
# IDE — track Cursor rules, ignore the rest
919
.idea/
10-
.cursor/
11-
*.iml
20+
.cursor/*
21+
!.cursor/rules/
22+
!.cursor/rules/**
1223

1324
# OS
1425
.DS_Store
1526
Thumbs.db
1627

17-
# Old C++/Qt (if still present)
28+
# Logs & coverage
29+
*.log
30+
flutter_*.log
31+
coverage/
32+
33+
# Secrets / local env (never commit)
34+
.env
35+
.env.*
36+
!.env.example
37+
38+
# Old C++/Qt / design mockups (local only)
1839
*.o
1940
*.a
2041
*.so
2142
*.dll
2243
*.exe
23-
flutter_*.log
24-
design-front
44+
design-front/

0 commit comments

Comments
 (0)