-
Notifications
You must be signed in to change notification settings - Fork 0
Tamp Vite
Wrapper for Vite 5 AND Vitest 1 — co-located in one package because Vitest's major tracks Vite's. Per ADR 0002 the .V{Major} pin tracks the headline tool (Vite); Vitest gets a parallel facade.
using Tamp.Vite.V5; // pulls in both Vite and Vitest classesFull reference: https://github.com/tamp-build/tamp-vite.
Vite.Dev(tool, s => …) // vite dev — long-running, foreground only
Vite.BuildProject(tool, s => …) // vite build — the canonical CI verb
Vite.Preview(tool, s => …) // vite preview — smoke the dist locally
Vite.OptimizeDeps(tool, s => …) // vite optimize --force
Vite.Raw(tool, …) // escape hatchCommon flags (all verbs): --config, --mode, --base, --logLevel, --clearScreen / --no-clearScreen, --force, --debug [category], --filter.
Vitest.Run(tool, s => …) // vitest run — the canonical CI invocation
Vitest.Watch(tool, s => …) // vitest watch — interactive
Vitest.Related(tool, s => s.AddFile("src/auth.ts")) // run tests related to changed files
Vitest.Bench(tool, s => …)
Vitest.Typecheck(tool, s => …)
Vitest.Raw(tool, …)Common flags (all verbs): --config, --root, --dir, --mode, --silent, --bail, --pool, --reporter (repeatable), --outputFile, --passWithNoTests, --logHeapUsage, --coverage, --coverage.provider, --coverage.reporter (repeatable), --coverage.reportsDirectory.
Note: there is no Vitest.List. Vitest 1.x doesn't have a list subcommand — that's 2+. If you build against a 2.x runtime you can call Vitest.Raw(tool, "list") until a .V2 sibling package ships.
[NuGetPackage("vite", UseSystemPath = true)]
readonly Tool ViteTool = null!;
[NuGetPackage("vitest", UseSystemPath = true)]
readonly Tool VitestTool = null!;
Target Build => _ => _.Executes(() =>
Vite.BuildProject(ViteTool, s => s
.SetMode("production")
.SetOutDir("dist")
.SetEmptyOutDir(true)
.SetSourcemap("hidden")
.SetWorkingDirectory(RootDirectory / "frontend")));
Target Test => _ => _.Executes(() =>
Vitest.Run(VitestTool, s => s
.SetCoverage()
.SetCoverageProvider("v8")
.AddCoverageReporter("text")
.AddCoverageReporter("lcov")
.AddReporter("default")
.AddReporter("junit")
.SetOutputFile("junit=./TestResults/junit.xml")
.SetWorkingDirectory(RootDirectory / "frontend")));- Module Catalog
- Tamp.Turbo — Vite + Vitest plug into Turbo's task graph for monorepo builds
- Satellite repo: https://github.com/tamp-build/tamp-vite
The example(s) above use the fluent Set*-chain shape. Every wrapper verb on this page also accepts a new XxxSettings { ... } object-init form. Both produce identical CommandPlans; the fluent shape stays canonical in docs and the tamp init template. See Build Script Authoring → Two authoring styles for the side-by-side comparison.
Start here
Modules
- Module Catalog (canonical list, 50+ satellites)
- .NET toolchain
- Containers
- JS toolchain
- Supply-chain security
Analyzers
Tooling
Execution
CI integration
Editor integration
Migration
Reference
Project