supermemory/packages/memory-graph/vite.config.ts
Vorflux AI e7676763a9 Add comprehensive unit tests for memory-graph package
79 tests across 6 test files covering:
- SpatialIndex: grid rebuild, queryPoint hit-testing, boundary cells, hash detection
- ViewportState: worldToScreen/screenToWorld roundtrip, pan, zoomImmediate,
  zoomTo animation, fitToNodes, centerOn, inertia decay
- ForceSimulation: init/destroy lifecycle, update hot-swap, reheat/coolDown
- VersionChainIndex: chain building via parentMemoryId, caching, rebuild
- Graph data utils: normalizeDocCoordinates, getMemoryBorderColor,
  getEdgeVisualProps, screenToBackendCoords, calculateBackendViewport
- Mock data: deterministic seeded output, correct counts, valid edge references

Also exports pure utility functions from use-graph-data.ts for testability.
2026-03-27 00:06:21 +00:00

36 lines
712 B
TypeScript

import { defineConfig } from "vitest/config"
import react from "@vitejs/plugin-react"
import { resolve } from "node:path"
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": resolve(__dirname, "./src"),
},
},
test: {
include: ["src/**/*.test.ts"],
environment: "node",
},
build: {
lib: {
entry: {
"memory-graph": resolve(__dirname, "src/index.tsx"),
"mock-data": resolve(__dirname, "src/mock-data.ts"),
},
formats: ["es", "cjs"],
},
rollupOptions: {
external: ["react", "react-dom", "react/jsx-runtime"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
},
sourcemap: true,
minify: false,
},
})