Skip to content

Commit 54cc336

Browse files
authored
Add custom gemini baseurl support (zilliztech#183)
* Add Gemini API basic URL configuration, optimize CI workflow to support multiple operating systems, update dependencies and fix cleanup scripts * Optimize build performance, add Windows specific settings and troubleshooting documentation, update configurations to support incremental builds and caching * Optimize CI workflow to support cross platform build output validation, update documentation to include validation commands for Windows and Unix
1 parent 5df059a commit 54cc336

File tree

25 files changed

+429
-60
lines changed

25 files changed

+429
-60
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ OPENAI_API_KEY=your-openai-api-key-here
4444
# Google Gemini API key
4545
# GEMINI_API_KEY=your-gemini-api-key-here
4646

47+
# Gemini API base URL (optional, for custom endpoints)
48+
# GEMINI_BASE_URL=https://generativelanguage.googleapis.com/v1beta
49+
4750
# =============================================================================
4851
# Ollama Configuration
4952
# =============================================================================

.github/workflows/ci.yml

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,61 @@ name: CI
22

33
on:
44
push:
5-
branches: [ master, main, claude_context ]
5+
branches: [master, main, claude_context]
66
pull_request:
7-
branches: [ master, main, claude_context ]
7+
branches: [master, main, claude_context]
88

99
jobs:
1010
lint_and_build:
11-
runs-on: ubuntu-latest
12-
11+
runs-on: ${{ matrix.os }}
12+
1313
strategy:
1414
matrix:
15+
os: [ubuntu-latest, windows-latest]
1516
node-version: [20.x, 22.x]
16-
17+
1718
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v4
20-
21-
- name: Install pnpm
22-
uses: pnpm/action-setup@v4
23-
with:
24-
version: 10
25-
26-
- name: Setup Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v4
28-
with:
29-
node-version: ${{ matrix.node-version }}
30-
cache: 'pnpm'
31-
32-
- name: Install dependencies
33-
run: pnpm install --frozen-lockfile
34-
35-
# - name: Lint code
36-
# run: pnpm lint
37-
38-
- name: Build packages
39-
run: pnpm build
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 10
26+
27+
- name: Setup Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
cache: "pnpm"
32+
33+
- name: Configure Windows line endings
34+
if: matrix.os == 'windows-latest'
35+
run: git config --global core.autocrlf false
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
40+
# - name: Lint code
41+
# run: pnpm lint
42+
43+
- name: Build packages
44+
run: pnpm build
45+
46+
- name: Test clean command (Windows validation)
47+
if: matrix.os == 'windows-latest'
48+
run: |
49+
pnpm clean
50+
echo "Clean command executed successfully on Windows"
51+
52+
- name: Verify build outputs (Unix)
53+
if: matrix.os != 'windows-latest'
54+
run: |
55+
ls -la packages/core/dist || echo "packages/core/dist not found"
56+
ls -la packages/mcp/dist || echo "packages/mcp/dist not found"
4057
58+
- name: Verify build outputs (Windows)
59+
if: matrix.os == 'windows-latest'
60+
run: |
61+
Get-ChildItem packages/core/dist -ErrorAction SilentlyContinue | Format-Table -AutoSize || Write-Host "packages/core/dist not found"
62+
Get-ChildItem packages/mcp/dist -ErrorAction SilentlyContinue | Format-Table -AutoSize || Write-Host "packages/mcp/dist not found"

.npmrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Enable shell emulator for cross-platform script execution
2+
shell-emulator=true
3+
4+
# Ignore workspace root check warning (already configured in package.json)
5+
ignore-workspace-root-check=true
6+
7+
# Build performance optimizations
8+
prefer-frozen-lockfile=true
9+
auto-install-peers=true
10+
dedupe-peer-dependents=true
11+
12+
# Enhanced caching
13+
store-dir=~/.pnpm-store
14+
cache-dir=~/.pnpm-cache
15+
16+
# Parallel execution optimization
17+
child-concurrency=4

CONTRIBUTING.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,44 @@ Thank you for your interest in contributing to Claude Context! This guide will h
1313
### Development Setup
1414

1515
1. **Fork and Clone**
16+
1617
```bash
1718
git clone https://github.com/your-username/claude-context.git
1819
cd claude-context
1920
```
2021

21-
2. **Install Dependencies**
22+
2. **Platform-Specific Setup**
23+
24+
**Windows Users:**
25+
26+
```powershell
27+
# Configure git line endings (recommended)
28+
git config core.autocrlf false
29+
30+
# Ensure pnpm is installed
31+
npm install -g pnpm
32+
```
33+
34+
**Linux/macOS Users:**
35+
36+
```bash
37+
# Standard setup - no additional configuration needed
38+
```
39+
40+
3. **Install Dependencies**
41+
2242
```bash
2343
pnpm install
2444
```
2545

26-
3. **Build All Packages**
46+
4. **Build All Packages**
47+
2748
```bash
2849
pnpm build
2950
```
3051

31-
4. **Start Development Mode**
52+
5. **Start Development Mode**
53+
3254
```bash
3355
pnpm dev
3456
```
@@ -71,6 +93,7 @@ pnpm dev
7193
### Package-Specific Development
7294

7395
For detailed development instructions for each package, see:
96+
7497
- [Core Package Development](packages/core/CONTRIBUTING.md)
7598
- [VSCode Extension Development](packages/vscode-extension/CONTRIBUTING.md)
7699
- [MCP Server Development](packages/mcp/CONTRIBUTING.md)
@@ -97,6 +120,7 @@ refactor(mcp): improve error handling
97120
### Pull Request Process
98121

99122
1. **Create Feature Branch**
123+
100124
```bash
101125
git checkout -b feature/your-feature-name
102126
```
@@ -106,17 +130,20 @@ refactor(mcp): improve error handling
106130
- Update documentation if needed
107131

108132
3. **Build and Verify**
133+
109134
```bash
110135
pnpm build
111136
```
112137

113138
4. **Commit Your Changes**
139+
114140
```bash
115141
git add .
116142
git commit -m "feat(core): add your feature description"
117143
```
118144

119145
5. **Push and Create PR**
146+
120147
```bash
121148
git push origin feature/your-feature-name
122149
```

0 commit comments

Comments
 (0)