Thanks for your interest in improving Avemo Dev! This document covers how to get a development build running, the project layout, and the conventions used here.
- Node.js 20 or newer
- pnpm 9 or newer (
corepack enablewill provide it) - A Chromium-based browser (Chrome, Edge, Brave, Arc, …) for loading the extension
pnpm install # install dependencies
pnpm dev # start Vite in watch mode with HMRThen load the extension:
- Open
chrome://extensions. - Enable Developer mode (top-right).
- Click Load unpacked and select the generated
dist/folder.
CRXJS reloads the extension as you edit source files. For a production build,
run pnpm build and load the same dist/ folder.
| Command | What it does |
|---|---|
pnpm dev |
Vite dev server + HMR for the extension |
pnpm build |
Type-check (vue-tsc) then produce the unpacked extension in dist/ |
pnpm type-check |
Type-check only, no build |
pnpm test |
Run the Vitest unit suite once |
pnpm test:watch |
Vitest in watch mode |
pnpm e2e:install |
One-time: download the Chromium build Playwright drives |
pnpm e2e |
Run the Playwright end-to-end suite against dist/ (build first) |
src/
├─ background/ # MV3 service worker (toggles the panel on command/icon click)
├─ content/ # content script: mounts the Shadow-DOM host
│ ├─ overlay-root.ts # creates the shadow root, injects tokens + Inter
│ ├─ overlay-manager.ts # watches the Pinia store, drives the plain-JS renderers
│ └─ overlays/ # column/baseline/row grids, outlines, inspector, tools
├─ ui/ # Vue panel + section/component tree
├─ stores/ # Pinia store — the single config contract the UI drives
├─ lib/ # framework-agnostic helpers (color, grid math, storage, …)
└─ styles/ # panel.css — the avemo OKLCH token system (injected inline)
Key architectural notes:
- Shadow DOM isolation. The panel and every overlay mount inside a shadow root so page CSS never leaks in, and the extension's styles never affect the page.
- Store-driven overlays.
src/stores/settings.tsis the source of truth;overlay-manager.tswatches it and calls the plain-JS renderers insrc/content/overlays/. Overlays don't import Vue. - Per-domain persistence. Config is saved per host in
chrome.storage.localand auto-restored on the next visit.
- TypeScript strict mode throughout — no
anyescape hatches without a reason. - Match the style, naming, and comment density of the surrounding code.
- Keep overlay renderers framework-agnostic (no Vue imports under
content/overlays/). - Prefer small, focused modules in
src/lib/for reusable logic and add a unit test.
pnpm type-checkpasses.pnpm testpasses (add/adjust tests for behavior changes).pnpm buildsucceeds.- If you touched panel/overlay behavior, sanity-check it in a real browser and,
where practical, extend the Playwright suite in
e2e/.
This project uses Conventional Commits:
feat(inspector): add contrast ratio readout
fix(panel): restore focus after closing a color field
docs: clarify E2E setup
Use the issue templates. For anything security-related, please read SECURITY.md first.