- PatternDef.validate + Luhn-gated credit-card detection; de-overlap the generic phone/date/IP patterns; presets.swiss unchanged (production behavior) - strip g/y flags from nameHint so .test() is stateless (latent footgun) - openAICompatibleProvider: bounded retry on transient failures (network / timeout / 429 / 5xx), configurable via retries + retryDelayMs - eslint + prettier + vitest coverage (97%); CI runs lint/format/coverage - docs: README badges + new-option docs, SECURITY.md, issue/PR templates 26 tests passing; build emits ESM+CJS+types. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
41 lines
1.6 KiB
Markdown
41 lines
1.6 KiB
Markdown
# Contributing to @mobiletic/anonymizer
|
|
|
|
Thanks for your interest in improving this project! Contributions of all kinds are welcome — bug reports,
|
|
new pattern presets, additional LLM providers, docs, and tests.
|
|
|
|
## Getting started
|
|
|
|
```bash
|
|
git clone https://github.com/mobiletic/anonymizer.git
|
|
cd anonymizer
|
|
npm install
|
|
npm test # run the test suite (vitest)
|
|
npm run test:coverage # tests + coverage report
|
|
npm run typecheck # tsc --noEmit
|
|
npm run lint # eslint
|
|
npm run format # prettier --write (or `npm run format:check` to verify)
|
|
npm run build # tsup → dist/ (ESM + CJS + types)
|
|
```
|
|
|
|
## Guidelines
|
|
|
|
- **Tests first.** Every behavior change needs a test. The anonymization core is privacy-critical — we
|
|
keep coverage tight, especially around coreference, de-collision, and streaming.
|
|
- **No runtime dependencies.** The core must stay dependency-free. New providers should rely only on
|
|
platform APIs (e.g. `fetch`).
|
|
- **Keep it framework-agnostic.** No framework-specific code (NestJS, Express, React, …) in the package.
|
|
- **Patterns use the global flag.** Any `PatternDef.re` must be a global (`/…/g`) regex.
|
|
- **Conventional commits** are appreciated (`feat:`, `fix:`, `docs:`, `test:`, `chore:`).
|
|
|
|
## Reporting security issues
|
|
|
|
Please do **not** open public issues for vulnerabilities (e.g. a PII-leak path). Email
|
|
`security@mobiletic.com` instead.
|
|
|
|
## Pull requests
|
|
|
|
1. Fork and branch from `main`.
|
|
2. Add tests and update docs.
|
|
3. Ensure `npm test`, `npm run typecheck`, and `npm run build` pass.
|
|
4. Open the PR with a clear description of the change and its motivation.
|