dsh-brain/vendor/dsh-mnemon/vitest.config.ts

61 lines
6.0 KiB
TypeScript

import { configDefaults, defineConfig } from 'vitest/config'
import { fileURLToPath } from 'node:url'
import { clientCssPlugin } from './tsdown.config.ts'
export default defineConfig({
// Compile the real class maps; JSDOM does not implement the browser CSS layout engine.
plugins: [{ ...clientCssPlugin(false), enforce: 'pre' } as never],
resolve: {
alias: Object.entries({
'dsh-brain-mnemon/client': fileURLToPath(new URL('./src/client/extension-sdk.ts', import.meta.url)),
'dsh-brain-mnemon-source-runtime/client': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-runtime/src/client.ts', import.meta.url)),
'dsh-brain-mnemon-source-documents/client': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-documents/src/client.ts', import.meta.url)),
'dsh-brain-mnemon-source-memory-spaces/client': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-memory-spaces/src/client.ts', import.meta.url)),
'dsh-brain-mnemon-source-memory-spaces/testing': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-memory-spaces/src/testing.ts', import.meta.url)),
'dsh-brain-mnemon-source-memory-spaces/native-cli': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-memory-spaces/src/native-cli.ts', import.meta.url)),
'dsh-brain-mnemon-source-memory-spaces/space-identity': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-memory-spaces/src/space-identity.ts', import.meta.url)),
'dsh-brain-mnemon-source-memory-spaces/provider-sdk': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-memory-spaces/src/provider-sdk.ts', import.meta.url)),
'dsh-brain-mnemon/extension-sdk': fileURLToPath(new URL('./src/sdk/index.ts', import.meta.url)),
'dsh-brain-mnemon/contracts': fileURLToPath(new URL('./src/core/contracts/index.ts', import.meta.url)),
'dsh-brain-mnemon/testing': fileURLToPath(new URL('./src/sdk/testing.ts', import.meta.url)),
'dsh-brain-mnemon-source-runtime/contracts': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-runtime/src/contracts.ts', import.meta.url)),
'dsh-brain-mnemon-source-documents/contracts': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-documents/src/contracts.ts', import.meta.url)),
'dsh-brain-mnemon-source-memory-spaces/contracts': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-memory-spaces/src/contracts.ts', import.meta.url)),
'dsh-brain-mnemon-source-runtime': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-runtime/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-source-documents': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-documents/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-source-skills/client': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-skills/src/client.ts', import.meta.url)),
'dsh-brain-mnemon-source-skills/contracts': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-skills/src/contracts.ts', import.meta.url)),
'dsh-brain-mnemon-source-skills': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-skills/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-source-memory-spaces': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-source-memory-spaces/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-strategy-default-three-tier/extension-sdk': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-strategy-default-three-tier/src/extension-sdk.ts', import.meta.url)),
'dsh-brain-mnemon-strategy-scoped': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-strategy-scoped/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-strategy-light-context': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-strategy-light-context/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-strategy-auto-capture': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-strategy-auto-capture/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-strategy-default-three-tier': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-strategy-default-three-tier/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-strategy-general': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-strategy-general/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-provider-mnemon-native': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-provider-mnemon-native/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-provider-openviking': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-provider-openviking/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-provider-honcho': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-provider-honcho/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-provider-mem0': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-provider-mem0/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-provider-hindsight': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-provider-hindsight/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-provider-holographic': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-provider-holographic/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-provider-retaindb': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-provider-retaindb/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-provider-byterover': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-provider-byterover/src/index.ts', import.meta.url)),
'dsh-brain-mnemon-provider-supermemory': fileURLToPath(new URL('./plugins/dsh-brain-mnemon-provider-supermemory/src/index.ts', import.meta.url)),
}).map(([name, replacement]) => ({ find: new RegExp('^' + name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '$'), replacement })),
// Keep UI packages on Mnemon's React instance just as the browser bundle does.
dedupe: ['react', 'react-dom'],
},
test: {
environment: 'node',
// These tests must execute outside the workspace, against packed artifacts.
exclude: [...configDefaults.exclude, 'scripts/fixtures/**'],
coverage: { enabled: false },
server: {
deps: {
inline: ['@deepseek-ai/dsh-client-ui-primitives'],
},
},
},
})