Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish VS Code Extension

on:
push:
branches:
- master
workflow_dispatch:

jobs:
# Wait for other CI workflows to complete
wait-for-ci:
name: Wait for CI to Complete
runs-on: ubuntu-latest
steps:
- name: Wait for test workflow
uses: lewagon/wait-on-check-action@v1.3.4
with:
ref: ${{ github.sha }}
check-name: 'Test'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

- name: Wait for build workflow
uses: lewagon/wait-on-check-action@v1.3.4
with:
ref: ${{ github.sha }}
check-name: 'Build'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

# Publish to VS Code Marketplace
publish:
name: Publish Extension
runs-on: ubuntu-latest
needs: wait-for-ci
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install Dependencies
run: npm ci

- name: Compile Extension
run: npm run compile

- name: Install vsce
run: npm install -g @vscode/vsce

- name: Publish to VS Code Marketplace
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: vsce publish --no-yarn
if: env.VSCE_PAT != ''

- name: Publish to Open VSX Registry
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
run: vsce publish --no-yarn --target linux-x64 --packagedExtensionPath extension.vsix
if: env.OVSX_PAT != ''
29 changes: 29 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": {
"preLaunchTask": "${defaultBuildTask}"
},
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm: compile"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"name": "vscode-test",
"args": {
"preLaunchTask": "${defaultBuildTask}"
},
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
]
}
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Nuvo Code

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
73 changes: 73 additions & 0 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# VS Code Extension Publishing Guide

## GitHub Secrets Configuration

Bu workflow'un çalışması için aşağıdaki GitHub secrets'ları ayarlamanız gerekiyor:

### 1. VS Code Marketplace (vsce) Personal Access Token

1. https://marketplace.visualstudio.com/manage adresine gidin
2. Sol menüden "Security" sekmesine tıklayın
3. "New Personal Access Token" butonuna tıklayın
4. Token'a bir isim verin (örn: `nuvo-commit-ci`)
5. "All accessible organizations" seçin
6. Oluşturulan token'ı kopyalayın
7. GitHub repository'nizde:
- Settings → Secrets and variables → Actions
- "New repository secret" butonuna tıklayın
- Name: `VSCE_PAT`
- Value: Kopyaladığınız token

### 2. Open VSX Registry Token (Opsiyonel)

Eğer Open VSX Registry'ye de publish etmek isterseniz:

1. https://open-vsx.org/user-settings/tokens adresine gidin
2. "Create New Token" butonuna tıklayın
3. Token'ı kopyalayın
4. GitHub repository'nizde:
- Settings → Secrets and variables → Actions
- "New repository secret" butonuna tıklayın
- Name: `OVSX_PAT`
- Value: Kopyaladığınız token

## Workflow Akışı

1. **Master branch'e push** yapıldığında workflow tetiklenir
2. **CI beklemesi**: Diğer test ve build workflow'larının tamamlanmasını bekler
3. **Build**: Extension derlenir ve paketlanır
4. **Publish**: VS Code Marketplace'e otomatik olarak publish edilir

## Manuel Tetikleme

Workflow'u manuel olarak da tetikleyebilirsiniz:
- GitHub repository → Actions → "Publish VS Code Extension" → "Run workflow"

## Version Yönetimi

Her publish işleminden önce `package.json` dosyasındaki `version` alanını güncellemeyi unutmayın:

```json
{
"version": "0.1.1" // Minor veya patch versiyonunu artırın
}
```

## Gerekli CI Workflow'ları

Bu workflow, aşağıdaki check'lerin tamamlanmasını bekler:
- `Test` - Test workflow'u
- `Build` - Build workflow'u

Eğer farklı isimlerde CI workflow'larınız varsa, `publish.yml` dosyasındaki `check-name` değerlerini güncelleyin.

## Troubleshooting

### Workflow CI'yi bekliyor ama CI yoksa
- Eğer henüz CI workflow'ları oluşturmadıysanız, `wait-for-ci` job'unu kaldırabilirsiniz
- Veya check-name değerlerini mevcut workflow'larınıza göre güncelleyin

### Publish hatası alıyorsanız
- VSCE_PAT secret'ının doğru ayarlandığından emin olun
- Token'ın süresinin dolmadığını kontrol edin
- Publisher adının (`nuvocode`) marketplace'te kayıtlı olduğunu doğrulayın
172 changes: 172 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# 🧪 Nuvo Commit Test Rehberi

