mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
Adds a full dev-server preview system including: - Backend proxy/upgrade handler for dev server traffic - File-serving backend route with CSP headers - DevServerPreviewButton and HtmlArtifactPanel components - HTML artifact detection and preview in messages - File preview improvements with mobile support - Shared types and settings schema for dev server config - Comprehensive test coverage for all new code
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import { defineConfig } from 'vitest/config'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
{
|
|
name: 'markdown-as-text',
|
|
enforce: 'pre',
|
|
transform(code: string, id: string) {
|
|
if (id.endsWith('.md')) {
|
|
return { code: `export default ${JSON.stringify(code)};`, map: null }
|
|
}
|
|
return null
|
|
},
|
|
},
|
|
],
|
|
test: {
|
|
globals: true,
|
|
environment: 'node',
|
|
setupFiles: ['./test/setup.ts'],
|
|
include: ['test/**/*.{test,spec}.{ts,tsx}', 'src/**/*.test.ts'],
|
|
exclude: [
|
|
'**/node_modules/**',
|
|
'**/dist/**',
|
|
'test/services/assistant-mode.test.ts',
|
|
'test/services/internal-token.test.ts',
|
|
'test/auth/internal-token-middleware.test.ts',
|
|
'test/routes/internal-schedules.test.ts',
|
|
'test/routes/internal-notifications.test.ts',
|
|
'test/routes/internal-settings.test.ts',
|
|
'test/routes/internal-repos.test.ts',
|
|
'src/db/model-state.test.ts',
|
|
'src/routes/providers.test.ts',
|
|
'src/routes/repos.test.ts',
|
|
],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'html'],
|
|
},
|
|
env: {
|
|
NODE_ENV: 'test',
|
|
PORT: '3001',
|
|
DATABASE_PATH: ':memory:',
|
|
AUTH_SECRET: 'test-secret-for-encryption',
|
|
WORKSPACE_PATH: '/tmp/test-workspace',
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'bun:sqlite': path.resolve(__dirname, './test/mocks/bun-sqlite.ts'),
|
|
},
|
|
},
|
|
})
|