diff --git a/cookie_consent/__init__.py b/cookie_consent/__init__.py index 331dfae..906d362 100644 --- a/cookie_consent/__init__.py +++ b/cookie_consent/__init__.py @@ -1 +1 @@ -__version__ = "0.5.0b0" +__version__ = "0.6.0" diff --git a/docs/changelog.rst b/docs/changelog.rst index a5dd5f9..939dab2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,15 +2,70 @@ Changelog ========= -0.6.0 (unreleased) +0.6.0 (2024-05-10) ------------------ +Feature release with improved JS support. + 💥 This feature release has a potential breaking change. The ``CookieGroup.varname`` field now has a unique constraint on it. The ``Cookie`` model now has a unique constraint on ``cookiegroup``, ``name`` and ``domain``. If you have duplicate values, this migration will crash. -* ... +**💥 Breaking changes** + +Some (database) unique constraints have been added to the model fields. If you have +duplicate values in those fields, the migrations will crash. You should check for +duplicates before upgrading, and fix those: + +.. code-block:: py + + from django.db.models import Count + from cookie_consent.models import CookieGroup, Cookie + + # duplicated cookie groups (by varname) + CookieGroup.objects.values("varname").annotate(n=Count("varname")).filter(n__gt=1) + # + + # duplicated cookies + Cookie.objects.values("cookiegroup", "name", "domain").annotate(n=Count("id")).filter(n__gt=1) + # + +Additionally, support for unmaintained Django versions (3.2, 4.1) is dropped. + +**New features** + +* The JS for the cookiebar module is rewritten in TypeScript and published as an + `npm package`_ for people wishing to integrate this functionality in their own + frontend stack. ``cookie_consent/cookiebar.module.js`` is still in the Python package, + and it's generated from the same source code. + +* Added support for natural keys in dumpdata/loaddata management commands. + +**Deprecations** + +None. + +**Bugfixes** + +* Fixed cache not being cleared after queryset (bulk) update/deletes +* Swapped the order of ``onShow`` and ``doInsert`` in the cookiebar JS. ``onShow`` is + now called after the cookiebar is inserted into the document. +* Added missing unique constraint to ``CookieGroup.varname`` field +* Added missing unique constraint on ``Cookie`` fields ``cookiegroup``, ``name`` and + ``domain``. + +**Project maintenance** + +* Add missing templatetag instruction to docs +* Removed Django < 4.2 compatibility shims +* Formatted code with latest black version +* Dropped Django 3.2 & 4.1 from the supported versions +* Removed unused dependencies +* Bumped github actions to latest versions +* Updated to modern packaging tooling with ``pyproject.toml`` + +.. _npm package: https://www.npmjs.com/package/django-cookie-consent 0.5.0b0 (2023-09-24) -------------------- diff --git a/js/package-lock.json b/js/package-lock.json index 58bb39a..bb3a336 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -1,12 +1,12 @@ { "name": "django-cookie-consent", - "version": "0.6.0-beta0", + "version": "0.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "django-cookie-consent", - "version": "0.6.0-beta0", + "version": "0.6.0", "license": "BSD-2-Clause", "devDependencies": { "esbuild": "^0.20.2", diff --git a/js/package.json b/js/package.json index 1db695a..a2aab1d 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "django-cookie-consent", - "version": "0.6.0-beta0", + "version": "0.6.0", "description": "Frontend code for django-cookie-consent", "main": "lib/index.js", "type": "module", diff --git a/pyproject.toml b/pyproject.toml index 603cc06..56bdcc5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "django-cookie-consent" -version = "0.5.0b0" +version = "0.6.0" description = "Django cookie consent application" authors = [ {name = "Informatika Mihelac", email = "bmihelac@mihelac.org"} diff --git a/tbump.toml b/tbump.toml index 7a4b8f6..b7cda8f 100644 --- a/tbump.toml +++ b/tbump.toml @@ -1,5 +1,5 @@ [version] -current = "0.5.0b0" +current = "0.6.0" regex = ''' (?P\d+) \.