Verify the build
Run lint, types, tests, and a build in one shot.
LocalLens ships one composite script that runs every check the project cares about:
bun run checkWhat it actually runs
bun run check chains four steps. Each one is also exposed on its
own:
| Step | Command | What it checks |
|---|---|---|
| Lint + format | bun run lint (biome check .) | Style and obvious bugs across the repo. Configured in biome.json. |
| Types | bun run typecheck (tsc --noEmit) | TypeScript strict mode against src/** and tests/**. |
| Tests | bun run test | Bun tests in tests/ — currently chunker.test.ts and prompt.test.ts. |
| Build | bun run build | bun build src/server.ts --target=bun --outdir=dist. Smoke-tests that nothing breaks the bundler. |
If any step fails, the whole script exits non-zero. CI runs the same script.
Tests in particular
There are only two test files. They cover the parts most likely to regress quietly:
tests/chunker.test.ts— verifies thatchunkDocumentproduces overlapping chunks with stable source metadata and rejects invalid chunk settings.tests/prompt.test.ts— verifies thatbuildGroundedHistoryincludes source context and the no-context fallback, that the system prompt enforces source-grounding, and that the bracket citation format is in place.
When you change anything in src/rag.ts or src/files.ts, those
tests are your first line of defence.
Format on the way
bun run formatRuns Biome with --write. Handy as a pre-commit step.