This merge delivers the full draft planning feature (FN-3106) — API routes for planning subtasks, the AiSessionStore backend for draft sessions, a draft planning API client, auto-creation of planning drafts from user input, and corresponding UI polish in PlanningModeModal with accessibility-focused Fusion-Task-Id: FN-3106
54 lines
2.1 KiB
TypeScript
54 lines
2.1 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
import react from "@vitejs/plugin-react";
|
|
import { resolve } from "node:path";
|
|
import { cpus } from "node:os";
|
|
|
|
// Cap fan-out to 4 so high-core dev machines don't spawn 27+ workers per
|
|
// package — that saturates the box when workspace packages test concurrently.
|
|
const defaultMaxWorkers = Math.min(4, Math.max(1, cpus().length - 1));
|
|
const requestedMaxWorkers = Number.parseInt(process.env.VITEST_MAX_WORKERS ?? String(defaultMaxWorkers), 10);
|
|
const maxWorkers = Math.max(1, Number.isFinite(requestedMaxWorkers) ? requestedMaxWorkers : defaultMaxWorkers);
|
|
process.env.VITEST_MAX_WORKERS = String(maxWorkers);
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
"@fusion/core": resolve(__dirname, "../core/src/index.ts"),
|
|
"@fusion/engine": resolve(__dirname, "../engine/src/index.ts"),
|
|
"@fusion/plugin-sdk": resolve(__dirname, "../plugin-sdk/src/index.ts"),
|
|
"@fusion/test-utils": resolve(__dirname, "../core/src/__test-utils__/workspace.ts"),
|
|
},
|
|
},
|
|
test: {
|
|
environment: "jsdom",
|
|
// Process CSS imports so jsdom-based tests that assert on getComputedStyle
|
|
// see the actual rules from co-located component CSS files.
|
|
css: { include: [/.+/] },
|
|
globals: true,
|
|
include: ["app/**/*.test.{ts,tsx}", "src/**/*.test.{ts,tsx}"],
|
|
setupFiles: [
|
|
"./src/__tests__/setup-test-isolation.ts",
|
|
resolve(__dirname, "../core/src/__test-utils__/vitest-setup.ts"),
|
|
"./vitest.setup.ts",
|
|
],
|
|
globalSetup: [resolve(__dirname, "../core/src/__test-utils__/vitest-teardown.ts")],
|
|
pool: "forks",
|
|
maxWorkers,
|
|
poolOptions: { forks: { minForks: 1, maxForks: maxWorkers } },
|
|
fileParallelism: true,
|
|
isolate: true,
|
|
// Dashboard route and integration-heavy suites can exceed the Vitest
|
|
// 5s default under workspace-concurrent runs.
|
|
testTimeout: 15_000,
|
|
hookTimeout: 15_000,
|
|
coverage: {
|
|
enabled: false,
|
|
reporter: ["text", "html", "json"],
|
|
reportsDirectory: "./coverage",
|
|
include: ["app/**/*.{ts,tsx}", "src/**/*.{ts,tsx}"],
|
|
exclude: ["**/*.test.{ts,tsx}", "**/*.d.ts", "dist/**"],
|
|
},
|
|
},
|
|
});
|