@y4wee/nupo 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +147 -0
- package/dist/screens/InitScreen.js +4 -1
- package/dist/services/checks.js +21 -6
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# nupo
|
|
2
|
+
|
|
3
|
+
**nupo** est un gestionnaire d'environnements de développement Odoo en ligne de commande. Il simplifie l'installation, la configuration et le lancement de plusieurs versions d'Odoo en parallèle, directement depuis le terminal.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Fonctionnalités
|
|
8
|
+
|
|
9
|
+
- **Installation de versions Odoo** — clone community + enterprise, création du virtualenv Python, installation des dépendances
|
|
10
|
+
- **Mise à jour des versions** — vérification et mise à jour vers le dernier commit distant
|
|
11
|
+
- **Gestion de services** — créer, modifier, supprimer des configurations de service Odoo (port HTTP, modules custom, conf Odoo)
|
|
12
|
+
- **Lancement de services** — démarrage avec options (-d, -u, -i, --shell, --stop-after-init) et visualiseur de logs en temps réel avec filtrage
|
|
13
|
+
- **Configuration VS Code** — génération automatique de `settings.json` / `launch.json` pour le debug Odoo
|
|
14
|
+
- **Interface themeable** — couleurs entièrement personnalisables (primary, secondary, text, cursor)
|
|
15
|
+
- **Reprise d'installation** — une installation interrompue peut être reprise à l'étape où elle s'est arrêtée
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Prérequis
|
|
20
|
+
|
|
21
|
+
- **Node.js** ≥ 18
|
|
22
|
+
- **Python** ≥ 3.8 avec `pip` et `venv`
|
|
23
|
+
- **Git**
|
|
24
|
+
- Un dépôt **Odoo Community** accessible en local ou clonable
|
|
25
|
+
|
|
26
|
+
> Pour Odoo Enterprise : une clé SSH avec accès au dépôt `git@github.com:odoo/enterprise.git` est requise.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
### Via le script d'installation (Linux & macOS)
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
curl -fsSL https://y4wee.github.io/nupo/install.sh | bash
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Le script vérifie automatiquement la présence de Node.js ≥ 18 et l'installe via `nvm` si nécessaire.
|
|
39
|
+
|
|
40
|
+
### Via npm
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install -g @y4wee/nupo
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Utilisation
|
|
49
|
+
|
|
50
|
+
### Interface interactive
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
nupo
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Lance le menu principal avec navigation au clavier (↑↓ pour naviguer, ↵ pour sélectionner, Échap pour revenir).
|
|
57
|
+
|
|
58
|
+
### Commandes CLI
|
|
59
|
+
|
|
60
|
+
#### Démarrer un service directement
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
nupo start <nom_du_service> [options]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
| Option | Description |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `-d <base>` | Nom de la base de données |
|
|
69
|
+
| `-u <module>` | Module à mettre à jour |
|
|
70
|
+
| `-i <module>` | Module à installer |
|
|
71
|
+
| `--stop-after-init` | Arrêter après l'initialisation |
|
|
72
|
+
| `--shell` | Lancer en mode shell interactif |
|
|
73
|
+
|
|
74
|
+
**Exemples :**
|
|
75
|
+
```bash
|
|
76
|
+
nupo start mon_service
|
|
77
|
+
nupo start mon_service -d ma_base -u mon_module
|
|
78
|
+
nupo start mon_service --shell
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### Configurer VS Code pour une version
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
nupo code <branche>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Exemples :**
|
|
88
|
+
```bash
|
|
89
|
+
nupo code 17.0
|
|
90
|
+
nupo code 18.0
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Configure automatiquement `.vscode/settings.json` et `launch.json` pour le debug Odoo, puis ouvre VS Code.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Première utilisation
|
|
98
|
+
|
|
99
|
+
Au premier lancement, nupo guide à travers une étape d'initialisation :
|
|
100
|
+
|
|
101
|
+
1. Vérification de Python, pip et venv
|
|
102
|
+
2. Saisie du chemin vers le dépôt Odoo (source des clones)
|
|
103
|
+
|
|
104
|
+
Une fois initialisé, le menu principal donne accès à toutes les fonctionnalités.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Configuration
|
|
109
|
+
|
|
110
|
+
La configuration est stockée dans `~/.nupo/config.json`.
|
|
111
|
+
|
|
112
|
+
Elle est modifiable directement via **nupo → Paramètres** :
|
|
113
|
+
|
|
114
|
+
| Paramètre | Description | Défaut |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| `odoo_path_repo` | Chemin du dépôt Odoo source | — |
|
|
117
|
+
| `log_buffer_size` | Nombre de lignes de logs conservées | `500` |
|
|
118
|
+
| `primary_color` | Couleur principale de l'interface | `#9F0C58` |
|
|
119
|
+
| `secondary_color` | Couleur des titres d'écran | `#E79439` |
|
|
120
|
+
| `text_color` | Couleur des textes secondaires | `#848484` |
|
|
121
|
+
| `cursor_color` | Couleur de surlignage des sélections | `cyan` |
|
|
122
|
+
|
|
123
|
+
La variable d'environnement `NUPO_CONFIG_DIR` permet de surcharger le répertoire de configuration.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Mise à jour
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npm update -g @y4wee/nupo
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Publier une nouvelle version (développeurs)
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npm version patch # ou minor / major
|
|
139
|
+
git push origin master --tags
|
|
140
|
+
npm publish --access=public
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Licence
|
|
146
|
+
|
|
147
|
+
MIT
|
|
@@ -174,7 +174,10 @@ export function InitScreen({ config, leftWidth, onComplete }) {
|
|
|
174
174
|
React.createElement(Text, { color: "red" },
|
|
175
175
|
"\u00C9tape \u00E9chou\u00E9e : ",
|
|
176
176
|
errorStep.label),
|
|
177
|
-
React.createElement(
|
|
177
|
+
errorStep.errorMessage && (React.createElement(Box, { flexDirection: "column", gap: 0 },
|
|
178
|
+
React.createElement(Text, { color: textColor }, "Pour installer :"),
|
|
179
|
+
errorStep.errorMessage.split('\n').map((line, i) => (React.createElement(Text, { key: i, color: "cyan" }, ` ${line}`))))),
|
|
180
|
+
React.createElement(Text, { color: textColor, dimColor: true }, "Relancez nupo une fois corrig\u00E9."))),
|
|
178
181
|
!waitingInput && !errorStep && !done && (React.createElement(Box, { marginTop: 1 },
|
|
179
182
|
React.createElement(Text, { color: textColor, dimColor: true }, "\u27F3 V\u00E9rification en cours\u2026"))))),
|
|
180
183
|
React.createElement(StepsPanel, { steps: steps, textColor: textColor }),
|
package/dist/services/checks.js
CHANGED
|
@@ -22,17 +22,35 @@ async function tryCommand(cmd, args) {
|
|
|
22
22
|
return { ok: false, error: error.message ?? String(err) };
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
const isMac = process.platform === 'darwin';
|
|
26
|
+
const HINTS = {
|
|
27
|
+
python: isMac
|
|
28
|
+
? 'brew install python3 (ou téléchargez depuis https://python.org)'
|
|
29
|
+
: 'sudo apt install python3 # Debian/Ubuntu\nsudo dnf install python3 # Fedora/RHEL',
|
|
30
|
+
pip: isMac
|
|
31
|
+
? 'brew install python3 (pip3 inclus)\nou : python3 -m ensurepip --upgrade'
|
|
32
|
+
: 'sudo apt install python3-pip # Debian/Ubuntu\nsudo dnf install python3-pip # Fedora/RHEL',
|
|
33
|
+
venv: isMac
|
|
34
|
+
? 'brew install python3 (venv inclus)'
|
|
35
|
+
: 'sudo apt install python3-venv # Debian/Ubuntu\nsudo dnf install python3-venv # Fedora/RHEL',
|
|
36
|
+
};
|
|
25
37
|
export async function checkPython() {
|
|
26
38
|
const result = await tryCommand('python3', ['--version']);
|
|
27
39
|
if (result.ok)
|
|
28
40
|
return result;
|
|
29
|
-
|
|
41
|
+
const result2 = await tryCommand('python', ['--version']);
|
|
42
|
+
if (result2.ok)
|
|
43
|
+
return result2;
|
|
44
|
+
return { ok: false, error: HINTS.python };
|
|
30
45
|
}
|
|
31
46
|
export async function checkPip() {
|
|
32
47
|
const result = await tryCommand('pip3', ['--version']);
|
|
33
48
|
if (result.ok)
|
|
34
49
|
return result;
|
|
35
|
-
|
|
50
|
+
const result2 = await tryCommand('pip', ['--version']);
|
|
51
|
+
if (result2.ok)
|
|
52
|
+
return result2;
|
|
53
|
+
return { ok: false, error: HINTS.pip };
|
|
36
54
|
}
|
|
37
55
|
export async function checkVenv() {
|
|
38
56
|
const result = await tryCommand('python3', ['-m', 'venv', '--help']);
|
|
@@ -41,8 +59,5 @@ export async function checkVenv() {
|
|
|
41
59
|
const result2 = await tryCommand('python', ['-m', 'venv', '--help']);
|
|
42
60
|
if (result2.ok)
|
|
43
61
|
return { ok: true };
|
|
44
|
-
|
|
45
|
-
? 'réinstallez Python via python.org ou brew install python3'
|
|
46
|
-
: 'sudo apt install python3-venv';
|
|
47
|
-
return { ok: false, error: `python venv non disponible (${hint})` };
|
|
62
|
+
return { ok: false, error: HINTS.venv };
|
|
48
63
|
}
|