Skip to content

Commit 8de7581

Browse files
Merge pull request #4 from ai-action/fix/vite
2 parents 5eaad8f + 672331f commit 8de7581

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ jobs:
4949
- name: Build package
5050
run: npm run build
5151

52+
- name: Verify CLI via npm exec
53+
run: |
54+
package_archive=$(npm pack | tail -n 1)
55+
temp_dir=$(mktemp -d)
56+
cd "$temp_dir"
57+
output=$(npm exec --yes --package "${GITHUB_WORKSPACE}/${package_archive}" code-ollama -- --help)
58+
printf '%s\n' "$output"
59+
grep -F "code-ollama" <<< "$output"
60+
grep -F "run <model> <prompt>" <<< "$output"
61+
5262
- name: Setup Ollama
5363
uses: ai-action/setup-ollama@v2
5464

vite.config.mts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,19 @@ import { defineConfig } from 'vitest/config';
55
export default defineConfig({
66
build: {
77
target: 'node24',
8-
lib: {
9-
entry: 'src/cli.ts',
10-
formats: ['es'],
11-
fileName: 'cli',
12-
},
8+
ssr: 'src/cli.ts',
139
rolldownOptions: {
10+
output: {
11+
entryFileNames: 'cli.js',
12+
},
1413
external: [
15-
'@inkjs/ui',
1614
'cac',
17-
'ink',
1815
'node:child_process',
1916
'node:fs',
2017
'node:os',
2118
'node:path',
2219
'node:util',
2320
'ollama',
24-
'react',
2521
],
2622
},
2723
},

0 commit comments

Comments
 (0)