|
| 1 | +# Workflow de Développement |
| 2 | + |
| 3 | +## Vue d'ensemble |
| 4 | + |
| 5 | +Ce projet utilise un workflow en couches pour garantir la qualité du code: |
| 6 | + |
| 7 | +- **Justfile** - Commandes de développement (`just <recipe>`) |
| 8 | +- **Lefthook** - Git hooks automatiques |
| 9 | +- **Conductor** - Scripts de workspace |
| 10 | + |
| 11 | +## Diagramme |
| 12 | + |
| 13 | +```mermaid |
| 14 | +flowchart TB |
| 15 | + subgraph SETUP["Setup"] |
| 16 | + A[just install] --> B[bun install] |
| 17 | + B --> C[lefthook install] |
| 18 | + end |
| 19 | +
|
| 20 | + subgraph DEV["Development"] |
| 21 | + D[just dev] --> E[lint] |
| 22 | + E --> F[format] |
| 23 | + F --> G[format-check] |
| 24 | + G --> H[dev server :4320] |
| 25 | + end |
| 26 | +
|
| 27 | + subgraph QA["QA / CI"] |
| 28 | + I[just qa] --> J[lint + format] |
| 29 | + J --> K[check-tags] |
| 30 | + K --> L[build] |
| 31 | +
|
| 32 | + M[just ci] --> N[lint] |
| 33 | + N --> O[format-check] |
| 34 | + O --> P[check-tags] |
| 35 | + P --> Q[build] |
| 36 | + end |
| 37 | +
|
| 38 | + subgraph HOOKS["Git Hooks"] |
| 39 | + R[git commit] --> S[pre-commit] |
| 40 | + S --> T[format + lint + check-tags] |
| 41 | +
|
| 42 | + U[git push] --> V[pre-push] |
| 43 | + V --> W[astro check + build] |
| 44 | + end |
| 45 | +
|
| 46 | + subgraph ARCHIVE["Archive"] |
| 47 | + X[just archive] --> Y[rm node_modules] |
| 48 | + end |
| 49 | +
|
| 50 | + SETUP --> DEV |
| 51 | + DEV --> QA |
| 52 | + QA --> HOOKS |
| 53 | + HOOKS --> ARCHIVE |
| 54 | +``` |
| 55 | + |
| 56 | +## Commandes |
| 57 | + |
| 58 | +| Commande | Usage | Description | |
| 59 | +|----------|-------|-------------| |
| 60 | +| `just i` | Setup | Installer dépendances | |
| 61 | +| `just dev` | Dev | Serveur sur port 4320 | |
| 62 | +| `just dev 4321` | Dev | Serveur sur port custom | |
| 63 | +| `just qa` | Agents | Validation avec autoformat | |
| 64 | +| `just ci` | CI | Validation sans autoformat | |
| 65 | +| `just build` | Build | Build production | |
| 66 | +| `just clean` | Cleanup | Cache seulement | |
| 67 | +| `just archive` | Archive | Supprime node_modules | |
| 68 | + |
| 69 | +## Git Hooks (Lefthook) |
| 70 | + |
| 71 | +### Pre-commit (parallèle) |
| 72 | + |
| 73 | +| Job | Commande | Description | |
| 74 | +|-----|----------|-------------| |
| 75 | +| format | `just format` | Formatte le code | |
| 76 | +| format-check | `just format-check` | Vérifie le format | |
| 77 | +| lint | `just lint` | ESLint | |
| 78 | +| check-tags | `just check-tags` | Valide les tags | |
| 79 | + |
| 80 | +### Pre-push (parallèle) |
| 81 | + |
| 82 | +| Job | Commande | Description | |
| 83 | +|-----|----------|-------------| |
| 84 | +| check | `just check` | TypeScript/Astro check | |
| 85 | +| build | `just build` | Build complet | |
| 86 | + |
| 87 | +## Conductor Scripts |
| 88 | + |
| 89 | +| Script | Commande | Quand | |
| 90 | +|--------|----------|-------| |
| 91 | +| Setup | `just install` | Création workspace | |
| 92 | +| Run | `just dev` | Bouton Run | |
| 93 | +| Archive | `just archive` | Archivage workspace | |
| 94 | + |
| 95 | +## Flux de travail typique |
| 96 | + |
| 97 | +```bash |
| 98 | +# 1. Setup initial |
| 99 | +just install |
| 100 | + |
| 101 | +# 2. Développement |
| 102 | +just dev # ou just dev 4321 pour un autre port |
| 103 | + |
| 104 | +# 3. Avant commit (automatique via lefthook) |
| 105 | +# format → format-check → lint → check-tags |
| 106 | + |
| 107 | +# 4. Avant push (automatique via lefthook) |
| 108 | +# check → build |
| 109 | + |
| 110 | +# 5. Archivage |
| 111 | +just archive |
| 112 | +``` |
0 commit comments