1.8 KiB
1.8 KiB
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
git clone https://git.pdntechnology.com.tr/pdn/cookie-consent.git
cd cookie-consent
npm install
npm test
Try the Next.js demo
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:
npm test
Add or update tests when you change behaviour in:
src/preferences.jssrc/storage.jssrc/consent-api.jssrc/google/*src/cookie-schema.jssrc/react/theme.js
Pull request checklist
npm testpasses locally- Public API changes are reflected in
src/index.d.tsand/orsrc/react/index.d.ts - User-facing changes are documented in
README.md - Turkish docs updated in
README.tr.mdwhen behaviour or public API changes CHANGELOG.mdupdated under[Unreleased]or the next version
Commit messages
Use clear, imperative messages:
Add theme prop to CookieConsentFix bootstrap script advanced settingsDocument cookie inventory API
Code guidelines
- Prefer framework-agnostic logic in
src/and React-specific UI insrc/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.