@fzed51/git-tool 0.3.0 → 0.6.0
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/CHANGELOG.md +38 -0
- package/README.md +100 -21
- package/dist/git-changelog.d.ts +2 -0
- package/dist/git-changelog.d.ts.map +1 -0
- package/dist/git-changelog.js +71 -0
- package/dist/git-changelog.js.map +1 -0
- package/dist/lib/git-changelog.d.ts +26 -0
- package/dist/lib/git-changelog.d.ts.map +1 -0
- package/dist/lib/git-changelog.js +119 -0
- package/dist/lib/git-changelog.js.map +1 -0
- package/dist/lib/git-commit.d.ts +9 -0
- package/dist/lib/git-commit.d.ts.map +1 -1
- package/dist/lib/git-commit.js +69 -3
- package/dist/lib/git-commit.js.map +1 -1
- package/dist/lib/git-commit.test.d.ts +5 -0
- package/dist/lib/git-commit.test.d.ts.map +1 -0
- package/dist/lib/git-commit.test.js +208 -0
- package/dist/lib/git-commit.test.js.map +1 -0
- package/dist/lib/git-wrapper.d.ts +13 -0
- package/dist/lib/git-wrapper.d.ts.map +1 -1
- package/dist/lib/git-wrapper.js +28 -0
- package/dist/lib/git-wrapper.js.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/package.json +13 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,44 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
--->
|
|
9
|
+
|
|
10
|
+
## [0.6.0] - 2026-02-12
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Ajout du modèle Mistral pour de meilleures performances
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Ajustement des paramètres pour une meilleure compatibilité avec le modèle Mistral
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## [0.5.0] - 2026-02-11
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- Added new scripts for git-commit and git-changelog to streamline development workflow.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- Updated changelog insertion logic to use marker for better changelog management.
|
|
26
|
+
- Corrected the date of version 0.4.0 in the changelog.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## [0.4.0] - 2026-02-11
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
- Added `git-changelog` command for AI-powered changelog generation
|
|
33
|
+
- Added methods to retrieve Git tags
|
|
34
|
+
- Added `wrapLines` function for commit message formatting
|
|
35
|
+
- Added Jest configuration and test scripts
|
|
36
|
+
- Added comprehensive tool documentation in the README
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- Improved commit message generation
|
|
40
|
+
- Clarified commit message instructions in the documentation
|
|
41
|
+
- Added `commander` dependency for CLI improvements
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
- Preserved bullet points and numbered lists in line wrapping
|
|
45
|
+
|
|
8
46
|
## [0.3.0] - 2026-02-11
|
|
9
47
|
|
|
10
48
|
### Added
|
package/README.md
CHANGED
|
@@ -1,30 +1,62 @@
|
|
|
1
|
-
# Git Tool
|
|
1
|
+
# Git Tool 🚀
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Outil en ligne de commande pour Git avec génération automatique de messages de commit propulsée par l'IA.
|
|
4
4
|
|
|
5
5
|
## Description
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Git Tool est un utilitaire CLI qui améliore votre workflow Git en générant automatiquement des messages de commit pertinents et descriptifs à partir des fichiers staged et de leurs différences. Utilisant l'IA Mistral (modèle `devstral-latest`), l'outil analyse vos modifications et produit des messages de commit suivant les conventions standards.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Caractéristiques
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
✨ **Génération intelligente** - Messages de commit générés par IA en analysant vos modifications
|
|
12
|
+
📋 **Aperçu des fichiers** - Affichage coloré des fichiers staged avant génération
|
|
13
|
+
🔍 **Confirmation interactive** - Validation avant de committer
|
|
14
|
+
📊 **Statistiques de tokens** - Logs de l'utilisation de l'API Mistral
|
|
15
|
+
⚡ **Interface élégante** - Banner ASCII et feedback visuel avec couleurs
|
|
16
|
+
🎯 **Conventions standards** - Respect des conventions de commit (feat, fix, doc, etc.)
|
|
14
17
|
|
|
15
18
|
## Installation
|
|
16
19
|
|
|
20
|
+
### Installation globale (recommandée)
|
|
21
|
+
|
|
17
22
|
```bash
|
|
23
|
+
npm install -g @fzed51/git-tool
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Installation locale pour développement
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone <repository>
|
|
30
|
+
cd git-tool
|
|
18
31
|
yarn install
|
|
19
32
|
yarn build
|
|
20
33
|
```
|
|
21
34
|
|
|
22
35
|
## Utilisation
|
|
23
36
|
|
|
24
|
-
###
|
|
37
|
+
### Ligne de commande
|
|
38
|
+
|
|
39
|
+
Une fois installé globalement, utilisez la commande `git-commit` :
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# 1. Ajoutez vos fichiers au staging
|
|
43
|
+
git add .
|
|
44
|
+
|
|
45
|
+
# 2. Générez et créez votre commit avec l'IA
|
|
46
|
+
git-commit
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
L'outil va :
|
|
50
|
+
1. Afficher les fichiers staged
|
|
51
|
+
2. Analyser les différences
|
|
52
|
+
3. Générer un message de commit via l'IA
|
|
53
|
+
4. Demander confirmation
|
|
54
|
+
5. Créer le commit
|
|
55
|
+
|
|
56
|
+
### Utilisation programmatique (API)
|
|
25
57
|
|
|
26
58
|
```typescript
|
|
27
|
-
import { generateCommitMessage, git } from "git-tool";
|
|
59
|
+
import { generateCommitMessage, git, GitWrapper } from "@fzed51/git-tool";
|
|
28
60
|
|
|
29
61
|
// Générer un message de commit
|
|
30
62
|
const message = await generateCommitMessage();
|
|
@@ -32,42 +64,89 @@ console.log(message);
|
|
|
32
64
|
|
|
33
65
|
// Utiliser le wrapper git
|
|
34
66
|
const stagedFiles = await git.getStagedFiles();
|
|
67
|
+
console.log("Fichiers staged:", stagedFiles);
|
|
68
|
+
|
|
69
|
+
// Créer une instance personnalisée
|
|
70
|
+
const customGit = new GitWrapper({ cwd: "/path/to/repo" });
|
|
71
|
+
const diff = await customGit.getStagedDiff();
|
|
35
72
|
```
|
|
36
73
|
|
|
37
74
|
## Configuration
|
|
38
75
|
|
|
39
|
-
|
|
76
|
+
### Variables d'environnement
|
|
77
|
+
|
|
78
|
+
Créez un fichier `.env` à la racine du projet (ou dans votre répertoire home pour une configuration globale) :
|
|
40
79
|
|
|
41
80
|
```env
|
|
42
|
-
# Clé API
|
|
43
|
-
MISTRAL_API_KEY=
|
|
81
|
+
# Clé API Mistral (requis)
|
|
82
|
+
MISTRAL_API_KEY=votre_cle_api_mistral
|
|
83
|
+
MISTRAL_MODEL=devstral-latest
|
|
44
84
|
```
|
|
45
85
|
|
|
46
|
-
**
|
|
86
|
+
**Obtenir une clé API Mistral :**
|
|
87
|
+
1. Créez un compte sur [console.mistral.ai](https://console.mistral.ai)
|
|
88
|
+
2. Générez une clé API
|
|
89
|
+
3. Ajoutez-la à votre fichier `.env`
|
|
90
|
+
|
|
91
|
+
**⚠️ Sécurité :** Ne commitez jamais votre fichier `.env` ! Il est automatiquement ignoré par `.gitignore`.
|
|
47
92
|
|
|
48
93
|
## Développement
|
|
49
94
|
|
|
95
|
+
### Scripts disponibles
|
|
96
|
+
|
|
50
97
|
```bash
|
|
51
98
|
# Compiler TypeScript
|
|
52
99
|
yarn build
|
|
53
100
|
|
|
54
|
-
# Mode
|
|
101
|
+
# Mode développement (exécution directe avec tsx)
|
|
55
102
|
yarn dev
|
|
56
103
|
|
|
57
|
-
# Linter
|
|
104
|
+
# Linter et formatting (Biome)
|
|
58
105
|
yarn lint
|
|
59
106
|
yarn lint:fix
|
|
107
|
+
```
|
|
60
108
|
|
|
61
|
-
|
|
62
|
-
|
|
109
|
+
### Structure du projet
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
git-tool/
|
|
113
|
+
├── src/
|
|
114
|
+
│ ├── git-commit.ts # CLI principale
|
|
115
|
+
│ └── lib/
|
|
116
|
+
│ ├── git-commit.ts # Logique de génération
|
|
117
|
+
│ ├── git-wrapper.ts # Wrapper pour commandes git
|
|
118
|
+
│ └── index.ts # API publique
|
|
119
|
+
├── dist/ # Fichiers compilés
|
|
120
|
+
├── package.json
|
|
121
|
+
└── tsconfig.json
|
|
63
122
|
```
|
|
64
123
|
|
|
65
124
|
## Technologies
|
|
66
125
|
|
|
67
|
-
- **TypeScript** - Langage principal (
|
|
68
|
-
- **
|
|
69
|
-
- **
|
|
126
|
+
- **TypeScript** - Langage principal (ESM)
|
|
127
|
+
- **Mistral AI** - Modèle `devstral-latest` pour la génération
|
|
128
|
+
- **Biome.js** - Linting et formatting ultra-rapide
|
|
129
|
+
- **Chalk** - Couleurs et style dans le terminal
|
|
130
|
+
- **Node.js** - ≥ 18.0.0
|
|
131
|
+
|
|
132
|
+
## Changelog
|
|
133
|
+
|
|
134
|
+
Voir [CHANGELOG.md](CHANGELOG.md) pour l'historique détaillé des versions.
|
|
135
|
+
|
|
136
|
+
### Versions récentes
|
|
137
|
+
|
|
138
|
+
- **v0.3.0** - Affichage des fichiers staged, feedback visuel amélioré
|
|
139
|
+
- **v0.2.0** - Banner ASCII, API publique, confirmation interactive
|
|
140
|
+
- **v0.0.1** - Version initiale avec wrapper Git et CLI basique
|
|
70
141
|
|
|
71
142
|
## Licence
|
|
72
143
|
|
|
73
|
-
|
|
144
|
+
MIT - Voir [LICENSE](LICENSE) pour plus de détails.
|
|
145
|
+
|
|
146
|
+
## Auteur
|
|
147
|
+
|
|
148
|
+
Fabien Sanchez
|
|
149
|
+
|
|
150
|
+
## Contribuer
|
|
151
|
+
|
|
152
|
+
Les contributions sont les bienvenues ! N'hésitez pas à ouvrir une issue ou une pull request.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-changelog.d.ts","sourceRoot":"","sources":["../src/git-changelog.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { stdin as input, stdout as output } from "node:process";
|
|
4
|
+
import * as readline from "node:readline/promises";
|
|
5
|
+
import { getLastVersionTag, getCommitsSinceLastVersion, generateChangelog, updateChangelogFile, } from "./lib/git-changelog.js";
|
|
6
|
+
import { GitWrapper } from "./lib/git-wrapper.js";
|
|
7
|
+
const program = new Command();
|
|
8
|
+
program
|
|
9
|
+
.name("git-changelog")
|
|
10
|
+
.description("Génère un changelog à partir de l'historique Git avec l'IA")
|
|
11
|
+
.argument("<version>", "La prochaine version (ex: 1.0.0)")
|
|
12
|
+
.option("--from <tag>", "Tag de départ (défaut: dernier tag de version)")
|
|
13
|
+
.option("--no-commit", "Ne pas commiter automatiquement le CHANGELOG.md")
|
|
14
|
+
.action(async (version, options) => {
|
|
15
|
+
try {
|
|
16
|
+
console.log(chalk.green.bold([
|
|
17
|
+
" ▘▗ ▌ ▜",
|
|
18
|
+
"▛▌▌▜▘▄▖▛▘▛▌▀▌▛▌▛▌█▌▐ ▛▌▛▌",
|
|
19
|
+
"▙▌▌▐▖ ▙▖▌▌█▌▌▌▙▌▙▖▐▖▙▌▙▌",
|
|
20
|
+
"▄▌ ▄▌ ▄▌",
|
|
21
|
+
].join("\n")));
|
|
22
|
+
// Récupérer le tag de départ
|
|
23
|
+
const fromTag = options.from ?? (await getLastVersionTag());
|
|
24
|
+
if (fromTag) {
|
|
25
|
+
console.log(chalk.blue(`\n📌 Dernier tag de version: ${fromTag}`));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
console.log(chalk.yellow("\n⚠️ Aucun tag de version trouvé, utilisation des derniers commits."));
|
|
29
|
+
}
|
|
30
|
+
// Récupérer les commits
|
|
31
|
+
const commits = await getCommitsSinceLastVersion(fromTag || undefined);
|
|
32
|
+
if (commits.length === 0) {
|
|
33
|
+
console.log(chalk.yellow("\n⚠️ Aucun commit trouvé depuis la dernière version."));
|
|
34
|
+
process.exit(0);
|
|
35
|
+
}
|
|
36
|
+
console.log(chalk.blue(`\n📋 ${commits.length} commit(s) trouvé(s):`));
|
|
37
|
+
for (const commit of commits) {
|
|
38
|
+
console.log(chalk.cyan(` • ${commit}`));
|
|
39
|
+
}
|
|
40
|
+
// Générer le changelog
|
|
41
|
+
console.log("\n🤖 Génération du changelog...\n");
|
|
42
|
+
const changelog = await generateChangelog(version, commits);
|
|
43
|
+
console.log("✅ Changelog généré:\n");
|
|
44
|
+
console.log("─".repeat(50));
|
|
45
|
+
console.log(changelog);
|
|
46
|
+
console.log("─".repeat(50));
|
|
47
|
+
// Demander validation
|
|
48
|
+
const rl = readline.createInterface({ input, output });
|
|
49
|
+
const answer = await rl.question("\n❓ Mettre à jour le CHANGELOG.md ? (o/n) ");
|
|
50
|
+
rl.close();
|
|
51
|
+
if (answer.toLowerCase() === "o" || answer.toLowerCase() === "y") {
|
|
52
|
+
const filePath = await updateChangelogFile(changelog);
|
|
53
|
+
console.log(chalk.green(`\n✅ ${filePath} mis à jour !`));
|
|
54
|
+
if (options.commit) {
|
|
55
|
+
const git = new GitWrapper();
|
|
56
|
+
await git.add(["CHANGELOG.md"]);
|
|
57
|
+
await git.commit(`docs: update CHANGELOG.md for v${version}`);
|
|
58
|
+
console.log(chalk.green("✅ Commit effectué !"));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
console.log("\n💡 Changelog non appliqué.");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
console.error("❌ Erreur:", error instanceof Error ? error.message : error);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
program.parse();
|
|
71
|
+
//# sourceMappingURL=git-changelog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-changelog.js","sourceRoot":"","sources":["../src/git-changelog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,eAAe,CAAC;KACrB,WAAW,CAAC,4DAA4D,CAAC;KACzE,QAAQ,CAAC,WAAW,EAAE,kCAAkC,CAAC;KACzD,MAAM,CAAC,cAAc,EAAE,gDAAgD,CAAC;KACxE,MAAM,CAAC,aAAa,EAAE,iDAAiD,CAAC;KACxE,MAAM,CACL,KAAK,EAAE,OAAe,EAAE,OAA2C,EAAE,EAAE;IACrE,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CAAC,IAAI,CACd;YACE,sBAAsB;YACtB,2BAA2B;YAC3B,2BAA2B;YAC3B,2BAA2B;SAC5B,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CACF,CAAC;QAEF,6BAA6B;QAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,MAAM,iBAAiB,EAAE,CAAC,CAAC;QAC5D,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC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
|
|
7
|
+
* Récupère le dernier tag de version.
|
|
8
|
+
* Si aucun tag n'existe, retourne une chaîne vide.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getLastVersionTag(): Promise<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Récupère les commits depuis le dernier tag de version.
|
|
13
|
+
* Si aucun tag n'est trouvé, récupère les N derniers commits.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getCommitsSinceLastVersion(tag?: string): Promise<string[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Génère un changelog formaté en Markdown à partir d'une liste de commits
|
|
18
|
+
* en utilisant l'IA pour les catégoriser et les rédiger.
|
|
19
|
+
*/
|
|
20
|
+
export declare function generateChangelog(version: string, commits: string[]): Promise<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Met à jour le fichier CHANGELOG.md en ajoutant le nouveau contenu
|
|
23
|
+
* à l'emplacement du marqueur "--->" s'il existe.
|
|
24
|
+
*/
|
|
25
|
+
export declare function updateChangelogFile(newEntry: string, filePath?: string): Promise<string>;
|
|
26
|
+
//# sourceMappingURL=git-changelog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-changelog.d.ts","sourceRoot":"","sources":["../../src/lib/git-changelog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,eAAe,CAAC;AAUvB;;;GAGG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,CAEzD;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,EAAE,CAAC,CAanB;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,MAAM,CAAC,CAoDjB;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,SAAiB,GACxB,OAAO,CAAC,MAAM,CAAC,CAiCjB"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Changelog Generator
|
|
3
|
+
* Génère automatiquement un changelog à partir de l'historique des commits
|
|
4
|
+
*/
|
|
5
|
+
import "dotenv/config";
|
|
6
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
7
|
+
import { git } from "./git-wrapper.js";
|
|
8
|
+
const mistral = new Mistral({
|
|
9
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
10
|
+
});
|
|
11
|
+
const mistralModel = process.env.MISTRAL_MODEL || "mistral-small-latest";
|
|
12
|
+
/**
|
|
13
|
+
* Récupère le dernier tag de version.
|
|
14
|
+
* Si aucun tag n'existe, retourne une chaîne vide.
|
|
15
|
+
*/
|
|
16
|
+
export async function getLastVersionTag() {
|
|
17
|
+
return await git.getLastVersionTag();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Récupère les commits depuis le dernier tag de version.
|
|
21
|
+
* Si aucun tag n'est trouvé, récupère les N derniers commits.
|
|
22
|
+
*/
|
|
23
|
+
export async function getCommitsSinceLastVersion(tag) {
|
|
24
|
+
const lastTag = tag ?? (await git.getLastVersionTag());
|
|
25
|
+
if (!lastTag) {
|
|
26
|
+
// Pas de tag trouvé, récupérer les 50 derniers commits
|
|
27
|
+
const output = await git.getLog({ count: 50, format: "%h %s" });
|
|
28
|
+
return output
|
|
29
|
+
.split("\n")
|
|
30
|
+
.map((l) => l.trim())
|
|
31
|
+
.filter(Boolean);
|
|
32
|
+
}
|
|
33
|
+
return await git.getLogSince(lastTag);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Génère un changelog formaté en Markdown à partir d'une liste de commits
|
|
37
|
+
* en utilisant l'IA pour les catégoriser et les rédiger.
|
|
38
|
+
*/
|
|
39
|
+
export async function generateChangelog(version, commits) {
|
|
40
|
+
if (commits.length === 0) {
|
|
41
|
+
throw new Error("Aucun commit trouvé pour générer le changelog.");
|
|
42
|
+
}
|
|
43
|
+
// date du jour au format YYYY-MM-DD
|
|
44
|
+
const today = new Date().toISOString().split("T")[0];
|
|
45
|
+
const system = "Tu es un assistant de développement expert en rédaction de changelogs clairs et professionnels.";
|
|
46
|
+
const prompt = `Voici une liste de commits Git. Génère un changelog au format Markdown pour la version ${version}.
|
|
47
|
+
|
|
48
|
+
Commits :
|
|
49
|
+
${commits.join("\n")}
|
|
50
|
+
|
|
51
|
+
Règles :
|
|
52
|
+
- Regroupe les commits par catégorie (Added, Changed, Fixed, Removed, etc.) en utilisant les conventions Keep a Changelog
|
|
53
|
+
- Chaque entrée doit être concise et compréhensible par un utilisateur final
|
|
54
|
+
- Utilise le format "## [${version}] - ${today}" comme titre avec la date du jour
|
|
55
|
+
- Ne mets pas de blocs de code markdown autour du résultat
|
|
56
|
+
- Réponds uniquement avec le changelog, sans explication supplémentaire`;
|
|
57
|
+
const response = await mistral.chat.complete({
|
|
58
|
+
model: mistralModel,
|
|
59
|
+
temperature: 0.3,
|
|
60
|
+
messages: [
|
|
61
|
+
{ role: "system", content: system },
|
|
62
|
+
{ role: "user", content: prompt },
|
|
63
|
+
],
|
|
64
|
+
});
|
|
65
|
+
if (response.usage) {
|
|
66
|
+
console.info("\nTokens utilisés:");
|
|
67
|
+
console.info("─".repeat(30));
|
|
68
|
+
if (response.usage.promptTokens !== undefined)
|
|
69
|
+
console.info("promptTokens:", response.usage.promptTokens);
|
|
70
|
+
if (response.usage.completionTokens !== undefined)
|
|
71
|
+
console.info("completionTokens:", response.usage.completionTokens);
|
|
72
|
+
if (response.usage.totalTokens !== undefined)
|
|
73
|
+
console.info("totalTokens:", response.usage.totalTokens);
|
|
74
|
+
console.info("─".repeat(30) + "\n");
|
|
75
|
+
}
|
|
76
|
+
const content = response.choices?.[0]?.message?.content;
|
|
77
|
+
const changelog = typeof content === "string" ? content.trim() : "";
|
|
78
|
+
if (!changelog) {
|
|
79
|
+
throw new Error("Impossible de générer le changelog.");
|
|
80
|
+
}
|
|
81
|
+
return changelog;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Met à jour le fichier CHANGELOG.md en ajoutant le nouveau contenu
|
|
85
|
+
* à l'emplacement du marqueur "--->" s'il existe.
|
|
86
|
+
*/
|
|
87
|
+
export async function updateChangelogFile(newEntry, filePath = "CHANGELOG.md") {
|
|
88
|
+
const { readFile, writeFile } = await import("node:fs/promises");
|
|
89
|
+
const { resolve } = await import("node:path");
|
|
90
|
+
const fullPath = resolve(filePath);
|
|
91
|
+
let existingContent = "";
|
|
92
|
+
try {
|
|
93
|
+
existingContent = await readFile(fullPath, "utf-8");
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// Fichier inexistant, on le crée
|
|
97
|
+
existingContent = "# Changelog\n";
|
|
98
|
+
}
|
|
99
|
+
// Insérer après le marqueur "--->" s'il existe
|
|
100
|
+
const markerIndex = existingContent.indexOf("--->");
|
|
101
|
+
let updatedContent;
|
|
102
|
+
if (markerIndex !== -1) {
|
|
103
|
+
const afterMarker = existingContent.substring(markerIndex + 4);
|
|
104
|
+
updatedContent = `${existingContent.substring(0, markerIndex + 4)}\n\n${newEntry}\n${afterMarker}`;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const titleMatch = existingContent.match(/^# .+\n/);
|
|
108
|
+
if (titleMatch) {
|
|
109
|
+
const afterTitle = existingContent.substring(titleMatch[0].length);
|
|
110
|
+
updatedContent = `${titleMatch[0]}\n${newEntry}\n${afterTitle}`;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
updatedContent = `# Changelog\n\n${newEntry}\n\n${existingContent}`;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
await writeFile(fullPath, updatedContent, "utf-8");
|
|
117
|
+
return fullPath;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=git-changelog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-changelog.js","sourceRoot":"","sources":["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CAAC,CAAC,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;IACrG,CAAC;SAAM,CAAC;QACN,MAAM,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpD,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,UAAU,GAAG,eAAe,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YACnE,cAAc,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,QAAQ,KAAK,UAAU,EAAE,CAAC;QAClE,CAAC;aAAM,CAAC;YACN,cAAc,GAAG,kBAAkB,QAAQ,OAAO,eAAe,EAAE,CAAC;QACtE,CAAC;IACH,CAAC;IAED,MAAM,SAAS,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACnD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/lib/git-commit.d.ts
CHANGED
|
@@ -3,5 +3,14 @@
|
|
|
3
3
|
* Génère automatiquement un message de commit à partir des fichiers staged
|
|
4
4
|
*/
|
|
5
5
|
import "dotenv/config";
|
|
6
|
+
/**
|
|
7
|
+
* Formate un texte en ajoutant des retours à la ligne pour éviter
|
|
8
|
+
* les lignes trop longues, sans couper les mots.
|
|
9
|
+
*
|
|
10
|
+
* @param text - Le texte à formater
|
|
11
|
+
* @param maxLength - Longueur maximale par ligne (défaut: 72)
|
|
12
|
+
* @returns Le texte formaté avec retours à la ligne
|
|
13
|
+
*/
|
|
14
|
+
export declare function wrapLines(text: string, maxLength?: number): string;
|
|
6
15
|
export declare function generateCommitMessage(): Promise<string>;
|
|
7
16
|
//# sourceMappingURL=git-commit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-commit.d.ts","sourceRoot":"","sources":["../../src/lib/git-commit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"git-commit.d.ts","sourceRoot":"","sources":["../../src/lib/git-commit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,eAAe,CAAC;AAUvB;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,SAAK,GAAG,MAAM,CAwD9D;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC,CAoE7D"}
|
package/dist/lib/git-commit.js
CHANGED
|
@@ -8,6 +8,67 @@ import { git } from "./git-wrapper.js";
|
|
|
8
8
|
const mistral = new Mistral({
|
|
9
9
|
apiKey: process.env.MISTRAL_API_KEY,
|
|
10
10
|
});
|
|
11
|
+
const mistralModel = process.env.MISTRAL_MODEL || "mistral-small-latest";
|
|
12
|
+
/**
|
|
13
|
+
* Formate un texte en ajoutant des retours à la ligne pour éviter
|
|
14
|
+
* les lignes trop longues, sans couper les mots.
|
|
15
|
+
*
|
|
16
|
+
* @param text - Le texte à formater
|
|
17
|
+
* @param maxLength - Longueur maximale par ligne (défaut: 72)
|
|
18
|
+
* @returns Le texte formaté avec retours à la ligne
|
|
19
|
+
*/
|
|
20
|
+
export function wrapLines(text, maxLength = 72) {
|
|
21
|
+
const lines = text.split("\n");
|
|
22
|
+
const wrappedLines = [];
|
|
23
|
+
for (let i = 0; i < lines.length; i++) {
|
|
24
|
+
const line = lines[i];
|
|
25
|
+
// Ligne vide : conserver telle quelle
|
|
26
|
+
if (line.trim() === "") {
|
|
27
|
+
wrappedLines.push("");
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
// Si la ligne est déjà courte, la conserver
|
|
31
|
+
if (line.length <= maxLength) {
|
|
32
|
+
wrappedLines.push(line);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
// Détecter l'indentation : espaces + éventuelle puce
|
|
36
|
+
// ( -, *, +, • ) ou numéro de liste (ex: "1." ou "2)") suivi d'un espace
|
|
37
|
+
const listIndentMatch = line.match(/^(\s*(?:[-*+•]|(?:\d+[\.\)]))\s+)/);
|
|
38
|
+
const firstIndent = listIndentMatch
|
|
39
|
+
? listIndentMatch[0]
|
|
40
|
+
: line.match(/^\s*/)?.[0] || "";
|
|
41
|
+
const content = line.substring(firstIndent.length);
|
|
42
|
+
const nextIndent = " ".repeat(firstIndent.length);
|
|
43
|
+
// Découper la ligne en respectant les mots
|
|
44
|
+
const words = content.split(/(\s+)/); // Garder les espaces
|
|
45
|
+
let currentLine = firstIndent;
|
|
46
|
+
for (const word of words) {
|
|
47
|
+
const testLine = currentLine + word;
|
|
48
|
+
if (testLine.length <= maxLength) {
|
|
49
|
+
currentLine = testLine;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
// Si le mot seul est plus long que maxLength
|
|
53
|
+
if (currentLine.trim() === "" && word.trim().length > maxLength) {
|
|
54
|
+
wrappedLines.push(nextIndent + word.trim());
|
|
55
|
+
currentLine = nextIndent;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
// Ajouter la ligne actuelle et commencer une nouvelle
|
|
59
|
+
if (currentLine.trim() !== "") {
|
|
60
|
+
wrappedLines.push(currentLine.trimEnd());
|
|
61
|
+
}
|
|
62
|
+
currentLine = nextIndent + word.trimStart();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (currentLine.trim() !== "") {
|
|
67
|
+
wrappedLines.push(currentLine.trimEnd());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return wrappedLines.join("\n");
|
|
71
|
+
}
|
|
11
72
|
export async function generateCommitMessage() {
|
|
12
73
|
const stagedFiles = await git.getStagedFiles();
|
|
13
74
|
if (stagedFiles.length === 0) {
|
|
@@ -17,6 +78,7 @@ export async function generateCommitMessage() {
|
|
|
17
78
|
if (!diff.trim()) {
|
|
18
79
|
throw new Error("Aucune modification trouvée dans les fichiers staged.");
|
|
19
80
|
}
|
|
81
|
+
const system = "Tu es un assistant de développement et un expert en Git et en bonnes pratiques de versioning.";
|
|
20
82
|
const prompt = `Analyse les changements git suivants et génère un message de commit concis et descriptif.
|
|
21
83
|
|
|
22
84
|
Fichiers modifiés:
|
|
@@ -31,11 +93,15 @@ Génère un message de commit qui suit les conventions:
|
|
|
31
93
|
- Utilise l'impératif présent (ex: "feat", "fix", "test", "doc", "chore")
|
|
32
94
|
- Soit clair et précis sur ce qui a changé et pourquoi
|
|
33
95
|
|
|
34
|
-
Réponds uniquement avec le message de commit, sans explication supplémentaire.`;
|
|
96
|
+
Réponds uniquement avec le message de commit, sans explication supplémentaire, sans mise en forme markdown.`;
|
|
35
97
|
const response = await mistral.chat.complete({
|
|
36
|
-
model:
|
|
98
|
+
model: mistralModel,
|
|
37
99
|
temperature: 0.2,
|
|
38
100
|
messages: [
|
|
101
|
+
{
|
|
102
|
+
role: "system",
|
|
103
|
+
content: system,
|
|
104
|
+
},
|
|
39
105
|
{
|
|
40
106
|
role: "user",
|
|
41
107
|
content: prompt,
|
|
@@ -59,6 +125,6 @@ Réponds uniquement avec le message de commit, sans explication supplémentaire.
|
|
|
59
125
|
if (!commitMessage) {
|
|
60
126
|
throw new Error("Impossible de générer un message de commit.");
|
|
61
127
|
}
|
|
62
|
-
return commitMessage;
|
|
128
|
+
return wrapLines(commitMessage, 72);
|
|
63
129
|
}
|
|
64
130
|
//# sourceMappingURL=git-commit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-commit.js","sourceRoot":"","sources":["../../src/lib/git-commit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,MAAM,WAAW,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GAEG"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests unitaires pour la fonction wrapLines
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect } from "@jest/globals";
|
|
5
|
+
import { wrapLines } from "./git-commit.js";
|
|
6
|
+
describe("wrapLines", () => {
|
|
7
|
+
describe("Ligne unique courte", () => {
|
|
8
|
+
it("devrait conserver une ligne courte inchangée", () => {
|
|
9
|
+
const input = "feat: add new feature";
|
|
10
|
+
const result = wrapLines(input, 72);
|
|
11
|
+
expect(result).toBe(input);
|
|
12
|
+
});
|
|
13
|
+
it("devrait conserver une ligne de 72 caractères exactement", () => {
|
|
14
|
+
const input = "a".repeat(72);
|
|
15
|
+
const result = wrapLines(input, 72);
|
|
16
|
+
expect(result).toBe(input);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
describe("Ligne unique trop longue", () => {
|
|
20
|
+
it("devrait découper une ligne longue sans indentation", () => {
|
|
21
|
+
const input = "This is a very long line that exceeds the maximum length and should be wrapped into multiple lines";
|
|
22
|
+
const result = wrapLines(input, 72);
|
|
23
|
+
const lines = result.split("\n");
|
|
24
|
+
// Vérifier que toutes les lignes respectent la limite
|
|
25
|
+
lines.forEach((line) => {
|
|
26
|
+
expect(line.length).toBeLessThanOrEqual(72);
|
|
27
|
+
});
|
|
28
|
+
// Vérifier qu'il y a plusieurs lignes
|
|
29
|
+
expect(lines.length).toBeGreaterThan(1);
|
|
30
|
+
// Vérifier que le contenu est préservé (sans les espaces multiples)
|
|
31
|
+
expect(result.replace(/\n/g, " ")).toBe(input);
|
|
32
|
+
});
|
|
33
|
+
it("devrait découper sans couper les mots", () => {
|
|
34
|
+
const input = "This is a very long line that should be wrapped without breaking words in the middle";
|
|
35
|
+
const result = wrapLines(input, 40);
|
|
36
|
+
const lines = result.split("\n");
|
|
37
|
+
// Vérifier qu'aucune ligne ne se termine ou commence en milieu de mot
|
|
38
|
+
lines.forEach((line, index) => {
|
|
39
|
+
if (index < lines.length - 1) {
|
|
40
|
+
// Pas de tirets en fin de ligne (sauf si c'était dans le texte original)
|
|
41
|
+
expect(line.trim()).not.toMatch(/\w-$/);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe("Lignes multiples", () => {
|
|
47
|
+
it("devrait traiter correctement un message multi-lignes", () => {
|
|
48
|
+
const input = `feat: add authentication
|
|
49
|
+
|
|
50
|
+
This commit adds OAuth2 authentication support with Google provider.
|
|
51
|
+
It includes token refresh mechanism and secure storage implementation.`;
|
|
52
|
+
const result = wrapLines(input, 72);
|
|
53
|
+
const lines = result.split("\n");
|
|
54
|
+
// Vérifier que toutes les lignes respectent la limite
|
|
55
|
+
lines.forEach((line) => {
|
|
56
|
+
expect(line.length).toBeLessThanOrEqual(72);
|
|
57
|
+
});
|
|
58
|
+
// La première ligne doit rester intacte (titre)
|
|
59
|
+
expect(lines[0]).toBe("feat: add authentication");
|
|
60
|
+
// La deuxième ligne doit être vide
|
|
61
|
+
expect(lines[1]).toBe("");
|
|
62
|
+
});
|
|
63
|
+
it("devrait préserver les lignes vides", () => {
|
|
64
|
+
const input = "Ligne 1\n\nLigne 3\n\nLigne 5";
|
|
65
|
+
const result = wrapLines(input, 72);
|
|
66
|
+
const lines = result.split("\n");
|
|
67
|
+
expect(lines.length).toBe(5);
|
|
68
|
+
expect(lines[1]).toBe("");
|
|
69
|
+
expect(lines[3]).toBe("");
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
describe("Indentation", () => {
|
|
73
|
+
it("devrait préserver l'indentation lors du découpage", () => {
|
|
74
|
+
const input = " This is an indented line that is very long and should be wrapped while preserving the indentation";
|
|
75
|
+
const result = wrapLines(input, 50);
|
|
76
|
+
const lines = result.split("\n");
|
|
77
|
+
// Toutes les lignes doivent commencer par 2 espaces
|
|
78
|
+
lines.forEach((line) => {
|
|
79
|
+
if (line.trim() !== "") {
|
|
80
|
+
expect(line.startsWith(" ")).toBe(true);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
it("devrait gérer plusieurs niveaux d'indentation", () => {
|
|
85
|
+
const input = `Pas d'indentation
|
|
86
|
+
Indentation 2
|
|
87
|
+
Indentation 4
|
|
88
|
+
Indentation 6`;
|
|
89
|
+
const result = wrapLines(input, 72);
|
|
90
|
+
const lines = result.split("\n");
|
|
91
|
+
expect(lines[0]).toMatch(/^Pas/);
|
|
92
|
+
expect(lines[1]).toMatch(/^ {2}Indentation 2/);
|
|
93
|
+
expect(lines[2]).toMatch(/^ {4}Indentation 4/);
|
|
94
|
+
expect(lines[3]).toMatch(/^ {6}Indentation 6/);
|
|
95
|
+
});
|
|
96
|
+
it("devrait préserver les puces lors du découpage", () => {
|
|
97
|
+
const input = "- This is a bullet point that is very long and should be wrapped while preserving the bullet prefix and indentation";
|
|
98
|
+
const result = wrapLines(input, 40);
|
|
99
|
+
console.debug({ input, result });
|
|
100
|
+
const lines = result.split("\n");
|
|
101
|
+
const indentMatch = input.match(/^(\s*(?:[-*+•]|\d+[\.\)]))\s*/);
|
|
102
|
+
const indent = indentMatch ? indentMatch[0] : "";
|
|
103
|
+
lines.forEach((line, index) => {
|
|
104
|
+
if (line.trim() !== "") {
|
|
105
|
+
if (index === 0) {
|
|
106
|
+
expect(line.startsWith(indent)).toBe(true);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
expect(line.startsWith(" ".repeat(indent.length))).toBe(true);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
it("devrait préserver les listes numérotées lors du découpage", () => {
|
|
115
|
+
const input = "1. This is a numbered item that is very long and should be wrapped while preserving the numbering prefix";
|
|
116
|
+
const result = wrapLines(input, 40);
|
|
117
|
+
console.debug({ input, result });
|
|
118
|
+
const lines = result.split("\n");
|
|
119
|
+
const indentMatch = input.match(/^(\s*(?:[-*+•]|\d+[\.\)]))\s*/);
|
|
120
|
+
const indent = indentMatch ? indentMatch[0] : "";
|
|
121
|
+
lines.forEach((line, index) => {
|
|
122
|
+
if (line.trim() !== "") {
|
|
123
|
+
if (index === 0) {
|
|
124
|
+
expect(line.startsWith(indent)).toBe(true);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
expect(line.startsWith(" ".repeat(indent.length))).toBe(true);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
describe("Cas limites", () => {
|
|
134
|
+
it("devrait gérer une chaîne vide", () => {
|
|
135
|
+
const result = wrapLines("", 72);
|
|
136
|
+
expect(result).toBe("");
|
|
137
|
+
});
|
|
138
|
+
it("devrait gérer un seul mot très long", () => {
|
|
139
|
+
const longWord = "a".repeat(100);
|
|
140
|
+
const result = wrapLines(longWord, 72);
|
|
141
|
+
// Le mot long devrait rester sur une seule ligne même s'il dépasse
|
|
142
|
+
expect(result).toBe(longWord);
|
|
143
|
+
});
|
|
144
|
+
it("devrait gérer des espaces multiples", () => {
|
|
145
|
+
const input = "word1 word2 word3 that needs to be wrapped because it is too long";
|
|
146
|
+
const result = wrapLines(input, 40);
|
|
147
|
+
const lines = result.split("\n");
|
|
148
|
+
lines.forEach((line) => {
|
|
149
|
+
expect(line.length).toBeLessThanOrEqual(40);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
it("devrait gérer maxLength très petit", () => {
|
|
153
|
+
const input = "This is a test";
|
|
154
|
+
const result = wrapLines(input, 5);
|
|
155
|
+
const lines = result.split("\n");
|
|
156
|
+
// Devrait découper autant que possible
|
|
157
|
+
expect(lines.length).toBeGreaterThan(1);
|
|
158
|
+
});
|
|
159
|
+
it("devrait gérer une ligne avec seulement des espaces", () => {
|
|
160
|
+
const input = "Ligne 1\n \nLigne 3";
|
|
161
|
+
const result = wrapLines(input, 72);
|
|
162
|
+
const lines = result.split("\n");
|
|
163
|
+
expect(lines.length).toBe(3);
|
|
164
|
+
expect(lines[1]).toBe("");
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
describe("Message de commit réaliste", () => {
|
|
168
|
+
it("devrait formater correctement un message de commit git standard", () => {
|
|
169
|
+
const input = `feat(auth): implement OAuth2 authentication with Google
|
|
170
|
+
|
|
171
|
+
Add OAuth2 authentication flow supporting Google login. This implementation includes the following features:
|
|
172
|
+
- Token generation and validation using JWT
|
|
173
|
+
- Automatic token refresh mechanism to maintain user sessions
|
|
174
|
+
- Secure credential storage using encrypted cookies
|
|
175
|
+
- Comprehensive error handling for various authentication failure scenarios`;
|
|
176
|
+
const result = wrapLines(input, 72);
|
|
177
|
+
const lines = result.split("\n");
|
|
178
|
+
// Vérifier que toutes les lignes respectent la limite
|
|
179
|
+
lines.forEach((line) => {
|
|
180
|
+
expect(line.length).toBeLessThanOrEqual(72);
|
|
181
|
+
});
|
|
182
|
+
// Le titre devrait rester intact
|
|
183
|
+
expect(lines[0]).toContain("feat(auth)");
|
|
184
|
+
// Devrait y avoir une ligne vide après le titre
|
|
185
|
+
expect(lines[1]).toBe("");
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
describe("Options de maxLength", () => {
|
|
189
|
+
it("devrait utiliser 72 par défaut", () => {
|
|
190
|
+
const input = "a ".repeat(40);
|
|
191
|
+
const result = wrapLines(input);
|
|
192
|
+
const lines = result.split("\n");
|
|
193
|
+
expect(lines.length).toBeGreaterThan(1);
|
|
194
|
+
lines.forEach((line) => {
|
|
195
|
+
expect(line.length).toBeLessThanOrEqual(72);
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
it("devrait accepter une limite personnalisée", () => {
|
|
199
|
+
const input = "This is a test that should be wrapped at 30 characters maximum";
|
|
200
|
+
const result = wrapLines(input, 30);
|
|
201
|
+
const lines = result.split("\n");
|
|
202
|
+
lines.forEach((line) => {
|
|
203
|
+
expect(line.length).toBeLessThanOrEqual(30);
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
});
|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
87
87
|
* Vérifie s'il y a des changements non commités
|
|
88
88
|
*/
|
|
89
89
|
hasUncommittedChanges(): Promise<boolean>;
|
|
90
|
+
/**
|
|
91
|
+
* Récupère le dernié tag
|
|
92
|
+
*/
|
|
93
|
+
getLastTag(): Promise<string>;
|
|
94
|
+
/**
|
|
95
|
+
* Récupère le dernier tag de version suivant le pattern vMAJOR.MINOR.PATCH (ex: v1.2.3)
|
|
96
|
+
*/
|
|
97
|
+
getLastVersionTag(): Promise<string>;
|
|
98
|
+
/**
|
|
99
|
+
* Récupère l'historique des commits depuis un ref donné (tag, commit, branche)
|
|
100
|
+
* Retourne un tableau de lignes formatées "hash subject"
|
|
101
|
+
*/
|
|
102
|
+
getLogSince(since: string, format?: string): Promise<string[]>;
|
|
90
103
|
}
|
|
91
104
|
/**
|
|
92
105
|
* Instance par défaut du wrapper git
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-wrapper.d.ts","sourceRoot":"","sources":["../../src/lib/git-wrapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAiB;gBAEpB,OAAO,GAAE,cAAmB;IAIxC;;OAEG;YACW,IAAI;IAclB;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKzC;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAItC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAIlC;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIzC;;OAEG;IACG,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlD;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO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B,IAAI,OAAO,CAAC,OAAO,CAAC;IAK/C;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IAW1C;;;OAGG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,SAAU,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAOtE;AAED;;GAEG;AACH,eAAO,MAAM,GAAG,YAAmB,CAAC"}
|
package/dist/lib/git-wrapper.js
CHANGED
|
@@ -160,6 +160,34 @@ export class GitWrapper {
|
|
|
160
160
|
const status = await this.getStatus();
|
|
161
161
|
return status.length > 0;
|
|
162
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Récupère le dernié tag
|
|
165
|
+
*/
|
|
166
|
+
async getLastTag() {
|
|
167
|
+
return await this.exec("describe --tags --abrev=0");
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Récupère le dernier tag de version suivant le pattern vMAJOR.MINOR.PATCH (ex: v1.2.3)
|
|
171
|
+
*/
|
|
172
|
+
async getLastVersionTag() {
|
|
173
|
+
const output = await this.exec('tag --list "v[0-9]*.[0-9]*.[0-9]*" --sort=-v:refname');
|
|
174
|
+
const tags = output
|
|
175
|
+
.split("\n")
|
|
176
|
+
.map((t) => t.trim())
|
|
177
|
+
.filter(Boolean);
|
|
178
|
+
return tags.length > 0 ? tags[0] : "";
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Récupère l'historique des commits depuis un ref donné (tag, commit, branche)
|
|
182
|
+
* Retourne un tableau de lignes formatées "hash subject"
|
|
183
|
+
*/
|
|
184
|
+
async getLogSince(since, format = "%h %s") {
|
|
185
|
+
const output = await this.exec(`log ${since}..HEAD --format="${format}"`);
|
|
186
|
+
return output
|
|
187
|
+
.split("\n")
|
|
188
|
+
.map((l) => l.trim())
|
|
189
|
+
.filter(Boolean);
|
|
190
|
+
}
|
|
163
191
|
}
|
|
164
192
|
/**
|
|
165
193
|
* Instance par défaut du wrapper git
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-wrapper.js","sourceRoot":"","sources":["../../src/lib/git-wrapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AASlC;;GAEG;AACH,MAAM,OAAO,UAAU;IACb,OAAO,CAAiB;IAEhC,YAAY,UAA0B,EAAE;QACtC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,IAAI,CAAC,OAAe;QAChC,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,OAAO,OAAO,EAAE,EAAE;gBACnD,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG;aACtB,CAAC,CAAC;YACH,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CAAC,eAAe,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QAClB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QAC5D,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa;QACjB,OAAO,MAAM,IAA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AC,WAAW,CAAC,KAAa,EAAE,MAAM,GAAG,OAAO;QAC/C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,oBAAoB,MAAM,GAAG,CAAC,CAAC;QAC1E,OAAO,MAAM;aACV,KAAK,CAAC,IAAI,CAAC;aACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACpB,MAAM,CAAC,OAAO,CAAC,CAAC;IACrB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,UAAU,EAAE,CAAC"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Exporte les fonctionnalités principales du package
|
|
4
4
|
*/
|
|
5
5
|
export { generateCommitMessage } from "./git-commit.js";
|
|
6
|
+
export { getLastVersionTag, getCommitsSinceLastVersion, generateChangelog, updateChangelogFile, } from "./git-changelog.js";
|
|
6
7
|
export { git, GitWrapper } from "./git-wrapper.js";
|
|
7
8
|
export type { GitExecOptions } from "./git-wrapper.js";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
* Exporte les fonctionnalités principales du package
|
|
4
4
|
*/
|
|
5
5
|
export { generateCommitMessage } from "./git-commit.js";
|
|
6
|
+
export { getLastVersionTag, getCommitsSinceLastVersion, generateChangelog, updateChangelogFile, } from "./git-changelog.js";
|
|
6
7
|
export { git, GitWrapper } from "./git-wrapper.js";
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fzed51/git-tool",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "A command-line tool for Git operations with AI-powered commit message generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/lib/index.js",
|
|
7
7
|
"types": "./dist/lib/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"git-commit": "./dist/git-commit.js"
|
|
9
|
+
"git-commit": "./dist/git-commit.js",
|
|
10
|
+
"git-changelog": "./dist/git-changelog.js"
|
|
10
11
|
},
|
|
11
12
|
"exports": {
|
|
12
13
|
".": {
|
|
@@ -25,9 +26,13 @@
|
|
|
25
26
|
},
|
|
26
27
|
"scripts": {
|
|
27
28
|
"build": "tsc",
|
|
28
|
-
"postbuild": "chmod +x dist/git-commit.js",
|
|
29
|
+
"postbuild": "chmod +x dist/git-commit.js dist/git-changelog.js",
|
|
29
30
|
"prepublishOnly": "npm run build",
|
|
30
|
-
"
|
|
31
|
+
"git-commit": "tsx src/git-commit.ts",
|
|
32
|
+
"git-changelog": "tsx src/git-changelog.ts",
|
|
33
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
34
|
+
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
|
|
35
|
+
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
|
|
31
36
|
"lint": "biome check .",
|
|
32
37
|
"lint:fix": "biome check --write ."
|
|
33
38
|
},
|
|
@@ -48,13 +53,17 @@
|
|
|
48
53
|
"license": "MIT",
|
|
49
54
|
"devDependencies": {
|
|
50
55
|
"@biomejs/biome": "^2.3.14",
|
|
56
|
+
"@types/jest": "^30.0.0",
|
|
51
57
|
"@types/node": "^22.10.2",
|
|
58
|
+
"jest": "^30.2.0",
|
|
59
|
+
"ts-jest": "^29.4.6",
|
|
52
60
|
"tsx": "^4.21.0",
|
|
53
61
|
"typescript": "^5.7.2"
|
|
54
62
|
},
|
|
55
63
|
"dependencies": {
|
|
56
64
|
"@mistralai/mistralai": "^1.14.0",
|
|
57
65
|
"chalk": "^5.6.2",
|
|
66
|
+
"commander": "^14.0.3",
|
|
58
67
|
"dotenv": "^17.2.4"
|
|
59
68
|
}
|
|
60
69
|
}
|