Skip to content
Six sliders, one for each preset, TypeScript, oxlint, oxfmt, Vite, Vitest and TypeDoc, each set to a position of its own.

wtf project

Shared configs and tools for a pnpm workspace of TypeScript packages. Extend a preset instead of copying a config, and run your TypeScript from source.

Each repo of TypeScript packages needs a tsconfig, a lint config, a format config, a test config and a docs config. When you copy them from repo to repo, they drift apart, and a fix in one repo does not reach the others.

With @wtf/project, each config extends a shared preset, and states only what is different in your repo. You install only the presets that you use. An update of a preset reaches every repo that extends it.

// vitest.config.ts, at the root
import { rootConfig } from '@wtf/project-vitest/config'
export default rootConfig()
{
"extends": "@wtf/project-typescript/strict",
"compilerOptions": { "composite": true, "rootDir": "src", "outDir": "dist" },
"include": ["src"]
}

You do not build before you test. The resolve hook runs the TypeScript of the workspace straight from src, and the TypeScript, Vite and Vitest configs resolve each workspace package to its source in the same way. In CI, the same tests run on the build, with coverage mapped back to the source.

Terminal window
pnpm test # from the source, with nothing built
pnpm test:dist # from the build, as CI does

One preset for each tool

TypeScript, oxlint, oxfmt, Vite, Vitest and TypeDoc each have a package of their own. Install the ones you use, and extend them.

No build before a test

Each package of your workspace exports its TypeScript by the @wtf/source condition. The resolve hook, Vite and Vitest read it, so a test runs the source as it is.

Coverage of the build

CI tests what you publish, the build, and maps the coverage back to the source by the source maps.

Held to the standards

Run the Web Platform Tests of a standard in Vitest, at a pinned commit, with a list of the known failures of your implementation.