## ✅ Unit Testler (CI'da çalışıyor)

```bash
# Tüm unit testler
npm run test:unit

# Coverage raporu ile
npm run test:coverage

# Tek bir test dosyası
npx jest src/utils/sanitize.test.ts
```

## 🚀 Extension Manuel Testi

### Yöntem 1: Debug Mode (Önerilen)

1. **F5** tuşuna bas veya "Run and Debug" → "Run Extension"
2. Yeni bir VS Code penceresi açılacak
3. Test edilecek repo'da çalış:
```bash
git add .
```
4. **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`)
5. `Nuvo Commit: Generate Commit Message` yaz ve Enter
6. Commit mesajı oluşturulacak

### Yöntem 2: VSIX Package

```bash
# 1. Package oluştur
npm install -g @vscode/vsce
vsce package

# 2. VS Code'da yükle
# - Extensions panelini aç (Cmd+Shift+X)
# - ⋯ menüsünden "Install from VSIX"
# - nuvo-commit-0.1.0.vsix dosyasını seç
```

### Yöntem 3: Extension Development Host

```bash
# Terminal'de
code --extensionDevelopmentPath=/Users/ozerozdas/Dev/companies/nuvocode/infra/nuvo-commit
```

## 📋 Test Senaryoları

### 1. Temel Commit Mesajı
```bash
# Test repo oluştur
mkdir test-repo && cd test-repo
git init
echo "console.log('hello')" > index.js
git add index.js

# Extension'ı çalıştır
# Beklenen: "chore: add index.js" veya benzeri
```

### 2. Farklı Değişiklik Tipleri
```bash
# Yeni dosya
echo "new file" > new.txt
git add new.txt

# Değişiklik
echo "modified" >> existing.txt
git add existing.txt

# Silme
git rm old.txt
```

### 3. Ollama Entegrasyonu
```bash
# Ollama'nın çalıştığından emin ol
ollama serve

# Model yüklü mü kontrol et
ollama list | grep qwen3

# Değilse yükle
ollama pull qwen3:4b
```

### 4. Ayarlar Testi
VS Code Settings (`Cmd+,`):
```json
{
"nuvoCommit.provider": "ollama",
"nuvoCommit.model": "qwen3:4b",
"nuvoCommit.ollamaEndpoint": "http://localhost:11434/api/generate",
"nuvoCommit.maxDiffChars": 12000,
"nuvoCommit.autoCommit": false
}
```

## 🐛 Hata Ayıklama

### Extension Logları
```bash
# VS Code Output panelini aç
# "Extension Host" seç
```

### Ollama Hataları
- Ollama çalışıyor mu? `ollama list`
- Endpoint doğru mu? Varsayılan: `http://localhost:11434/api/generate`
- Model yüklü mü? `ollama pull qwen3:4b`

### Common Issues

**"Cannot reach Ollama"**
```bash
# Ollama'yı başlat
ollama serve

# Port dinleniyor mu?
lsof -i :11434
```

**"No staged changes"**
```bash
# Değişiklikleri stage et
git add .
```

**Extension görünmüyor**
```bash
# VS Code'u yeniden başlat
# Developer: Reload Window (Cmd+Shift+P)
```

## 🔍 Integration Test (Otomatik)

```bash
# VS Code instance'ında çalıştır
npm test

# Not: X server gerektirir, macOS'ta sorun olabilir
# CI'da xvfb ile çalışır
```

## 📊 Coverage Raporu

```bash
npm run test:coverage

# coverage/lcov-report/index.html dosyasını aç
open coverage/lcov-report/index.html
```

## 🎯 Hızlı Test Checklist

- [ ] Unit testler geçiyor (`npm run test:unit`)
- [ ] Extension F5 ile açılıyor
- [ ] Command Palette'de komut görünüyor
- [ ] Staged değişikliklerle commit mesajı üretiliyor
- [ ] Ollama yanıt veriyor
- [ ] Ayarlar çalışıyor
- [ ] Hata durumlarında kullanıcı bilgilendiriliyor

## 💡 İpuçları

1. **Geliştirme sırasında**: F5 ile debug mode kullan
2. **Paylaşım öncesi**: `vsce package` ile .vsix oluştur
3. **CI/CD**: GitHub Actions otomatik test yapıyor
4. **Hata ayıklama**: Output panelinde "Extension Host" loglarını kontrol et
Binary file added images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading