cookie-consent/CONTRIBUTING.md
Pdn Technology 1fe78d39e1
Some checks are pending
CI / test (20) (push) Waiting to run
CI / test (22) (push) Waiting to run
npm ayarları
2026-06-20 09:09:51 +03:00

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://github.com/pdntechnology/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.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.