Development
Scripts, test layout, and contribution guidelines for VernLLM
pnpm install
pnpm run build # tsdown → dist (ESM + CJS + types)
pnpm run typecheck # tsc --noEmit on src, since tsdown doesn't fully type-check
pnpm run typecheck:test # tsc --noEmit on src + test (separate tsconfig, no rootDir conflict)
pnpm run test # vitest run (unit + integration)
pnpm run test:unit # vitest run --project unit
pnpm run test:unit:coverage # vitest run --project unit --coverage
pnpm run test:int # vitest run --project integration
pnpm run test:int:coverage # vitest run --project integration --coverage
pnpm run test:watch # vitest, watch mode
pnpm run test:coverage # vitest run --coverage (v8 provider, unit + integration combined)
pnpm run lint # oxlint
pnpm run format # oxfmt
pnpm run changeset # record a change for the next releaseTest layout
Tests live under tests/unit/ and tests/integration/. No real API calls are made anywhere in the suite; everything runs against fakes and mocks.
tests/unit/
| File | Covers |
|---|---|
vernLLM.call, vernLLM.schema | Retry, backoff, timeout, abort, schema, model override, usage |
circuitBreaker | Breaker as a standalone unit, including isolateByModel |
cachedCall | Caching, usage reservation/refund |
logger | Injectable logger |
vernLLM.history | Multi-turn history validation |
vernLLM.utils | Internal helpers |
index.exports | Public export surface |
adapters/* | Each provider's request/response translation against a fake client |
tests/integration/
| File | Covers |
|---|---|
vernLLM, vernLLM.history, cachedCall | Workflow-level behavior |
adapters/* | Workflow-level behavior per provider |
CI
Every PR runs through several workflows in .github/workflows/:
| Workflow | Checks |
|---|---|
lint.yml | oxlint across the workspace |
typecheck.yml | tsc --noEmit on src and on tests separately |
test-unit.yml | tests/unit/*, uploads coverage to Codecov under the unit flag |
test-integration.yml | tests/integration/*, uploads coverage to Codecov under the integration flag |
build-checks.yml | peer dependency check, tsdown build, bundle size limit, smoke test on the built output |
changeset.yml | fails if a PR touching packages/vern-llm has no changeset |
docs-build.yml | lint, typecheck, and build the docs site. It only runs when apps/docs/** or the lockfile changes |
codeql.yml | static analysis, runs on PRs, pushes to main, and a weekly schedule |
Codecov merges the unit and integration coverage flags into one view, scoped to packages/vern-llm/** via codecov.yml at the repo root. It enforces two checks: codecov/patch requires at least 80% coverage on changed lines, and codecov/project fails if overall coverage regresses by more than 0.5%.
Two more workflows run outside the PR flow:
version-packages.ymlopens or updates a "Version Packages" PR on every push tomainthat touches release-relevant files, usingchangesets/action.version.ymlruns when that PR is merged: it cuts a GitHub Release and triggerspublish.ymlto publish to npm and deploy the docs site.
See Contributing for the pre-PR checklist with local-equivalent commands for each of these.
Contributing
See Contributing for the full guide: forking, branch setup, test expectations, and the pre-PR checklist.