How the project is organized and where to look. Read the actual directories and source to confirm details, since file lists change over time.
1. Directory Structure
Read the src/ tree to understand module organization. Each directory has a clear responsibility:
src/modules/: public surface. The barrel files exposed to consumers are the ones listed under exports in package.json (read it for the current entrypoints). Subfolders hold the essentials (core poku/assert/strict) and the helper APIs (describe, it, test, skip, kill, env, etc.)
src/services/: runtime services. The runner, per-file execution, watch mode, and reporters live here
src/parsers/: CLI and config parsing. Argument reading, config discovery, runtime detection, and runner resolution
src/configs/: global state, including the GLOBAL singleton
src/builders/: chainable builders (assert, reporter)
src/polyfills/: cross-runtime compatibility shims
src/bin/: CLI entry. src/bin/index.ts is the published binary
src/@types/: TypeScript type definitions
To find a specific file, read the relevant directory rather than relying on a fixed list here.
2. Execution Flow
Trace the path from CLI invocation to test results:
- The CLI entry (
src/bin/index.ts) parses args, loads config, and calls poku()
- The
poku() orchestrator in the essentials module starts the run
- The runner service builds a concurrency-bounded queue and iterates the matched files
- Each test file is spawned in its own process with
shell: false
- Child processes inherit
POKU_* environment variables set by the parent
- The selected reporter renders results
3. Config System
- Auto-discovered files (in order):
poku.config.js, .pokurc.json, .pokurc.jsonc. The discovery logic lives in the options parser under src/parsers/. poku.config.cjs and poku.config.ts are supported only via an explicit --config= flag, not auto-discovery
- For the available options, read the config types in
src/@types/ and the CLI help in src/bin/. They are the source of truth and stay current as options evolve
4. Runtime Detection
Read the runtime detection and runner resolution in src/parsers/:
- Detection order:
POKU_RUNTIME env var, then typeof Deno, then typeof Bun, otherwise default 'node'
- Runner: Bun (
['bun']), Deno (['deno', 'run', ...perms]), Node (['node'], or ['node', '--import=tsx'] for TypeScript files)
5. Competitive Context
Poku differentiates from Jest/Vitest/Mocha/etc. by:
- No internal test mapping: tests are not registered or mapped internally, only their execution is reported. This is the core architectural decision that makes tests behave as plain JavaScript (see the Philosophy in
CLAUDE.md)
- Zero runtime dependencies
- Faster than Jest and Vitest in the project's own benchmarks (see
benchmark/ for current numbers and the caveats stated there)
- Process-per-file isolation by default (
--isolation=none runs all files in the same process, useful for debugging)
- Cross-platform (Node/Bun/Deno) zero-config
- Built-in service management (
startService, waitForPort, kill, and related helpers)
1---2name: architecture-33description: Architecture deep-dive for poku covering project structure, execution flow, config discovery, runtime detection, and competitive context. Use when navigating the codebase or understanding how components fit together.4---56How the project is organized and where to look. Read the actual directories and source to confirm details, since file lists change over time.78### 1. Directory Structure910Read the `src/` tree to understand module organization. Each directory has a clear responsibility:1112- `src/modules/`: public surface. The barrel files exposed to consumers are the ones listed under `exports` in `package.json` (read it for the current entrypoints). Subfolders hold the essentials (core `poku`/`assert`/`strict`) and the helper APIs (`describe`, `it`, `test`, `skip`, `kill`, `env`, etc.)13- `src/services/`: runtime services. The runner, per-file execution, watch mode, and reporters live here14- `src/parsers/`: CLI and config parsing. Argument reading, config discovery, runtime detection, and runner resolution15- `src/configs/`: global state, including the `GLOBAL` singleton16- `src/builders/`: chainable builders (assert, reporter)17- `src/polyfills/`: cross-runtime compatibility shims18- `src/bin/`: CLI entry. `src/bin/index.ts` is the published binary19- `src/@types/`: TypeScript type definitions2021To find a specific file, read the relevant directory rather than relying on a fixed list here.2223### 2. Execution Flow2425Trace the path from CLI invocation to test results:26271. The CLI entry (`src/bin/index.ts`) parses args, loads config, and calls `poku()`282. The `poku()` orchestrator in the essentials module starts the run293. The runner service builds a concurrency-bounded queue and iterates the matched files304. Each test file is spawned in its own process with `shell: false`315. Child processes inherit `POKU_*` environment variables set by the parent326. The selected reporter renders results3334### 3. Config System3536- Auto-discovered files (in order): `poku.config.js`, `.pokurc.json`, `.pokurc.jsonc`. The discovery logic lives in the options parser under `src/parsers/`. `poku.config.cjs` and `poku.config.ts` are supported only via an explicit `--config=` flag, not auto-discovery37- For the available options, read the config types in `src/@types/` and the CLI help in `src/bin/`. They are the source of truth and stay current as options evolve3839### 4. Runtime Detection4041Read the runtime detection and runner resolution in `src/parsers/`:4243- Detection order: `POKU_RUNTIME` env var, then `typeof Deno`, then `typeof Bun`, otherwise default `'node'`44- Runner: Bun (`['bun']`), Deno (`['deno', 'run', ...perms]`), Node (`['node']`, or `['node', '--import=tsx']` for TypeScript files)4546### 5. Competitive Context4748Poku differentiates from Jest/Vitest/Mocha/etc. by:4950- **No internal test mapping**: tests are not registered or mapped internally, only their execution is reported. This is the core architectural decision that makes tests behave as plain JavaScript (see the Philosophy in `CLAUDE.md`)51- Zero runtime dependencies52- Faster than Jest and Vitest in the project's own benchmarks (see `benchmark/` for current numbers and the caveats stated there)53- Process-per-file isolation by default (`--isolation=none` runs all files in the same process, useful for debugging)54- Cross-platform (Node/Bun/Deno) zero-config55- Built-in service management (`startService`, `waitForPort`, `kill`, and related helpers)