Skip to content

Commit af65acf

Browse files
committed
docs: update AGENTS.MD for the bun and biome toolchain
1 parent e1b8418 commit af65acf

1 file changed

Lines changed: 27 additions & 14 deletions

File tree

AGENTS.MD

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,25 @@ OpenCode plugin for Google Antigravity OAuth. Intercepts `fetch()` calls to `gen
1212
bun install # Install dependencies
1313
bun run build # Compile (tsc -p tsconfig.build.json)
1414
bun run typecheck # Type-check only (tsc --noEmit)
15-
bun run test # Run all tests (vitest run)
16-
bunx vitest run src/plugin/auth.test.ts # Single test file
17-
bunx vitest run -t "test name here" # Single test by name
18-
bunx vitest --watch src/plugin/auth.test.ts # Watch mode, single file
19-
bun run --cwd packages/opencode test:coverage # Coverage report
20-
bun run --cwd packages/opencode test:e2e:models # E2E: model availability check
21-
bun run --cwd packages/opencode test:e2e:regression # E2E: regression suite
15+
bun run test # Run all unit tests (bun test --isolate across packages)
16+
bun test --isolate src/plugin/auth.test.ts # Single test file
17+
bun test --isolate -t "test name here" # Single test by name (uses bun:test's -t filter)
18+
bun test --isolate --watch src/plugin/auth.test.ts # Watch mode, single file
19+
bun run test:e2e # Deterministic e2e flows (mock Antigravity server, no network)
20+
bun run test:e2e:models # Live Antigravity model inventory (CI-gated, network)
21+
bun run test:e2e:regression # Cross-model + Gemini CLI regression (network)
22+
bun run --cwd packages/opencode smoke:tui # Pack-and-install smoke test for the TUI subpath
2223
```
2324

24-
No linter or formatter is configured. Style is enforced by convention (see below).
25+
Format and lint via Biome:
26+
27+
```bash
28+
bun run format # biome format --write .
29+
bun run format:check # biome format . (CI gate)
30+
bun run lint # biome lint . (CI gate)
31+
```
32+
33+
Pre-commit hooks (`.lefthook.yml`) run Biome on changed `*.{ts,tsx,js,mjs,json,jsonc,yml,yaml}` files via `bunx biome check --staged --no-errors-on-unmatched`. The repo pins the toolchain in `mise.toml` (`bun = "1.3"`, `node = "24"`) and CI uses `oven-sh/setup-bun@v2` with `bun-version: 1.3`.
2534

2635
## TypeScript Configuration
2736

@@ -70,7 +79,7 @@ No linter or formatter is configured. Style is enforced by convention (see below
7079

7180
### Formatting
7281
- 2-space indentation
73-
- Double quotes for strings
82+
- Single quotes for strings (Biome `quoteStyle: single`)
7483
- Trailing commas in multiline constructs
7584
- No semicolons (project convention)
7685

@@ -130,15 +139,19 @@ Per-account device fingerprints stored in `antigravity-accounts.json`. Each fing
130139

131140
## Testing
132141

133-
- Framework: **Vitest 3** with native ESM
134-
- Config: `vitest.config.ts`
135-
- Tests colocated: `src/plugin/foo.test.ts` next to `src/plugin/foo.ts`
136-
- Use `describe`/`it`/`expect` standard Vitest API
137-
- Mock with `vi.fn()`, `vi.spyOn()`, `vi.mock()`
142+
- Framework: **Bun's test runner** (`bun test`; the `bun:test` module re-exports a jest-compatible namespace)
143+
- Config: no per-package config — Bun discovers `*.test.ts` next to source. The `bunfig.toml` at the root and in each workspace preloads `test/setup.ts` (env-isolation + a per-test mkdtemp root + a `globalThis.stubbed` / `unstubAllGlobals` / `freshImport` helper). The e2e workspace uses `bunfig.toml` `root = "./src"` so its tests stay isolated from the unit workspace.
144+
- Tests colocated: `src/plugin/foo.test.ts` next to `src/plugin/foo.ts`. The e2e workspace uses `*.e2e.test.ts` so the root `bun run test` and `bun run test:e2e` selectors can target them precisely.
145+
- Use `describe`/`it`/`expect` from `bun:test` — the standard API.
146+
- Mock with `mock()`, `spyOn()`, and the `jest` namespace exported from `bun:test` (`jest.fn`, `jest.spyOn`, `jest.setSystemTime`, etc.). The `test/setup.ts` preload patches `jest.setSystemTime` / `jest.useRealTimers` so they also spy on `Date.now()` (Bun's `bun:test` clock only fakes the timer queue, not the wall clock).
138147

139148
## Documentation
140149

141150
- [README.md](README.md) — Installation & usage
142151
- [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) — Detailed architecture guide
143152
- [docs/ANTIGRAVITY_API_SPEC.md](docs/ANTIGRAVITY_API_SPEC.md) — API reference
144153
- [CHANGELOG.md](CHANGELOG.md) — Version history
154+
- [ARCHITECTURE.md](ARCHITECTURE.md) and [STRUCTURE.md](STRUCTURE.md) — repo-level architecture and file-system map
155+
- [biome.json](biome.json) — formatter + linter config
156+
- [lefthook.yml](lefthook.yml) — pre-commit Biome hook
157+
- [mise.toml](mise.toml) — pinned `bun` + `node` versions

0 commit comments

Comments
 (0)