Thunderbird/Betterbird add-on (Manifest V3): typing inside a quote splits the quote and inserts your own text with a marker such as [OH]:. - English and German user interface - Licensed under the Mozilla Public License 2.0 - English documentation, JSDoc lint gate, 87 tests (node:test + jsdom)
5.1 KiB
5.1 KiB
Contributing to Inline Comment
Rules and conventions for everyone who works on this repository.
What this is
A MailExtension (Manifest V3) for Thunderbird and Betterbird, version 128 or later. When you
start typing inside a quoted block in the compose window, the add-on splits the quote at the caret
and inserts your own text in between, styled and prefixed with a marker such as [OH]:. Overview:
README.md, structure:
.docs/architecture/overview.md.
Read first
.plan/roadmap.md– current state and next steps- the latest entry in
.plan/daily/ .docs/architecture/system-design.md– flows and design decisions.docs/decisions/– architecture decision records
Language
- English for code, identifiers, code comments, JSDoc, documentation, test names and commit messages.
- Exceptions: the German UI strings in
src/_locales/de/messages.json, the German readmeREADME.de.mdand the German listing texts.
Commands
npm install # development tools only (prettier, eslint, jsdom)
npm test # unit and DOM tests (node:test + jsdom)
npm run lint # ESLint with the JSDoc rules (eslint.config.mjs)
npm run format # format all files with Prettier
npm run check # format check + lint + tests; run before every push
npm run build # check + dist/inline-comment-<version>.xpi
Rules
- Bilingual UI: every user-visible string comes from
_locales(default localeen, plusde). Each UI string needs a key in bothsrc/_locales/en/messages.jsonandsrc/_locales/de/messages.json, with an Englishdescription. In extension pages, mark elements withdata-i18n(seesrc/lib/i18n.js); in scripts, usei18n.getMessage()of the WebExtension API (messengerorbrowser).test/i18n.test.jsenforces identical keys and placeholders in both locales and that every key is used. - Licence header: every new
.js,.css,.html,.svgand.shfile insrc/,test/andscripts/needs the MPL-2.0 header:.jsand.cssas a block comment, HTML and SVG as<!-- -->(HTML directly after<!doctype html>), shell scripts as#lines after the shebang.eslint.config.mjscarries it as well. JSON files get no header.test/license.test.jsenforces this. - JSDoc: every named function (function declarations, and function or arrow expressions
assigned to a variable, property or object key) has a JSDoc block with a description, a typed
@paramfor each parameter and a typed@returnswhen it returns a value. Inline callbacks passed directly as arguments are exempt. Prefer specific types (unknown,object,Record<string, T>) over*,ObjectorFunction, and write defaults in the description ("Defaults to …") instead of[name=value].npm run lintenforces this. - No markup in DOM sinks: never use
innerHTML,insertAdjacentHTMLordocument.write, and never assign toouterHTML. Build DOM nodes withcreateElement,textContentandsetAttribute. ReadingouterHTML(to hand a node to the editor viainsertHTML) is fine.test/dom-sinks.test.jsenforces this for every file insrc/. - Mail HTML: inline CSS only; no
<style>blocks, no classes. Other mail clients strip them. - No runtime dependencies in the add-on. npm packages are development tools only.
- Script format: files in
src/lib/are classic scripts in the UMD pattern (globalThis.InlineCommentplusmodule.exports), because compose scripts cannot load ES modules. - No secrets, no private infrastructure, no personal data in the repository: no tokens or
passwords, no internal host names, IP addresses or local paths, no real names or e-mail addresses
of third persons. Examples and test fixtures use invented names and
example.comaddresses. - Version and changelog: every change that ships in the
.xpigets an entry inCHANGELOG.mdand a new version inpackage.jsonandsrc/manifest.json.test/manifest.test.jschecks that all three match. - Tests: new behaviour only with tests. Testable logic belongs in
src/lib/;compose.jsandbackground.jsstay thin. - Manual test before releases: the jsdom tests cannot cover the real mail editor. Before a
release, run the manual test plan in
.docs/guides/testplan.mdin Thunderbird and record the result (version, application, date) in.plan/daily/<date>.md. - Docs in the same commit: update
README.md/README.de.md,.docs/,CHANGELOG.mdand.plan/daily/<date>.mdin the same commit as the change.
Workflow
- Develop: change code and tests, run
npm run check. - Try it in Thunderbird:
npm run build, then loaddist/inline-comment-<version>.xpias a temporary add-on (about:debugging→ "This Thunderbird" → "Load Temporary Add-on…"). The guides in.docs/guides/describe the details. - Release: bump the version, update
CHANGELOG.md, pass the manual test plan, then publish the.xpias a release in the public repository. Submission to addons.thunderbird.net is planned (see.plan/roadmap.md).