- React + TypeScript via Vite; extension entry
src/main.tsx, UI rootsrc/App.tsx. - UI pieces in
src/components/(Background, SearchBar, BookmarkGrid, drawers, etc.) with barrel exportsrc/components/index.ts; shared hooks insrc/hooks/, state insrc/stores/(Zustand), utilities insrc/utils/, i18n insrc/i18n/, styles insrc/styles/. src/background.tshosts the extension service worker; assets insrc/assets/; static manifest/icons/screenshots live inpublic/; build artifacts output todist/with the manifest copied post-build.
npm install— install dependencies.npm run dev— start the Vite dev server; use with the extension reloader or open http://localhost:5173 for UI checks.npm run dev:watch— watch builds for extension workflows that need continuous bundling.npm run build— type-check (tsc -b), bundle with Vite, and copypublic/manifest.json& icons intodist/.npm run preview— serve the production bundle locally.npm run lint— run ESLint across the repo.
- TypeScript strict mode; prefer functional React components and hooks; state lives in Zustand slices under
src/stores. - CSS Modules per component; keep shared globals in
src/styles/globals.css. - Use 2-space indentation, semicolons, single quotes; PascalCase for components/types, camelCase for functions/variables, SCREAMING_SNAKE_CASE for constants.
- Keep exports centralized via existing barrel files when adding new modules.
- No automated test suite yet; at minimum run
npm run lintandnpm run buildbefore PRs. - When adding logic-heavy utilities or hooks, co-locate tests as
*.test.ts(x)and prefer React Testing Library + Vitest to match Vite. - Provide manual QA notes (browsers, extension steps, screenshots) in PRs.
- Follow Conventional Commits (
feat:,fix:,chore:,refactor:) as seen in history; keep messages imperative and scoped. - PRs should include a brief summary, linked issues, screenshots/GIFs for UI changes (light/dark where relevant), and test/QA notes.
- Keep changes small and focused; update related docs/strings in
src/i18n/when altering user-facing text.
- Update extension metadata in
public/manifest.json; request only necessary permissions. - Do not embed secrets or analytics keys; data is stored locally (check storage helpers in
src/utils/and stores). - After
npm run build, loaddist/viachrome://extensions→ "Load unpacked" to validate permissions and background behavior.