Skip to content

Contributing

Ömer Faruk Ballı edited this page Oct 3, 2026 · 1 revision

Contributing

Language: English · Türkçe

Bug reports, fixes, translations and ideas are welcome. Please read CONTRIBUTING.md before opening a pull request. The project follows the Code of Conduct.

  • Security issues go through SECURITY.md, never public issues.
  • Larger changes (new features, format changes, new permissions): open an issue first.
  • Contributions are licensed under the MIT License.

Project layout

Path What it is
packages/core Platform-independent TypeScript: OTP algorithms, the encrypted vault, importers and exporters. No browser APIs.
packages/ui The shared React interface (popup and management pages) and the message contract
apps/extension The browser extension (WXT): background service, browser integration and tests

Build and test

Requirements: Node.js 22+ and pnpm 10.

pnpm install
pnpm test        # all unit tests
pnpm typecheck
pnpm lint        # eslint + prettier --check
pnpm coverage    # thresholds: 90% lines/statements/functions, 85% branches
pnpm format      # run before committing

pnpm --filter @claviger/extension build          # Chrome  → apps/extension/.output/chrome-mv3
pnpm --filter @claviger/extension build:firefox  # Firefox → apps/extension/.output/firefox-mv3

Tests of one package: pnpm --filter @claviger/core test <pattern>.

Ground rules (short version)

  • packages/core stays platform-independent: no chrome.* or browser.* APIs.
  • Write tests first for behaviour changes; a bug fix comes with a test that fails without it.
  • Cryptography only via WebCrypto and hash-wasm.
  • Untrusted input may only throw CoreError; never drop an account silently; never put secrets into error messages or logs.
  • Incompatible storage changes bump the format version and migrate existing vaults without data loss (docs/vault-format.md).
  • No new permissions without discussing it in an issue first.
  • UI text lives in the translation dictionaries; every key must exist in every language.

Commits and pull requests

  • Conventional Commits: feat:, fix:, docs:, test:, refactor:, chore: (optionally with a scope, e.g. fix(core): …).
  • One topic per pull request. pnpm test, pnpm typecheck and pnpm lint must pass; CI runs them on every PR.
  • Describe what changed and how you tested it. For UI changes add a screenshot.

Versioning follows SemVer: docs/versioning.md.

Translations

claviger ships in English and Turkish. To add a language, follow docs/i18n.md. In short:

  1. Add packages/ui/src/i18n/xx.ts (popup strings) and packages/ui/src/manage/i18n/xx.ts (manage strings).
  2. Register the language in packages/ui/src/i18n/locales.ts (LOCALES and LANGUAGE_VALUES).
  3. Register the dictionaries in i18n.tsx and manage/i18n/index.ts.
  4. Add apps/extension/public/_locales/xx/messages.json for the browser-level texts (extension name, context menu, shortcut descriptions).
  5. The key-parity tests in apps/extension/test/i18n-split.test.ts must pass.

English is the fallback for any missing key.

Clone this wiki locally