# Contributing

## What helps most, in order

1. **Review your language.** See [TRANSLATIONS.md](TRANSLATIONS.md). The wording
   *is* the product; a clumsy notice is worse than none.
2. **Report a widget that isn't detected or a site the notice breaks on.** Real
   pages beat synthetic tests. Include the vendor and a URL if you can.
3. **Bug fixes.** Small and focused.
4. **Features.** Please open an issue first — see the scope rule below.

## The scope rule

This widget does one thing: show the Article 50 disclosures. It will stay
dependency-free, under ~10 kB gzipped, and make no network requests. Proposals
that add a build step for consumers, a dependency, telemetry, or a hosted
service will be declined — not because they're bad ideas, but because a
compliance control people paste into a footer has to stay auditable by reading
one file.

## Forks

Encouraged. If you distribute a modified version, please rebrand it — see
[TRADEMARKS.md](TRADEMARKS.md); it takes two minutes by design.

## Setup

```bash
npm install
npm test
```

Tests drive a real Chromium via Playwright against fixture pages. If
`npm install` can't fetch a browser, run `npx playwright install chromium`.

## Before you open a PR

- `npm run lint` passes (`node --check`)
- `npm test` passes
- No new dependency in `package.json`
- ES5-compatible syntax in `src/` — the widget runs on whatever the visitor
  has, not what your bundler targets. No arrow functions, `const`/`let`,
  template literals, spread, classes, `async`/`await`, `?.` or `??`.
  `npm run lint` enforces this via `scripts/check-es5.mjs`, which strips
  comments first so prose can mention `const` freely.
- If you changed behaviour, add a test that would have failed before

## Releasing (maintainers)

1. Bump the version in **three** places: the banner comment, `VERSION`, and
   `package.json`.
2. Add a `CHANGELOG.md` entry.
3. `git tag v1.0.1 && git push --tags`

CI verifies the banner matches the tag and refuses to publish a version that
already exists. Published versions are immutable — never re-tag.
