README.md
Hacking๐
Build & check๐
Toolchain prerequisites: node 22+.
make setup # npm install + activates the pre-commit hook
make check # dprint verify, typecheck, unit tests -- what the pre-commit hook runs
make fmt # apply dprint
make build # emits dist/ for the publishable packages, and bundles the gallery
make check-e2e # drives the gallery in a headless Chrome with trusted input; not part of check
make publish # npm publish for the public packages
Run make alone for the full target list.
Layout๐
This is an npm workspace. The root package.json is private and fans out to packages/*:
packages/yukey/-- the kit. Published. Components (src/yk-*.ts) and their mechanisms, the default theme, and the component gallery (src/gallery/, bundled tostatic/gallery.js). Unit tests live beside their subject assrc/*.test.ts.packages/yukey-testkit/-- a dependency-free CDP client for driving a page with trusted input. Published. Node-only; it exists so that apps built on yukey (and yukey's own e2e suite) can test real keyboard traversal, which synthetic DOM events can't do.packages/e2e/-- yukey's own end-to-end suite. Private. Serves the gallery bundle, launches a headless Chrome, runs scenarios against the gallery entries.docs/-- the precepts (what yukey's design follows) and, as they appear, guides for composing with it.
Things worth knowing๐
- The published packages ship
dist/(.js+.d.ts+ maps), not.ts. Lit's decorators requireexperimentalDecoratorsanduseDefineForClassFields: false; compiling here means consumers don't have to match those flags. Consequence: anything consuming yukey via afile:dependency mustmake buildhere first. packages/e2eimportsyukey-testkitthrough the workspace symlink and resolves to itsdist/, like any outside consumer would. The e2e package'scheckandtest:e2escripts build the testkit first, so this never needs remembering.- The e2e suite needs a Chromium. It defaults to
/headless-shell/headless-shell;YUKEY_E2E_CHROMEoverrides. Chrome is launched with--no-sandbox(fine for headless-shell in a container; worth knowing if you point it at a desktop Chrome).
docs/hacking/README.md ยท 2.2 KiB ยท dc38216d2f