diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ee727abf..f499d5c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,6 +49,16 @@ jobs: - name: Build package run: npm run build + - name: Verify CLI via npm exec + run: | + package_archive=$(npm pack | tail -n 1) + temp_dir=$(mktemp -d) + cd "$temp_dir" + output=$(npm exec --yes --package "${GITHUB_WORKSPACE}/${package_archive}" code-ollama -- --help) + printf '%s\n' "$output" + grep -F "code-ollama" <<< "$output" + grep -F "run " <<< "$output" + - name: Setup Ollama uses: ai-action/setup-ollama@v2 diff --git a/vite.config.mts b/vite.config.mts index 15ecd0e9..47505985 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -5,23 +5,19 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ build: { target: 'node24', - lib: { - entry: 'src/cli.ts', - formats: ['es'], - fileName: 'cli', - }, + ssr: 'src/cli.ts', rolldownOptions: { + output: { + entryFileNames: 'cli.js', + }, external: [ - '@inkjs/ui', 'cac', - 'ink', 'node:child_process', 'node:fs', 'node:os', 'node:path', 'node:util', 'ollama', - 'react', ], }, },