Compare commits
8 Commits
1.1.1
..
f63b6770d2
| Author | SHA1 | Date | |
|---|---|---|---|
| f63b6770d2 | |||
| a90ab0eca3 | |||
| 1bdd31ae0c | |||
| 0697e279ca | |||
| 718cdf87c9 | |||
| bab40a8304 | |||
| 102861ccfa | |||
| 76aa5b0444 |
@@ -1,6 +1,8 @@
|
|||||||
# Zemit
|
# Zemit
|
||||||
|
|
||||||
Génère des messages de commit dans VSCode à partir du diff en cours, via un modèle d'IA.
|
Génère des messages de commit, via un modèle d'IA, directement dans VSCode.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Ce que ça fait
|
## Ce que ça fait
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 216 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 11 KiB |
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "zemit",
|
"name": "zemit",
|
||||||
"version": "1.1.1",
|
"version": "1.1.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "zemit",
|
"name": "zemit",
|
||||||
"version": "1.1.1",
|
"version": "1.1.3",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^18.0.0",
|
"@types/node": "^18.0.0",
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "zemit",
|
"name": "zemit",
|
||||||
"version": "1.1.1",
|
"version": "1.1.3",
|
||||||
"displayName": "Zemit",
|
"displayName": "Zemit",
|
||||||
"description": "Génère des messages de commit dans VSCode à partir du diff en cours, via un modèle d'IA.",
|
"description": "Génère des messages de commit, via un modèle d'IA, directement dans VSCode.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.hyko.cx/hykocx/zemit"
|
"url": "https://git.hyko.cx/hykocx/zemit"
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "esbuild src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --platform=node --target=node18",
|
"build": "esbuild src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --platform=node --target=node18",
|
||||||
"watch": "esbuild src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --platform=node --target=node18 --watch",
|
"watch": "esbuild src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --platform=node --target=node18 --watch",
|
||||||
"package": "npm run build && vsce package"
|
"package": "npm run build && vsce package --baseContentUrl https://git.hyko.cx/hykocx/zemit/raw/branch/main --baseImagesUrl https://git.hyko.cx/hykocx/zemit/raw/branch/main"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^18.0.0",
|
"@types/node": "^18.0.0",
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
export const SYSTEM_PROMPT =
|
||||||
|
"You are a git commit message generator. Output only the commit message — no explanation, no preamble, no backticks, no quotes. All messages must be written in English."
|
||||||
|
|
||||||
|
export const CONVENTIONAL_INSTRUCTION = `Based on the provided git diff, generate a concise and descriptive commit message following the Conventional Commits format:
|
||||||
|
|
||||||
|
<type>(<scope>): <short description>
|
||||||
|
|
||||||
|
Types: feat, fix, refactor, style, docs, test, chore, perf, revert
|
||||||
|
- feat: new feature
|
||||||
|
- fix: bug fix
|
||||||
|
- refactor: code restructuring without behavior change
|
||||||
|
- style: formatting only (spaces, commas, no logic change)
|
||||||
|
- docs: documentation only
|
||||||
|
- test: add or update tests
|
||||||
|
- chore: maintenance, dependencies, build config
|
||||||
|
- perf: performance improvement
|
||||||
|
- revert: revert a previous commit (format: revert: revert "<original message>")
|
||||||
|
|
||||||
|
Rules:
|
||||||
|
- Scope is optional, specifies the affected area (e.g. auth, api, storage, ui, config)
|
||||||
|
- Description: lowercase, no trailing period, in English
|
||||||
|
- One commit = one intention, do not mix fix and refactor
|
||||||
|
- For breaking changes, add ! after the type and a BREAKING CHANGE: footer
|
||||||
|
- Only include a body if there are multiple distinct changes to explain; for a single focused change, output the title only`
|
||||||
|
|
||||||
|
export const SIMPLE_INSTRUCTION = `Based on the provided git diff, generate a short and clear one-line commit message (50-72 characters).`
|
||||||
+1
-13
@@ -1,17 +1,5 @@
|
|||||||
import * as vscode from "vscode"
|
import * as vscode from "vscode"
|
||||||
|
import { SYSTEM_PROMPT, CONVENTIONAL_INSTRUCTION, SIMPLE_INSTRUCTION } from "./prompts"
|
||||||
const SYSTEM_PROMPT =
|
|
||||||
"You are a helpful assistant that generates informative git commit messages based on git diffs output. Skip preamble and remove all backticks surrounding the commit message."
|
|
||||||
|
|
||||||
const CONVENTIONAL_INSTRUCTION = `Based on the provided git diff, generate a concise and descriptive commit message.
|
|
||||||
|
|
||||||
The commit message should:
|
|
||||||
1. Have a short title (50-72 characters)
|
|
||||||
2. Follow the Conventional Commits format (feat:, fix:, chore:, docs:, refactor:, test:, style:, etc.)
|
|
||||||
3. Be clear and informative
|
|
||||||
4. Only include a body description if there are multiple distinct changes to explain, if the diff represents a single focused change, output the title only`
|
|
||||||
|
|
||||||
const SIMPLE_INSTRUCTION = `Based on the provided git diff, generate a short and clear one-line commit message (50-72 characters).`
|
|
||||||
|
|
||||||
export interface AIProvider {
|
export interface AIProvider {
|
||||||
generateCommitMessage(diff: string, style: string, signal: AbortSignal): AsyncIterable<string>
|
generateCommitMessage(diff: string, style: string, signal: AbortSignal): AsyncIterable<string>
|
||||||
|
|||||||
Reference in New Issue
Block a user