docstodev 3.0.3 → 3.0.4
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 +59 -31
- package/package.json +2 -1
- package/src/commands/run.ts +0 -14
- package/src/exporters/html.ts +44 -9
package/README.md
CHANGED
|
@@ -1,60 +1,88 @@
|
|
|
1
|
+
# 🚀 DocsToDev
|
|
1
2
|
|
|
2
|
-
|
|
3
|
-
Solution d'automatisation de documentation technique intelligente
|
|
3
|
+
**L'intelligence artificielle au service de votre documentation technique.**
|
|
4
4
|
|
|
5
|
-
DocsToDev est une
|
|
5
|
+
DocsToDev est une solution d'automatisation avancée qui transforme des bases de code complexes en une documentation structurée, visuelle et compréhensible. Créé par **Chadrack Massamba (EsporDev)**, cet outil comble le fossé entre le code brut et la connaissance métier.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
---
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## ✨ Fonctionnalités Clés
|
|
10
10
|
|
|
11
|
+
* **🔍 Analyse Statique Hybride** : Combine l'analyse déterministe (AST) et l'IA (**MakazouIA**) pour interpréter le rôle métier de chaque fichier.
|
|
12
|
+
* **📂 Arborescence Dynamique** : Génère une vue explorateur fidèle à votre structure de dossiers.
|
|
13
|
+
* **📊 Graphes de Dépendances** : Visualisation automatique des flux et interactions via Mermaid.js.
|
|
14
|
+
* **⚡ Mode Incrémental** : Système de cache performant pour n'analyser que les fichiers modifiés.
|
|
15
|
+
* **🌍 Multi-format** : Export interactif en HTML, PDF, Markdown et TXT.
|
|
11
16
|
|
|
12
|
-
|
|
17
|
+
---
|
|
13
18
|
|
|
19
|
+
## 🛠️ Installation & Prérequis
|
|
14
20
|
|
|
15
|
-
|
|
21
|
+
### Installation globale
|
|
16
22
|
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g docstodev
|
|
17
25
|
|
|
18
|
-
|
|
26
|
+
```
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
### 💡 Note importante (Projets non-JS)
|
|
21
29
|
|
|
30
|
+
> [!IMPORTANT]
|
|
31
|
+
> **NB :** Si votre projet n'est pas un projet Node.js (ex: projet **HTML/CSS pur, PHP, Python, ou C#**), vous devez impérativement initialiser un environnement npm à la racine de votre dossier avant de lancer l'outil :
|
|
32
|
+
> ```bash
|
|
33
|
+
> npm init -y
|
|
34
|
+
>
|
|
35
|
+
> ```
|
|
36
|
+
>
|
|
37
|
+
>
|
|
38
|
+
> Cela permet à DocsToDev de gérer correctement le cache et les dépendances d'analyse.
|
|
22
39
|
|
|
23
|
-
|
|
40
|
+
---
|
|
24
41
|
|
|
25
|
-
|
|
26
|
-
Pour utiliser DocsToDev en ligne de commande, suivez ces étapes :
|
|
42
|
+
## 🚀 Utilisation (CLI)
|
|
27
43
|
|
|
28
|
-
|
|
44
|
+
Une fois installé, une seule commande suffit pour documenter tout votre projet :
|
|
29
45
|
|
|
30
|
-
|
|
46
|
+
```bash
|
|
47
|
+
npx docstodev run
|
|
31
48
|
|
|
32
|
-
|
|
33
|
-
Une fois le projet compilé, vous pouvez lancer l'analyse via npx :
|
|
49
|
+
```
|
|
34
50
|
|
|
35
|
-
Options disponibles :
|
|
51
|
+
### Options disponibles :
|
|
36
52
|
|
|
37
|
-
|
|
53
|
+
| Option | Description |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `--lang <fr | en>` |
|
|
56
|
+
| `-i, --incremental` | Analyse uniquement les fichiers modifiés (gain de temps). |
|
|
57
|
+
| `--clear-cache` | Vide le cache et force une analyse complète. |
|
|
58
|
+
| `--no-animation` | Désactive les animations dans le terminal (idéal pour CI/CD). |
|
|
38
59
|
|
|
39
|
-
|
|
60
|
+
---
|
|
40
61
|
|
|
41
|
-
|
|
62
|
+
## 🏗️ Architecture et Langages Supportés
|
|
42
63
|
|
|
43
|
-
|
|
64
|
+
DocsToDev identifie automatiquement le rôle exact de chaque fichier (Page, UI Component, API endpoint, Service, etc.).
|
|
44
65
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
66
|
+
* **Web** : TypeScript (`.ts`, `.tsx`), JavaScript (`.js`, `.jsx`).
|
|
67
|
+
* **Backend** : Python (`.py`), Java (`.java`), C# (`.cs`), Go (`.go`), Rust (`.rs`), PHP (`.php`).
|
|
68
|
+
* **Design** : CSS, SCSS, HTML.
|
|
48
69
|
|
|
49
|
-
|
|
70
|
+
---
|
|
50
71
|
|
|
51
|
-
|
|
72
|
+
## 👥 Bénéficiaires et Cas d'Usage
|
|
52
73
|
|
|
53
|
-
|
|
74
|
+
* **Onboarding** : Intégrez un nouveau développeur sur un projet existant en quelques minutes.
|
|
75
|
+
* **Audit technique** : Visualisez instantanément la complexité et les risques d'une base de code.
|
|
76
|
+
* **Documentation continue** : Maintenez une doc à jour à chaque commit sans effort manuel.
|
|
54
77
|
|
|
55
|
-
|
|
56
|
-
📄 Licence et Crédits
|
|
57
|
-
Développé par EspoirDev Massamba Kiminou Chadrack Delmard.
|
|
78
|
+
---
|
|
58
79
|
|
|
80
|
+
## 📄 Licence et Crédits
|
|
59
81
|
|
|
60
|
-
|
|
82
|
+
**Développeur** : Chadrack Massamba (EsporDev)
|
|
83
|
+
|
|
84
|
+
**Date du projet** : 6 janvier 2026
|
|
85
|
+
|
|
86
|
+
**Contact** : espoirdev2006@gmail.com
|
|
87
|
+
|
|
88
|
+
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docstodev",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "Solution d’automatisation de documentation technique intelligente avec IA",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli/index.js",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"chalk": "^5.4.1",
|
|
34
34
|
"commander": "^13.1.0",
|
|
35
|
+
"docstodev": "^3.0.3",
|
|
35
36
|
"dotenv": "^16.4.7",
|
|
36
37
|
"globby": "^14.0.2",
|
|
37
38
|
"puppeteer": "^24.1.1"
|
package/src/commands/run.ts
CHANGED
|
@@ -316,13 +316,11 @@ export async function runCommand(
|
|
|
316
316
|
}
|
|
317
317
|
finalMD += `\n`;
|
|
318
318
|
|
|
319
|
-
// Section BUT DU PROJET (PRIORITÉ ABSOLUE)
|
|
320
319
|
if (aiResult.projectGoal) {
|
|
321
320
|
finalMD += `## 🎯 ${t.projectGoal}\n\n`;
|
|
322
321
|
finalMD += `${aiResult.projectGoal}\n\n`;
|
|
323
322
|
}
|
|
324
323
|
|
|
325
|
-
// Section DESIGN SYSTEM
|
|
326
324
|
if (aiResult.designSystem && aiOptions.includeDesignSystem) {
|
|
327
325
|
finalMD += `## 🎨 ${t.designSystem}\n\n`;
|
|
328
326
|
if (aiResult.designSystem.primaryColors && aiResult.designSystem.primaryColors.length > 0) {
|
|
@@ -336,7 +334,6 @@ export async function runCommand(
|
|
|
336
334
|
}
|
|
337
335
|
}
|
|
338
336
|
|
|
339
|
-
// Section RISQUES
|
|
340
337
|
if (aiResult.risks && aiOptions.includeRisks && aiResult.risks.length > 0) {
|
|
341
338
|
finalMD += `## ⚠️ ${t.risks}\n\n`;
|
|
342
339
|
aiResult.risks.forEach(risk => {
|
|
@@ -346,7 +343,6 @@ export async function runCommand(
|
|
|
346
343
|
});
|
|
347
344
|
}
|
|
348
345
|
|
|
349
|
-
// Section RECOMMANDATIONS
|
|
350
346
|
if (aiResult.recommendations && aiOptions.includeRecommendations && aiResult.recommendations.length > 0) {
|
|
351
347
|
finalMD += `## 💡 ${t.recommendations}\n\n`;
|
|
352
348
|
aiResult.recommendations.forEach(reco => {
|
|
@@ -355,19 +351,13 @@ export async function runCommand(
|
|
|
355
351
|
finalMD += `\n`;
|
|
356
352
|
}
|
|
357
353
|
|
|
358
|
-
// Analyse IA complète
|
|
359
354
|
finalMD += `## 💡 ${t.aiTitle}\n\n${formattedAiSummary}\n\n`;
|
|
360
|
-
|
|
361
|
-
// Structure du projet
|
|
362
355
|
finalMD += `## 📂 ${t.structure}\n\n`;
|
|
363
356
|
finalMD += "```\n";
|
|
364
357
|
finalMD += renderTree(buildTree(files));
|
|
365
358
|
finalMD += "```\n\n";
|
|
366
|
-
|
|
367
|
-
// Analyse détaillée
|
|
368
359
|
finalMD += detailContent;
|
|
369
360
|
|
|
370
|
-
// Dépendances
|
|
371
361
|
finalMD += `## 📦 ${t.deps}\n\n`;
|
|
372
362
|
finalMD += `| Module | Type | Occurrences |\n`;
|
|
373
363
|
finalMD += `| :--- | :--- | :---: |\n`;
|
|
@@ -393,10 +383,6 @@ export async function runCommand(
|
|
|
393
383
|
exportToHTML(docsDir, finalMD, mermaidGraph, language, fileTreeStructure);
|
|
394
384
|
console.log(` ✓ Rapport HTML généré : docs/report.html\n`);
|
|
395
385
|
|
|
396
|
-
// console.log("📄 Étape 6/6 : Génération du PDF...");
|
|
397
|
-
// await generatePDF(path.join(docsDir, "report.html"), path.join(docsDir, "report.pdf"));
|
|
398
|
-
// console.log(` ✓ PDF exporté : docs/report.pdf\n`);
|
|
399
|
-
|
|
400
386
|
console.log("╔══════════════════════════════════════════╗");
|
|
401
387
|
console.log("║ ✨ Analyse terminée avec succès ! ║");
|
|
402
388
|
console.log("╚══════════════════════════════════════════╝\n");
|
package/src/exporters/html.ts
CHANGED
|
@@ -765,7 +765,8 @@ function generateHierarchyGraph(tree: TreeStructure, maxDepth: number = 4): stri
|
|
|
765
765
|
let nodeId = 0;
|
|
766
766
|
|
|
767
767
|
function sanitizeLabel(label: string): string {
|
|
768
|
-
|
|
768
|
+
// Ne pas supprimer les slashes, juste nettoyer les caractères problématiques
|
|
769
|
+
return label.replace(/["\[\]]/g, '');
|
|
769
770
|
}
|
|
770
771
|
|
|
771
772
|
function getFileExtension(filename: string): string {
|
|
@@ -791,17 +792,34 @@ function generateHierarchyGraph(tree: TreeStructure, maxDepth: number = 4): stri
|
|
|
791
792
|
return styleMap[ext] || ':::fileStyle';
|
|
792
793
|
}
|
|
793
794
|
|
|
794
|
-
function traverse(obj: TreeStructure, parentId: string | null, depth: number): void {
|
|
795
|
+
function traverse(obj: TreeStructure, parentId: string | null, depth: number, parentPath: string = ''): void {
|
|
795
796
|
if (depth > maxDepth) return;
|
|
796
797
|
|
|
797
798
|
const entries = Object.entries(obj);
|
|
798
|
-
|
|
799
|
+
|
|
800
|
+
// Séparer dossiers et fichiers
|
|
801
|
+
const folders: [string, TreeStructure | null][] = [];
|
|
802
|
+
const files: [string, TreeStructure | null][] = [];
|
|
803
|
+
|
|
799
804
|
entries.forEach(([key, value]) => {
|
|
805
|
+
const isFolder = value !== null && typeof value === 'object' && Object.keys(value).length > 0;
|
|
806
|
+
if (isFolder) {
|
|
807
|
+
folders.push([key, value]);
|
|
808
|
+
} else {
|
|
809
|
+
files.push([key, value]);
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
|
|
813
|
+
// Traiter d'abord les dossiers
|
|
814
|
+
folders.forEach(([key, value]) => {
|
|
800
815
|
const currentId = `node${nodeId++}`;
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
const
|
|
816
|
+
const currentPath = parentPath ? `${parentPath}/${key}` : key;
|
|
817
|
+
|
|
818
|
+
// Afficher seulement le nom du dossier, pas le chemin complet
|
|
819
|
+
const displayName = key.split('/').pop() || key;
|
|
820
|
+
const label = sanitizeLabel(displayName);
|
|
821
|
+
const displayLabel = `📁 ${label}`;
|
|
822
|
+
const style = ':::folderStyle';
|
|
805
823
|
|
|
806
824
|
graph += ` ${currentId}["${displayLabel}"]${style}\n`;
|
|
807
825
|
|
|
@@ -809,8 +827,25 @@ function generateHierarchyGraph(tree: TreeStructure, maxDepth: number = 4): stri
|
|
|
809
827
|
graph += ` ${parentId} --> ${currentId}\n`;
|
|
810
828
|
}
|
|
811
829
|
|
|
812
|
-
if (
|
|
813
|
-
traverse(value, currentId, depth + 1);
|
|
830
|
+
if (value && depth < maxDepth) {
|
|
831
|
+
traverse(value, currentId, depth + 1, currentPath);
|
|
832
|
+
}
|
|
833
|
+
});
|
|
834
|
+
|
|
835
|
+
// Ensuite traiter les fichiers
|
|
836
|
+
files.forEach(([key, value]) => {
|
|
837
|
+
const currentId = `node${nodeId++}`;
|
|
838
|
+
|
|
839
|
+
// Afficher seulement le nom du fichier
|
|
840
|
+
const displayName = key.split('/').pop() || key;
|
|
841
|
+
const label = sanitizeLabel(displayName);
|
|
842
|
+
const displayLabel = `📄 ${label}`;
|
|
843
|
+
const style = getNodeStyle(key, false);
|
|
844
|
+
|
|
845
|
+
graph += ` ${currentId}["${displayLabel}"]${style}\n`;
|
|
846
|
+
|
|
847
|
+
if (parentId) {
|
|
848
|
+
graph += ` ${parentId} --> ${currentId}\n`;
|
|
814
849
|
}
|
|
815
850
|
});
|
|
816
851
|
}
|