73 lines
1.8 KiB
Markdown
73 lines
1.8 KiB
Markdown
# Contributing
|
|
|
|
Thank you for considering a contribution to `@pdntechnology/cookie-consent`.
|
|
|
|
## Before you start
|
|
|
|
- Open an issue for large changes so we can agree on the approach first.
|
|
- Keep pull requests focused. One feature or fix per PR is easier to review.
|
|
- Match the existing code style: small modules, clear names, minimal dependencies.
|
|
|
|
## Development setup
|
|
|
|
```bash
|
|
git clone https://git.pdntechnology.com.tr/pdn/cookie-consent.git
|
|
cd cookie-consent
|
|
npm install
|
|
npm test
|
|
```
|
|
|
|
### Try the Next.js demo
|
|
|
|
```bash
|
|
cd examples/next-app
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
The example uses a local file dependency on the parent package.
|
|
|
|
## Tests
|
|
|
|
All changes should pass the test suite:
|
|
|
|
```bash
|
|
npm test
|
|
```
|
|
|
|
Add or update tests when you change behaviour in:
|
|
|
|
- `src/preferences.js`
|
|
- `src/storage.js`
|
|
- `src/consent-api.js`
|
|
- `src/google/*`
|
|
- `src/cookie-schema.js`
|
|
- `src/react/theme.js`
|
|
|
|
## Pull request checklist
|
|
|
|
- [ ] `npm test` passes locally
|
|
- [ ] Public API changes are reflected in `src/index.d.ts` and/or `src/react/index.d.ts`
|
|
- [ ] User-facing changes are documented in `README.md`
|
|
- [ ] Turkish docs updated in `README.tr.md` when behaviour or public API changes
|
|
- [ ] `CHANGELOG.md` updated under `[Unreleased]` or the next version
|
|
|
|
## Commit messages
|
|
|
|
Use clear, imperative messages:
|
|
|
|
- `Add theme prop to CookieConsent`
|
|
- `Fix bootstrap script advanced settings`
|
|
- `Document cookie inventory API`
|
|
|
|
## Code guidelines
|
|
|
|
- Prefer framework-agnostic logic in `src/` and React-specific UI in `src/react/`
|
|
- Do not add runtime dependencies without a strong reason
|
|
- Fail safely: never throw from public consent APIs in the browser
|
|
- Surface storage failures via return values, callbacks, or debug logging
|
|
|
|
## License
|
|
|
|
By contributing, you agree that your contributions will be licensed under the [MIT License](LICENSE).
|