Pag-unlad
Development Guide
Edit English only; translations propagate
Update documentation only under website/docs
(English). Translations under website/i18n/<locale>/…
are generated and should not be edited manually. Use the translation tasks (e.g., make translate_web_docs_batch
) to refresh localized content.
Prerequisites
- Node.js 22+ and npm (tested with Node 22)
- Thunderbird 128 ESR or newer (for manual testing)
Project Layout (high‑level)
- Root: packaging script
distribution_zip_packer.sh
, docs, screenshots sources/
: main add-on code (background, options/popup UI, manifests, icons)tests/
: Vitest suitewebsite/
: Docusaurus docs (with i18n underwebsite/i18n/de/...
)
Install & Tooling
- Install root deps:
npm ci
- Docs (optional):
cd website && npm ci
- Discover targets:
make help
Live Dev (web‑ext run)
- Quick loop in Firefox Desktop (UI smoke‑tests only):
npx web-ext run --source-dir sources --target=firefox-desktop
- Run in Thunderbird (preferred for MailExtensions):
npx web-ext run --source-dir sources --start-url about:addons --firefox-binary "$(command -v thunderbird || echo /path/to/thunderbird)"
- Tips:
- Keep Thunderbird’s Error Console open (Tools → Developer Tools → Error Console).
- MV3 event pages are suspended when idle; reload the add‑on after code changes, or let web‑ext auto‑reload.
- Some Firefox‑only behaviors differ; always verify in Thunderbird for API parity.
- Thunderbird binary paths (examples):
- Linux:
thunderbird
(e.g.,/usr/bin/thunderbird
) - macOS:
/Applications/Thunderbird.app/Contents/MacOS/thunderbird
- Windows:
"C:\\Program Files\\Mozilla Thunderbird\\thunderbird.exe"
- Profile isolation: Use a separate Thunderbird profile for development to avoid impacting your daily setup.
Make Targets (Alphabetical)
The Makefile standardizes common dev flows. Run make help
anytime for a one‑line summary of every target.
Tip: running make
with no target opens a simple Whiptail menu to pick a target.
Target | One‑line description |
---|---|
clean | Remove local build/preview artifacts (tmp/, web-local-preview/, website/build/). |
commit | Format, run tests (incl. i18n), update changelog, commit & push. |
eslint | Run ESLint via flat config (npm run -s lint:eslint ). |
help | List all targets with one‑line docs (sorted). |
lint | web‑ext lint on sources/ (temp manifest; ignores ZIPs; non‑fatal). |
menu | Interactive menu to select a target and optional arguments. |
pack | Build ATN & LOCAL ZIPs (runs linter; calls packer script). |
prettier | Format repository in place (writes changes). |
prettier_check | Prettier in check mode (no writes); fails if reformat needed. |
prettier_write | Alias for prettier . |
test | Prettier (write), ESLint, then Vitest (coverage if configured). |
test_i18n | i18n‑only tests: add‑on placeholders/parity + website parity. |
translate_app | Alias for translation_app . |
translation_app | Translate app UI strings from sources/_locales/en/messages.json . |
translate_web_docs_batch | Translate website docs via OpenAI Batch API (preferred). |
translate_web_docs_sync | Translate website docs synchronously (legacy, non-batch). |
translate_web_index | Alias for translation_web_index . |
translation_web_index | Translate homepage/navbar/footer UI (website/i18n/en/code.json → .../<lang>/code.json ). |
web_build | Build docs to website/build (supports --locales / BUILD_LOCALES ). |
web_build_linkcheck | Offline‑safe link check (skips remote HTTP[S]). |
web_build_local_preview | Local gh‑pages preview; auto‑serve on 8080–8090; optional tests/link‑check. |
web_push_github | Push website/build to the gh-pages branch. |
Syntax for options
- Use
make <command> OPTS="…"
to pass options (quotes recommended). Each target below shows example usage.
--
Locale build tips
- Build a subset of locales: set
BUILD_LOCALES="en de"
or passOPTS="--locales en,de"
to web targets. - Preview a specific locale:
http://localhost:<port>/Thunderbird-Reply-with-Attachments/de/
.
Build & Package
- Build ZIPs:
make pack
- Produces ATN and LOCAL ZIPs in the repo root (do not edit artifacts by hand)
- Tip: update version in both
sources/manifest_ATN.json
andsources/manifest_LOCAL.json
before packaging - Manual install (dev): Thunderbird → Tools → Add‑ons and Themes → gear → Install Add‑on From File… → select the built ZIP
Test
- Full suite:
make test
(Vitest) - Coverage (optional):
npm i -D @vitest/coverage-v8
- Run
make test
; opencoverage/index.html
for HTML report - i18n only:
make test_i18n
(UI keys/placeholders/titles + website per‑locale per‑doc parity with id/title/sidebar_label checks)
Debugging & Logs
- Error Console: Tools → Developer Tools → Error Console
- Toggle verbose logs at runtime:
- Enable:
messenger.storage.local.set({ debug: true })
- Disable:
messenger.storage.local.set({ debug: false })
- Logs appear while composing/sending replies
Docs (website)
- Dev server:
cd website && npm run start
- Build static site:
cd website && npm run build
- Make equivalents (alphabetical):
make web_build
,make web_build_linkcheck
,make web_build_local_preview
,make web_push_github
- Usage examples:
- EN only, skip tests/link‑check, no push:
make web_build_local_preview OPTS="--locales en --no-test --no-link-check --dry-run"
- All locales, with tests/link‑check, then push:
make web_build_local_preview && make web_push_github
- Before publishing, run the offline‑safe link check:
make web_build_linkcheck
. - i18n: English lives in
website/docs/*.md
; German translations inwebsite/i18n/de/docusaurus-plugin-content-docs/current/*.md
- Search: If Algolia DocSearch env vars are set in CI (
DOCSEARCH_APP_ID
,DOCSEARCH_API_KEY
,DOCSEARCH_INDEX_NAME
), the site uses Algolia search; otherwise it falls back to local search. On the homepage, press/
orCtrl+K
to open the search box.