CodeVetter · Repo Unpack · System map
vitest-dev/vitest
The system has a Node coordinator, interchangeable execution workers, browser infrastructure, and an optional Vue interface. Configuration resolution precedes server attachment and test scheduling. Persistent state is held in filesystem artifacts and caches, while active task state belongs to coordinator and client state managers. Distribution consists of built package entrypoints plus a separately built documentation site.
- The executable vitest.mjs loads dist/cli.js; its source entrypoint calls createCLI().parse(), while package exports separately expose built public APIs.
- createVitest constructs Logger, VitestPackageInstaller, PluginHarness, and Vitest around resolveConfig; setup failures close the instance before rethrowing.
- resolveConfig installs capture, test-config, core, and browser-loader plugins into Vite resolution, then resolves Vitest configuration and project entries.
- Vitest._start attaches root and project servers; _setRootConfig owns StateManager, VitestCache, SnapshotManager, tracing, resolver, and transform-service instances.
- Pool worker selection supports forks, threads, VM variants, TypeScript checking, and a custom poolRunner; fork workers launch child processes with advanced IPC serialization.
- Browser support contributes configuration, plugins, parent creation, and RPC to a core-created Vite server; Playwright and preview providers have separate package entrypoints.
- The Vue UI mounts through client/main.ts and chooses a live WebSocket client or static report client; live transport uses birpc and flatted serialization.
- Root scripts provide recursive package builds, linting, typechecking, and split test suites; VitePress builds documentation, and Netlify publishes docs/.vitepress/dist using pnpm ci:docs.