@@ -51,7 +51,7 @@ Lerna monorepo with npm workspaces. Current version: see `lerna.json`.
5151```
5252packages/ # 25 modular @tko/* packages (all TypeScript)
5353builds/ # 2 bundled distributions (knockout, reference)
54- tools/ # Shared build config (build.mk, karma.conf.js, repackage.mjs)
54+ tools/ # Shared build config (build.mk, repackage.mjs)
5555skills/ # AI agent skills (on-demand workflow instructions)
5656tko.io/ # Documentation site (Astro + Starlight, deployed to GitHub Pages)
5757Makefile # Top-level build orchestrator
@@ -63,25 +63,26 @@ Key packages: `@tko/observable`, `@tko/computed`, `@tko/bind`,
6363Builds: ` @tko/build.knockout ` (backwards-compatible) and
6464` @tko/build.reference ` (modern/recommended).
6565
66+ ## Prerequisites
67+
68+ - ** Bun** — package manager and script runner. Install via [ mise] ( https://mise.jdx.dev/ ) : ` mise install ` (reads ` .tool-versions ` ), or [ bun.sh] ( https://bun.sh ) .
69+ - Use ` bun install ` instead of ` npm install ` .
70+
6671## Build Commands
6772
6873All builds use Make + esbuild. Run from the repo root:
6974
7075``` bash
71- npm install # Install all dependencies (uses npm workspaces)
76+ bun install # Install all dependencies (uses Bun workspaces)
7277make # Build all packages (ESM, CommonJS, MJS)
73- make test # Run all tests with Electron
74- make test-headless # Run all tests with headless Chrome
75- make test-headless-ff # Run all tests with headless Firefox
76- make test-headless-jquery # Run tests with jQuery enabled
77- make test-coverage # Run tests and generate coverage report
78+ make test # Run all tests (Vitest, headless Chromium via Playwright)
79+ bunx vitest run # Same as make test, directly
7880make eslint # Run ESLint
7981make eslint-fix # Run ESLint with auto-fix
8082make format # Check Prettier formatting
8183make format-fix # Fix Prettier formatting
8284make tsc # TypeScript type-check (no emit)
8385make dts # Generate TypeScript declaration files
84- make knip # Run Knip for Linting imports and exports
8586make sweep # Clean dist/ and coverage/ dirs
8687make clean # Full clean (node_modules, lockfiles, dist)
8788```
@@ -91,17 +92,14 @@ Make targets (they include `tools/build.mk`).
9192
9293## Testing
9394
94- - ** Runner** : Karma
95- - ** Frameworks** : Mocha + Chai + Sinon
96- - ** Browsers** : Electron (default), Chrome Headless, Firefox Headless
97- - ** Coverage** : nyc/Istanbul (~ 89% statements, ~ 83% branches)
98- - ** Test files** : ` packages/*/spec/ ` directories
99-
100- Use Mocha/Chai/Sinon for repository tests.
95+ - ** Runner** : Vitest browser mode (Playwright, headless Chromium)
96+ - ** Assertions** : Chai (expect) + Sinon (spies/stubs/timers)
97+ - ** Config** : ` vitest.config.ts ` at repo root
98+ - ** Test files** : ` packages/*/spec/**/*.ts ` , ` builds/*/spec/**/*.js `
99+ - ** Run** : ` bunx vitest run ` (all tests) or ` bunx vitest run <path> ` (single file)
101100
102- Do not:
103- - split shared specs into runner-specific versions while they still need to run
104- in the browser harness
101+ Tests run in a real browser via Playwright — not jsdom. This is required
102+ because TKO does low-level DOM manipulation, MutationObserver, and event handling.
105103
106104## Code Style
107105
@@ -231,7 +229,7 @@ When validating `tko.io` documentation changes with the local docs site:
231229
232230## Important Guidelines
233231
234- - Do not modify ` tools/build.mk ` or ` tools/karma.conf.js ` without understanding
232+ - Do not modify ` tools/build.mk ` or ` vitest.config.ts ` without understanding
235233 the full impact — they are shared across all 25+ packages.
236234- Do not add runtime dependencies to core packages. TKO is zero-dependency.
237235- The ` builds/ ` packages bundle everything into a single distributable.
0 commit comments