# 📦 Gestion des Versions RollerLogic

## Fichier Source Unique

**`version.json`** - Source de vérité unique pour la version de toute l'application

```json
{
  "version": "1.3.66"
}
```

## 🚀 Utilisation Rapide

### Incrémenter la version automatiquement

```bash
# Patch: 1.3.66 → 1.3.67
npm run version:bump:patch

# Minor: 1.3.66 → 1.4.0
npm run version:bump:minor

# Major: 1.3.66 → 2.0.0
npm run version:bump:major
```

Ces commandes vont automatiquement :

1. ✅ Mettre à jour `version.json`
2. ✅ Synchroniser `rollerlogic-api/package.json`
3. ✅ Synchroniser `rollerlogic-mobile/package.json`
4. ✅ Synchroniser `admin/js/config.production.js`

### Synchroniser manuellement après modification de version.json

Si vous modifiez `version.json` manuellement :

```bash
npm run version:sync
```

## 📝 Workflow Recommandé

### Option 1 : Automatique (Recommandé)

```bash
# 1. Incrémenter la version
npm run version:bump:patch

# 2. Vérifier les changements
git diff

# 3. Commit et push
git add .
git commit -m "chore: bump version to 1.3.67"
git push
```

### Option 2 : Manuel

```bash
# 1. Éditer version.json
# Changer "1.3.66" → "1.3.67"

# 2. Synchroniser tous les fichiers
npm run version:sync

# 3. Commit et push
git add .
git commit -m "chore: bump version to 1.3.67"
git push
```

## 🎯 Avantages

- **Un seul fichier à modifier** : `version.json`
- **Zéro risque d'oubli** : Tous les fichiers synchronisés automatiquement
- **Cohérence garantie** : Même version partout
- **Workflow simplifié** : Une seule commande pour tout mettre à jour

## 📂 Fichiers Synchronisés

| Fichier                           | Usage                       |
| --------------------------------- | --------------------------- |
| `version.json`                    | **Source de vérité** unique |
| `package.json`                    | Version du workspace        |
| `rollerlogic-api/package.json`    | Version de l'API            |
| `rollerlogic-mobile/package.json` | Version du client mobile    |
| `admin/js/config.production.js`   | Version du panel admin      |

## 🔧 Scripts Disponibles

- `npm run version:sync` - Synchronise tous les fichiers depuis version.json
- `npm run version:bump:patch` - Incrémente le patch (x.x.X)
- `npm run version:bump:minor` - Incrémente le minor (x.X.0)
- `npm run version:bump:major` - Incrémente le major (X.0.0)

## ⚠️ Important

**NE PLUS MODIFIER MANUELLEMENT** :

- ❌ `rollerlogic-api/package.json` (version)
- ❌ `rollerlogic-mobile/package.json` (version)
- ❌ `admin/js/config.production.js` (VERSION)

**TOUJOURS UTILISER** :

- ✅ `version.json` (manuel)
- ✅ `npm run version:bump:*` (automatique)
